Add USR_RSTN support

This commit is contained in:
Miodrag Milanovic 2025-01-20 08:41:36 +01:00
parent 5c142fc257
commit dbcc9b734f
6 changed files with 28 additions and 0 deletions

View File

@ -149,6 +149,8 @@ struct BitstreamBackend
}
}
break;
case id_USR_RSTN.index:
break;
default:
log_error("Unhandled cell %s of type %s\n", cell.second.get()->name.c_str(ctx),
cell.second->type.c_str(ctx));

View File

@ -162,3 +162,6 @@ X(CI_FILTER_CONST)
X(CP_FILTER_CONST)
X(PLL_CFG_A)
X(PLL_CFG_B)
X(CC_USR_RSTN)
X(USR_RSTN)

View File

@ -63,6 +63,8 @@ bool GateMateImpl::isBelLocationValid(BelId bel, bool explain_invalid) const
return false;
if (y < 2 || y > 127)
return false;
if (x == 1 && y == 66)
return false;
return true;
}
return true;
@ -177,6 +179,10 @@ void GateMateImpl::postRoute()
cell->params[id_INIT_L20] = Property(0b1010, 4);
cell->params[id_O1] = Property(0b11, 2);
cell->params[id_RAM_O1] = Property(1, 1);
} else if (IdString(extra_data.name) == id_RAM_I1) {
cell->params[id_RAM_I1] = Property(1, 1);
} else if (IdString(extra_data.name) == id_RAM_I2) {
cell->params[id_RAM_I2] = Property(1, 1);
} else {
log_error("Issue adding pass trough signal for %s.\n",IdString(extra_data.name).c_str(ctx));
}

View File

@ -114,6 +114,10 @@ def main():
pp.extra_data = PipExtraData(PIP_EXTRA_CPE,ch.strs.id("RAM_O2"))
pp = tt.create_pip("CPE.IN1", "CPE.RAM_O1")
pp.extra_data = PipExtraData(PIP_EXTRA_CPE,ch.strs.id("RAM_O1"))
pp = tt.create_pip("CPE.RAM_I1", "CPE.OUT1")
pp.extra_data = PipExtraData(PIP_EXTRA_CPE,ch.strs.id("RAM_I1"))
pp = tt.create_pip("CPE.RAM_I2", "CPE.OUT2")
pp.extra_data = PipExtraData(PIP_EXTRA_CPE,ch.strs.id("RAM_I2"))
for i in range(1,9):
tt.create_wire(f"CPE.V_IN{i}", "CPE_VIRTUAL_WIRE")
pp = tt.create_pip(f"CPE.V_IN{i}", f"CPE.IN{i}")

View File

@ -559,6 +559,17 @@ void GateMatePacker::pack_pll()
ci.type = id_PLL;
}
}
void GateMatePacker::pack_misc()
{
for (auto &cell : ctx->cells) {
CellInfo &ci = *cell.second;
if (!ci.type.in(id_CC_USR_RSTN))
continue;
ci.type = id_USR_RSTN;
}
}
void GateMatePacker::pack_constants()
{
log_info("Packing constants..\n");
@ -610,6 +621,7 @@ void GateMateImpl::pack()
packer.pack_io();
packer.pack_pll();
packer.pack_bufg();
packer.pack_misc();
packer.pack_cpe();
packer.remove_constants();
}

View File

@ -32,6 +32,7 @@ struct GateMatePacker
void pack_cpe();
void pack_bufg();
void pack_pll();
void pack_misc();
void pack_constants();
void disconnect_if_gnd(CellInfo *cell, IdString input);