aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelina Koƛcielnicka <mwk@0x04.net>2022-06-02 11:47:29 +0200
committerMarcelina Koƛcielnicka <mwk@0x04.net>2022-06-02 12:49:34 +0200
commit3a0aa9c6630c6e2bb2ffb2d7f5b4e3921316ba48 (patch)
treed04147d34ed0cd10e8f08ffd63f2688c13504c36
parent01cb02c81df14762cce117a823af742ed044a5c4 (diff)
downloadyosys-3a0aa9c6630c6e2bb2ffb2d7f5b4e3921316ba48.tar.gz
yosys-3a0aa9c6630c6e2bb2ffb2d7f5b4e3921316ba48.tar.bz2
yosys-3a0aa9c6630c6e2bb2ffb2d7f5b4e3921316ba48.zip
memory_dff: Add support for no_rw_check attribute.
-rw-r--r--kernel/constids.inc1
-rw-r--r--passes/memory/memory_dff.cc10
-rw-r--r--passes/memory/memory_libmap.cc3
3 files changed, 14 insertions, 0 deletions
diff --git a/kernel/constids.inc b/kernel/constids.inc
index d822c078b..443ac3bcb 100644
--- a/kernel/constids.inc
+++ b/kernel/constids.inc
@@ -137,6 +137,7 @@ X(nomem2reg)
X(nomeminit)
X(nosync)
X(nowrshmsk)
+X(no_rw_check)
X(O)
X(OFFSET)
X(onehot)
diff --git a/passes/memory/memory_dff.cc b/passes/memory/memory_dff.cc
index 91209d428..dd3d8a8f3 100644
--- a/passes/memory/memory_dff.cc
+++ b/passes/memory/memory_dff.cc
@@ -357,6 +357,14 @@ struct MemoryDffWorker
return;
}
+ // Check for no_rw_check
+ bool no_rw_check = mem.get_bool_attribute(ID::no_rw_check);
+ for (auto attr: {ID::ram_block, ID::rom_block, ID::ram_style, ID::rom_style, ID::ramstyle, ID::romstyle, ID::syn_ramstyle, ID::syn_romstyle}) {
+ if (mem.get_string_attribute(attr) == "no_rw_check") {
+ no_rw_check = true;
+ }
+ }
+
// Construct cache.
MemQueryCache cache(qcsat, mem, port, ff);
@@ -392,6 +400,8 @@ struct MemoryDffWorker
pd.uncollidable_mask[j] = true;
pd.collision_x_mask[j] = true;
}
+ if (no_rw_check)
+ pd.collision_x_mask[j] = true;
}
}
portdata.push_back(pd);
diff --git a/passes/memory/memory_libmap.cc b/passes/memory/memory_libmap.cc
index ab7bb7bb2..898e0af85 100644
--- a/passes/memory/memory_libmap.cc
+++ b/passes/memory/memory_libmap.cc
@@ -443,6 +443,9 @@ void MemMapping::determine_style() {
std::string val_s = val.decode_string();
for (auto &c: val_s)
c = std::tolower(c);
+ // Handled in memory_dff.
+ if (val_s == "no_rw_check")
+ continue;
if (val_s == "auto") {
// Nothing.
} else if (val_s == "logic" || val_s == "registers") {