Gowin. Registers in IO.

Change the logic for handling command line keys and attributes -
attributes allow routines to be placed in IO regardless of global mode.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
This commit is contained in:
YRabbit 2024-12-31 21:01:46 +10:00
parent 74e7f87309
commit 1c28394dbd

View File

@ -700,8 +700,8 @@ struct GowinPacker
// input reg in IO
CellInfo *iologic_i = nullptr;
if ((ci.type == id_IBUF && ctx->settings.count(id_IREG_IN_IOB)) ||
(ci.type == id_IOBUF && ctx->settings.count(id_IOREG_IN_IOB))) {
if ((ci.type == id_IBUF && (ctx->settings.count(id_IREG_IN_IOB) || ci.attrs.count(id_IOBFF))) ||
(ci.type == id_IOBUF && (ctx->settings.count(id_IOREG_IN_IOB) || ci.attrs.count(id_IOBFF)))) {
if (ci.getPort(id_O) == nullptr) {
continue;
@ -761,8 +761,8 @@ struct GowinPacker
// output reg in IO
CellInfo *iologic_o = nullptr;
if ((ci.type == id_OBUF && ctx->settings.count(id_OREG_IN_IOB)) ||
(ci.type == id_IOBUF && ctx->settings.count(id_IOREG_IN_IOB))) {
if ((ci.type == id_OBUF && (ctx->settings.count(id_OREG_IN_IOB) || ci.attrs.count(id_IOBFF))) ||
(ci.type == id_IOBUF && (ctx->settings.count(id_IOREG_IN_IOB) || ci.attrs.count(id_IOBFF)))) {
while (1) {
if (ci.getPort(id_I) == nullptr) {
break;
@ -862,7 +862,7 @@ struct GowinPacker
}
// output enable reg in IO
if (ci.type == id_IOBUF && ctx->settings.count(id_IOREG_IN_IOB)) {
if (ci.type == id_IOBUF && (ctx->settings.count(id_IOREG_IN_IOB) || ci.attrs.count(id_IOBFF))) {
while (1) {
if (ci.getPort(id_OEN) == nullptr) {
break;