Make boundbox fit NG-Ultra internal design
This commit is contained in:
parent
7a7aabb4b4
commit
15b917b349
@ -8,7 +8,7 @@ NEXTPNR_NAMESPACE_BEGIN
|
|||||||
NPNR_PACKED_STRUCT(struct NGUltraTileInstExtraDataPOD {
|
NPNR_PACKED_STRUCT(struct NGUltraTileInstExtraDataPOD {
|
||||||
int32_t name;
|
int32_t name;
|
||||||
uint8_t lobe;
|
uint8_t lobe;
|
||||||
uint8_t dummy1;
|
uint8_t tile_type;
|
||||||
uint16_t dummy2;
|
uint16_t dummy2;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -223,6 +223,15 @@ enum BelExtra
|
|||||||
BEL_EXTRA_FE_SCC = 2,
|
BEL_EXTRA_FE_SCC = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum TileTypeExtra
|
||||||
|
{
|
||||||
|
TILE_EXTRA_FABRIC = 0,
|
||||||
|
TILE_EXTRA_TUBE = 1,
|
||||||
|
TILE_EXTRA_SOC = 2,
|
||||||
|
TILE_EXTRA_RING = 3,
|
||||||
|
TILE_EXTRA_FENCE = 4
|
||||||
|
};
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -14,13 +14,14 @@ from himbaechel_dbgen.chip import *
|
|||||||
class TileExtraData(BBAStruct):
|
class TileExtraData(BBAStruct):
|
||||||
name: IdString
|
name: IdString
|
||||||
lobe: int = 0
|
lobe: int = 0
|
||||||
|
tile_type: int = 0
|
||||||
|
|
||||||
def serialise_lists(self, context: str, bba: BBAWriter):
|
def serialise_lists(self, context: str, bba: BBAWriter):
|
||||||
pass
|
pass
|
||||||
def serialise(self, context: str, bba: BBAWriter):
|
def serialise(self, context: str, bba: BBAWriter):
|
||||||
bba.u32(self.name.index)
|
bba.u32(self.name.index)
|
||||||
bba.u8(self.lobe)
|
bba.u8(self.lobe)
|
||||||
bba.u8(0) # dummy
|
bba.u8(self.tile_type)
|
||||||
bba.u16(0) # dummy
|
bba.u16(0) # dummy
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@ -80,6 +81,12 @@ PIP_EXTRA_VIRTUAL = 6
|
|||||||
BEL_EXTRA_FE_CSC = 1
|
BEL_EXTRA_FE_CSC = 1
|
||||||
BEL_EXTRA_FE_SCC = 2
|
BEL_EXTRA_FE_SCC = 2
|
||||||
|
|
||||||
|
TILE_EXTRA_FABRIC = 0
|
||||||
|
TILE_EXTRA_TUBE = 1
|
||||||
|
TILE_EXTRA_SOC = 2
|
||||||
|
TILE_EXTRA_RING = 3
|
||||||
|
TILE_EXTRA_FENCE = 4
|
||||||
|
|
||||||
def bel_z(tile_type, bel_name, bel_type):
|
def bel_z(tile_type, bel_name, bel_type):
|
||||||
if tile_type.startswith("CKG"):
|
if tile_type.startswith("CKG"):
|
||||||
if (bel_type=="PLL"):
|
if (bel_type=="PLL"):
|
||||||
@ -674,7 +681,19 @@ def main():
|
|||||||
lobe = 7
|
lobe = 7
|
||||||
case "IOB4" | "IOB5" | "HSSL4" | "HSSL5" | "HSSL6" | "HSSL7":
|
case "IOB4" | "IOB5" | "HSSL4" | "HSSL5" | "HSSL6" | "HSSL7":
|
||||||
lobe = 8
|
lobe = 8
|
||||||
ti.extra_data = TileExtraData(ch.strs.id(name),lobe)
|
tile_type = 0
|
||||||
|
if item["orig"] in ["TILE","CGB","MESH"]:
|
||||||
|
tile_type = TILE_EXTRA_FABRIC
|
||||||
|
elif item["orig"] in ["TUBE"]:
|
||||||
|
tile_type = TILE_EXTRA_TUBE
|
||||||
|
elif item["orig"] in ["SOCBank"]:
|
||||||
|
tile_type = TILE_EXTRA_SOC
|
||||||
|
elif item["orig"].startswith("IOB") or item["orig"].startswith("HSSL") or item["orig"].startswith("CKG"):
|
||||||
|
tile_type = TILE_EXTRA_RING
|
||||||
|
elif item["orig"].startswith("FENCE"):
|
||||||
|
tile_type = TILE_EXTRA_FENCE
|
||||||
|
|
||||||
|
ti.extra_data = TileExtraData(ch.strs.id(name),lobe, tile_type)
|
||||||
|
|
||||||
for name, data in tilegrid.items():
|
for name, data in tilegrid.items():
|
||||||
print(f"Generate nodes for {name}...")
|
print(f"Generate nodes for {name}...")
|
||||||
|
@ -234,6 +234,12 @@ int NgUltraImpl::tile_lobe(int tile) const
|
|||||||
return data.lobe;
|
return data.lobe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TileTypeExtra NgUltraImpl::tile_type(int tile) const
|
||||||
|
{
|
||||||
|
const auto &data = *tile_extra_data(tile);
|
||||||
|
return (TileTypeExtra)data.tile_type;
|
||||||
|
}
|
||||||
|
|
||||||
void NgUltraImpl::preRoute()
|
void NgUltraImpl::preRoute()
|
||||||
{
|
{
|
||||||
log_break();
|
log_break();
|
||||||
@ -686,6 +692,9 @@ bool NgUltraImpl::getClusterPlacement(ClusterId cluster, BelId root_bel,
|
|||||||
|
|
||||||
BoundingBox NgUltraImpl::getRouteBoundingBox(WireId src, WireId dst) const
|
BoundingBox NgUltraImpl::getRouteBoundingBox(WireId src, WireId dst) const
|
||||||
{
|
{
|
||||||
|
if ((tile_type(src.tile)!=TILE_EXTRA_FABRIC || tile_type(dst.tile)!=TILE_EXTRA_FABRIC)) {
|
||||||
|
return { 0, 0, ctx->getGridDimX(), ctx->getGridDimY() };
|
||||||
|
}
|
||||||
int x0, y0, x1, y1;
|
int x0, y0, x1, y1;
|
||||||
auto expand = [&](int x, int y) {
|
auto expand = [&](int x, int y) {
|
||||||
x0 = std::min(x0, x);
|
x0 = std::min(x0, x);
|
||||||
@ -699,14 +708,11 @@ BoundingBox NgUltraImpl::getRouteBoundingBox(WireId src, WireId dst) const
|
|||||||
int dx, dy;
|
int dx, dy;
|
||||||
tile_xy(ctx->chip_info, dst.tile, dx, dy);
|
tile_xy(ctx->chip_info, dst.tile, dx, dy);
|
||||||
expand(dx, dy);
|
expand(dx, dy);
|
||||||
// Two TILEs left and up, and one tile right and down
|
// Reach 7 MESH above and below (3 left and 3 right of TILE/CGB)
|
||||||
int exp = 8;
|
return {(x0 & 0xfffc) - 3*4, // 3 MESH on left
|
||||||
if (x0 == 0 || y0==0 || y1==52*4 || x1==96*4)
|
(y0 & 0xfffc) - 4, // row above
|
||||||
exp = 24; // more expansion around IO
|
(x1 & 0xfffc) + 4*4, // MESH bellow and 3 right
|
||||||
return {(x0 & 0xfffc) - exp,
|
(y1 & 0xfffc) + 8}; // current and row bellow
|
||||||
(y0 & 0xfffc) - exp,
|
|
||||||
(x1 & 0xfffc) + exp,
|
|
||||||
(y1 & 0xfffc) + exp};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delay_t NgUltraImpl::estimateDelay(WireId src, WireId dst) const
|
delay_t NgUltraImpl::estimateDelay(WireId src, WireId dst) const
|
||||||
|
@ -71,6 +71,7 @@ struct NgUltraImpl : HimbaechelAPI
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
int tile_lobe(int tile) const;
|
int tile_lobe(int tile) const;
|
||||||
|
TileTypeExtra tile_type(int tile) const;
|
||||||
IdString tile_name_id(int tile) const;
|
IdString tile_name_id(int tile) const;
|
||||||
std::string tile_name(int tile) const;
|
std::string tile_name(int tile) const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user