Skip to content

Commit

Permalink
Fix gowin ALU SUB mode ports (YosysHQ#1407)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerkiaga authored Jan 1, 2025
1 parent 3d350c2 commit 0345b6e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions himbaechel/uarch/gowin/pack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,12 @@ struct GowinPacker
ci->renamePort(id_I0, id_I3);
ci->renamePort(id_I2, id_I0);
}
// XXX mode 1 - SUB
else if (ci->params.at(id_ALU_MODE).as_int64() == 1) {
ci->renamePort(id_I3, id_I2);
ci->renamePort(id_I1, id_I3);
ci->renamePort(id_I2, id_I1);
}
// XXX I2 is pin C which must be set to 1 for all ALU modes except MUL
// we use only mode 2 ADDSUB so create and connect this pin
ci->addInput(id_I2);
Expand Down

0 comments on commit 0345b6e

Please sign in to comment.