mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-15 13:28:59 +00:00
Keep track of bits in variable length chain, to check for taps
This commit is contained in:
parent
f2d4814284
commit
83e2d87fb8
|
@ -186,6 +186,11 @@ state <int> shiftx_width
|
||||||
state <int> slice
|
state <int> slice
|
||||||
udata <int> minlen
|
udata <int> minlen
|
||||||
udata <vector<pair<Cell*,int>>> chain
|
udata <vector<pair<Cell*,int>>> chain
|
||||||
|
udata <pool<SigBit>> chain_bits
|
||||||
|
|
||||||
|
code
|
||||||
|
chain_bits.clear();
|
||||||
|
endcode
|
||||||
|
|
||||||
match shiftx
|
match shiftx
|
||||||
select shiftx->type.in($shiftx)
|
select shiftx->type.in($shiftx)
|
||||||
|
@ -251,13 +256,20 @@ match next
|
||||||
index <SigBit> port(next, \Q)[idx] === port(shiftx, \A)[shiftx_width-1-GetSize(chain)]
|
index <SigBit> port(next, \Q)[idx] === port(shiftx, \A)[shiftx_width-1-GetSize(chain)]
|
||||||
filter port(next, clk_port) == port(first, clk_port)
|
filter port(next, clk_port) == port(first, clk_port)
|
||||||
filter en_port == IdString() || port(next, en_port) == port(first, en_port)
|
filter en_port == IdString() || port(next, en_port) == port(first, en_port)
|
||||||
|
filter !chain_bits.count(port(next, \D)[idx])
|
||||||
set slice idx
|
set slice idx
|
||||||
endmatch
|
endmatch
|
||||||
|
|
||||||
code
|
code
|
||||||
if (next) {
|
if (next) {
|
||||||
|
chain_bits.insert(port(next, \Q)[slice]);
|
||||||
chain.emplace_back(next, slice);
|
chain.emplace_back(next, slice);
|
||||||
if (GetSize(chain) < shiftx_width)
|
if (GetSize(chain) < shiftx_width)
|
||||||
subpattern(tail);
|
subpattern(tail);
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
if (next) {
|
||||||
|
chain_bits.erase(port(next, \Q)[slice]);
|
||||||
|
chain.pop_back();
|
||||||
|
}
|
||||||
endcode
|
endcode
|
||||||
|
|
Loading…
Reference in a new issue