From 1e6124309fb02824c43549e0861d4023fc5827d8 Mon Sep 17 00:00:00 2001 From: David Shah Date: Sat, 16 Jun 2018 17:44:35 +0200 Subject: ice40: Proper global promotion Signed-off-by: David Shah --- ice40/cells.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'ice40/cells.cc') 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; } -- cgit v1.2.3