aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/arch.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-20 13:01:22 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-20 13:01:22 +0200
commit4648d3bc839f1c8458d3b96bc572774600eaa33f (patch)
tree056e72e731613f432276bacc518684894de443d2 /ice40/arch.cc
parent5ca4663294aff1f4af45e9abfffa20c1e44ea017 (diff)
downloadnextpnr-4648d3bc839f1c8458d3b96bc572774600eaa33f.tar.gz
nextpnr-4648d3bc839f1c8458d3b96bc572774600eaa33f.tar.bz2
nextpnr-4648d3bc839f1c8458d3b96bc572774600eaa33f.zip
Working on the timing annotator
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/arch.cc')
-rw-r--r--ice40/arch.cc23
1 files changed, 18 insertions, 5 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index 7baaef8d..ba02ff9f 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -21,7 +21,7 @@
#include <cmath>
#include "log.h"
#include "nextpnr.h"
-
+#include "util.h"
NEXTPNR_NAMESPACE_BEGIN
// -----------------------------------------------------------------------
@@ -414,26 +414,39 @@ std::vector<GraphicElement> Arch::getPipGraphics(PipId pip) const
std::vector<GraphicElement> ret;
// FIXME
return ret;
-}
+};
// -----------------------------------------------------------------------
bool Arch::getCellDelay(const CellInfo *cell, IdString fromPort,
IdString toPort, delay_t &delay) const
{
- // TODO
+ if (cell->type == id("ICESTORM_LC")) {
+ if (fromPort == id("I0") || fromPort == id("I1") ||
+ fromPort == id("I2") || fromPort == id("I3")) {
+ if (toPort == id("O") || toPort == id("LO")) {
+ delay = 450;
+ return true;
+ }
+ }
+ }
return false;
}
IdString Arch::getPortClock(const CellInfo *cell, IdString port) const
{
- // TODO
+ if (cell->type == id("ICESTORM_LC") &&
+ bool_or_default(cell->params, id("DFF_ENABLE"))) {
+ if (port != id("LO") && port != id("CIN") && port != id("COUT"))
+ return id("CLK");
+ }
return IdString();
}
bool Arch::isClockPort(const CellInfo *cell, IdString port) const
{
- // TODO
+ if (cell->type == id("ICESTORM_LC") && port == id("CLK"))
+ return true;
return false;
}