CGRA-ME
CGRA.cpp
Go to the documentation of this file.
1 /*******************************************************************************
2  * The software programs comprising "CGRA-ME" and the documentation provided
3  * with them are copyright by its authors and the University of Toronto. Only
4  * non-commercial, not-for-profit use of this software is permitted without ex-
5  * plicit permission. This software is provided "as is" with no warranties or
6  * guarantees of support. See the LICENCE for more details. You should have re-
7  * ceived a copy of the full licence along with this software. If not, see
8  * <http://cgra-me.ece.utoronto.ca/license/>.
9  ******************************************************************************/
10 
11 #include <CGRA/CGRA.h>
12 #include <CGRA/Control.h>
13 #include <CGRA/ModuleComposites.h>
14 #include <CGRA/ModuleElastic.h>
15 
16 #include <coreir.h>
17 #include <coreir/passes/analysis/verilog.h>
18 
19 #include <algorithm>
20 #include <fstream>
21 
22 class PropagatePorts : public CoreIR::InstanceGraphPass {
23  public:
24  //The static keyword is important here!
25  static std::string ID;
26  PropagatePorts() : InstanceGraphPass(ID, "Propagate special ports from bottom module to top"), modulesToPropagateFrom() {modulesToPropagateFrom.clear();}
27 
28  bool runOnInstanceGraphNode(CoreIR::InstanceGraphNode& node) override;
29  void print() override {
30  std::cout << "Propagating ports\n";
31  }
32 
33  private:
34  // Tracker of modules that have ports that need to be propagated
35  std::unordered_map<CoreIR::Module *, std::vector<std::string>> modulesToPropagateFrom;
36 };
37 std::string PropagatePorts::ID = "propagatePorts";
38 
39 CGRA::CGRA(std::string name, std::string templateName)
40  : top_level_module(std::make_unique<Module>(std::move(name), std::move(templateName)))
41 {
42 }
43 
44 const MRRG& CGRA::getMRRG(int II)
45 {
46  if((std::ptrdiff_t)mrrgs.size() < II)
47  {
48  mrrgs.resize(II, std::shared_ptr<MRRG>(nullptr));
49  }
50 
51  auto& mrrg_ptr = mrrgs[II-1];
52  if(!mrrg_ptr.get())
53  {
54  auto initial_mrrg = std::unique_ptr<const MRRG>(getTopLevelModule().createMRRG(II));
55  verifyAndPrintReport(*initial_mrrg, std::cout, true, true);
56  mrrg_ptr = std::make_shared<const MRRG>(std::move(*initial_mrrg));
57  }
58 
59  return *mrrg_ptr;
60 }
61 
62 
63 // Function that generates the bitstream
65 {
66  // figure out what the scanchain order is
67  std::vector<ConfigCell*> config_table;
68  getTopLevelModule().genConfigOrder(config_table);
69 
70  // result for this function
71  BitStream bitstream;
72 
73  // Dump some info
74  std::cout << "config table: \n\t";
75  for (auto* p : config_table) {
76  std::cout << p << ' ';
77  }
78  std::cout << '\n';
79 
80  // create an index from (Module, OpGraphOp) to a set of MRRG nodes mapped to that OpGraphOp within that Module
81  std::map<const Module*, MRRGNodesFromOpNode> mrrgnodes_for_op_node_for_module;
82  for(auto* op : mapping.getOpGraph().opNodes())
83  {
84  for (auto* n : mapping.getMappingList(op)) {
85  mrrgnodes_for_op_node_for_module[n->parent][op].insert(n);
86  }
87  }
88 
89  // dump some more info
90  std::cout << "Value mappings: (val node: {mrrg node })\n";
91  for(auto* val : mapping.getOpGraph().valNodes()) {
92  std::cout << val << ":";
93  for (auto* nptr : mapping.getMappingList(val)) {
94  const auto& mrrg_node = *nptr;
95  std::cout << mrrg_node << " ";
96  }
97  std::cout << '\n';
98  }
99 
100  // create an index from (Module, OpGraphVal) to a set of MRRG nodes mapped to that OpGraphVal within that Module
101  std::map<const Module*, MRRGNodesFromValNode> mrrgnodes_for_val_node_for_module;
102  for(auto* val : mapping.getOpGraph().valNodes()) {
103  for(auto* n : mapping.getMappingList(val)) {
104  mrrgnodes_for_val_node_for_module[n->parent][val].insert(n);
105  }
106  }
107 
108  if (mrrgnodes_for_val_node_for_module.find(nullptr) != end(mrrgnodes_for_val_node_for_module)) {
109  std::cout << "detected mrrg node(s) with unset parent (no containing Module)!:\n";
110  }
111 
112  int II = mapping.getII();
113  // in scanchain order, pass items from the indexes created earlier to the module's getBitConfig functions
114  for (const auto* ccell : config_table) {
115  const auto* module = &ccell->getSingleConnectedPort().getModule();
116 
117  const auto module_and_mrrg_nodes_for_val_node = mrrgnodes_for_val_node_for_module.find(module);
118  const auto module_and_mrrg_nodes_for_op_node = mrrgnodes_for_op_node_for_module.find(module);
119  const bool val_nodes_available = module_and_mrrg_nodes_for_val_node != end(mrrgnodes_for_val_node_for_module);
120  const bool op_nodes_available = module_and_mrrg_nodes_for_op_node != end(mrrgnodes_for_op_node_for_module);
121  const auto value_for_bitstream = [&](){
122  try {
123  // separate statements so we can avoid modifying the indexes
124  if (val_nodes_available) {
125  if (op_nodes_available) {
126  return module->getBitConfig(getMRRG(II), mapping.getOpGraph(), mapping, *ccell, module_and_mrrg_nodes_for_op_node->second, module_and_mrrg_nodes_for_val_node->second);
127  } else {
128  return module->getBitConfig(getMRRG(II), mapping.getOpGraph(), mapping, *ccell, {}, module_and_mrrg_nodes_for_val_node->second);
129  }
130  } else {
131  if (op_nodes_available) {
132  return module->getBitConfig(getMRRG(II), mapping.getOpGraph(), mapping, *ccell, module_and_mrrg_nodes_for_op_node->second, {});
133  } else {
134  return module->getBitConfig(getMRRG(II), mapping.getOpGraph(), mapping, *ccell, {}, {});
135  }
136  }
137  } catch (...) {
138  // print out some diagnostic information. The virtual functions of Module are user configuration points,
139  // and so it's probably a good idea to provide some diagnostics when things go wrong.
140  std::cout << "Exception thrown when getting bitconfig from " << module->getName() << " with the following input:" << std::endl;
141  std::cout << "ConfigCell name: " << ccell->getName() << std::endl;
142  std::cout << "Op Nodes:" << std::endl;
143  if (op_nodes_available) {
144  for (const auto& op_and_nodes : module_and_mrrg_nodes_for_op_node->second) {
145  std::cout << '\t' << *op_and_nodes.first << std::endl;
146  for (const auto& mrrg_node : op_and_nodes.second) {
147  std::cout << "\t\t" << *mrrg_node << std::endl;
148  }
149  }
150  } else {
151  std::cout << "\t[ none ]" << std::endl;
152  }
153  std::cout << "Value Nodes:" << std::endl;
154  if (val_nodes_available) {
155  for (const auto& val_and_nodes : module_and_mrrg_nodes_for_val_node->second) {
156  std::cout << '\t' << *val_and_nodes.first << std::endl;
157  for (const auto& mrrg_node : val_and_nodes.second) {
158  std::cout << "\t\t" << *mrrg_node << std::endl;
159  }
160  }
161  } else {
162  std::cout << "\t[ none ]" << std::endl;
163  }
164  std::cout << "End listing" << std::endl;
165  throw;
166  }
167  }();
168 
169  // Adding padding config bits when used contexts (II) is less than supported contexts (SII)
170  auto padded_bitstream = BitConfig(ccell->l_contexts);
171  for (auto cycle=0; cycle<ccell->l_contexts ; cycle++) {
172  if (cycle < II) {
173  padded_bitstream.add(value_for_bitstream.getBitSetting()[cycle], cycle);
174  }
175  else {
176  padded_bitstream.add({(size_t)ccell->getStorageSize(), BitSetting::LOW}, cycle);
177  }
178  }
179 
180  // check that we get the expected number of bits
181  if ((std::ptrdiff_t)value_for_bitstream[0].size() != ccell->getStorageSize()) {
182  std::cout << ("wrong number of bits returned for " + module->getName() + "::" + ccell->getName()) << ": " << value_for_bitstream[0] << ". Expected " << ccell->getStorageSize() << " bits. Got " << value_for_bitstream[0].size() << " bits\n";
183  throw cgrame_error("wrong number of bits returned for " + module->getName() + "::" + ccell->getName());
184  } else {
185  if(dynamic_cast<const ElasticConfigCell*>(ccell)){
186  int used_cycles = value_for_bitstream.getUsedCycles();
187  bitstream.append(ccell, value_for_bitstream.getBitSetting(), used_cycles);
188  } else {
189  bitstream.append(ccell, padded_bitstream.getBitSetting());
190  }
191  }
192  }
193 
194  return bitstream;
195 }
196 
197 /*
198 // Generates timing constraints for CGRA using an opgraph that is already mapped
199 void CGRA::genTimingConstraints(OpGraph * opgraph)
200 {
201  // the Tickle script we will be writing to
202  std::ofstream Timing;
203  Timing.open("primetime.tcl");
204 
205  // Similar to the bitstream generator, we want all modules that we need to configure
206  std::vector<Module*> ConfigTable; // Table that holds modules that need to be configured
207  genConfigOrder(ConfigTable); // Initializing the table
208 
209  // Disabling all IO's, Muxes, and FuncUnits
210  Timing << "# disabling required timing paths\n";
211  for (unsigned i = 0; i < ConfigTable.size(); i++)
212  {
213  if (ConfigTable[i]->getModuleType() == MOD_PRIM_MUX) // If it's a configurable mux, disable it (no need to disable output port if all inputs are disabled
214  {
215  Timing << "set_disable_timing " << ConfigTable[i]->ReturnPath() << "/in*\n"; // "in" is hardcoded for mux inputs"
216  }
217  else if (ConfigTable[i]->getModuleType() == MOD_PRIM_FUNC)
218  {
219  for (auto it = ConfigTable[i]->submodules.begin(); it != ConfigTable[i]->submodules.end(); it++) // If it's a FuncUnit, disable all submodules
220  {
221  Timing << "set_disable_timing " << it->second->ReturnPath() << "\n";
222  }
223  }
224  else if (ConfigTable[i]->parent->getModuleType() == MOD_PRIM_IO) // If its parent is an IO device
225  {
226  Timing << "set_disable_timing " << ConfigTable[i]->parent->ReturnPath() << "\n";
227  }
228  else if (ConfigTable[i]->getModuleType() == MOD_PRIM_TRI) // If it's just a Tristate, and it's parent is not an IO device
229  {
230  Timing << "set_disable_timing " << ConfigTable[i]->ReturnPath() << "\n";
231  }
232  }
233 
234  // Re-enabling the required paths
235  Timing << "# now re-enabling required timing paths\n";
236  for(auto & op: opgraph->opNodes()) // For all OPNodes, we want to get bits for IO devices and FuncUnits
237  {
238  if (op->opcode == OpCode::INPUT) // If it's an input node -> IO
239  {
240  Timing << "remove_disable_timing " << op->mapped_nodes[0]->parent->ReturnPath() << "\n";
241  Timing << "set_disable_timing " << op->mapped_nodes[0]->parent->ReturnPath() << "/OE\n";
242  }
243  else if (op->opcode == OpCode::OUTPUT) // If it's an output node -> IO
244  {
245  Timing << "remove_disable_timing " << op->mapped_nodes[0]->parent->ReturnPath() << "\n";
246  }
247  else // If it's a function node->FuncUnit
248  {
249  Timing << "remove_disable_timing " << op->mapped_nodes[0]->parent->ReturnPath()
250  << "/" << ((FuncUnit*)op->mapped_nodes[0]->parent)->all_modes[op->opcode].ModuleName << "\n";
251  }
252  }
253  for(auto & val: opgraph->valNodes()) // Dealing with the Multiplexers
254  {
255  for(auto & n: val->mapped_nodes)
256  {
257  if (n->pt == MUX_IN) // If it's a mux in node
258  {
259  Timing << "remove_disable_timing " << n->parent->ReturnPath() << "/in";
260  Timing << getNumAfterString(n->name, ".in") << "\n";
261  }
262  }
263  }
264  Timing.close();
265 }
266 */
267 
268 // Floorplans CGRABlocks on ASIC chip
270 {
271  auto& submodules = getTopLevelModule().submodules;
272  // the Tickle script we will be writing to
273  std::ofstream Floorplan;
274  Floorplan.open("encounter.tcl");
275  // Setting up the variables in the tcl script
276  Floorplan << "variable blockarea\n"; // Area of a CGRA block
277  Floorplan << "variable blocklength [expr sqrt($blockarea) / 0.85]\n"; // How long a block will be
278  Floorplan << "variable N " << num_floorplan_rows << "\n"; // # of rows in CGRA
279  Floorplan << "variable M " << num_floorplan_columns << "\n"; // # of cols in CGRA
280  Floorplan << "variable cgrawidth [expr $N*$blocklength]\n"; // CGRA width
281  Floorplan << "variable cgraheight [expr $M*$blocklength]\n"; // CGRA height
282  Floorplan << "variable border 20\n"; // Width of the border used on ASIC chip
283  // Loading the libraries required
284  Floorplan << "# loading libraries\n";
285  Floorplan << "loadConfig encounter.conf 0\n";
286  Floorplan << "setUIVar rda_Input ui_netlist CGRA_comp.v\n";
287  Floorplan << "setUIVar rda_Input ui_topcell CGRA\n";
288  Floorplan << "commitConfig\n";
289  // Setting up the chip
290  Floorplan << "# set up chip\n";
291  Floorplan << "floorPlan -site core -s $cgrawidth $cgraheight $border $border $border $border\n";
292 
293  // Floorplanning the CGRABlocks
294  Floorplan << "# floorplan blocks\n";
295 
296  int CurrentROW = 0, CurrentCOL = 0;
297  for (auto it = submodules.begin(); it != submodules.end(); it++) // Iterate through all the non-IO modules in CGRA
298  {
299  // At the time this was comment out, nothing set MOD_PRIM_IO
300  // if (it->second->getModuleType() != MOD_PRIM_IO) // If it's not an IO device, floorplan it
301  {
302  Floorplan << "setObjFPlanBox Module " << it->second->getName();
303  // First argument
304  Floorplan << " [expr $border+" << CurrentCOL << "*$blocklength] ";
305  // Second argument
306  Floorplan << "[expr $cgraheight+$border-" << (CurrentROW+1) << "*$blocklength] ";
307  // Third argument
308  Floorplan << "[expr $border+" << (CurrentCOL+1) << "*$blocklength] ";
309  // Fourth argument
310  Floorplan << "[expr $cgraheight+$border-" << CurrentROW << "*$blocklength]\n";
311  CurrentCOL++; // Move to next position in CGRA
312  if (CurrentCOL == num_floorplan_columns) // Change to a new row if we reached the end of it
313  {
314  CurrentCOL = 0;
315  CurrentROW++;
316  }
317  }
318  }
319 
320  // Placing the design
321  Floorplan << "# placing design\n";
322  Floorplan << "getMultiCpuUsage -localCpu\n";
323  Floorplan << "setPlaceMode -fp false\n";
324  Floorplan << "placeDesign -prePlaceOpt\n";
325 
326  // Routing the design
327  Floorplan << "# routing design\n";
328  Floorplan << "setNanoRouteMode -quiet -drouteStartIteration default\n";
329  Floorplan << "setNanoRouteMode -quiet -routeTopRoutingLayer default\n";
330  Floorplan << "setNanoRouteMode -quiet -routeBottomRoutingLayer default\n";
331  Floorplan << "setNanoRouteMode -quiet -drouteEndIteration default\n";
332  Floorplan << "setNanoRouteMode -quiet -routeWithTimingDriven false\n";
333  Floorplan << "setNanoRouteMode -quiet -routeWithSiDriven false\n";
334  Floorplan << "routeDesign -globalDetail\n";
335 
336  // Saving the design
337  Floorplan << "saveDesign CGRA.enc\n";
338  // Getting spef file for Primetime
339  Floorplan << "rcOut -spef CGRA.spef\n";
340  // Getting netlist for Primetime
341  Floorplan << "saveNetlist CGRA_Golden.v\n";
342 
343  Floorplan.close();
344 }
345 
346 namespace {
347 
348 std::vector<Module*> computeModulePostorder(Module* module, std::vector<Module*> unique_postorder) {
349  for(const auto& nameAndSubmodule : module->submodules) {
350  auto submod = nameAndSubmodule.second;
351  unique_postorder = computeModulePostorder(submod, std::move(unique_postorder));
352  }
353 
354  for(const auto& nameAndConfigCell : module->configcells) {
355  auto ccell = nameAndConfigCell.second;
356  unique_postorder = computeModulePostorder(ccell, std::move(unique_postorder));
357  }
358 
359  unique_postorder.push_back(module);
360 
361  return std::move(unique_postorder);
362 }
363 
364 
365 void genVerilogCoreIR(CGRA& cgra, std::string dir, const int& contexts) {
366  CoreIR::Context* c = CoreIR::newContext();
367  CoreIR::Namespace* cgrame = c->newNamespace("cgrame");
368  (void)cgrame; // don't have a use for the namespace here, yet. It just needs to exist
369  auto cgra_top = &cgra.getTopLevelModule();
370 
371  const auto generate_order = computeModulePostorder(cgra_top, {});
372  std::set<std::string> generated_names;
373  for (const auto& module : generate_order) {
374  if (
375  not generated_names.insert(module->GenericName()).second // Can only have one of each generator
376  ) {
377  continue;
378  }
379  module->CoreIRGenModuleVerilog(c, contexts);
380  }
381 
382  CoreIR::Module* topMod = cgrame->getGenerator(cgra_top->GenericName())->getModule({});
383  topMod->runGenerator(); // top module must have a definition before calling setTop
384  c->setTop(topMod);
385  std::string fileName = dir + "/cgrame.v";
386  std::ofstream fout(fileName);
387  c->addPass(new PropagatePorts());
388  c->runPasses({"rungenerators", "removebulkconnections", "flattentypes", "propagatePorts", "verilog"}, {"cgrame"});
389  auto& vpass = dynamic_cast<CoreIR::Passes::Verilog&>(*c->getPassManager()->getAnalysisPass("verilog"));
390  std::vector<CoreIR::Passes::VModule*> modList = vpass.getModList();
391  cgra.hybridPorts = modList[modList.size()-1]->getPorts();
392  vpass.writeToStream(fout);
393  CoreIR::deleteContext(c);
394 }
395 
396 void genHybridCoreIR(CGRA& cgra, std::string dir, int mem_size) {
397  std::ofstream myfile;
398  std::string fileName = dir + "/control.sv";
399  myfile.open(fileName);
400  buildComp(myfile, cgra.hybridPorts, mem_size);
401 }
402 
403 }
404 
405 void CGRA::genVerilog(VerilogType vt, std::string dir, const int& contexts) {
406  switch(vt) {
408  case VerilogType::CoreIR: return genVerilogCoreIR(*this, dir, contexts);
409  }
410 }
411 
412 void CGRA::genHybrid(VerilogType vt, std::string dir, int mem_size) {
413  switch(vt) {
414  case VerilogType::CGRAME: std::cout << "Not yet" << "";
415  case VerilogType::CoreIR: return genHybridCoreIR(*this, dir, mem_size);
416  }
417 }
418 
419 
433 bool PropagatePorts::runOnInstanceGraphNode(CoreIR::InstanceGraphNode& node) {
434  CoreIR::Context* c = this->getContext();
435 
436  CoreIR::Module* m = node.getModule();
437 
438  if (m->isGenerated()) {
439  CoreIR::Generator* g = m->getGenerator();
440  if (g->getMetaData().find("propagatePorts") != g->getMetaData().end()) {
441  std::vector<std::string> portsToPropagate = g->getMetaData()["propagatePorts"].get<std::vector<std::string>>();
442  if (!portsToPropagate.empty()) {
443  modulesToPropagateFrom.emplace(m, portsToPropagate);
444  }
445  }
446  }
447 
448  if (!m->hasDef()) return false;
449  CoreIR::ModuleDef* def = m->getDef();
450  // Check if the child has a special port that needs to be propagated, add the wire and/or connect it
451  for (auto imap : def->getInstances()) {
452  CoreIR::Instance* inst = imap.second;
453  CoreIR::Module* mref = imap.second->getModuleRef();
454 
455  if (modulesToPropagateFrom.find(mref) != modulesToPropagateFrom.end()) {
456  // std::cout << mref->getName() << " is in " << m->getName() << "\n";
457  string iname = imap.first;
458  std::vector<string> portsToPropagate = modulesToPropagateFrom.at(mref);
459  auto thisRecord = m->getType()->getRecord();
460  auto submodRecord = mref->getType()->getRecord();
461  for (auto & port : portsToPropagate) {
462  // std::cout << "Looking for " << port << "\n";
463  // Iterate through the instance's wireables to find the port's type
464  if (submodRecord.find(port) != submodRecord.end()) {
465  if (thisRecord.find(iname+"_"+port) == thisRecord.end()) {
466  node.appendField(iname+"_"+port, mref->getType()->getRecord().at(port));
467  // std::cout << "Adding port: " << port << "\n";
468  }
469  // std::cout << "Connecting " << port << " from " << iname << "\n";
470  def->connect("self." + iname + "_" + port, iname + "." + port);
471  port = iname+"_"+port;
472  }
473  }
474  if (modulesToPropagateFrom.find(m) == modulesToPropagateFrom.end()) {
475  modulesToPropagateFrom.emplace(m, portsToPropagate);
476  }
477  else {
478  // Case where a module has multiple children with ports to propagate
479  std::copy(portsToPropagate.begin(), portsToPropagate.end(), std::back_inserter(modulesToPropagateFrom[m]));
480  }
481  }
482  }
483 
484  return true;
485 }
Module::submodules
std::map< std::string, Module * > submodules
Definition: Module.h:227
BitConfig
Definition: BitSetting.h:58
ModuleComposites.h
verifyAndPrintReport
bool verifyAndPrintReport(const MRRG &mrrg, std::ostream &os, bool silent_on_no_errors, bool throw_if_errors, const ConfigStore &extra_opts)
Definition: MRRG.cpp:473
Module::genVerilogCGRAME
void genVerilogCGRAME(std::string dir)
Definition: Module.cpp:175
MRRG
Definition: MRRG.h:216
PropagatePorts::runOnInstanceGraphNode
bool runOnInstanceGraphNode(CoreIR::InstanceGraphNode &node) override
Definition: CGRA.cpp:433
CGRA::genFloorPlan
void genFloorPlan()
Definition: CGRA.cpp:269
CGRA::genBitStream
BitStream genBitStream(const Mapping &mapping)
Definition: CGRA.cpp:64
BitStream
Definition: CGRA.h:34
VerilogType
VerilogType
Definition: Module.h:150
ModuleElastic.h
CGRA::genVerilog
void genVerilog(VerilogType vt, std::string dir, const int &SII)
Definition: CGRA.cpp:405
PropagatePorts::modulesToPropagateFrom
std::unordered_map< CoreIR::Module *, std::vector< std::string > > modulesToPropagateFrom
Definition: CGRA.cpp:43
CGRA
Definition: CGRA.h:76
Mapping::getOpGraph
OpGraph & getOpGraph()
Definition: Mapping.h:82
OpGraph::valNodes
auto & valNodes() const
Definition: OpGraph.h:314
Mapping::getMappingList
const std::vector< MRRG::NodeDescriptor > & getMappingList(OpGraph::NodeDescriptor key) const
Definition: Mapping.h:57
BitSetting::LOW
@ LOW
Mapping
Definition: Mapping.h:31
PropagatePorts::ID
static std::string ID
Definition: CGRA.cpp:33
CGRA::mrrgs
std::vector< std::shared_ptr< const MRRG > > mrrgs
Definition: CGRA.h:99
VerilogType::CoreIR
@ CoreIR
Module::GenericName
virtual std::string GenericName()
Definition: Module.cpp:260
Module::configcells
std::map< std::string, ConfigCell * > configcells
Definition: Module.h:228
CGRA::getMRRG
const MRRG & getMRRG(int II)
Definition: CGRA.cpp:44
OpGraph::opNodes
auto & opNodes() const
Definition: OpGraph.h:313
CGRA::getTopLevelModule
Module & getTopLevelModule()
Definition: CGRA.h:89
Module
Definition: Module.h:163
VerilogType::CGRAME
@ CGRAME
CGRA::num_floorplan_columns
int num_floorplan_columns
Definition: CGRA.h:101
Module::CoreIRGenModuleVerilog
virtual void CoreIRGenModuleVerilog(CoreIR::Context *c, int contexts)
Definition: Module.cpp:606
Mapping::getII
int getII() const
Definition: Mapping.cpp:53
Module::genConfigOrder
void genConfigOrder(std::vector< ConfigCell * > &ConfigTable) const
Definition: Module.cpp:164
CGRA.h
end
auto end(const SingleItemImmutableSet< VertexID > &siis)
Definition: Collections.h:138
ElasticConfigCell
Definition: ModuleElastic.h:318
BitStream::append
void append(const ConfigCell *ccell, const BitArray &bits, int con_used=0)
Definition: BitStream.cpp:19
CGRA::hybridPorts
std::vector< std::string > hybridPorts
Definition: CGRA.h:95
PropagatePorts
Definition: CGRA.cpp:22
CGRA::CGRA
CGRA(std::string name="CGRA", std::string templateName="cgra")
Definition: CGRA.cpp:39
PropagatePorts::PropagatePorts
PropagatePorts()
Definition: CGRA.cpp:34
PropagatePorts::print
void print() override
Definition: CGRA.cpp:37
CGRA::num_floorplan_rows
int num_floorplan_rows
Definition: CGRA.h:100
buildComp
void buildComp(ofstream &myfile, std::vector< std::string > ports, int mem_size)
Definition: Control.cpp:10
CGRA::genHybrid
void genHybrid(VerilogType vt, std::string dir, int mem_size)
Definition: CGRA.cpp:412
Control.h
cgrame_error
Definition: Exception.h:20