aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/cells.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-16 17:44:35 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-16 17:44:35 +0200
commit1e6124309fb02824c43549e0861d4023fc5827d8 (patch)
tree9b60248aa76cb911fe6af0eca037113d1af986b6 /ice40/cells.cc
parentbb92dc09a8d3450a7d356edf0ac2e9971083cf2f (diff)
downloadnextpnr-1e6124309fb02824c43549e0861d4023fc5827d8.tar.gz
nextpnr-1e6124309fb02824c43549e0861d4023fc5827d8.tar.bz2
nextpnr-1e6124309fb02824c43549e0861d4023fc5827d8.zip
ice40: Proper global promotion
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/cells.cc')
-rw-r--r--ice40/cells.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/ice40/cells.cc b/ice40/cells.cc
index 52356711..4cc4f29c 100644
--- a/ice40/cells.cc
+++ b/ice40/cells.cc
@@ -196,7 +196,9 @@ bool is_clock_port(const PortRef &port)
return false;
if (is_ff(port.cell))
return port.port == "C";
- if (is_ram(port.cell))
+ if (port.cell->type == "ICESTORM_LC")
+ return port.port == "CLK";
+ if (is_ram(port.cell) || port.cell->type == "ICESTORM_RAM")
return port.port == "RCLK" || port.port == "WCLK";
return false;
}
@@ -207,6 +209,19 @@ bool is_reset_port(const PortRef &port)
return false;
if (is_ff(port.cell))
return port.port == "R" || port.port == "S";
+ if (port.cell->type == "ICESTORM_LC")
+ return port.port == "SR";
+ return false;
+}
+
+bool is_enable_port(const PortRef &port)
+{
+ if (port.cell == nullptr)
+ return false;
+ if (is_ff(port.cell))
+ return port.port == "E";
+ if (port.cell->type == "ICESTORM_LC")
+ return port.port == "CEN";
return false;
}