1 |
28 |
robfinch |
// ============================================================================
|
2 |
|
|
// __
|
3 |
|
|
// \\__/ o\ (C) 2023 Robert Finch, Waterloo
|
4 |
|
|
// \ __ / All rights reserved.
|
5 |
|
|
// \/_// robfinch@finitron.ca
|
6 |
|
|
// ||
|
7 |
|
|
//
|
8 |
|
|
//
|
9 |
|
|
// fb_palram.sv
|
10 |
|
|
// - Palette RAM for frame buffer
|
11 |
|
|
//
|
12 |
|
|
// BSD 3-Clause License
|
13 |
|
|
// Redistribution and use in source and binary forms, with or without
|
14 |
|
|
// modification, are permitted provided that the following conditions are met:
|
15 |
|
|
//
|
16 |
|
|
// 1. Redistributions of source code must retain the above copyright notice, this
|
17 |
|
|
// list of conditions and the following disclaimer.
|
18 |
|
|
//
|
19 |
|
|
// 2. Redistributions in binary form must reproduce the above copyright notice,
|
20 |
|
|
// this list of conditions and the following disclaimer in the documentation
|
21 |
|
|
// and/or other materials provided with the distribution.
|
22 |
|
|
//
|
23 |
|
|
// 3. Neither the name of the copyright holder nor the names of its
|
24 |
|
|
// contributors may be used to endorse or promote products derived from
|
25 |
|
|
// this software without specific prior written permission.
|
26 |
|
|
//
|
27 |
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
28 |
|
|
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
29 |
|
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
30 |
|
|
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
31 |
|
|
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
32 |
|
|
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
33 |
|
|
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
34 |
|
|
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
35 |
|
|
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
36 |
|
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
37 |
|
|
//
|
38 |
|
|
// ============================================================================
|
39 |
|
|
|
40 |
|
|
module fb_palram(clka, ena, wea, addra, dina, douta, clkb, enb, web, addrb, dinb, doutb);
|
41 |
|
|
parameter XILINX = 1;
|
42 |
|
|
input clka;
|
43 |
|
|
input ena;
|
44 |
|
|
input [7:0] wea;
|
45 |
|
|
input [12:0] addra;
|
46 |
|
|
input [63:0] dina;
|
47 |
|
|
output [63:0] douta;
|
48 |
|
|
input clkb;
|
49 |
|
|
input enb;
|
50 |
|
|
input web;
|
51 |
|
|
input [12:0] addrb;
|
52 |
|
|
input [31:0] dinb;
|
53 |
|
|
output [31:0] doutb;
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
generate begin : gPalram
|
57 |
|
|
if (XILINX)
|
58 |
|
|
// xpm_memory_tdpram: True Dual Port RAM
|
59 |
|
|
// Xilinx Parameterized Macro, version 2022.2
|
60 |
|
|
|
61 |
|
|
xpm_memory_tdpram #(
|
62 |
|
|
.ADDR_WIDTH_A(10), // DECIMAL
|
63 |
|
|
.ADDR_WIDTH_B(11), // DECIMAL
|
64 |
|
|
.AUTO_SLEEP_TIME(0), // DECIMAL
|
65 |
|
|
.BYTE_WRITE_WIDTH_A(8), // DECIMAL
|
66 |
|
|
.BYTE_WRITE_WIDTH_B(32), // DECIMAL
|
67 |
|
|
.CASCADE_HEIGHT(0), // DECIMAL
|
68 |
|
|
.CLOCKING_MODE("independent_clock"), // String
|
69 |
|
|
.ECC_MODE("no_ecc"), // String
|
70 |
|
|
.MEMORY_INIT_FILE("none"), // String
|
71 |
|
|
.MEMORY_INIT_PARAM("0"), // String
|
72 |
|
|
.MEMORY_OPTIMIZATION("true"), // String
|
73 |
|
|
.MEMORY_PRIMITIVE("auto"), // String
|
74 |
|
|
.MEMORY_SIZE(1024*64), // DECIMAL
|
75 |
|
|
.MESSAGE_CONTROL(0), // DECIMAL
|
76 |
|
|
.READ_DATA_WIDTH_A(64), // DECIMAL
|
77 |
|
|
.READ_DATA_WIDTH_B(32), // DECIMAL
|
78 |
|
|
.READ_LATENCY_A(2), // DECIMAL
|
79 |
|
|
.READ_LATENCY_B(2), // DECIMAL
|
80 |
|
|
.READ_RESET_VALUE_A("0"), // String
|
81 |
|
|
.READ_RESET_VALUE_B("0"), // String
|
82 |
|
|
.RST_MODE_A("SYNC"), // String
|
83 |
|
|
.RST_MODE_B("SYNC"), // String
|
84 |
|
|
.SIM_ASSERT_CHK(0), // DECIMAL; 0=disable simulation messages, 1=enable simulation messages
|
85 |
|
|
.USE_EMBEDDED_CONSTRAINT(0), // DECIMAL
|
86 |
|
|
.USE_MEM_INIT(1), // DECIMAL
|
87 |
|
|
.USE_MEM_INIT_MMI(0), // DECIMAL
|
88 |
|
|
.WAKEUP_TIME("disable_sleep"), // String
|
89 |
|
|
.WRITE_DATA_WIDTH_A(64), // DECIMAL
|
90 |
|
|
.WRITE_DATA_WIDTH_B(32), // DECIMAL
|
91 |
|
|
.WRITE_MODE_A("no_change"), // String
|
92 |
|
|
.WRITE_MODE_B("no_change"), // String
|
93 |
|
|
.WRITE_PROTECT(1) // DECIMAL
|
94 |
|
|
)
|
95 |
|
|
xpm_memory_tdpram_inst (
|
96 |
|
|
.dbiterra(), // 1-bit output: Status signal to indicate double bit error occurrence
|
97 |
|
|
// on the data output of port A.
|
98 |
|
|
|
99 |
|
|
.dbiterrb(), // 1-bit output: Status signal to indicate double bit error occurrence
|
100 |
|
|
// on the data output of port A.
|
101 |
|
|
|
102 |
|
|
.douta(douta), // READ_DATA_WIDTH_A-bit output: Data output for port A read operations.
|
103 |
|
|
.doutb(doutb), // READ_DATA_WIDTH_B-bit output: Data output for port B read operations.
|
104 |
|
|
.sbiterra(), // 1-bit output: Status signal to indicate single bit error occurrence
|
105 |
|
|
// on the data output of port A.
|
106 |
|
|
|
107 |
|
|
.sbiterrb(), // 1-bit output: Status signal to indicate single bit error occurrence
|
108 |
|
|
// on the data output of port B.
|
109 |
|
|
|
110 |
|
|
.addra(addra[12:3]), // ADDR_WIDTH_A-bit input: Address for port A write and read operations.
|
111 |
|
|
.addrb(addrb[12:2]), // ADDR_WIDTH_B-bit input: Address for port B write and read operations.
|
112 |
|
|
.clka(clka), // 1-bit input: Clock signal for port A. Also clocks port B when
|
113 |
|
|
// parameter CLOCKING_MODE is "common_clock".
|
114 |
|
|
|
115 |
|
|
.clkb(clkb), // 1-bit input: Clock signal for port B when parameter CLOCKING_MODE is
|
116 |
|
|
// "independent_clock". Unused when parameter CLOCKING_MODE is
|
117 |
|
|
// "common_clock".
|
118 |
|
|
|
119 |
|
|
.dina(dina), // WRITE_DATA_WIDTH_A-bit input: Data input for port A write operations.
|
120 |
|
|
.dinb(dinb), // WRITE_DATA_WIDTH_B-bit input: Data input for port B write operations.
|
121 |
|
|
.ena(ena), // 1-bit input: Memory enable signal for port A. Must be high on clock
|
122 |
|
|
// cycles when read or write operations are initiated. Pipelined
|
123 |
|
|
// internally.
|
124 |
|
|
|
125 |
|
|
.enb(enb), // 1-bit input: Memory enable signal for port B. Must be high on clock
|
126 |
|
|
// cycles when read or write operations are initiated. Pipelined
|
127 |
|
|
// internally.
|
128 |
|
|
|
129 |
|
|
.injectdbiterra(1'b0), // 1-bit input: Controls double bit error injection on input data when
|
130 |
|
|
// ECC enabled (Error injection capability is not available in
|
131 |
|
|
// "decode_only" mode).
|
132 |
|
|
|
133 |
|
|
.injectdbiterrb(1'b0), // 1-bit input: Controls double bit error injection on input data when
|
134 |
|
|
// ECC enabled (Error injection capability is not available in
|
135 |
|
|
// "decode_only" mode).
|
136 |
|
|
|
137 |
|
|
.injectsbiterra(1'b0), // 1-bit input: Controls single bit error injection on input data when
|
138 |
|
|
// ECC enabled (Error injection capability is not available in
|
139 |
|
|
// "decode_only" mode).
|
140 |
|
|
|
141 |
|
|
.injectsbiterrb(1'b0), // 1-bit input: Controls single bit error injection on input data when
|
142 |
|
|
// ECC enabled (Error injection capability is not available in
|
143 |
|
|
// "decode_only" mode).
|
144 |
|
|
|
145 |
|
|
.regcea(1'b1), // 1-bit input: Clock Enable for the last register stage on the output
|
146 |
|
|
// data path.
|
147 |
|
|
|
148 |
|
|
.regceb(1'b1), // 1-bit input: Clock Enable for the last register stage on the output
|
149 |
|
|
// data path.
|
150 |
|
|
|
151 |
|
|
.rsta(1'b0), // 1-bit input: Reset signal for the final port A output register stage.
|
152 |
|
|
// Synchronously resets output port douta to the value specified by
|
153 |
|
|
// parameter READ_RESET_VALUE_A.
|
154 |
|
|
|
155 |
|
|
.rstb(1'b0), // 1-bit input: Reset signal for the final port B output register stage.
|
156 |
|
|
// Synchronously resets output port doutb to the value specified by
|
157 |
|
|
// parameter READ_RESET_VALUE_B.
|
158 |
|
|
|
159 |
|
|
.sleep(1'b0), // 1-bit input: sleep signal to enable the dynamic power saving feature.
|
160 |
|
|
.wea(wea), // WRITE_DATA_WIDTH_A/BYTE_WRITE_WIDTH_A-bit input: Write enable vector
|
161 |
|
|
// for port A input data port dina. 1 bit wide when word-wide writes are
|
162 |
|
|
// used. In byte-wide write configurations, each bit controls the
|
163 |
|
|
// writing one byte of dina to address addra. For example, to
|
164 |
|
|
// synchronously write only bits [15-8] of dina when WRITE_DATA_WIDTH_A
|
165 |
|
|
// is 32, wea would be 4'b0010.
|
166 |
|
|
|
167 |
|
|
.web(web) // WRITE_DATA_WIDTH_B/BYTE_WRITE_WIDTH_B-bit input: Write enable vector
|
168 |
|
|
// for port B input data port dinb. 1 bit wide when word-wide writes are
|
169 |
|
|
// used. In byte-wide write configurations, each bit controls the
|
170 |
|
|
// writing one byte of dinb to address addrb. For example, to
|
171 |
|
|
// synchronously write only bits [15-8] of dinb when WRITE_DATA_WIDTH_B
|
172 |
|
|
// is 32, web would be 4'b0010.
|
173 |
|
|
|
174 |
|
|
);
|
175 |
|
|
|
176 |
|
|
// End of xpm_memory_tdpram_inst instantiation
|
177 |
|
|
end
|
178 |
|
|
endgenerate
|
179 |
|
|
|
180 |
|
|
endmodule
|