update SCC

This commit is contained in:
2020-10-08 17:45:57 +02:00
parent 117b0e4375
commit 27f4e93027
13 changed files with 48 additions and 39 deletions

View File

@ -29,8 +29,8 @@ int sc_main(int argc, char *argv[]) {
///////////////////////////////////////////////////////////////////////////
// configure logging
///////////////////////////////////////////////////////////////////////////
scc::init_logging(logging::INFO);
//scc::init_logging(logging::WARNING);
scc::init_logging(log::INFO);
//scc::init_logging(log::WARNING);
///////////////////////////////////////////////////////////////////////////
// instantiate top level

View File

@ -7,13 +7,14 @@
#include <target.h>
#include <router.h>
enum { SLV_CNT=2};
SC_MODULE(Top) {
ClkGen * clk_gen;
ResetGen* reset_gen;
Initiator* initiator;
Router<4>* router;
Memory* memory[4];
Router<SLV_CNT>* router;
Memory* memory[SLV_CNT];
Top(const sc_core::sc_module_name& nm)
: sc_core::sc_module()
@ -24,8 +25,8 @@ SC_MODULE(Top) {
clk_gen=new ClkGen("clk_gen");
reset_gen=new ResetGen("reset_gen");
initiator = new Initiator("initiator");
router = new Router<4>("router");
for (int i = 0; i < 4; i++) {
router = new Router<SLV_CNT>("router");
for (int i = 0; i < SLV_CNT; i++) {
char txt[20];
sprintf(txt, "memory_%d", i);
memory[i] = new Memory(txt);
@ -33,7 +34,7 @@ SC_MODULE(Top) {
// Bind sockets
initiator->socket.bind(router->target_socket);
for (int i = 0; i < 4; i++)
for (int i = 0; i < SLV_CNT; i++)
router->initiator_socket[i].bind(memory[i]->socket);
// connect signals
clk_gen->clk_o(clk);