mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Use -match-init to not synth contradicting init values
This commit is contained in:
parent
72d03dc910
commit
a3b25b4af8
|
@ -216,7 +216,7 @@ struct SynthGowinPass : public ScriptPass
|
||||||
if (check_label("map_ffs"))
|
if (check_label("map_ffs"))
|
||||||
{
|
{
|
||||||
run("dffsr2dff");
|
run("dffsr2dff");
|
||||||
run("dff2dffs");
|
run("dff2dffs -match-init");
|
||||||
run("opt_clean");
|
run("opt_clean");
|
||||||
if (!nodffe)
|
if (!nodffe)
|
||||||
run("dff2dffe -direct-match $_DFF_* -direct-match $__DFFS_*");
|
run("dff2dffe -direct-match $_DFF_* -direct-match $__DFFS_*");
|
||||||
|
|
|
@ -36,7 +36,8 @@ design -load read
|
||||||
# these should synth to a flop with reset
|
# these should synth to a flop with reset
|
||||||
chparam -set INIT 1 myDFF myDFFN myDFFE myDFFNE
|
chparam -set INIT 1 myDFF myDFFN myDFFE myDFFNE
|
||||||
|
|
||||||
# these should give a warning
|
# async should give a warning
|
||||||
|
# sync should synth to a mux
|
||||||
chparam -set INIT 0 myDFF*S* myDFF*P*
|
chparam -set INIT 0 myDFF*S* myDFF*P*
|
||||||
chparam -set INIT 1 myDFF*R* myDFF*C*
|
chparam -set INIT 1 myDFF*R* myDFF*C*
|
||||||
|
|
||||||
|
@ -45,28 +46,29 @@ flatten
|
||||||
synth_gowin -run coarse:
|
synth_gowin -run coarse:
|
||||||
|
|
||||||
# check the flops mapped as expected
|
# check the flops mapped as expected
|
||||||
select -assert-count 0 t:DFF
|
select -assert-count 1 t:DFF
|
||||||
select -assert-count 1 t:DFFC
|
select -assert-count 1 t:DFFC
|
||||||
select -assert-count 1 t:DFFCE
|
select -assert-count 1 t:DFFCE
|
||||||
select -assert-count 0 t:DFFE
|
select -assert-count 1 t:DFFE
|
||||||
select -assert-count 0 t:DFFN
|
select -assert-count 1 t:DFFN
|
||||||
select -assert-count 1 t:DFFNC
|
select -assert-count 1 t:DFFNC
|
||||||
select -assert-count 1 t:DFFNCE
|
select -assert-count 1 t:DFFNCE
|
||||||
select -assert-count 0 t:DFFNE
|
select -assert-count 1 t:DFFNE
|
||||||
select -assert-count 1 t:DFFNP
|
select -assert-count 1 t:DFFNP
|
||||||
select -assert-count 1 t:DFFNPE
|
select -assert-count 1 t:DFFNPE
|
||||||
select -assert-count 1 t:DFFNR
|
select -assert-count 0 t:DFFNR
|
||||||
select -assert-count 1 t:DFFNRE
|
select -assert-count 0 t:DFFNRE
|
||||||
select -assert-count 2 t:DFFNS
|
select -assert-count 2 t:DFFNS
|
||||||
select -assert-count 2 t:DFFNSE
|
select -assert-count 2 t:DFFNSE
|
||||||
select -assert-count 1 t:DFFP
|
select -assert-count 1 t:DFFP
|
||||||
select -assert-count 1 t:DFFPE
|
select -assert-count 1 t:DFFPE
|
||||||
select -assert-count 1 t:DFFR
|
select -assert-count 0 t:DFFR
|
||||||
select -assert-count 1 t:DFFRE
|
select -assert-count 0 t:DFFRE
|
||||||
select -assert-count 2 t:DFFS
|
select -assert-count 2 t:DFFS
|
||||||
select -assert-count 2 t:DFFSE
|
select -assert-count 2 t:DFFSE
|
||||||
|
select -assert-count 12 t:LUT2
|
||||||
|
|
||||||
# check the expected leftover init values
|
# check the expected leftover init values
|
||||||
# this would happen if your reset value is not the initial value
|
# this would happen if your reset value is not the initial value
|
||||||
# which would be weird
|
# which would be weird
|
||||||
select -assert-count 16 a:init
|
select -assert-count 8 a:init
|
||||||
|
|
Loading…
Reference in a new issue