bind/unbind bel
This commit is contained in:
parent
189164e7c8
commit
fcdf1e0bfd
@ -90,6 +90,22 @@ IdString Arch::getBelName(BelId bel) const
|
||||
return id(bel_str);
|
||||
}
|
||||
|
||||
void Arch::bindBel(BelId bel, CellInfo *cell, PlaceStrength strength)
|
||||
{
|
||||
bels.at(bel).bound_cell = cell;
|
||||
cell->bel = bel;
|
||||
cell->belStrength = strength;
|
||||
refreshUiBel(bel);
|
||||
}
|
||||
|
||||
void Arch::unbindBel(BelId bel)
|
||||
{
|
||||
bels.at(bel).bound_cell->bel = BelId();
|
||||
bels.at(bel).bound_cell->belStrength = STRENGTH_NONE;
|
||||
bels.at(bel).bound_cell = nullptr;
|
||||
refreshUiBel(bel);
|
||||
}
|
||||
|
||||
bool Arch::checkBelAvail(BelId bel) const { return bels.at(bel).bound_cell == nullptr; }
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
@ -30,11 +30,31 @@ struct ArchArgs
|
||||
std::string device;
|
||||
};
|
||||
|
||||
struct BelInfo
|
||||
{
|
||||
IdString name, type;
|
||||
std::map<IdString, std::string> attrs;
|
||||
CellInfo *bound_cell;
|
||||
std::unordered_map<IdString, PinInfo> pins;
|
||||
DecalXY decalxy;
|
||||
int x, y, z;
|
||||
bool gb;
|
||||
};
|
||||
|
||||
struct PinInfo
|
||||
{
|
||||
IdString name;
|
||||
WireId wire;
|
||||
PortType type;
|
||||
};
|
||||
|
||||
struct Arch : BaseCtx
|
||||
{
|
||||
ArchArgs args;
|
||||
mistral::CycloneV* cyclonev;
|
||||
|
||||
std::unordered_map<IdString, BelInfo> bels;
|
||||
|
||||
Arch(ArchArgs args);
|
||||
|
||||
std::string getChipName() const { return std::string{"TODO: getChipName"}; }
|
||||
|
Loading…
Reference in New Issue
Block a user