add CLI configurability
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
using namespace sc_core;
|
||||
using namespace fmt;
|
||||
|
||||
top::top(sc_core::sc_module_name const& nm, unsigned dimension) :sc_module(nm){
|
||||
top::top(sc_core::sc_module_name const& nm, uint8_t dimension,unsigned count) :sc_module(nm){
|
||||
sc_assert(dimension>0);
|
||||
SC_HAS_PROCESS(top);
|
||||
for(auto yidx=0U; yidx<dimension; ++yidx){
|
||||
@@ -43,7 +43,7 @@ top::top(sc_core::sc_module_name const& nm, unsigned dimension) :sc_module(nm){
|
||||
auto xidx = 0U;
|
||||
for(xidx=0U; xidx<dimension; ++xidx){
|
||||
auto name = format("snd_{}_{}", xidx+1, 0);
|
||||
senders[TOP].push_back(scc::make_unique<pkt_sender>(sc_module_name(name.c_str()), dimension, xidx+1, 0));
|
||||
senders[TOP].push_back(scc::make_unique<pkt_sender>(sc_module_name(name.c_str()), dimension, xidx+1, 0, count));
|
||||
auto& snd = senders[TOP].back();
|
||||
snd->clk_i(clk);
|
||||
auto& sw = switches[yidx*dimension+xidx];
|
||||
@@ -53,7 +53,7 @@ top::top(sc_core::sc_module_name const& nm, unsigned dimension) :sc_module(nm){
|
||||
yidx=dimension-1;
|
||||
for(xidx=0U; xidx<dimension; ++xidx){
|
||||
auto name = format("snd_{}_{}", xidx+1, dimension+1);
|
||||
senders[BOTTOM].push_back(scc::make_unique<pkt_sender>(sc_module_name(name.c_str()), dimension, xidx+1, dimension+1));
|
||||
senders[BOTTOM].push_back(scc::make_unique<pkt_sender>(sc_module_name(name.c_str()), dimension, xidx+1, dimension+1, count));
|
||||
auto& snd = senders[BOTTOM].back();
|
||||
snd->clk_i(clk);
|
||||
auto& sw = switches[yidx*dimension+xidx];
|
||||
@@ -63,7 +63,7 @@ top::top(sc_core::sc_module_name const& nm, unsigned dimension) :sc_module(nm){
|
||||
xidx=0U;
|
||||
for(yidx=0U; yidx<dimension; ++yidx){
|
||||
auto name = format("snd_{}_{}", 0, yidx+1);
|
||||
senders[LEFT].push_back(scc::make_unique<pkt_sender>(sc_module_name(name.c_str()), dimension, 0, yidx+1));
|
||||
senders[LEFT].push_back(scc::make_unique<pkt_sender>(sc_module_name(name.c_str()), dimension, 0, yidx+1, count));
|
||||
auto& snd = senders[LEFT].back();
|
||||
snd->clk_i(clk);
|
||||
auto& sw = switches[yidx*dimension+xidx];
|
||||
@@ -73,7 +73,7 @@ top::top(sc_core::sc_module_name const& nm, unsigned dimension) :sc_module(nm){
|
||||
xidx=dimension-1;
|
||||
for(yidx=0U; yidx<dimension; ++yidx){
|
||||
auto name = format("snd_{}_{}", dimension+1, yidx+1);
|
||||
senders[RIGHT].push_back(scc::make_unique<pkt_sender>(sc_module_name(name.c_str()), dimension, dimension+1, yidx+1));
|
||||
senders[RIGHT].push_back(scc::make_unique<pkt_sender>(sc_module_name(name.c_str()), dimension, dimension+1, yidx+1, count));
|
||||
auto& snd = senders[RIGHT].back();
|
||||
snd->clk_i(clk);
|
||||
auto& sw = switches[yidx*dimension+xidx];
|
||||
|
Reference in New Issue
Block a user