memory_dff: Add support for no_rw_check attribute.
authorMarcelina Kościelnicka <mwk@0x04.net>
Thu, 2 Jun 2022 09:47:29 +0000 (11:47 +0200)
committerMarcelina Kościelnicka <mwk@0x04.net>
Thu, 2 Jun 2022 10:49:34 +0000 (12:49 +0200)
kernel/constids.inc
passes/memory/memory_dff.cc
passes/memory/memory_libmap.cc

index d822c078b6a334dbc59438a522dfaae14a781215..443ac3bcb19c1cdb44a256e12909d544d5afb96a 100644 (file)
@@ -137,6 +137,7 @@ X(nomem2reg)
 X(nomeminit)
 X(nosync)
 X(nowrshmsk)
+X(no_rw_check)
 X(O)
 X(OFFSET)
 X(onehot)
index 91209d428765fdc532ea583275818604747e101d..dd3d8a8f3543b775ae140c946c4105ad8f75f1ca 100644 (file)
@@ -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);
index ab7bb7bb24c44d9457d05099837bd7b71ea9c4d0..898e0af85d6db36f5ba5ec2b6cc1c15f03c91753 100644 (file)
@@ -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") {