diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-05-02 10:44:59 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-05-02 10:44:59 -0700 |
commit | 5cd19b52da297cc7d44e9bf11dc9d1664a02ccce (patch) | |
tree | 6206a4fa059c47a56cc43914d4141a386a5f2c7f /passes/techmap | |
parent | 4aca928033874e8e35ecc4a18f22475c00bebad9 (diff) | |
parent | 98925f6c4be611434e75f0ccf645a7ef8adcfc63 (diff) | |
download | yosys-5cd19b52da297cc7d44e9bf11dc9d1664a02ccce.tar.gz yosys-5cd19b52da297cc7d44e9bf11dc9d1664a02ccce.tar.bz2 yosys-5cd19b52da297cc7d44e9bf11dc9d1664a02ccce.zip |
Merge remote-tracking branch 'origin/master' into xc7mux
Diffstat (limited to 'passes/techmap')
-rw-r--r-- | passes/techmap/shregmap.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/passes/techmap/shregmap.cc b/passes/techmap/shregmap.cc index a541b33be..75eedfbcc 100644 --- a/passes/techmap/shregmap.cc +++ b/passes/techmap/shregmap.cc @@ -178,7 +178,17 @@ struct ShregmapTechXilinx7 : ShregmapTech // Only map if $shiftx exclusively covers the shift register if (shiftx->type == "$shiftx") { - if (GetSize(taps) != shiftx->getParam("\\A_WIDTH").as_int()) + if (GetSize(taps) > shiftx->getParam("\\A_WIDTH").as_int()) + return false; + // Due to padding the most significant bits of A may be 1'bx, + // and if so, discount them + if (GetSize(taps) < shiftx->getParam("\\A_WIDTH").as_int()) { + const SigSpec A = shiftx->getPort("\\A"); + const int A_width = shiftx->getParam("\\A_WIDTH").as_int(); + for (int i = GetSize(taps); i < A_width; ++i) + if (A[i] != RTLIL::Sx) return false; + } + else if (GetSize(taps) != shiftx->getParam("\\A_WIDTH").as_int()) return false; } else if (shiftx->type == "$mux") { |