aboutsummaryrefslogtreecommitdiffstats
path: root/passes/techmap
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-05-02 10:44:59 -0700
committerEddie Hung <eddie@fpgeh.com>2019-05-02 10:44:59 -0700
commit5cd19b52da297cc7d44e9bf11dc9d1664a02ccce (patch)
tree6206a4fa059c47a56cc43914d4141a386a5f2c7f /passes/techmap
parent4aca928033874e8e35ecc4a18f22475c00bebad9 (diff)
parent98925f6c4be611434e75f0ccf645a7ef8adcfc63 (diff)
downloadyosys-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.cc12
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") {