diff options
author | David Shah <davey1576@gmail.com> | 2018-06-20 13:01:22 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-06-20 13:01:22 +0200 |
commit | 4648d3bc839f1c8458d3b96bc572774600eaa33f (patch) | |
tree | 056e72e731613f432276bacc518684894de443d2 /ice40 | |
parent | 5ca4663294aff1f4af45e9abfffa20c1e44ea017 (diff) | |
download | nextpnr-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')
-rw-r--r-- | ice40/arch.cc | 23 | ||||
-rw-r--r-- | ice40/main.cc | 3 |
2 files changed, 20 insertions, 6 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; } diff --git a/ice40/main.cc b/ice40/main.cc index 802a08b8..70d88946 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -36,6 +36,7 @@ #include "pybindings.h" #include "route.h" #include "version.h" +#include "timing.h" void svg_dump_el(const GraphicElement &el) { @@ -232,7 +233,7 @@ int main(int argc, char *argv[]) if (!pack_design(&ctx) && !ctx.force) log_error("Packing design failed.\n"); - + assign_budget(&ctx); print_utilisation(&ctx); if (!vm.count("pack-only")) { |