From 302ccc14cfa4344aeefa413e4d686e1c279552fa Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 29 Jun 2018 19:58:08 +0200 Subject: ice40: UltraPlus SPRAM working Signed-off-by: David Shah --- ice40/cells.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'ice40/cells.cc') diff --git a/ice40/cells.cc b/ice40/cells.cc index 27277e4e..7f690930 100644 --- a/ice40/cells.cc +++ b/ice40/cells.cc @@ -124,6 +124,24 @@ std::unique_ptr create_ice_cell(Context *ctx, IdString type, std::stri } else if (type == ctx->id("SB_GB")) { add_port(ctx, new_cell.get(), "USER_SIGNAL_TO_GLOBAL_BUFFER", PORT_IN); add_port(ctx, new_cell.get(), "GLOBAL_BUFFER_OUTPUT", PORT_OUT); + } else if (type == ctx->id("ICESTORM_SPRAM")) { + add_port(ctx, new_cell.get(), "WREN", PORT_IN); + add_port(ctx, new_cell.get(), "CHIPSELECT", PORT_IN); + add_port(ctx, new_cell.get(), "CLOCK", PORT_IN); + add_port(ctx, new_cell.get(), "STANDBY", PORT_IN); + add_port(ctx, new_cell.get(), "SLEEP", PORT_IN); + add_port(ctx, new_cell.get(), "POWEROFF", PORT_IN); + + for (int i = 0; i < 16; i++) { + add_port(ctx, new_cell.get(), "DATAIN_" + std::to_string(i), PORT_IN); + add_port(ctx, new_cell.get(), "DATAOUT_" + std::to_string(i), PORT_OUT); + } + for (int i = 0; i < 14; i++) { + add_port(ctx, new_cell.get(), "ADDRESS_" + std::to_string(i), PORT_IN); + } + for (int i = 0; i < 4; i++) { + add_port(ctx, new_cell.get(), "MASKWREN_" + std::to_string(i), PORT_IN); + } } else { log_error("unable to create iCE40 cell of type %s", type.c_str(ctx)); } -- cgit v1.2.3