mirror of https://github.com/YosysHQ/yosys.git
Added "memory -bram"
This commit is contained in:
parent
a7fe87f888
commit
45918b8315
|
@ -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 [-nomap] [selection]\n");
|
log(" memory [-nomap] [-bram <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");
|
||||||
|
@ -40,6 +40,7 @@ struct MemoryPass : public Pass {
|
||||||
log(" memory_share\n");
|
log(" memory_share\n");
|
||||||
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_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");
|
||||||
|
@ -49,6 +50,7 @@ struct MemoryPass : public Pass {
|
||||||
virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
|
virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
|
||||||
{
|
{
|
||||||
bool flag_nomap = false;
|
bool flag_nomap = false;
|
||||||
|
string memory_bram_opts;
|
||||||
|
|
||||||
log_header("Executing MEMORY pass.\n");
|
log_header("Executing MEMORY pass.\n");
|
||||||
log_push();
|
log_push();
|
||||||
|
@ -59,6 +61,10 @@ struct MemoryPass : public Pass {
|
||||||
flag_nomap = true;
|
flag_nomap = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (argidx+1 < args.size() && args[argidx] == "-bram") {
|
||||||
|
memory_bram_opts += " -rules " + args[++argidx];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
extra_args(args, argidx, design);
|
extra_args(args, argidx, design);
|
||||||
|
@ -69,6 +75,9 @@ struct MemoryPass : public Pass {
|
||||||
Pass::call(design, "opt_clean");
|
Pass::call(design, "opt_clean");
|
||||||
Pass::call(design, "memory_collect");
|
Pass::call(design, "memory_collect");
|
||||||
|
|
||||||
|
if (!memory_bram_opts.empty())
|
||||||
|
Pass::call(design, "memory_bram" + memory_bram_opts);
|
||||||
|
|
||||||
if (!flag_nomap)
|
if (!flag_nomap)
|
||||||
Pass::call(design, "memory_map");
|
Pass::call(design, "memory_map");
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
../../yosys -qq -p "proc; opt; memory -nomap; memory_bram -rules temp/brams_${2}.txt; opt -fast -full" \
|
../../yosys -qq -p "proc; opt; memory -nomap -bram temp/brams_${2}.txt; opt -fast -full" \
|
||||||
-l temp/synth_${1}_${2}.log -o temp/synth_${1}_${2}.v temp/brams_${1}.v
|
-l temp/synth_${1}_${2}.log -o temp/synth_${1}_${2}.v temp/brams_${1}.v
|
||||||
iverilog -Dvcd_file=\"temp/tb_${1}_${2}.vcd\" -DSIMLIB_MEMDELAY=1ns -o temp/tb_${1}_${2}.tb temp/brams_${1}_tb.v \
|
iverilog -Dvcd_file=\"temp/tb_${1}_${2}.vcd\" -DSIMLIB_MEMDELAY=1ns -o temp/tb_${1}_${2}.tb temp/brams_${1}_tb.v \
|
||||||
temp/brams_${1}_ref.v temp/synth_${1}_${2}.v temp/brams_${2}.v ../../techlibs/common/simlib.v
|
temp/brams_${1}_ref.v temp/synth_${1}_${2}.v temp/brams_${2}.v ../../techlibs/common/simlib.v
|
||||||
|
|
Loading…
Reference in New Issue