API change: Use CellInfo* and NetInfo* as cell/net handles (generic)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
5e53075990
commit
c3c9dab9f7
@ -214,27 +214,27 @@ uint32_t Arch::getBelChecksum(BelId bel) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Arch::bindBel(BelId bel, IdString cell, PlaceStrength strength)
|
void Arch::bindBel(BelId bel, CellInfo *cell, PlaceStrength strength)
|
||||||
{
|
{
|
||||||
bels.at(bel).bound_cell = cell;
|
bels.at(bel).bound_cell = cell;
|
||||||
cells.at(cell)->bel = bel;
|
cell->bel = bel;
|
||||||
cells.at(cell)->belStrength = strength;
|
cell->belStrength = strength;
|
||||||
refreshUiBel(bel);
|
refreshUiBel(bel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Arch::unbindBel(BelId bel)
|
void Arch::unbindBel(BelId bel)
|
||||||
{
|
{
|
||||||
cells.at(bels.at(bel).bound_cell)->bel = BelId();
|
bels.at(bel).bound_cell->bel = BelId();
|
||||||
cells.at(bels.at(bel).bound_cell)->belStrength = STRENGTH_NONE;
|
bels.at(bel).bound_cell->belStrength = STRENGTH_NONE;
|
||||||
bels.at(bel).bound_cell = IdString();
|
bels.at(bel).bound_cell = nullptr;
|
||||||
refreshUiBel(bel);
|
refreshUiBel(bel);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Arch::checkBelAvail(BelId bel) const { return bels.at(bel).bound_cell == IdString(); }
|
bool Arch::checkBelAvail(BelId bel) const { return bels.at(bel).bound_cell == nullptr; }
|
||||||
|
|
||||||
IdString Arch::getBoundBelCell(BelId bel) const { return bels.at(bel).bound_cell; }
|
CellInfo *Arch::getBoundBelCell(BelId bel) const { return bels.at(bel).bound_cell; }
|
||||||
|
|
||||||
IdString Arch::getConflictingBelCell(BelId bel) const { return bels.at(bel).bound_cell; }
|
CellInfo *Arch::getConflictingBelCell(BelId bel) const { return bels.at(bel).bound_cell; }
|
||||||
|
|
||||||
const std::vector<BelId> &Arch::getBels() const { return bel_ids; }
|
const std::vector<BelId> &Arch::getBels() const { return bel_ids; }
|
||||||
|
|
||||||
@ -271,34 +271,34 @@ uint32_t Arch::getWireChecksum(WireId wire) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Arch::bindWire(WireId wire, IdString net, PlaceStrength strength)
|
void Arch::bindWire(WireId wire, NetInfo *net, PlaceStrength strength)
|
||||||
{
|
{
|
||||||
wires.at(wire).bound_net = net;
|
wires.at(wire).bound_net = net;
|
||||||
nets.at(net)->wires[wire].pip = PipId();
|
net->wires[wire].pip = PipId();
|
||||||
nets.at(net)->wires[wire].strength = strength;
|
net->wires[wire].strength = strength;
|
||||||
refreshUiWire(wire);
|
refreshUiWire(wire);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Arch::unbindWire(WireId wire)
|
void Arch::unbindWire(WireId wire)
|
||||||
{
|
{
|
||||||
auto &net_wires = nets[wires.at(wire).bound_net]->wires;
|
auto &net_wires = wires.at(wire).bound_net->wires;
|
||||||
|
|
||||||
auto pip = net_wires.at(wire).pip;
|
auto pip = net_wires.at(wire).pip;
|
||||||
if (pip != PipId()) {
|
if (pip != PipId()) {
|
||||||
pips.at(pip).bound_net = IdString();
|
pips.at(pip).bound_net = nullptr;
|
||||||
refreshUiPip(pip);
|
refreshUiPip(pip);
|
||||||
}
|
}
|
||||||
|
|
||||||
net_wires.erase(wire);
|
net_wires.erase(wire);
|
||||||
wires.at(wire).bound_net = IdString();
|
wires.at(wire).bound_net = nullptr;
|
||||||
refreshUiWire(wire);
|
refreshUiWire(wire);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Arch::checkWireAvail(WireId wire) const { return wires.at(wire).bound_net == IdString(); }
|
bool Arch::checkWireAvail(WireId wire) const { return wires.at(wire).bound_net == nullptr; }
|
||||||
|
|
||||||
IdString Arch::getBoundWireNet(WireId wire) const { return wires.at(wire).bound_net; }
|
NetInfo *Arch::getBoundWireNet(WireId wire) const { return wires.at(wire).bound_net; }
|
||||||
|
|
||||||
IdString Arch::getConflictingWireNet(WireId wire) const { return wires.at(wire).bound_net; }
|
NetInfo *Arch::getConflictingWireNet(WireId wire) const { return wires.at(wire).bound_net; }
|
||||||
|
|
||||||
const std::vector<BelPin> &Arch::getWireBelPins(WireId wire) const { return wires.at(wire).bel_pins; }
|
const std::vector<BelPin> &Arch::getWireBelPins(WireId wire) const { return wires.at(wire).bel_pins; }
|
||||||
|
|
||||||
@ -323,13 +323,13 @@ uint32_t Arch::getPipChecksum(PipId wire) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Arch::bindPip(PipId pip, IdString net, PlaceStrength strength)
|
void Arch::bindPip(PipId pip, NetInfo *net, PlaceStrength strength)
|
||||||
{
|
{
|
||||||
WireId wire = pips.at(pip).dstWire;
|
WireId wire = pips.at(pip).dstWire;
|
||||||
pips.at(pip).bound_net = net;
|
pips.at(pip).bound_net = net;
|
||||||
wires.at(wire).bound_net = net;
|
wires.at(wire).bound_net = net;
|
||||||
nets.at(net)->wires[wire].pip = pip;
|
net->wires[wire].pip = pip;
|
||||||
nets.at(net)->wires[wire].strength = strength;
|
net->wires[wire].strength = strength;
|
||||||
refreshUiPip(pip);
|
refreshUiPip(pip);
|
||||||
refreshUiWire(wire);
|
refreshUiWire(wire);
|
||||||
}
|
}
|
||||||
@ -337,18 +337,18 @@ void Arch::bindPip(PipId pip, IdString net, PlaceStrength strength)
|
|||||||
void Arch::unbindPip(PipId pip)
|
void Arch::unbindPip(PipId pip)
|
||||||
{
|
{
|
||||||
WireId wire = pips.at(pip).dstWire;
|
WireId wire = pips.at(pip).dstWire;
|
||||||
nets.at(wires.at(wire).bound_net)->wires.erase(wire);
|
wires.at(wire).bound_net->wires.erase(wire);
|
||||||
pips.at(pip).bound_net = IdString();
|
pips.at(pip).bound_net = nullptr;
|
||||||
wires.at(wire).bound_net = IdString();
|
wires.at(wire).bound_net = nullptr;
|
||||||
refreshUiPip(pip);
|
refreshUiPip(pip);
|
||||||
refreshUiWire(wire);
|
refreshUiWire(wire);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Arch::checkPipAvail(PipId pip) const { return pips.at(pip).bound_net == IdString(); }
|
bool Arch::checkPipAvail(PipId pip) const { return pips.at(pip).bound_net == nullptr; }
|
||||||
|
|
||||||
IdString Arch::getBoundPipNet(PipId pip) const { return pips.at(pip).bound_net; }
|
NetInfo *Arch::getBoundPipNet(PipId pip) const { return pips.at(pip).bound_net; }
|
||||||
|
|
||||||
IdString Arch::getConflictingPipNet(PipId pip) const { return pips.at(pip).bound_net; }
|
NetInfo *Arch::getConflictingPipNet(PipId pip) const { return pips.at(pip).bound_net; }
|
||||||
|
|
||||||
const std::vector<PipId> &Arch::getPips() const { return pip_ids; }
|
const std::vector<PipId> &Arch::getPips() const { return pip_ids; }
|
||||||
|
|
||||||
|
@ -31,7 +31,8 @@ struct WireInfo;
|
|||||||
|
|
||||||
struct PipInfo
|
struct PipInfo
|
||||||
{
|
{
|
||||||
IdString name, type, bound_net;
|
IdString name, type;
|
||||||
|
NetInfo *bound_net;
|
||||||
WireId srcWire, dstWire;
|
WireId srcWire, dstWire;
|
||||||
DelayInfo delay;
|
DelayInfo delay;
|
||||||
DecalXY decalxy;
|
DecalXY decalxy;
|
||||||
@ -39,7 +40,8 @@ struct PipInfo
|
|||||||
|
|
||||||
struct WireInfo
|
struct WireInfo
|
||||||
{
|
{
|
||||||
IdString name, type, bound_net;
|
IdString name, type;
|
||||||
|
NetInfo *bound_net;
|
||||||
std::vector<PipId> downhill, uphill, aliases;
|
std::vector<PipId> downhill, uphill, aliases;
|
||||||
BelPin uphill_bel_pin;
|
BelPin uphill_bel_pin;
|
||||||
std::vector<BelPin> downhill_bel_pins;
|
std::vector<BelPin> downhill_bel_pins;
|
||||||
@ -57,7 +59,8 @@ struct PinInfo
|
|||||||
|
|
||||||
struct BelInfo
|
struct BelInfo
|
||||||
{
|
{
|
||||||
IdString name, type, bound_cell;
|
IdString name, type;
|
||||||
|
CellInfo *bound_cell;
|
||||||
std::unordered_map<IdString, PinInfo> pins;
|
std::unordered_map<IdString, PinInfo> pins;
|
||||||
DecalXY decalxy;
|
DecalXY decalxy;
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
@ -142,11 +145,11 @@ struct Arch : BaseCtx
|
|||||||
const std::vector<BelId> &getBelsByTile(int x, int y) const;
|
const std::vector<BelId> &getBelsByTile(int x, int y) const;
|
||||||
bool getBelGlobalBuf(BelId bel) const;
|
bool getBelGlobalBuf(BelId bel) const;
|
||||||
uint32_t getBelChecksum(BelId bel) const;
|
uint32_t getBelChecksum(BelId bel) const;
|
||||||
void bindBel(BelId bel, IdString cell, PlaceStrength strength);
|
void bindBel(BelId bel, CellInfo *cell, PlaceStrength strength);
|
||||||
void unbindBel(BelId bel);
|
void unbindBel(BelId bel);
|
||||||
bool checkBelAvail(BelId bel) const;
|
bool checkBelAvail(BelId bel) const;
|
||||||
IdString getBoundBelCell(BelId bel) const;
|
CellInfo *getBoundBelCell(BelId bel) const;
|
||||||
IdString getConflictingBelCell(BelId bel) const;
|
CellInfo *getConflictingBelCell(BelId bel) const;
|
||||||
const std::vector<BelId> &getBels() const;
|
const std::vector<BelId> &getBels() const;
|
||||||
BelType getBelType(BelId bel) const;
|
BelType getBelType(BelId bel) const;
|
||||||
WireId getBelPinWire(BelId bel, PortPin pin) const;
|
WireId getBelPinWire(BelId bel, PortPin pin) const;
|
||||||
@ -157,11 +160,11 @@ struct Arch : BaseCtx
|
|||||||
IdString getWireName(WireId wire) const;
|
IdString getWireName(WireId wire) const;
|
||||||
IdString getWireType(WireId wire) const;
|
IdString getWireType(WireId wire) const;
|
||||||
uint32_t getWireChecksum(WireId wire) const;
|
uint32_t getWireChecksum(WireId wire) const;
|
||||||
void bindWire(WireId wire, IdString net, PlaceStrength strength);
|
void bindWire(WireId wire, NetInfo *net, PlaceStrength strength);
|
||||||
void unbindWire(WireId wire);
|
void unbindWire(WireId wire);
|
||||||
bool checkWireAvail(WireId wire) const;
|
bool checkWireAvail(WireId wire) const;
|
||||||
IdString getBoundWireNet(WireId wire) const;
|
NetInfo *getBoundWireNet(WireId wire) const;
|
||||||
IdString getConflictingWireNet(WireId wire) const;
|
NetInfo *getConflictingWireNet(WireId wire) const;
|
||||||
DelayInfo getWireDelay(WireId wire) const { return DelayInfo(); }
|
DelayInfo getWireDelay(WireId wire) const { return DelayInfo(); }
|
||||||
const std::vector<WireId> &getWires() const;
|
const std::vector<WireId> &getWires() const;
|
||||||
const std::vector<BelPin> &getWireBelPins(WireId wire) const;
|
const std::vector<BelPin> &getWireBelPins(WireId wire) const;
|
||||||
@ -170,11 +173,11 @@ struct Arch : BaseCtx
|
|||||||
IdString getPipName(PipId pip) const;
|
IdString getPipName(PipId pip) const;
|
||||||
IdString getPipType(PipId pip) const;
|
IdString getPipType(PipId pip) const;
|
||||||
uint32_t getPipChecksum(PipId pip) const;
|
uint32_t getPipChecksum(PipId pip) const;
|
||||||
void bindPip(PipId pip, IdString net, PlaceStrength strength);
|
void bindPip(PipId pip, NetInfo *net, PlaceStrength strength);
|
||||||
void unbindPip(PipId pip);
|
void unbindPip(PipId pip);
|
||||||
bool checkPipAvail(PipId pip) const;
|
bool checkPipAvail(PipId pip) const;
|
||||||
IdString getBoundPipNet(PipId pip) const;
|
NetInfo *getBoundPipNet(PipId pip) const;
|
||||||
IdString getConflictingPipNet(PipId pip) const;
|
NetInfo *getConflictingPipNet(PipId pip) const;
|
||||||
const std::vector<PipId> &getPips() const;
|
const std::vector<PipId> &getPips() const;
|
||||||
WireId getPipSrcWire(PipId pip) const;
|
WireId getPipSrcWire(PipId pip) const;
|
||||||
WireId getPipDstWire(PipId pip) const;
|
WireId getPipDstWire(PipId pip) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user