diff options
author | Dan Ravensloft <dan.ravensloft@gmail.com> | 2020-05-23 12:52:13 +0100 |
---|---|---|
committer | Marcelina KoĆcielnicka <mwk@0x04.net> | 2020-07-04 19:45:10 +0200 |
commit | 83cde2d02ba06bbd4014858983ac324bf44cb6c6 (patch) | |
tree | b999b0fc1a813b7683d85ba63b0cfd129e1d18b2 /techlibs/intel_alm/common/abc9_model.v | |
parent | a9b61080a409d3ad2c8ff4a9bbef9ba1c9c1d194 (diff) | |
download | yosys-83cde2d02ba06bbd4014858983ac324bf44cb6c6.tar.gz yosys-83cde2d02ba06bbd4014858983ac324bf44cb6c6.tar.bz2 yosys-83cde2d02ba06bbd4014858983ac324bf44cb6c6.zip |
intel_alm: ABC9 sequential optimisations
Diffstat (limited to 'techlibs/intel_alm/common/abc9_model.v')
-rw-r--r-- | techlibs/intel_alm/common/abc9_model.v | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/techlibs/intel_alm/common/abc9_model.v b/techlibs/intel_alm/common/abc9_model.v new file mode 100644 index 000000000..dd46147a5 --- /dev/null +++ b/techlibs/intel_alm/common/abc9_model.v @@ -0,0 +1,55 @@ +`ifdef cyclonev +`define SYNCPATH 262 +`define SYNCSETUP 522 +`define COMBPATH 0 +`endif +`ifdef cyclone10gx +`define SYNCPATH 219 +`define SYNCSETUP 268 +`define COMBPATH 0 +`endif + +// fallback for when a family isn't detected (e.g. when techmapping for equivalence) +`ifndef SYNCPATH +`define SYNCPATH 0 +`define SYNCSETUP 0 +`define COMBPATH 0 +`endif + +// This is a purely-synchronous flop, that ABC9 can use for sequential synthesis. +(* abc9_flop, lib_whitebox *) +module MISTRAL_FF_SYNCONLY( + input DATAIN, CLK, ENA, SCLR, SLOAD, SDATA, + output reg Q +); + +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; + + $setup(DATAIN, posedge CLK, `SYNCSETUP); + $setup(ENA, posedge CLK, `SYNCSETUP); + $setup(SCLR, posedge CLK, `SYNCSETUP); + $setup(SLOAD, posedge CLK, `SYNCSETUP); + $setup(SDATA, posedge CLK, `SYNCSETUP); +endspecify + +initial begin + // Altera flops initialise to zero. + Q = 0; +end + +always @(posedge CLK) begin + // Clock-enable + if (ENA) begin + // Synchronous clear + if (SCLR) Q <= 0; + // Synchronous load + else if (SLOAD) Q <= SDATA; + else Q <= DATAIN; + end +end + +endmodule |