diff options
author | Clifford Wolf <cliffordvienna@gmail.com> | 2018-07-11 12:04:53 +0000 |
---|---|---|
committer | Clifford Wolf <cliffordvienna@gmail.com> | 2018-07-11 12:04:53 +0000 |
commit | ce6afb5f7f7e2e26918c01d9b818bff9ceb93601 (patch) | |
tree | cb098c84c01655b15a02051d6fbbbdd368dba9ca /generic | |
parent | 0d71ed76cbc80d6ef317a3ae743dcb92baca45ed (diff) | |
parent | 7081cca01654030f9a3b731cebf36e68590e3ed1 (diff) | |
download | nextpnr-ce6afb5f7f7e2e26918c01d9b818bff9ceb93601.tar.gz nextpnr-ce6afb5f7f7e2e26918c01d9b818bff9ceb93601.tar.bz2 nextpnr-ce6afb5f7f7e2e26918c01d9b818bff9ceb93601.zip |
Merge branch 'ice40gfx' into 'master'
Ice40gfx
See merge request SymbioticEDA/nextpnr!7
Diffstat (limited to 'generic')
-rw-r--r-- | generic/arch.cc | 31 | ||||
-rw-r--r-- | generic/arch.h | 28 | ||||
-rw-r--r-- | generic/archdefs.h | 1 |
3 files changed, 36 insertions, 24 deletions
diff --git a/generic/arch.cc b/generic/arch.cc index 8f897604..b3854401 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -107,27 +107,32 @@ void Arch::addBelInout(IdString bel, IdString name, IdString wire) wires.at(wire).downhill_bel_pins.push_back(BelPin{bel, name}); } -void Arch::addFrameGraphic(const GraphicElement &graphic) +void Arch::addDecalGraphic(DecalId decal, const GraphicElement &graphic) { - frame_graphics.push_back(graphic); + decal_graphics[decal].push_back(graphic); +} + +void Arch::setFrameDecal(DecalXY decalxy) +{ + frame_decalxy = decalxy; frameGraphicsReload = true; } -void Arch::addWireGraphic(WireId wire, const GraphicElement &graphic) +void Arch::setWireDecal(WireId wire, DecalXY decalxy) { - wires.at(wire).graphics.push_back(graphic); + wires.at(wire).decalxy = decalxy; wireGraphicsReload.insert(wire); } -void Arch::addPipGraphic(PipId pip, const GraphicElement &graphic) +void Arch::setPipDecal(PipId pip, DecalXY decalxy) { - pips.at(pip).graphics.push_back(graphic); + pips.at(pip).decalxy = decalxy; pipGraphicsReload.insert(pip); } -void Arch::addBelGraphic(BelId bel, const GraphicElement &graphic) +void Arch::setBelDecal(BelId bel, DecalXY decalxy) { - bels.at(bel).graphics.push_back(graphic); + bels.at(bel).decalxy = decalxy; belGraphicsReload.insert(bel); } @@ -310,13 +315,15 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const // --------------------------------------------------------------- -const std::vector<GraphicElement> &Arch::getFrameGraphics() const { return frame_graphics; } +const std::vector<GraphicElement> &Arch::getDecalGraphics(DecalId decal) const { return decal_graphics.at(decal); } + +DecalXY Arch::getFrameDecal() const { return frame_decalxy; } -const std::vector<GraphicElement> &Arch::getBelGraphics(BelId bel) const { return bels.at(bel).graphics; } +DecalXY Arch::getBelDecal(BelId bel) const { return bels.at(bel).decalxy; } -const std::vector<GraphicElement> &Arch::getWireGraphics(WireId wire) const { return wires.at(wire).graphics; } +DecalXY Arch::getWireDecal(WireId wire) const { return wires.at(wire).decalxy; } -const std::vector<GraphicElement> &Arch::getPipGraphics(PipId pip) const { return pips.at(pip).graphics; } +DecalXY Arch::getPipDecal(PipId pip) const { return pips.at(pip).decalxy; } // --------------------------------------------------------------- diff --git a/generic/arch.h b/generic/arch.h index e739cfab..dafbfec3 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -34,16 +34,16 @@ struct PipInfo IdString name, bound_net; WireId srcWire, dstWire; DelayInfo delay; - std::vector<GraphicElement> graphics; + DecalXY decalxy; }; struct WireInfo { IdString name, bound_net; - std::vector<GraphicElement> graphics; std::vector<PipId> downhill, uphill, aliases; BelPin uphill_bel_pin; std::vector<BelPin> downhill_bel_pins; + DecalXY decalxy; int grid_x, grid_y; }; @@ -58,7 +58,7 @@ struct BelInfo { IdString name, type, bound_cell; std::unordered_map<IdString, PinInfo> pins; - std::vector<GraphicElement> graphics; + DecalXY decalxy; int grid_x, grid_y; bool gb; }; @@ -74,7 +74,9 @@ struct Arch : BaseCtx std::vector<IdString> bel_ids, wire_ids, pip_ids; std::unordered_map<IdString, std::vector<IdString>> bel_ids_by_type; - std::vector<GraphicElement> frame_graphics; + std::unordered_map<DecalId, std::vector<GraphicElement>> decal_graphics; + DecalXY frame_decalxy; + float grid_distance_to_delay; void addWire(IdString name, int x, int y); @@ -86,10 +88,11 @@ struct Arch : BaseCtx void addBelOutput(IdString bel, IdString name, IdString wire); void addBelInout(IdString bel, IdString name, IdString wire); - void addFrameGraphic(const GraphicElement &graphic); - void addWireGraphic(WireId wire, const GraphicElement &graphic); - void addPipGraphic(PipId pip, const GraphicElement &graphic); - void addBelGraphic(BelId bel, const GraphicElement &graphic); + void addDecalGraphic(DecalId decal, const GraphicElement &graphic); + void setFrameDecal(DecalXY decalxy); + void setWireDecal(WireId wire, DecalXY decalxy); + void setPipDecal(PipId pip, DecalXY decalxy); + void setBelDecal(BelId bel, DecalXY decalxy); // --------------------------------------------------------------- // Common Arch API. Every arch must provide the following methods. @@ -155,10 +158,11 @@ struct Arch : BaseCtx float getDelayNS(delay_t v) const { return v; } uint32_t getDelayChecksum(delay_t v) const { return 0; } - const std::vector<GraphicElement> &getFrameGraphics() const; - const std::vector<GraphicElement> &getBelGraphics(BelId bel) const; - const std::vector<GraphicElement> &getWireGraphics(WireId wire) const; - const std::vector<GraphicElement> &getPipGraphics(PipId pip) const; + const std::vector<GraphicElement> &getDecalGraphics(DecalId decal) const; + DecalXY getFrameDecal() const; + DecalXY getBelDecal(BelId bel) const; + DecalXY getWireDecal(WireId wire) const; + DecalXY getPipDecal(PipId pip) const; bool allGraphicsReload = false; bool frameGraphicsReload = false; diff --git a/generic/archdefs.h b/generic/archdefs.h index 9e8462e0..8e6dcb2f 100644 --- a/generic/archdefs.h +++ b/generic/archdefs.h @@ -49,5 +49,6 @@ typedef IdString PortPin; typedef IdString BelId; typedef IdString WireId; typedef IdString PipId; +typedef IdString DecalId; NEXTPNR_NAMESPACE_END |