mirror of
https://github.com/YosysHQ/nextpnr.git
synced 2026-08-22 06:07:27 +02:00
Add getGridDimX(), getGridDimY(), getTileDimZ() API
Signed-off-by: Clifford Wolf <[email protected]>
This commit is contained in:
@@ -78,7 +78,24 @@ void Arch::addBel(IdString name, IdString type, Loc loc, bool gb)
|
||||
bel_ids_by_type[type].push_back(name);
|
||||
|
||||
bel_by_loc[loc] = name;
|
||||
|
||||
if (bels_by_tile.size() <= loc.x)
|
||||
bels_by_tile.resize(loc.x + 1);
|
||||
|
||||
if (bels_by_tile[loc.x].size() <= loc.y)
|
||||
bels_by_tile[loc.x].resize(loc.y + 1);
|
||||
|
||||
bels_by_tile[loc.x][loc.y].push_back(name);
|
||||
|
||||
if (tileDimZ.size() <= loc.x)
|
||||
tileDimZ.resize(loc.x + 1);
|
||||
|
||||
if (tileDimZ[loc.x].size() <= loc.y)
|
||||
tileDimZ[loc.x].resize(loc.y + 1);
|
||||
|
||||
gridDimX = std::max(gridDimX, loc.x + 1);
|
||||
gridDimY = std::max(gridDimY, loc.x + 1);
|
||||
tileDimZ[loc.x][loc.y] = std::max(tileDimZ[loc.x][loc.y], loc.z + 1);
|
||||
}
|
||||
|
||||
void Arch::addBelInput(IdString bel, IdString name, IdString wire)
|
||||
|
||||
+8
-1
@@ -87,11 +87,14 @@ struct Arch : BaseCtx
|
||||
std::unordered_map<IdString, std::vector<IdString>> bel_ids_by_type;
|
||||
|
||||
std::unordered_map<Loc, BelId> bel_by_loc;
|
||||
std::unordered_map<int, std::unordered_map<int, std::vector<BelId>>> bels_by_tile;
|
||||
std::vector<std::vector<std::vector<BelId>>> bels_by_tile;
|
||||
|
||||
std::unordered_map<DecalId, std::vector<GraphicElement>> decal_graphics;
|
||||
DecalXY frame_decalxy;
|
||||
|
||||
int gridDimX, gridDimY;
|
||||
std::vector<std::vector<int>> tileDimZ;
|
||||
|
||||
float grid_distance_to_delay;
|
||||
|
||||
void addWire(IdString name, int x, int y);
|
||||
@@ -131,6 +134,10 @@ struct Arch : BaseCtx
|
||||
BelType belTypeFromId(IdString id) const { return id; }
|
||||
PortPin portPinFromId(IdString id) const { return id; }
|
||||
|
||||
int getGridDimX() const { return gridDimX; }
|
||||
int getGridDimY() const { return gridDimY; }
|
||||
int getTileDimZ(int x, int y) const { return tileDimZ[x][y]; }
|
||||
|
||||
BelId getBelByName(IdString name) const;
|
||||
IdString getBelName(BelId bel) const;
|
||||
Loc getBelLocation(BelId bel) const;
|
||||
|
||||
Reference in New Issue
Block a user