summaryrefslogtreecommitdiff
path: root/passes
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-04 15:33:51 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-04 15:40:08 +0200
commit0bb694221832f250977437f29365bc5e17c4cd09 (patch)
tree593de0bdf37af0772c69424eccc9dbdd2dc538d1 /passes
parentb5a3419ac2c6f367b90f062c4e2252029910cdb9 (diff)
Added "show -signed"
Diffstat (limited to 'passes')
-rw-r--r--passes/cmds/show.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/passes/cmds/show.cc b/passes/cmds/show.cc
index c15feb7b..4f6b811b 100644
--- a/passes/cmds/show.cc
+++ b/passes/cmds/show.cc
@@ -45,6 +45,7 @@ struct ShowWorker
RTLIL::Module *module;
uint32_t currentColor;
bool genWidthLabels;
+ bool genSignedLabels;
bool stretchIO;
bool enumerateIds;
bool abbreviateIds;
@@ -354,7 +355,9 @@ struct ShowWorker
std::string label_string = "{{";
for (auto &p : in_ports)
- label_string += stringf("<p%d> %s|", id2num(p), escape(p.str()));
+ label_string += stringf("<p%d> %s%s|", id2num(p), escape(p.str()),
+ genSignedLabels && it.second->hasParam(p.str() + "_SIGNED") &&
+ it.second->getParam(p.str() + "_SIGNED").as_bool() ? "*" : "");
if (label_string[label_string.size()-1] == '|')
label_string = label_string.substr(0, label_string.size()-1);
@@ -487,12 +490,12 @@ struct ShowWorker
fprintf(f, "}\n");
}
- ShowWorker(FILE *f, RTLIL::Design *design, std::vector<RTLIL::Design*> &libs, uint32_t colorSeed,
- bool genWidthLabels, bool stretchIO, bool enumerateIds, bool abbreviateIds, bool notitle,
+ ShowWorker(FILE *f, RTLIL::Design *design, std::vector<RTLIL::Design*> &libs, uint32_t colorSeed, bool genWidthLabels,
+ bool genSignedLabels, bool stretchIO, bool enumerateIds, bool abbreviateIds, bool notitle,
const std::vector<std::pair<std::string, RTLIL::Selection>> &color_selections,
const std::vector<std::pair<std::string, RTLIL::Selection>> &label_selections) :
f(f), design(design), currentColor(colorSeed), genWidthLabels(genWidthLabels),
- stretchIO(stretchIO), enumerateIds(enumerateIds), abbreviateIds(abbreviateIds),
+ genSignedLabels(genSignedLabels), stretchIO(stretchIO), enumerateIds(enumerateIds), abbreviateIds(abbreviateIds),
notitle(notitle), color_selections(color_selections), label_selections(label_selections)
{
ct.setup_internals();
@@ -572,6 +575,10 @@ struct ShowPass : public Pass {
log(" -width\n");
log(" annotate busses with a label indicating the width of the bus.\n");
log("\n");
+ log(" -signed\n");
+ log(" mark ports (A, B) that are declarted as signed (using the [AB]_SIGNED\n");
+ log(" cell parameter) with an asterisk next to the port name.\n");
+ log("\n");
log(" -stretch\n");
log(" stretch the graph so all inputs are on the left side and all outputs\n");
log(" (including inout ports) are on the right side.\n");
@@ -610,6 +617,7 @@ struct ShowPass : public Pass {
std::vector<RTLIL::Design*> libs;
uint32_t colorSeed = 0;
bool flag_width = false;
+ bool flag_signed = false;
bool flag_stretch = false;
bool flag_pause = false;
bool flag_enum = false;
@@ -664,6 +672,10 @@ struct ShowPass : public Pass {
flag_width= true;
continue;
}
+ if (arg == "-signed") {
+ flag_signed= true;
+ continue;
+ }
if (arg == "-stretch") {
flag_stretch= true;
continue;
@@ -727,7 +739,7 @@ struct ShowPass : public Pass {
delete lib;
log_cmd_error("Can't open dot file `%s' for writing.\n", dot_file.c_str());
}
- ShowWorker worker(f, design, libs, colorSeed, flag_width, flag_stretch, flag_enum, flag_abbeviate, flag_notitle, color_selections, label_selections);
+ ShowWorker worker(f, design, libs, colorSeed, flag_width, flag_signed, flag_stretch, flag_enum, flag_abbeviate, flag_notitle, color_selections, label_selections);
fclose(f);
for (auto lib : libs)