diff options
author | Eddie Hung <eddieh@ece.ubc.ca> | 2019-03-14 08:10:02 -0700 |
---|---|---|
committer | Eddie Hung <eddieh@ece.ubc.ca> | 2019-03-14 08:10:02 -0700 |
commit | 26ecbc1aee1dca1c186ab2b51835d74f67bc3e75 (patch) | |
tree | b9cc84592ebccaec275b5f3279f76297ef294e64 /passes/techmap | |
parent | 79b4a275ce85d231186105b6e73a596ff3326e1f (diff) | |
download | yosys-26ecbc1aee1dca1c186ab2b51835d74f67bc3e75.tar.gz yosys-26ecbc1aee1dca1c186ab2b51835d74f67bc3e75.tar.bz2 yosys-26ecbc1aee1dca1c186ab2b51835d74f67bc3e75.zip |
Add shregmap -init_msb_first and use in synth_xilinx
Diffstat (limited to 'passes/techmap')
-rw-r--r-- | passes/techmap/shregmap.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/passes/techmap/shregmap.cc b/passes/techmap/shregmap.cc index f20863ba0..6cd9082dc 100644 --- a/passes/techmap/shregmap.cc +++ b/passes/techmap/shregmap.cc @@ -34,7 +34,7 @@ struct ShregmapOptions { int minlen, maxlen; int keep_before, keep_after; - bool zinit, init, params, ffe; + bool zinit, init, params, ffe, init_msb_first; dict<IdString, pair<IdString, IdString>> ffcells; ShregmapTech *tech; @@ -48,6 +48,7 @@ struct ShregmapOptions init = false; params = false; ffe = false; + init_msb_first = false; tech = nullptr; } }; @@ -307,6 +308,8 @@ struct ShregmapWorker initval.push_back(State::S0); remove_init.insert(bit); } + if (opts.init_msb_first) + std::reverse(initval.begin(), initval.end()); first_cell->setParam("\\INIT", initval); } @@ -442,9 +445,13 @@ struct ShregmapPass : public Pass { log("\n"); log(" -init\n"); log(" map initialized registers to the shift reg, add an INIT parameter to\n"); - log(" generated cells with the initialization value. (first bit to shift out\n"); + log(" generated cells with the initialization value. (First bit to shift out\n"); log(" in LSB position)\n"); log("\n"); + log(" -init_msb_first\n"); + log(" same as -init, but INIT parameter to have first bit to shift out\n"); + log(" in MSB position.\n"); + log("\n"); log(" -tech greenpak4\n"); log(" map to greenpak4 shift registers.\n"); log("\n"); @@ -515,6 +522,11 @@ struct ShregmapPass : public Pass { opts.init = true; continue; } + if (args[argidx] == "-init_msb_first") { + opts.init = true; + opts.init_msb_first = true; + continue; + } if (args[argidx] == "-params") { opts.params = true; continue; |