Merge pull request #1633 from YosysHQ/eddie/fix_autoname

autoname: do not rename ports
This commit is contained in:
Eddie Hung 2020-01-14 11:40:54 -08:00 committed by GitHub
commit 61ffd2d199
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View File

@ -56,7 +56,7 @@ int autoname_worker(Module *module)
for (auto &conn : cell->connections()) { for (auto &conn : cell->connections()) {
string suffix = stringf("_%s", log_id(conn.first)); string suffix = stringf("_%s", log_id(conn.first));
for (auto bit : conn.second) for (auto bit : conn.second)
if (bit.wire != nullptr && bit.wire->name[0] == '$') { if (bit.wire != nullptr && bit.wire->name[0] == '$' && !bit.wire->port_id) {
IdString new_name(cell->name.str() + suffix); IdString new_name(cell->name.str() + suffix);
int score = wire_score.at(bit.wire); int score = wire_score.at(bit.wire);
if (cell->output(conn.first)) score = 0; if (cell->output(conn.first)) score = 0;

19
tests/various/autoname.ys Normal file
View File

@ -0,0 +1,19 @@
read_ilang <<EOT
autoidx 2
module \top
wire output 3 $y
wire input 1 \a
wire input 2 \b
cell $and \b_$and_B
parameter \A_SIGNED 0
parameter \A_WIDTH 1
parameter \B_SIGNED 0
parameter \B_WIDTH 1
parameter \Y_WIDTH 1
connect \A \a
connect \B \b
connect \Y $y
end
end
EOT
autoname