diff options
Diffstat (limited to 'cyclonev')
-rw-r--r-- | cyclonev/arch.cc | 16 | ||||
-rw-r--r-- | cyclonev/arch.h | 20 |
2 files changed, 36 insertions, 0 deletions
diff --git a/cyclonev/arch.cc b/cyclonev/arch.cc index f5dd35eb..ac19b7d2 100644 --- a/cyclonev/arch.cc +++ b/cyclonev/arch.cc @@ -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
\ No newline at end of file diff --git a/cyclonev/arch.h b/cyclonev/arch.h index cdf41f39..cd5905cd 100644 --- a/cyclonev/arch.h +++ b/cyclonev/arch.h @@ -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"}; } |