summaryrefslogtreecommitdiff
path: root/frontends/verilog/verilog_frontend.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-03-24 11:13:32 +0100
committerClifford Wolf <clifford@clifford.at>2013-03-24 11:13:32 +0100
commitdf9753d398ff1f10396a8561524fee20fdbf512c (patch)
treef614c10cca56acf78e3fda6a886d5ea0cdceaf96 /frontends/verilog/verilog_frontend.cc
parent6960df7285fc7f2c703f349bea841800737f8dca (diff)
Added mem2reg option to verilog frontend
Diffstat (limited to 'frontends/verilog/verilog_frontend.cc')
-rw-r--r--frontends/verilog/verilog_frontend.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/frontends/verilog/verilog_frontend.cc b/frontends/verilog/verilog_frontend.cc
index 878f1c0e..f4a8c79f 100644
--- a/frontends/verilog/verilog_frontend.cc
+++ b/frontends/verilog/verilog_frontend.cc
@@ -78,6 +78,11 @@ struct VerilogFrontend : public Frontend {
log(" this can also be achieved by setting the 'nomem2reg'\n");
log(" attribute on the respective module or register.\n");
log("\n");
+ log(" -mem2reg\n");
+ log(" always convert memories to registers. this can also be\n");
+ log(" achieved by setting the 'mem2reg' attribute on the respective\n");
+ log(" module or register.\n");
+ log("\n");
log(" -ppdump\n");
log(" dump verilog code after pre-processor\n");
log("\n");
@@ -92,6 +97,7 @@ struct VerilogFrontend : public Frontend {
bool flag_dump_vlog = false;
bool flag_nolatches = false;
bool flag_nomem2reg = false;
+ bool flag_mem2reg = false;
bool flag_ppdump = false;
bool flag_nopp = false;
frontend_verilog_yydebug = false;
@@ -126,6 +132,10 @@ struct VerilogFrontend : public Frontend {
flag_nomem2reg = true;
continue;
}
+ if (arg == "-mem2reg") {
+ flag_mem2reg = true;
+ continue;
+ }
if (arg == "-ppdump") {
flag_ppdump = true;
continue;
@@ -163,7 +173,7 @@ struct VerilogFrontend : public Frontend {
frontend_verilog_yyparse();
frontend_verilog_yylex_destroy();
- AST::process(design, current_ast, flag_dump_ast, flag_dump_ast_diff, flag_dump_vlog, flag_nolatches, flag_nomem2reg);
+ AST::process(design, current_ast, flag_dump_ast, flag_dump_ast_diff, flag_dump_vlog, flag_nolatches, flag_nomem2reg, flag_mem2reg);
if (!flag_nopp)
fclose(fp);