From: Dan Ravensloft Date: Thu, 28 May 2020 10:33:19 +0000 (+0100) Subject: Improve MISTRAL_FF specify rules X-Git-Tag: working-ls180~417 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c6765443fdb57938418fb2b80bf56cda0e7d229b;p=yosys.git Improve MISTRAL_FF specify rules Co-authored-by: Eddie Hung --- diff --git a/techlibs/intel_alm/common/dff_sim.v b/techlibs/intel_alm/common/dff_sim.v index 38e3d6618..9ff8f9f67 100644 --- a/techlibs/intel_alm/common/dff_sim.v +++ b/techlibs/intel_alm/common/dff_sim.v @@ -79,10 +79,9 @@ module MISTRAL_FF( ); specify - if (ENA) (posedge CLK => (Q : DATAIN)) = `SYNCPATH; - if (ENA) (posedge CLK => (Q : SCLR)) = `SYNCPATH; - if (ENA) (posedge CLK => (Q : SLOAD)) = `SYNCPATH; - if (ENA) (posedge CLK => (Q : SDATA)) = `SYNCPATH; + if (ENA && ACLR !== 1'b0 && !SCLR && !SLOAD) (posedge CLK => (Q : DATAIN)) = `SYNCPATH; + if (ENA && SCLR) (posedge CLK => (Q : 1'b0)) = `SYNCPATH; + if (ENA && !SCLR && SLOAD) (posedge CLK => (Q : SDATA)) = `SYNCPATH; $setup(DATAIN, posedge CLK, `SYNCSETUP); $setup(ENA, posedge CLK, `SYNCSETUP); @@ -90,7 +89,7 @@ specify $setup(SLOAD, posedge CLK, `SYNCSETUP); $setup(SDATA, posedge CLK, `SYNCSETUP); - if (!ACLR) (ACLR => Q) = `COMBPATH; + if (ACLR === 1'b0) (ACLR => Q) = `COMBPATH; endspecify initial begin diff --git a/tests/arch/intel_alm/fsm.ys b/tests/arch/intel_alm/fsm.ys index 20321c62f..02e4a9789 100644 --- a/tests/arch/intel_alm/fsm.ys +++ b/tests/arch/intel_alm/fsm.ys @@ -13,7 +13,8 @@ cd fsm # Constrain all select calls below inside the top module select -assert-count 6 t:MISTRAL_FF select -assert-max 2 t:MISTRAL_ALUT2 # Clang returns 2, GCC returns 1 +select -assert-count 1 t:MISTRAL_ALUT3 select -assert-max 1 t:MISTRAL_ALUT4 # Clang returns 0, GCC returns 1 select -assert-max 5 t:MISTRAL_ALUT5 # Clang returns 5, GCC returns 4 select -assert-max 2 t:MISTRAL_ALUT6 # Clang returns 1, GCC returns 2 -select -assert-none t:MISTRAL_FF t:MISTRAL_ALUT2 t:MISTRAL_ALUT4 t:MISTRAL_ALUT5 t:MISTRAL_ALUT6 %% t:* %D +select -assert-none t:MISTRAL_FF t:MISTRAL_ALUT2 t:MISTRAL_ALUT3 t:MISTRAL_ALUT4 t:MISTRAL_ALUT5 t:MISTRAL_ALUT6 %% t:* %D