From e6dc9ce77df54b3a4e8d8353c7f28eeabfdcd8da Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 30 Jun 2018 17:13:22 +0200 Subject: Add implementations for generic arch db API Signed-off-by: Clifford Wolf --- generic/arch.h | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'generic/arch.h') diff --git a/generic/arch.h b/generic/arch.h index 4280951c..9c2bee2e 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -32,7 +32,7 @@ struct WireInfo; struct PipInfo { IdString name, bound_net; - WireInfo *srcWire, *dstWire; + WireId srcWire, dstWire; DelayInfo delay; std::vector graphics; }; @@ -41,13 +41,16 @@ struct WireInfo { IdString name, bound_net; std::vector graphics; - std::vector downhill, uphill, aliases; + std::vector downhill, uphill, aliases; + BelPin uphill_bel_pin; + std::vector downhill_bel_pins; + int grid_x, grid_y; }; struct PinInfo { IdString name; - WireInfo *wire; + WireId wire; PortType type; }; @@ -56,6 +59,8 @@ struct BelInfo IdString name, type, bound_cell; std::unordered_map pins; std::vector graphics; + int grid_x, grid_y; + bool gb; }; struct Arch : BaseCtx @@ -69,14 +74,22 @@ struct Arch : BaseCtx std::vector bel_ids, wire_ids, pip_ids; std::unordered_map> bel_ids_by_type; - void addWire(IdString name); + std::vector frame_graphics; + float grid_distance_to_delay; + + void addWire(IdString name, int x, int y); void addPip(IdString name, IdString srcWire, IdString dstWire, DelayInfo delay); - void addAias(IdString name, IdString srcWire, IdString dstWire, DelayInfo delay); + void addAlias(IdString name, IdString srcWire, IdString dstWire, DelayInfo delay); + + void addBel(IdString name, IdString type, int x, int y, bool gb); + void addBelInput(IdString bel, IdString name, IdString wire); + void addBelOutput(IdString bel, IdString name, IdString wire); + void addBelInout(IdString bel, IdString name, IdString wire); - void addBel(IdString name, IdString type); - void addBelInput(IdString cell, IdString name, IdString wire); - void addBwlOutput(IdString cell, IdString name, IdString wire); - void addBelInout(IdString cell, 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); // --------------------------------------------------------------- @@ -141,10 +154,10 @@ struct Arch : BaseCtx float getDelayNS(delay_t v) const { return v; } uint32_t getDelayChecksum(delay_t v) const { return 0; } - std::vector getFrameGraphics() const; - std::vector getBelGraphics(BelId bel) const; - std::vector getWireGraphics(WireId wire) const; - std::vector getPipGraphics(PipId pip) const; + const std::vector &getFrameGraphics() const; + const std::vector &getBelGraphics(BelId bel) const; + const std::vector &getWireGraphics(WireId wire) const; + const std::vector &getPipGraphics(PipId pip) const; bool allGraphicsReload = false; bool frameGraphicsReload = false; -- cgit v1.2.3