@@ -805,6 +805,14 @@ static void pack_iologic(Context *ctx)
805805 ci->addInput (id_XXX_VCC);
806806 ci->connectPort (id_XXX_VCC, ctx->nets [ctx->id (" $PACKER_VCC_NET" )].get ());
807807 }
808+ if (ctx->gw1n9_quirk && iob_bel != q0_dst->attrs .end ()) {
809+ bool have_XXX_VSS0 =
810+ ctx->bels [ctx->getBelByNameStr (iob_bel->second .as_string ())].pins .count (id_XXX_VSS0);
811+ if (have_XXX_VSS0) {
812+ q0_dst->disconnectPort (id_XXX_VSS0);
813+ q0_dst->connectPort (id_XXX_VSS0, ctx->nets [ctx->id (" $PACKER_VCC_NET" )].get ());
814+ }
815+ }
808816 } break ;
809817 default :
810818 break ;
@@ -933,6 +941,7 @@ static void pack_io(Context *ctx)
933941 // what type to create
934942 IdString new_cell_type = id_IOB;
935943 std::string constr_bel_name = std::string (" " );
944+ bool have_xxx_port = false ;
936945 // check whether the given IO is limited to simplified IO cells
937946 auto constr_bel = ci->attrs .find (id_BEL);
938947 if (constr_bel != ci->attrs .end ()) {
@@ -946,6 +955,9 @@ static void pack_io(Context *ctx)
946955 BelId constr_bel = ctx->getBelByNameStr (constr_bel_name);
947956 if (constr_bel != BelId ()) {
948957 new_cell_type = ctx->bels [constr_bel].type ;
958+ if (ctx->gw1n9_quirk ) {
959+ have_xxx_port = ctx->bels [constr_bel].pins .count (id_XXX_VSS0) != 0 ;
960+ }
949961 }
950962 }
951963
@@ -954,6 +966,13 @@ static void pack_io(Context *ctx)
954966 gwio_to_iob (ctx, ci, ice_cell.get (), packed_cells);
955967 new_cells.push_back (std::move (ice_cell));
956968 auto gwiob = new_cells.back ().get ();
969+ // XXX GW1NR-9 quirks
970+ if (have_xxx_port && ci->type != id_IBUF) {
971+ gwiob->addInput (id_XXX_VSS0);
972+ gwiob->connectPort (id_XXX_VSS0, ctx->nets [ctx->id (" $PACKER_GND_NET" )].get ());
973+ gwiob->addInput (id_XXX_VSS1);
974+ gwiob->connectPort (id_XXX_VSS1, ctx->nets [ctx->id (" $PACKER_GND_NET" )].get ());
975+ }
957976
958977 packed_cells.insert (ci->name );
959978 if (iob != nullptr ) {
0 commit comments