From 1e314cc0ced067d72cea54c8225cf9d3ed0b6c14 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 13 Jun 2018 12:48:58 +0200 Subject: Update chip Graphics API Signed-off-by: Clifford Wolf --- dummy/chip.cc | 8 ++++---- dummy/chip.h | 8 +++++++- ice40/chip.cc | 34 +++++++++++++++++----------------- ice40/chip.h | 8 +++++++- 4 files changed, 35 insertions(+), 23 deletions(-) diff --git a/dummy/chip.cc b/dummy/chip.cc index bab65ae4..b8a23709 100644 --- a/dummy/chip.cc +++ b/dummy/chip.cc @@ -175,25 +175,25 @@ float Chip::estimateDelay(PosInfo src, PosInfo dst) const // --------------------------------------------------------------- -std::vector Chip::getBelGraphics(BelId bel) const +std::vector Chip::getFrameGraphics() const { static std::vector ret; return ret; } -std::vector Chip::getWireGraphics(WireId wire) const +std::vector Chip::getBelGraphics(BelId bel) const { static std::vector ret; return ret; } -std::vector Chip::getPipGraphics(PipId pip) const +std::vector Chip::getWireGraphics(WireId wire) const { static std::vector ret; return ret; } -std::vector Chip::getFrameGraphics() const +std::vector Chip::getPipGraphics(PipId pip) const { static std::vector ret; return ret; diff --git a/dummy/chip.h b/dummy/chip.h index bc70fa5d..197e84f1 100644 --- a/dummy/chip.h +++ b/dummy/chip.h @@ -118,10 +118,16 @@ struct Chip PosInfo getPipPosition(PipId pip) const; float estimateDelay(PosInfo src, PosInfo dst) const; + std::vector getFrameGraphics() const; std::vector getBelGraphics(BelId bel) const; std::vector getWireGraphics(WireId wire) const; std::vector getPipGraphics(PipId pip) const; - std::vector getFrameGraphics() const; + + bool allGraphicsReload = false; + bool frameGraphicsReload = false; + std::unordered_set belGraphicsReload; + std::unordered_set wireGraphicsReload; + std::unordered_set pipGraphicsReload; }; NEXTPNR_NAMESPACE_END diff --git a/ice40/chip.cc b/ice40/chip.cc index 441e65f2..a9626a2c 100644 --- a/ice40/chip.cc +++ b/ice40/chip.cc @@ -289,6 +289,23 @@ float Chip::estimateDelay(PosInfo src, PosInfo dst) const // ----------------------------------------------------------------------- +std::vector Chip::getFrameGraphics() const +{ + std::vector ret; + + for (int x = 0; x <= chip_info.width; x++) + for (int y = 0; y <= chip_info.height; y++) { + GraphicElement el; + el.type = GraphicElement::G_LINE; + el.x1 = x - 0.05, el.x2 = x + 0.05, el.y1 = y, el.y2 = y, el.z = 0; + ret.push_back(el); + el.x1 = x, el.x2 = x, el.y1 = y - 0.05, el.y2 = y + 0.05, el.z = 0; + ret.push_back(el); + } + + return ret; +} + std::vector Chip::getBelGraphics(BelId bel) const { std::vector ret; @@ -369,21 +386,4 @@ std::vector Chip::getPipGraphics(PipId pip) const return ret; } -std::vector Chip::getFrameGraphics() const -{ - std::vector ret; - - for (int x = 0; x <= chip_info.width; x++) - for (int y = 0; y <= chip_info.height; y++) { - GraphicElement el; - el.type = GraphicElement::G_LINE; - el.x1 = x - 0.05, el.x2 = x + 0.05, el.y1 = y, el.y2 = y, el.z = 0; - ret.push_back(el); - el.x1 = x, el.x2 = x, el.y1 = y - 0.05, el.y2 = y + 0.05, el.z = 0; - ret.push_back(el); - } - - return ret; -} - NEXTPNR_NAMESPACE_END diff --git a/ice40/chip.h b/ice40/chip.h index 5eea1b8e..ac077b73 100644 --- a/ice40/chip.h +++ b/ice40/chip.h @@ -709,10 +709,16 @@ struct Chip // ------------------------------------------------- + std::vector getFrameGraphics() const; std::vector getBelGraphics(BelId bel) const; std::vector getWireGraphics(WireId wire) const; std::vector getPipGraphics(PipId pip) const; - std::vector getFrameGraphics() const; + + bool allGraphicsReload = false; + bool frameGraphicsReload = false; + std::unordered_set belGraphicsReload; + std::unordered_set wireGraphicsReload; + std::unordered_set pipGraphicsReload; }; NEXTPNR_NAMESPACE_END -- cgit v1.2.3