mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-05 10:50:25 +00:00
synth_intel_alm: alternative synthesis for Intel FPGAs
By operating at a layer of abstraction over the rather clumsy Intel primitives, we can avoid special hacks like `dffinit -highlow` in favour of simple techmapping. This also makes the primitives much easier to manipulate, and more descriptive (no more cyclonev_lcell_comb to mean anything from a LUT2 to a LUT6).
This commit is contained in:
parent
4c52691a58
commit
2e37e62e6b
29 changed files with 1662 additions and 1 deletions
48
techlibs/intel_alm/common/dff_sim.v
Normal file
48
techlibs/intel_alm/common/dff_sim.v
Normal file
|
@ -0,0 +1,48 @@
|
|||
// DATAIN: synchronous data input
|
||||
// CLK: clock input (positive edge)
|
||||
// ACLR: asynchronous clear (negative-true)
|
||||
// ENA: clock-enable
|
||||
// SCLR: synchronous clear
|
||||
// SLOAD: synchronous load
|
||||
// SDATA: synchronous load data
|
||||
//
|
||||
// Q: data output
|
||||
//
|
||||
// Note: the DFFEAS primitive is mostly emulated; it does not reflect what the hardware implements.
|
||||
module MISTRAL_FF(
|
||||
input DATAIN, CLK, ACLR, ENA, SCLR, SLOAD, SDATA,
|
||||
output reg Q
|
||||
);
|
||||
|
||||
`ifdef cyclonev
|
||||
specify
|
||||
(posedge CLK => (Q : DATAIN)) = 262;
|
||||
$setup(DATAIN, posedge CLK, 522);
|
||||
endspecify
|
||||
`endif
|
||||
`ifdef cyclone10gx
|
||||
specify
|
||||
(posedge CLK => (Q : DATAIN)) = 219;
|
||||
$setup(DATAIN, posedge CLK, 268);
|
||||
endspecify
|
||||
`endif
|
||||
|
||||
initial begin
|
||||
// Altera flops initialise to zero.
|
||||
Q = 0;
|
||||
end
|
||||
|
||||
always @(posedge CLK, negedge ACLR) begin
|
||||
// Asynchronous clear
|
||||
if (!ACLR) Q <= 0;
|
||||
// Clock-enable
|
||||
else if (ENA) begin
|
||||
// Synchronous clear
|
||||
if (SCLR) Q <= 0;
|
||||
// Synchronous load
|
||||
else if (SLOAD) Q <= SDATA;
|
||||
else Q <= DATAIN;
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue