3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-05 02:40:25 +00:00

dfflibmap: test negated state next_state with mixed polarities

This commit is contained in:
Emil J. Tywoniak 2025-07-10 18:54:43 +02:00
parent 73cbcffbbb
commit 7fe817c52f
2 changed files with 51 additions and 0 deletions

View file

@ -81,3 +81,19 @@ clean
select -assert-count 0 t:dffn
select -assert-count 5 t:dffsr
select -assert-count 1 t:dffe
design -load orig
dfflibmap -liberty dfflibmap.lib -liberty dfflibmap_dffsr_mixedpol.lib -dont_use dffsr
clean
# We have one more _NOT_ than with the regular dffsr
select -assert-count 6 t:$_NOT_
select -assert-count 1 t:dffn
select -assert-count 4 t:dffsr_mixedpol
select -assert-count 1 t:dffe
# The additional NOT is on ff2.
# Originally, ff2.R is an active high "set".
# dffsr_mixedpol has functionally swapped labels due to the next_state inversion,
# so we use its CLEAR port for the "set",
# but we have to invert it because the CLEAR pin is active low.
# ff2.CLEAR = !R
select -assert-count 1 c:ff2 %x:+[CLEAR] %ci t:$_NOT_ %i