aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-06-13 12:48:58 +0200
committerClifford Wolf <clifford@clifford.at>2018-06-13 12:48:58 +0200
commit1e314cc0ced067d72cea54c8225cf9d3ed0b6c14 (patch)
treec173f3746dfb352f95e504cbf335e9372e40f3fc
parent145c849596bdcd24f3b4e617eeb4ee06e1b93452 (diff)
downloadnextpnr-1e314cc0ced067d72cea54c8225cf9d3ed0b6c14.tar.gz
nextpnr-1e314cc0ced067d72cea54c8225cf9d3ed0b6c14.tar.bz2
nextpnr-1e314cc0ced067d72cea54c8225cf9d3ed0b6c14.zip
Update chip Graphics API
Signed-off-by: Clifford Wolf <clifford@clifford.at>
-rw-r--r--dummy/chip.cc8
-rw-r--r--dummy/chip.h8
-rw-r--r--ice40/chip.cc34
-rw-r--r--ice40/chip.h8
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<GraphicElement> Chip::getBelGraphics(BelId bel) const
+std::vector<GraphicElement> Chip::getFrameGraphics() const
{
static std::vector<GraphicElement> ret;
return ret;
}
-std::vector<GraphicElement> Chip::getWireGraphics(WireId wire) const
+std::vector<GraphicElement> Chip::getBelGraphics(BelId bel) const
{
static std::vector<GraphicElement> ret;
return ret;
}
-std::vector<GraphicElement> Chip::getPipGraphics(PipId pip) const
+std::vector<GraphicElement> Chip::getWireGraphics(WireId wire) const
{
static std::vector<GraphicElement> ret;
return ret;
}
-std::vector<GraphicElement> Chip::getFrameGraphics() const
+std::vector<GraphicElement> Chip::getPipGraphics(PipId pip) const
{
static std::vector<GraphicElement> 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<GraphicElement> getFrameGraphics() const;
std::vector<GraphicElement> getBelGraphics(BelId bel) const;
std::vector<GraphicElement> getWireGraphics(WireId wire) const;
std::vector<GraphicElement> getPipGraphics(PipId pip) const;
- std::vector<GraphicElement> getFrameGraphics() const;
+
+ bool allGraphicsReload = false;
+ bool frameGraphicsReload = false;
+ std::unordered_set<BelId> belGraphicsReload;
+ std::unordered_set<WireId> wireGraphicsReload;
+ std::unordered_set<PipId> 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<GraphicElement> Chip::getFrameGraphics() const
+{
+ std::vector<GraphicElement> 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<GraphicElement> Chip::getBelGraphics(BelId bel) const
{
std::vector<GraphicElement> ret;
@@ -369,21 +386,4 @@ std::vector<GraphicElement> Chip::getPipGraphics(PipId pip) const
return ret;
}
-std::vector<GraphicElement> Chip::getFrameGraphics() const
-{
- std::vector<GraphicElement> 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<GraphicElement> getFrameGraphics() const;
std::vector<GraphicElement> getBelGraphics(BelId bel) const;
std::vector<GraphicElement> getWireGraphics(WireId wire) const;
std::vector<GraphicElement> getPipGraphics(PipId pip) const;
- std::vector<GraphicElement> getFrameGraphics() const;
+
+ bool allGraphicsReload = false;
+ bool frameGraphicsReload = false;
+ std::unordered_set<BelId> belGraphicsReload;
+ std::unordered_set<WireId> wireGraphicsReload;
+ std::unordered_set<PipId> pipGraphicsReload;
};
NEXTPNR_NAMESPACE_END