From 87e72ef86fcd40865b944b5ea65575be1602faf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Fri, 23 Feb 2024 10:58:32 +0100 Subject: [PATCH] celledges: Add read ports arst paths --- kernel/celledges.cc | 17 ++++++++++++----- tests/various/check_4.ys | 29 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 tests/various/check_4.ys diff --git a/kernel/celledges.cc b/kernel/celledges.cc index 48475cfdd..1dbe3fd42 100644 --- a/kernel/celledges.cc +++ b/kernel/celledges.cc @@ -316,8 +316,11 @@ void packed_mem_op(AbstractCellEdgesDatabase *db, RTLIL::Cell *cell) int width = cell->getParam(ID::WIDTH).as_int(); for (int i = 0; i < n_rd_ports; i++) { - if (rd_clk_enable[i] != State::S0) + if (rd_clk_enable[i] != State::S0) { + for (int k = 0; k < width; k++) + db->add_edge(cell, ID::RD_ARST, i, ID::RD_DATA, i * width + k, -1); continue; + } for (int j = 0; j < abits; j++) for (int k = 0; k < width; k++) @@ -329,13 +332,17 @@ void packed_mem_op(AbstractCellEdgesDatabase *db, RTLIL::Cell *cell) void memrd_op(AbstractCellEdgesDatabase *db, RTLIL::Cell *cell) { log_assert(cell->type.in(ID($memrd), ID($memrd_v2))); - - if (cell->getParam(ID::CLK_ENABLE).as_bool()) - return; - int abits = cell->getParam(ID::ABITS).as_int(); int width = cell->getParam(ID::WIDTH).as_int(); + if (cell->getParam(ID::CLK_ENABLE).as_bool()) { + if (cell->type == ID($memrd_v2)) { + for (int k = 0; k < width; k++) + db->add_edge(cell, ID::ARST, 0, ID::DATA, k, -1); + } + return; + } + for (int j = 0; j < abits; j++) for (int k = 0; k < width; k++) db->add_edge(cell, ID::ADDR, j, ID::DATA, k, -1); diff --git a/tests/various/check_4.ys b/tests/various/check_4.ys new file mode 100644 index 000000000..010cd01fd --- /dev/null +++ b/tests/various/check_4.ys @@ -0,0 +1,29 @@ +# loop involving the asynchronous reset on a memory port +design -reset +read -vlog2k <