mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-28 19:35:53 +00:00
before some refactoring
This commit is contained in:
parent
42c5007cf6
commit
7a8efe9f1b
5 changed files with 16 additions and 150 deletions
|
@ -1,8 +1,12 @@
|
|||
`ifdef cycloneiv
|
||||
`define LCELL cycloneiv_lcell_comb
|
||||
`define MAC cycloneiv_mac
|
||||
`define MLAB cycloneiv_mlab_cell
|
||||
`ifdef cycloneiv
|
||||
`define LCELL cycloneiv_lcell_comb
|
||||
`define M9K cycloneiv_ram_block
|
||||
`endif
|
||||
`ifdef cycloneive
|
||||
`define LCELL cycloneive_lcell_comb
|
||||
`define M9K cycloneive_ram_block
|
||||
`endif
|
||||
|
||||
|
||||
module __MISTRAL_VCC(output Q);
|
||||
|
||||
|
@ -53,62 +57,24 @@ endmodule
|
|||
|
||||
module MISTRAL_NOT(input A, output Q);
|
||||
|
||||
NOT _TECHMAP_REPLACE_ (.IN(A), .OUT(Q));
|
||||
|
||||
//NOT _TECHMAP_REPLACE_ (.IN(A), .OUT(Q));
|
||||
assign Q = ~A;
|
||||
endmodule
|
||||
|
||||
|
||||
module MISTRAL_ALUT_ARITH(input A, B, C, D, CI, output SO, CO);
|
||||
parameter LUT = 16'h0000;
|
||||
parameter sum_lutc_input = "datac";
|
||||
`LCELL #(.lut_mask({LUT}),.sum_lutc_input(sum_lutc_input)) _TECHMAP_REPLACE_ (.dataa(A), .datab(B), .datac(C), .datad(D), .cin(CI), .sumout(SO), .cout(CO));
|
||||
`LCELL #(.lut_mask({LUT}),.sum_lutc_input(sum_lutc_input)) _TECHMAP_REPLACE_ (.dataa(A), .datab(B), .datac(C), .datad(D), .cin(CI), .combout(SO), .cout(CO));
|
||||
|
||||
endmodule
|
||||
|
||||
|
||||
module MISTRAL_MLAB(input [4:0] A1ADDR, input A1DATA, A1EN, CLK1, input [4:0] B1ADDR, output B1DATA);
|
||||
|
||||
parameter _TECHMAP_CELLNAME_ = "";
|
||||
|
||||
// Here we get to an unfortunate situation. The cell has a mem_init0 parameter,
|
||||
// which takes in a hexadecimal string that could be used to initialise RAM.
|
||||
// In the vendor simulation models, this appears to work fine, but Quartus,
|
||||
// either intentionally or not, forgets about this parameter and initialises the
|
||||
// RAM to zero.
|
||||
//
|
||||
// Because of this, RAM initialisation is presently disabled, but the source
|
||||
// used to generate mem_init0 is kept (commented out) in case this gets fixed
|
||||
// or an undocumented way to get Quartus to initialise from mem_init0 is found.
|
||||
|
||||
`MLAB #(
|
||||
.logical_ram_name(_TECHMAP_CELLNAME_),
|
||||
.logical_ram_depth(32),
|
||||
.logical_ram_width(1),
|
||||
.mixed_port_feed_through_mode("Dont Care"),
|
||||
.first_bit_number(0),
|
||||
.first_address(0),
|
||||
.last_address(31),
|
||||
.address_width(5),
|
||||
.data_width(1),
|
||||
.byte_enable_mask_width(1),
|
||||
.port_b_data_out_clock("NONE"),
|
||||
// .mem_init0($sformatf("%08x", INIT))
|
||||
) _TECHMAP_REPLACE_ (
|
||||
.portaaddr(A1ADDR),
|
||||
.portadatain(A1DATA),
|
||||
.portbaddr(B1ADDR),
|
||||
.portbdataout(B1DATA),
|
||||
.ena0(A1EN),
|
||||
.clk0(CLK1)
|
||||
);
|
||||
|
||||
endmodule
|
||||
|
||||
|
||||
module MISTRAL_M9K(A1ADDR, A1DATA, A1EN, CLK1, B1ADDR, B1DATA, B1EN);
|
||||
|
||||
parameter CFG_ABITS = 10;
|
||||
parameter CFG_DBITS = 10;
|
||||
parameter CFG_ABITS = 9;
|
||||
parameter CFG_DBITS = 9;
|
||||
|
||||
parameter _TECHMAP_CELLNAME_ = "";
|
||||
|
||||
|
@ -117,10 +83,10 @@ input [CFG_DBITS-1:0] A1DATA;
|
|||
input CLK1, A1EN, B1EN;
|
||||
output [CFG_DBITS-1:0] B1DATA;
|
||||
|
||||
// Much like the MLAB, the M9K has mem_init[01234] parameters which would let
|
||||
// The M9K has mem_init[01234] parameters which would let
|
||||
// you initialise the RAM cell via hex literals. If they were implemented.
|
||||
|
||||
cycloneiv_ram_block #(
|
||||
`M9K #(
|
||||
.operation_mode("dual_port"),
|
||||
.logical_ram_name(_TECHMAP_CELLNAME_),
|
||||
.port_a_address_width(CFG_ABITS),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue