diff options
author | Martin Povišer <povik@cutebit.org> | 2023-01-13 16:25:02 +0100 |
---|---|---|
committer | Martin Povišer <povik@cutebit.org> | 2023-01-13 19:57:24 +0100 |
commit | 314b8642051d8eb418a28e728cf5dcb788815307 (patch) | |
tree | b2862553c35292e5a575737572e2c12643962dee | |
parent | 61abca10a355b512a5f7d089aaf043d5df4d9ab5 (diff) | |
download | yosys-314b8642051d8eb418a28e728cf5dcb788815307.tar.gz yosys-314b8642051d8eb418a28e728cf5dcb788815307.tar.bz2 yosys-314b8642051d8eb418a28e728cf5dcb788815307.zip |
passes: show: Reuse string parts in generation of portboxes
Signed-off-by: Martin Povišer <povik@cutebit.org>
-rw-r--r-- | passes/cmds/show.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/passes/cmds/show.cc b/passes/cmds/show.cc index db428b329..6e8ae6eda 100644 --- a/passes/cmds/show.cc +++ b/passes/cmds/show.cc @@ -289,9 +289,12 @@ struct ShowWorker } std::string repinfo = rep > 1 ? stringf("%dx ", rep) : ""; + std::string portside = stringf("%d:%d", pos, pos - rep*c.width + 1); + std::string remoteside = stringf("%s%d:%d", repinfo.c_str(), cl, cr); + if (driver) { log_assert(!net.empty()); - label_pieces.push_back(stringf("<s%d> %d:%d - %s%d:%d ", chunk_idx, pos, pos-rep*c.width+1, repinfo.c_str(), cl, cr)); + label_pieces.push_back(stringf("<s%d> %s - %s ", chunk_idx, portside.c_str(), remoteside.c_str())); net_conn_map[net].in.insert({stringf("x%d:s%d", dot_idx, chunk_idx), rep*c.width}); net_conn_map[net].color = nextColor(c, net_conn_map[net].color); } else { @@ -304,7 +307,7 @@ struct ShowWorker c.data.front() == State::Sz ? 'Z' : '?', pos, pos-rep*c.width+1)); } else { - label_pieces.push_back(stringf("<s%d> %s%d:%d - %d:%d ", chunk_idx, repinfo.c_str(), cl, cr, pos, pos-rep*c.width+1)); + label_pieces.push_back(stringf("<s%d> %s - %s ", chunk_idx, remoteside.c_str(), portside.c_str())); net_conn_map[net].out.insert({stringf("x%d:s%d", dot_idx, chunk_idx), rep*c.width}); net_conn_map[net].color = nextColor(c, net_conn_map[net].color); } |