-
Notifications
You must be signed in to change notification settings - Fork 6
/
dualmem_widen.sv
77 lines (65 loc) · 2.39 KB
/
dualmem_widen.sv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
module dualmem_widen(clka, clkb, dina, dinb, addra, addrb, wea, web, douta, doutb, ena, enb);
input wire clka, clkb;
input [15:0] dina;
input [63:0] dinb;
input [10:0] addra;
input [8:0] addrb;
input [1:0] wea;
input [1:0] web;
input [0:0] ena, enb;
output [15:0] douta;
output [63:0] doutb;
genvar r;
wire [47:0] dout;
/*
`ifndef verilator
`define RAMB16
`endif
*/
`ifdef GENESYSII
`define RAMB16
`endif
`ifdef RAMB16
generate for (r = 0; r < 2; r=r+1)
RAMB16_S9_S36
RAMB16_S9_S36_inst
(
.CLKA ( clka ), // Port A Clock
.DOA ( douta[r*8 +: 8] ), // Port A 1-bit Data Output
.DOPA ( ),
.ADDRA ( addra ), // Port A 14-bit Address Input
.DIA ( dina[r*8 +: 8] ), // Port A 1-bit Data Input
.DIPA ( 1'b0 ),
.ENA ( ena ), // Port A RAM Enable Input
.SSRA ( 1'b0 ), // Port A Synchronous Set/Reset Input
.WEA ( wea[r] ), // Port A Write Enable Input
.CLKB ( clkb ), // Port B Clock
.DOB ( doutb[r*32 +: 32] ), // Port B 1-bit Data Output
.DOPB ( ),
.ADDRB ( addrb ), // Port B 14-bit Address Input
.DIB ( dinb[r*32 +: 32] ), // Port B 1-bit Data Input
.DIPB ( 4'b0 ),
.ENB ( enb ), // Port B RAM Enable Input
.SSRB ( 1'b0 ), // Port B Synchronous Set/Reset Input
.WEB ( web[r] ) // Port B Write Enable Input
);
endgenerate
`else // !`ifdef RAMB16
// This bit is a placeholder
infer_dpram #(.RAM_SIZE(11), .BYTE_WIDTH(8)) ram1 // RAM_SIZE is in words
(
.ram_clk_a(clka),
.ram_en_a(|ena),
.ram_we_a({wea[1],wea[1],wea[1],wea[1],wea[0],wea[0],wea[0],wea[0]}),
.ram_addr_a(addra),
.ram_wrdata_a({dina,dina,dina,dina}),
.ram_rddata_a({dout,douta}),
.ram_clk_b(clkb),
.ram_en_b(|enb),
.ram_we_b({web[1],web[1],web[1],web[1],web[0],web[0],web[0],web[0]}),
.ram_addr_b({2'b0,addrb}),
.ram_wrdata_b(dinb),
.ram_rddata_b(doutb)
);
`endif
endmodule // dualmem