aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/cells.h
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-13 16:26:21 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-13 16:26:21 +0200
commit5af707a0b6eb5455b40fac572a7bfeb5c3940eb4 (patch)
treebd62726eed83634fbd577644937fe2da7b0fd46e /ice40/cells.h
parent4a85cd57c0fabfba5b3851361c000ae801cb43f7 (diff)
downloadnextpnr-5af707a0b6eb5455b40fac572a7bfeb5c3940eb4.tar.gz
nextpnr-5af707a0b6eb5455b40fac572a7bfeb5c3940eb4.tar.bz2
nextpnr-5af707a0b6eb5455b40fac572a7bfeb5c3940eb4.zip
ice40: Pack RAMs
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/cells.h')
-rw-r--r--ice40/cells.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/ice40/cells.h b/ice40/cells.h
index 660c7265..e5b4fa9c 100644
--- a/ice40/cells.h
+++ b/ice40/cells.h
@@ -51,7 +51,14 @@ inline bool is_ff(const CellInfo *cell)
inline bool is_sb_io(const CellInfo *cell) { return cell->type == "SB_IO"; }
// Return true if a cell is a global buffer
-inline bool is_gbuf(const CellInfo *cell) {return cell->type == "SB_GB"; }
+inline bool is_gbuf(const CellInfo *cell) { return cell->type == "SB_GB"; }
+
+// Return true if a cell is a RAM
+inline bool is_ram(const CellInfo *cell)
+{
+ return cell->type == "SB_RAM40_4K" || cell->type == "SB_RAM40_4KNR" ||
+ cell->type == "SB_RAM40_4KNW" || cell->type == "SB_RAM40_4KNRNW";
+}
// Convert a SB_LUT primitive to (part of) an ICESTORM_LC, swapping ports
// as needed. Set no_dff if a DFF is not being used, so that the output