diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 180982a7c..e9b648b04 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -1856,9 +1856,9 @@ namespace { param_bits(ID::RD_COLLISION_X_MASK, max(1, param(ID::RD_PORTS) * param(ID::WR_PORTS))); param_bits(ID::RD_WIDE_CONTINUATION, max(1, param(ID::RD_PORTS))); param_bits(ID::RD_CE_OVER_SRST, max(1, param(ID::RD_PORTS))); - param_bits(ID::RD_ARST_VALUE, param(ID::RD_PORTS) * param(ID::WIDTH)); - param_bits(ID::RD_SRST_VALUE, param(ID::RD_PORTS) * param(ID::WIDTH)); - param_bits(ID::RD_INIT_VALUE, param(ID::RD_PORTS) * param(ID::WIDTH)); + param_bits(ID::RD_ARST_VALUE, max(1, param(ID::RD_PORTS) * param(ID::WIDTH))); + param_bits(ID::RD_SRST_VALUE, max(1, param(ID::RD_PORTS) * param(ID::WIDTH))); + param_bits(ID::RD_INIT_VALUE, max(1, param(ID::RD_PORTS) * param(ID::WIDTH))); param_bits(ID::WR_CLK_ENABLE, max(1, param(ID::WR_PORTS))); param_bits(ID::WR_CLK_POLARITY, max(1, param(ID::WR_PORTS))); param_bits(ID::WR_WIDE_CONTINUATION, max(1, param(ID::WR_PORTS))); diff --git a/tests/memories/nordports.ys b/tests/memories/nordports.ys new file mode 100644 index 000000000..d3694e64a --- /dev/null +++ b/tests/memories/nordports.ys @@ -0,0 +1,9 @@ +# check memory_collect doesn't produce invalid RTLIL on a memory w/o read ports +read_rtlil <