3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-06-01 14:47:53 +00:00

memory: add -bram-register

This commit is contained in:
Emil J. Tywoniak 2026-03-31 14:59:59 +02:00
parent b4b5093a14
commit 2bc6ea7f37

View file

@ -31,7 +31,7 @@ struct MemoryPass : public Pass {
{ {
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---| // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
log("\n"); 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("\n");
log("This pass calls all the other memory_* passes in a useful order:\n"); log("This pass calls all the other memory_* passes in a useful order:\n");
log("\n"); log("\n");
@ -47,6 +47,7 @@ struct MemoryPass : public Pass {
log(" opt_clean\n"); log(" opt_clean\n");
log(" memory_collect\n"); log(" memory_collect\n");
log(" memory_bram -rules <bram_rules> (when called with -bram)\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(" memory_map (skipped if called with -nomap)\n");
log("\n"); log("\n");
log("This converts memories to word-wide DFFs and address decoders\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_nomap = false;
bool flag_nordff = false; bool flag_nordff = false;
bool flag_memx = false; bool flag_memx = false;
bool flag_register = false;
string memory_dff_opts; string memory_dff_opts;
string memory_bram_opts; string memory_bram_opts;
string memory_share_opts; string memory_share_opts;
@ -97,8 +99,11 @@ struct MemoryPass : public Pass {
memory_dff_opts += " -no-rw-check"; memory_dff_opts += " -no-rw-check";
continue; continue;
} }
if (argidx+1 < args.size() && args[argidx] == "-bram") { if (argidx+1 < args.size() && (args[argidx] == "-bram" || args[argidx] == "-bram-register")) {
memory_bram_opts += " -rules " + args[++argidx]; if (args[argidx] == "-bram-register")
memory_bram_opts += " -rules " + args[++argidx] + " -register";
else
memory_bram_opts += " -rules " + args[++argidx];
continue; continue;
} }
break; break;