89 string errorMsg =
"Empty input netlist block.";
105 const std::string& dstDirectory)
const {
109 outFile.open(fileName.c_str(), ofstream::out);
113 outFile <<
"parameter " << param.
name() <<
" = " << param.
value();
147 string errorMsg =
"Unable to create file: " + fileName;
154 outFile.open(fileName.c_str(), ofstream::out);
157 outFile <<
"module " + entityName << endl;
161 outFile <<
"#(" << endl;
169 outFile << separator << endl;
170 outFile <<
"`include \"" << block.
package(i) <<
"_pkg.vh\"" << endl;
174 outFile <<
")" << endl;
188 outFile <<
"endmodule" << endl;
205 const std::string& indentation, std::ostream& stream) {
226 stream <<
";" << endl;
243 const std::string& indentation, std::ostream& stream) {
247 for (
size_t i = 0; i < block.
portCount(); i++) {
249 string portName = port.
name();
269 stream <<
" " << portName;
289 typedef std::set<const BaseNetlistBlock*, NetlistBlockNameComparator>
296 subBlocks.insert(&block.
subBlock(i));
301 for (BlockSet::const_iterator iter = subBlocks.begin();
302 iter != subBlocks.end(); iter++) {
305 for (
size_t i = 0; i < subBlock->
portCount(); i++) {
309 std::pair<out_edge_iterator, out_edge_iterator> edges =
310 boost::out_edges(vertexDescriptor, block.
netlist());
312 if (edges.first != edges.second) {
315 boost::target(edgeDescriptor, block.
netlist());
352 set<const BaseNetlistBlock*, NetlistBlockNameComparator> subBlocks;
354 subBlocks.insert(&block.
subBlock(i));
357 typedef std::vector<edge_descriptor> EdgeTable;
358 EdgeTable handledEdges;
362 for (
size_t i = 0; i < subBlock.
portCount(); i++) {
365 std::pair<out_edge_iterator, out_edge_iterator> edges =
366 boost::out_edges(vertexDescriptor, block.
netlist());
368 while (edges.first != edges.second) {
372 handledEdges, edgeDescriptor)) {
374 boost::source(edgeDescriptor, block.
netlist());
376 boost::target(edgeDescriptor, block.
netlist());
389 handledEdges.push_back(edgeDescriptor);
391 std::pair<edge_descriptor, bool> opposite =
393 dstVertex, srcVertex, block.
netlist());
395 assert(opposite.first != edgeDescriptor);
396 handledEdges.push_back(opposite.first);
399 block.
netlist()[edgeDescriptor];
400 if (property.fullyConnected()) {
413 string srcPortSignal;
421 property.port1FirstBit()) +
427 property.port1FirstBit() +
428 property.width() - 1) +
431 property.port1FirstBit()) +
435 string dstPortSignal;
443 property.port2FirstBit()) +
449 property.port2FirstBit() +
450 property.width() - 1) +
453 property.port2FirstBit()) +
460 << dstPortSignal <<
" = "
461 << srcPortSignal <<
";" << endl;
464 << srcPortSignal <<
" = "
465 << dstPortSignal <<
";" << endl;
510 stream << param.
value();
525 for (
size_t i = 0; i < component.
portCount(); i++) {
528 std::pair<out_edge_iterator, out_edge_iterator> edges =
529 boost::out_edges(vertexDescriptor, block.
netlist());
531 string srcConn = port.
name();
533 if (edges.first != edges.second) {
536 boost::target(edgeDescriptor, block.
netlist());
543 dstConn = dstPort->
name() +
"[0]";
547 dstConn = dstPort->
name();
550 dstConn = dstPort->
name();
558 stream <<
indentation(3) <<
"." << srcConn <<
"(" << dstConn <<
")";
560 stream <<
"," << endl;
563 stream <<
");" << endl << endl;
595 int length = formula.length();
596 for (
int i = 0; i < length; i++) {
597 if (!isdigit(formula[i])) {
624 unsigned int indentationLevel,
625 const std::string& indentation) {
627 string generatedInd(
"");
628 for (
unsigned int i = 0; i < indentationLevel; i++) {
678 if (
generic.startsWith(
"\"") &&
generic.endsWith(
"\"")) {
681 std::vector<TCEString> unallowed;
682 unallowed.push_back(
".");
683 unallowed.push_back(
"__");
684 for (
unsigned int i = 0; i < unallowed.size(); i++) {
685 if (
generic.find(unallowed.at(i)) != TCEString::npos) {
687 quoted <<
"\"" <<
generic <<
"\"";