forked from hdl/bazel_rules_hdl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tim 'mithro' Ansell <[email protected]>
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
diff --git a/passes/cmds/autoname.cc b/passes/cmds/autoname.cc | ||
index 737bd3e58..474303263 100644 | ||
--- passes/cmds/autoname.cc | ||
+++ passes/cmds/autoname.cc | ||
@@ -34,8 +34,13 @@ int autoname_worker(Module *module, const dict<Wire*, int>& wire_score) | ||
string suffix; | ||
for (auto bit : conn.second) | ||
if (bit.wire != nullptr && bit.wire->name[0] != '$') { | ||
- if (suffix.empty()) | ||
- suffix = stringf("_%s_%s", log_id(cell->type), log_id(conn.first)); | ||
+ if (suffix.empty()) { | ||
+ if (bit.wire->width > 1) { | ||
+ suffix = stringf("%i_%s_%s", bit.offset, log_id(cell->type), log_id(conn.first)); | ||
+ } else { | ||
+ suffix = stringf("_%s_%s", log_id(cell->type), log_id(conn.first)); | ||
+ } | ||
+ } | ||
string new_name(bit.wire->name.str() + suffix); | ||
int score = wire_score.at(bit.wire); | ||
if (cell->output(conn.first)) score = 0; | ||
@@ -52,8 +57,13 @@ int autoname_worker(Module *module, const dict<Wire*, int>& wire_score) | ||
string suffix; | ||
for (auto bit : conn.second) | ||
if (bit.wire != nullptr && bit.wire->name[0] == '$' && !bit.wire->port_id) { | ||
- if (suffix.empty()) | ||
- suffix = stringf("_%s", log_id(conn.first)); | ||
+ if (suffix.empty()) { | ||
+ if (bit.wire->width > 1) { | ||
+ suffix = stringf("%i_%s", bit.offset, log_id(conn.first)); | ||
+ } else { | ||
+ suffix = stringf("_%s", log_id(conn.first)); | ||
+ } | ||
+ } | ||
string new_name(cell->name.str() + suffix); | ||
int score = wire_score.at(bit.wire); | ||
if (cell->output(conn.first)) score = 0; |