mirror of
https://github.com/YosysHQ/nextpnr.git
synced 2026-05-04 07:08:26 +00:00
committed by
David Shah
parent
a9b6543361
commit
5ddde5c49f
@@ -36,7 +36,7 @@ void Arch::addWire(IdString name, IdString type, int x, int y)
|
||||
wire_ids.push_back(name);
|
||||
}
|
||||
|
||||
void Arch::addPip(IdString name, IdString type, IdString srcWire, IdString dstWire, DelayInfo delay)
|
||||
void Arch::addPip(IdString name, IdString type, IdString srcWire, IdString dstWire, DelayInfo delay, Loc loc)
|
||||
{
|
||||
NPNR_ASSERT(pips.count(name) == 0);
|
||||
PipInfo &pi = pips[name];
|
||||
@@ -45,10 +45,21 @@ void Arch::addPip(IdString name, IdString type, IdString srcWire, IdString dstWi
|
||||
pi.srcWire = srcWire;
|
||||
pi.dstWire = dstWire;
|
||||
pi.delay = delay;
|
||||
pi.loc = loc;
|
||||
|
||||
wires.at(srcWire).downhill.push_back(name);
|
||||
wires.at(dstWire).uphill.push_back(name);
|
||||
pip_ids.push_back(name);
|
||||
|
||||
if (int(tilePipDimZ.size()) <= loc.x)
|
||||
tilePipDimZ.resize(loc.x + 1);
|
||||
|
||||
if (int(tilePipDimZ[loc.x].size()) <= loc.y)
|
||||
tilePipDimZ[loc.x].resize(loc.y + 1);
|
||||
|
||||
gridDimX = std::max(gridDimX, loc.x + 1);
|
||||
gridDimY = std::max(gridDimY, loc.x + 1);
|
||||
tilePipDimZ[loc.x][loc.y] = std::max(tilePipDimZ[loc.x][loc.y], loc.z + 1);
|
||||
}
|
||||
|
||||
void Arch::addAlias(IdString name, IdString type, IdString srcWire, IdString dstWire, DelayInfo delay)
|
||||
@@ -88,15 +99,15 @@ void Arch::addBel(IdString name, IdString type, Loc loc, bool gb)
|
||||
|
||||
bels_by_tile[loc.x][loc.y].push_back(name);
|
||||
|
||||
if (int(tileDimZ.size()) <= loc.x)
|
||||
tileDimZ.resize(loc.x + 1);
|
||||
if (int(tileBelDimZ.size()) <= loc.x)
|
||||
tileBelDimZ.resize(loc.x + 1);
|
||||
|
||||
if (int(tileDimZ[loc.x].size()) <= loc.y)
|
||||
tileDimZ[loc.x].resize(loc.y + 1);
|
||||
if (int(tileBelDimZ[loc.x].size()) <= loc.y)
|
||||
tileBelDimZ[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);
|
||||
tileBelDimZ[loc.x][loc.y] = std::max(tileBelDimZ[loc.x][loc.y], loc.z + 1);
|
||||
}
|
||||
|
||||
void Arch::addBelInput(IdString bel, IdString name, IdString wire)
|
||||
@@ -352,6 +363,8 @@ NetInfo *Arch::getConflictingPipNet(PipId pip) const { return pips.at(pip).bound
|
||||
|
||||
const std::vector<PipId> &Arch::getPips() const { return pip_ids; }
|
||||
|
||||
Loc Arch::getPipLocation(PipId pip) const { return pips.at(pip).loc; }
|
||||
|
||||
WireId Arch::getPipSrcWire(PipId pip) const { return pips.at(pip).srcWire; }
|
||||
|
||||
WireId Arch::getPipDstWire(PipId pip) const { return pips.at(pip).dstWire; }
|
||||
|
||||
@@ -36,6 +36,7 @@ struct PipInfo
|
||||
WireId srcWire, dstWire;
|
||||
DelayInfo delay;
|
||||
DecalXY decalxy;
|
||||
Loc loc;
|
||||
};
|
||||
|
||||
struct WireInfo
|
||||
@@ -94,12 +95,13 @@ struct Arch : BaseCtx
|
||||
std::unordered_map<DecalId, std::vector<GraphicElement>> decal_graphics;
|
||||
|
||||
int gridDimX, gridDimY;
|
||||
std::vector<std::vector<int>> tileDimZ;
|
||||
std::vector<std::vector<int>> tileBelDimZ;
|
||||
std::vector<std::vector<int>> tilePipDimZ;
|
||||
|
||||
float grid_distance_to_delay;
|
||||
|
||||
void addWire(IdString name, IdString type, int x, int y);
|
||||
void addPip(IdString name, IdString type, IdString srcWire, IdString dstWire, DelayInfo delay);
|
||||
void addPip(IdString name, IdString type, IdString srcWire, IdString dstWire, DelayInfo delay, Loc loc);
|
||||
void addAlias(IdString name, IdString type, IdString srcWire, IdString dstWire, DelayInfo delay);
|
||||
|
||||
void addBel(IdString name, IdString type, Loc loc, bool gb);
|
||||
@@ -132,7 +134,8 @@ struct Arch : BaseCtx
|
||||
|
||||
int getGridDimX() const { return gridDimX; }
|
||||
int getGridDimY() const { return gridDimY; }
|
||||
int getTileDimZ(int x, int y) const { return tileDimZ[x][y]; }
|
||||
int getTileBelDimZ(int x, int y) const { return tileBelDimZ[x][y]; }
|
||||
int getTilePipDimZ(int x, int y) const { return tilePipDimZ[x][y]; }
|
||||
|
||||
BelId getBelByName(IdString name) const;
|
||||
IdString getBelName(BelId bel) const;
|
||||
@@ -175,6 +178,7 @@ struct Arch : BaseCtx
|
||||
NetInfo *getBoundPipNet(PipId pip) const;
|
||||
NetInfo *getConflictingPipNet(PipId pip) const;
|
||||
const std::vector<PipId> &getPips() const;
|
||||
Loc getPipLocation(PipId pip) const;
|
||||
WireId getPipSrcWire(PipId pip) const;
|
||||
WireId getPipDstWire(PipId pip) const;
|
||||
DelayInfo getPipDelay(PipId pip) const;
|
||||
|
||||
Reference in New Issue
Block a user