memory: add -bram-register

This commit is contained in:
Emil J. Tywoniak 2026-03-31 14:59:59 +02:00
parent 0f3efd2c1a
commit 9f5a95469d
1 changed files with 8 additions and 3 deletions

View File

@ -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 <bram_rules>] [selection]\n");
log(" memory [-norom] [-nomap] [-nordff] [-nowiden] [-nosat] [-memx] [-no-rw-check] [-bram <bram_rules>] [-bram-register <bram_rules>] [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 <bram_rules> (when called with -bram)\n");
log(" memory_bram -rules <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;