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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [orpsocv2/] [rtl/] [verilog/] [or1200/] [or1200_dc_tag.v] - Blame information for rev 483

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 350 julius
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  OR1200's DC TAG RAMs                                        ////
4
////                                                              ////
5
////  This file is part of the OpenRISC 1200 project              ////
6
////  http://opencores.org/project,or1k                           ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Instatiation of data cache tag rams.                        ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////   - make it smaller and faster                               ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Damjan Lampret, lampret@opencores.org                 ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE.  See the GNU Lesser General Public License for more ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// $Log: or1200_dc_tag.v,v $
45
// Revision 2.0  2010/06/30 11:00:00  ORSoC
46
// Minor update: 
47
// Coding style changed.
48
//
49
 
50
// synopsys translate_off
51
`include "timescale.v"
52
// synopsys translate_on
53
`include "or1200_defines.v"
54
 
55
module or1200_dc_tag(
56
        // Clock and reset
57
        clk, rst,
58
 
59
`ifdef OR1200_BIST
60
        // RAM BIST
61
        mbist_si_i, mbist_so_o, mbist_ctrl_i,
62
`endif
63
 
64 483 julius
`ifdef OR1200_RAM_PARITY
65
        // Parity error indicator
66
        p_err,
67
`endif
68
 
69 350 julius
        // Internal i/f
70
        addr, en, we, datain, tag_v, tag, dirty
71
);
72
 
73
parameter dw = `OR1200_DCTAG_W+1;
74
parameter aw = `OR1200_DCTAG;
75
 
76
//
77
// I/O
78
//
79
input                           clk;
80
input                           rst;
81
input   [aw-1:0]         addr;
82
input                           en;
83
input                           we;
84
input   [dw-1:0]         datain;
85
output                          tag_v;
86
output  [dw-3:0]         tag;
87
output                          dirty;
88
 
89
 
90
`ifdef OR1200_BIST
91
//
92
// RAM BIST
93
//
94
input mbist_si_i;
95
input [`OR1200_MBIST_CTRL_WIDTH - 1:0] mbist_ctrl_i;
96
output mbist_so_o;
97
`endif
98 483 julius
`ifdef OR1200_RAM_PARITY
99
parameter tag_ram_extra_width = 24 - (`OR1200_DCTAG_W+1);
100
output                          p_err;
101
wire [24-3:0]            tag_wire;
102
`else
103
wire [dw-3:0]            tag_wire;
104
`endif
105 350 julius
 
106
`ifdef OR1200_NO_DC
107
 
108
//
109
// Data cache not implemented
110
//
111
assign tag = {dw-1{1'b0}};
112
assign tag_v = 1'b0;
113
`ifdef OR1200_BIST
114
assign mbist_so_o = mbist_si_i;
115
`endif
116
 
117 483 julius
`ifdef OR1200_RAM_PARITY
118
assign p_err = 0;
119
`endif
120
 
121 350 julius
`else
122
 
123 483 julius
assign tag = tag_wire[dw-3:0];
124
 
125 350 julius
//
126
// Instantiation of TAG RAM block
127
//
128 476 julius
// Data widths are tag width plus one for valid
129 350 julius
   or1200_spram #
130
     (
131 477 julius
      .aw(`OR1200_DCTAG),
132 483 julius
 `ifdef OR1200_RAM_PARITY
133
      .dw(24)
134
 `else
135 476 julius
      .dw(`OR1200_DCTAG_W + 1)
136 483 julius
 `endif
137 350 julius
      )
138
   dc_tag0
139
     (
140
`ifdef OR1200_BIST
141
      // RAM BIST
142
      .mbist_si_i(mbist_si_i),
143
      .mbist_so_o(mbist_so_o),
144
      .mbist_ctrl_i(mbist_ctrl_i),
145
`endif
146
      .clk(clk),
147 483 julius
      .rst(rst),
148 350 julius
      .ce(en),
149
      .we(we),
150
      .addr(addr),
151 483 julius
`ifdef OR1200_RAM_PARITY
152
      .p_err(p_err),
153
      .di({{tag_ram_extra_width{1'b0}},datain}),
154
`else
155 350 julius
      .di(datain),
156 482 julius
`endif
157 483 julius
      .doq({tag_wire, tag_v, dirty})
158 350 julius
      );
159
`endif
160
 
161
endmodule // or1200_dc_tag

powered by: WebSVN 2.1.0

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