diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-11-08 10:58:57 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-11-08 10:58:57 +0100 |
commit | 420bc05627afe220102368fb29d717b429645869 (patch) | |
tree | 94edfa8926a458e2aed261d4e2091517ed053762 /passes/cmds | |
parent | 89be7bf52785c9a3058a0049481388ad44459174 (diff) | |
download | yosys-420bc05627afe220102368fb29d717b429645869.tar.gz yosys-420bc05627afe220102368fb29d717b429645869.tar.bz2 yosys-420bc05627afe220102368fb29d717b429645869.zip |
Added "Nx" syntax to "show" command for repeating SigChunks
Diffstat (limited to 'passes/cmds')
-rw-r--r-- | passes/cmds/show.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/passes/cmds/show.cc b/passes/cmds/show.cc index 1413742df..715c1de56 100644 --- a/passes/cmds/show.cc +++ b/passes/cmds/show.cc @@ -209,22 +209,24 @@ struct ShowWorker std::string label_string; int pos = sig.size()-1; int idx = single_idx_count++; - for (int i = int(sig.chunks().size())-1; i >= 0; i--) { + for (int rep, i = int(sig.chunks().size())-1; i >= 0; i -= rep) { const RTLIL::SigChunk &c = sig.chunks().at(i); net = gen_signode_simple(c, false); log_assert(!net.empty()); + for (rep = 1; i-rep >= 0 && c == sig.chunks().at(i-rep); rep++) {} + std::string repinfo = rep > 1 ? stringf("%dx ", rep) : ""; if (driver) { - label_string += stringf("<s%d> %d:%d - %d:%d |", i, pos, pos-c.width+1, c.offset+c.width-1, c.offset); + label_string += stringf("<s%d> %d:%d - %s%d:%d |", i, pos, pos-c.width+1, repinfo.c_str(), c.offset+c.width-1, c.offset); net_conn_map[net].in.insert(stringf("x%d:s%d", idx, i)); - net_conn_map[net].bits = c.width; + net_conn_map[net].bits = rep*c.width; net_conn_map[net].color = nextColor(c, net_conn_map[net].color); } else { - label_string += stringf("<s%d> %d:%d - %d:%d |", i, c.offset+c.width-1, c.offset, pos, pos-c.width+1); + label_string += stringf("<s%d> %s%d:%d - %d:%d |", i, repinfo.c_str(), c.offset+c.width-1, c.offset, pos, pos-rep*c.width+1); net_conn_map[net].out.insert(stringf("x%d:s%d", idx, i)); - net_conn_map[net].bits = c.width; + net_conn_map[net].bits = rep*c.width; net_conn_map[net].color = nextColor(c, net_conn_map[net].color); } - pos -= c.width; + pos -= rep * c.width; } if (label_string[label_string.size()-1] == '|') label_string = label_string.substr(0, label_string.size()-1); |