Skip to content

Commit

Permalink
Gowin. Registers in IO
Browse files Browse the repository at this point in the history
Check for unconnected ports.

Signed-off-by: YRabbit <[email protected]>
  • Loading branch information
yrabbit committed Dec 8, 2024
1 parent b82cf51 commit 79282bd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions himbaechel/uarch/gowin/pack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,10 @@ struct GowinPacker
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.getPort(id_O) == nullptr) {
continue;
}
// OBUF O -> D FF
CellInfo *ff = net_only_drives(ctx, ci.ports.at(id_O).net, is_ff, id_D, true);
if (ff != nullptr) {
Expand Down Expand Up @@ -729,6 +733,9 @@ struct GowinPacker
if ((ci.type == id_OBUF && ctx->settings.count(id_OREG_IN_IOB)) ||
(ci.type == id_IOBUF && ctx->settings.count(id_IOREG_IN_IOB))) {
while (1) {
if (ci.getPort(id_I) == nullptr) {
break;
}
// OBUF I <- Q FF
if (ci.ports.at(id_I).net->users.entries() != 1) {
break;
Expand Down Expand Up @@ -803,15 +810,18 @@ struct GowinPacker
// output enable reg in IO
if (ci.type == id_IOBUF && ctx->settings.count(id_IOREG_IN_IOB)) {
while (1) {
if (ci.getPort(id_OEN) == nullptr) {
break;
}
// IOBUF OEN <- Q FF
if (ci.ports.at(id_OEN).net->users.entries() != 1) {
continue;
break;
}
CellInfo *ff = net_driven_by(ctx, ci.ports.at(id_OEN).net, is_ff, id_Q);
if (ff != nullptr) {
BelId l_bel = get_iologico_bel(&ci);
if (l_bel == BelId()) {
continue;
break;
}
if (ctx->debug) {
log_info(" trying %s ff as Output Enable Register of %s IO\n", ctx->nameOf(ff),
Expand Down

0 comments on commit 79282bd

Please sign in to comment.