From 9f5a95469d2400672bda39f05b8805ddffca51b2 Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Tue, 31 Mar 2026 14:59:59 +0200 Subject: [PATCH] memory: add -bram-register --- passes/memory/memory.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/passes/memory/memory.cc b/passes/memory/memory.cc index d5dec6198..84dc3e351 100644 --- a/passes/memory/memory.cc +++ b/passes/memory/memory.cc @@ -31,7 +31,7 @@ struct MemoryPass : public Pass { { // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---| log("\n"); - log(" memory [-norom] [-nomap] [-nordff] [-nowiden] [-nosat] [-memx] [-no-rw-check] [-bram ] [selection]\n"); + log(" memory [-norom] [-nomap] [-nordff] [-nowiden] [-nosat] [-memx] [-no-rw-check] [-bram ] [-bram-register ] [selection]\n"); log("\n"); log("This pass calls all the other memory_* passes in a useful order:\n"); log("\n"); @@ -47,6 +47,7 @@ struct MemoryPass : public Pass { log(" opt_clean\n"); log(" memory_collect\n"); log(" memory_bram -rules (when called with -bram)\n"); + log(" memory_bram -rules -register (when called with -bram-register)\n"); log(" memory_map (skipped if called with -nomap)\n"); log("\n"); log("This converts memories to word-wide DFFs and address decoders\n"); @@ -59,6 +60,7 @@ struct MemoryPass : public Pass { bool flag_nomap = false; bool flag_nordff = false; bool flag_memx = false; + bool flag_register = false; string memory_dff_opts; string memory_bram_opts; string memory_share_opts; @@ -97,8 +99,11 @@ struct MemoryPass : public Pass { memory_dff_opts += " -no-rw-check"; continue; } - if (argidx+1 < args.size() && args[argidx] == "-bram") { - memory_bram_opts += " -rules " + args[++argidx]; + if (argidx+1 < args.size() && (args[argidx] == "-bram" || args[argidx] == "-bram-register")) { + if (args[argidx] == "-bram-register") + memory_bram_opts += " -rules " + args[++argidx] + " -register"; + else + memory_bram_opts += " -rules " + args[++argidx]; continue; } break;