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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [orpsocv2/] [rtl/] [verilog/] [or1200/] [or1200_ic_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 IC TAGs                                            ////
4
////                                                              ////
5
////  This file is part of the OpenRISC 1200 project              ////
6
////  http://www.opencores.org/cores/or1k/                        ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Instatiation of instruction 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
// CVS Revision History
45
//
46
// $Log: or1200_ic_tag.v,v $
47
// Revision 2.0  2010/06/30 11:00:00  ORSoC
48
// Minor update: 
49
// Coding style changed.
50
//
51
 
52
// synopsys translate_off
53
`include "timescale.v"
54
// synopsys translate_on
55
`include "or1200_defines.v"
56
 
57
module or1200_ic_tag(
58
        // Clock and reset
59
        clk, rst,
60
 
61
`ifdef OR1200_BIST
62
        // RAM BIST
63
        mbist_si_i, mbist_so_o, mbist_ctrl_i,
64
`endif
65
 
66 483 julius
`ifdef OR1200_RAM_PARITY
67
        // Parity error indicator
68
        p_err,
69
`endif
70
 
71 350 julius
        // Internal i/f
72
        addr, en, we, datain, tag_v, tag
73
);
74
 
75
parameter dw = `OR1200_ICTAG_W;
76
parameter aw = `OR1200_ICTAG;
77
 
78
//
79
// I/O
80
//
81
 
82
//
83
// Clock and reset
84
//
85
input                           clk;
86
input                           rst;
87
 
88
`ifdef OR1200_BIST
89
//
90
// RAM BIST
91
//
92
input mbist_si_i;
93
input [`OR1200_MBIST_CTRL_WIDTH - 1:0] mbist_ctrl_i;
94
output mbist_so_o;
95
`endif
96
 
97 483 julius
`ifdef OR1200_RAM_PARITY
98
parameter tag_ram_extra_width = 24 - `OR1200_ICTAG_W;
99
output                          p_err;
100
wire [24-2:0]            tag_wire;
101
`else
102
wire [dw-2:0]            tag_wire;
103
`endif
104
 
105
 
106 350 julius
//
107
// Internal i/f
108
//
109
input   [aw-1:0]         addr;
110
input                           en;
111
input                           we;
112
input   [dw-1:0]         datain;
113
output                          tag_v;
114 483 julius
output  [dw-2:0]         tag;
115 350 julius
 
116 483 julius
 
117 350 julius
`ifdef OR1200_NO_IC
118
 
119
//
120
// Insn cache not implemented
121
//
122
assign tag = {dw-1{1'b0}};
123
assign tag_v = 1'b0;
124
`ifdef OR1200_BIST
125
assign mbist_so_o = mbist_si_i;
126
`endif
127 483 julius
`ifdef OR1200_RAM_PARITY
128
assign p_err = 0;
129
`endif
130
 
131 350 julius
 
132
`else
133
 
134 483 julius
assign tag = tag_wire[dw-2:0];
135
 
136 350 julius
//
137
// Instantiation of TAG RAM block
138
//
139
   or1200_spram #
140
     (
141 477 julius
      .aw(`OR1200_ICTAG),
142 483 julius
 `ifdef OR1200_RAM_PARITY
143
      .dw(24)
144
 `else
145 477 julius
      .dw(`OR1200_ICTAG_W)
146 483 julius
 `endif
147 350 julius
      )
148
   ic_tag0
149
     (
150
`ifdef OR1200_BIST
151
      // RAM BIST
152
      .mbist_si_i(mbist_si_i),
153
      .mbist_so_o(mbist_so_o),
154
      .mbist_ctrl_i(mbist_ctrl_i),
155
`endif
156
      .clk(clk),
157 483 julius
      .rst(rst),
158 350 julius
      .ce(en),
159
      .we(we),
160
      //.oe(1'b1),
161
      .addr(addr),
162 483 julius
`ifdef OR1200_RAM_PARITY
163
      .p_err(p_err),
164
      .di({{tag_ram_extra_width{1'b0}},datain}),
165
`else
166 350 julius
      .di(datain),
167 482 julius
`endif
168 483 julius
      .doq({tag_wire, tag_v})
169 350 julius
      );
170
`endif
171
 
172
endmodule

powered by: WebSVN 2.1.0

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