OpenCores
URL https://opencores.org/ocsvn/or1200_hp/or1200_hp/trunk

Subversion Repositories or1200_hp

[/] [or1200_hp/] [trunk/] [rtl/] [rtl_cm2/] [verilog/] [or1200_dc_ram.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tobil
 
2
//////////////////////////////////////////////////////////////////////
3
////                                                              ////
4
////  OR1200's DC RAMs                                            ////
5
////                                                              ////
6
////  This file is part of the OpenRISC 1200 project              ////
7
////  http://www.opencores.org/cores/or1k/                        ////
8
////                                                              ////
9
////  Description                                                 ////
10
////  Instatiation of DC RAM blocks.                              ////
11
////                                                              ////
12
////  To Do:                                                      ////
13
////   - make it smaller and faster                               ////
14
////                                                              ////
15
////  Author(s):                                                  ////
16
////      - Damjan Lampret, lampret@opencores.org                 ////
17
////                                                              ////
18
//////////////////////////////////////////////////////////////////////
19
////                                                              ////
20
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
21
////                                                              ////
22
//// This source file may be used and distributed without         ////
23
//// restriction provided that this copyright statement is not    ////
24
//// removed from the file and that any derivative work contains  ////
25
//// the original copyright notice and the associated disclaimer. ////
26
////                                                              ////
27
//// This source file is free software; you can redistribute it   ////
28
//// and/or modify it under the terms of the GNU Lesser General   ////
29
//// Public License as published by the Free Software Foundation; ////
30
//// either version 2.1 of the License, or (at your option) any   ////
31
//// later version.                                               ////
32
////                                                              ////
33
//// This source is distributed in the hope that it will be       ////
34
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
35
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
36
//// PURPOSE.  See the GNU Lesser General Public License for more ////
37
//// details.                                                     ////
38
////                                                              ////
39
//// You should have received a copy of the GNU Lesser General    ////
40
//// Public License along with this source; if not, download it   ////
41
//// from http://www.opencores.org/lgpl.shtml                     ////
42
////                                                              ////
43
//////////////////////////////////////////////////////////////////////
44
//
45
// CVS Revision History
46
//
47
// $Log: not supported by cvs2svn $
48
// Revision 1.5  2004/04/05 08:29:57  lampret
49
// Merged branch_qmem into main tree.
50
//
51
// Revision 1.2.4.2  2003/12/10 15:28:28  simons
52
// Support for ram with byte selects added.
53
//
54
// Revision 1.2.4.1  2003/12/09 11:46:48  simons
55
// Mbist nameing changed, Artisan ram instance signal names fixed, some synthesis waning fixed.
56
//
57
// Revision 1.2  2002/10/17 20:04:40  lampret
58
// Added BIST scan. Special VS RAMs need to be used to implement BIST.
59
//
60
// Revision 1.1  2002/01/03 08:16:15  lampret
61
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
62
//
63
// Revision 1.8  2001/10/21 17:57:16  lampret
64
// Removed params from generic_XX.v. Added translate_off/on in sprs.v and id.v. Removed spr_addr from dc.v and ic.v. Fixed CR+LF.
65
//
66
// Revision 1.7  2001/10/14 13:12:09  lampret
67
// MP3 version.
68
//
69
// Revision 1.1.1.1  2001/10/06 10:18:36  igorm
70
// no message
71
//
72
// Revision 1.2  2001/08/09 13:39:33  lampret
73
// Major clean-up.
74
//
75
// Revision 1.1  2001/07/20 00:46:03  lampret
76
// Development version of RTL. Libraries are missing.
77
//
78
//
79
 
80
// synopsys translate_off
81
`include "timescale.v"
82
// synopsys translate_on
83
`include "or1200_defines.v"
84
 
85
module or1200_dc_ram_cm2(
86
                clk_i_cml_1,
87
                cmls,
88
 
89
        // Reset and clock
90
        clk, rst,
91
 
92
`ifdef OR1200_BIST
93
        // RAM BIST
94
        mbist_si_i, mbist_so_o, mbist_ctrl_i,
95
`endif
96
 
97
        // Internal i/f
98
        addr, en, we, datain, dataout
99
);
100
 
101
 
102
input clk_i_cml_1;
103
input cmls;
104
reg  en_cml_1;
105
 
106
 
107
 
108
parameter dw = `OR1200_OPERAND_WIDTH;
109
parameter aw = `OR1200_DCINDX;
110
 
111
//
112
// I/O
113
//
114
input                           clk;
115
input                           rst;
116
input   [aw-1:0]         addr;
117
input                           en;
118
input   [3:0]                    we;
119
input   [dw-1:0]         datain;
120
output  [dw-1:0]         dataout;
121
 
122
`ifdef OR1200_BIST
123
//
124
// RAM BIST
125
//
126
input                           mbist_si_i;
127
input [`OR1200_MBIST_CTRL_WIDTH - 1:0] mbist_ctrl_i;       // bist chain shift control
128
output                          mbist_so_o;
129
`endif
130
 
131
`ifdef OR1200_NO_DC
132
 
133
//
134
// Data cache not implemented
135
//
136
assign dataout = {dw{1'b0}};
137
`ifdef OR1200_BIST
138
assign mbist_so_o = mbist_si_i;
139
`endif
140
 
141
`else
142
 
143
`ifdef OR1200_RAM_MODELS_VIRTEX
144
 
145
//
146
//      Non-generic FPGA model instantiations
147
//
148
 
149
 
150
wire en_wire;
151
wire [3 : 0] we_wire;
152
wire [10 : 0] addr_wire;
153
wire [31 : 0] datain_wire;
154
 
155
 
156
// SynEDA CoreMultiplier
157
// assignment(s): en_wire
158
// replace(s): en
159
assign en_wire = en_cml_1;
160
assign we_wire = we;
161
assign addr_wire = addr;
162
assign datain_wire = datain;
163
 
164
dc_ram_sub_cm2 dc_ram (
165
                .clk_i_cml_1(clk_i_cml_1),
166
                .cmls(cmls),
167
        .clka(clk),
168
        .ena(en_wire),
169
        .wea(we_wire), // Bus [0 : 0] 
170
        .addra(addr_wire), // Bus [9 : 0] 
171
        .dina(datain_wire), // Bus [31 : 0] 
172
        .clkb(clk),
173
        .addrb(addr_wire),
174
        .doutb(dataout)); // Bus [31 : 0] 
175
 
176
`else
177
 
178
 
179
//
180
// Instantiation of RAM block
181
//
182
`ifdef OR1200_DC_1W_4KB
183
or1200_spram_1024x32_bw dc_ram(
184
`endif
185
`ifdef OR1200_DC_1W_8KB
186
or1200_spram_2048x32_bw dc_ram(
187
`endif
188
`ifdef OR1200_BIST
189
        // RAM BIST
190
        .mbist_si_i(mbist_si_i),
191
        .mbist_so_o(mbist_so_o),
192
        .mbist_ctrl_i(mbist_ctrl_i),
193
`endif
194
        .clk(clk),
195
        .rst(rst),
196
        .ce(en),
197
        .we(we),
198
        .oe(1'b1),
199
        .addr(addr),
200
        .di(datain),
201
        .doq(dataout)
202
);
203
`endif
204
`endif
205
 
206
always @ (posedge clk_i_cml_1) begin
207
en_cml_1 <= en;
208
end
209
endmodule
210
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.