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

Subversion Repositories or1k

[/] [or1k/] [tags/] [rel_16/] [or1200/] [rtl/] [verilog/] [or1200_cfgr.v] - Blame information for rev 562

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 504 lampret
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  OR1200's VR, UPR and Configuration Registers                ////
4
////                                                              ////
5
////  This file is part of the OpenRISC 1200 project              ////
6
////  http://www.opencores.org/cores/or1k/                        ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  According to OR1K architectural and OR1200 specifications.  ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////   - done                                                     ////
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: not supported by cvs2svn $
47 562 lampret
// Revision 1.1  2002/01/03 08:16:15  lampret
48
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
49
//
50 504 lampret
// Revision 1.7  2001/10/21 17:57:16  lampret
51
// 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.
52
//
53
// Revision 1.6  2001/10/14 13:12:09  lampret
54
// MP3 version.
55
//
56
// Revision 1.1.1.1  2001/10/06 10:18:35  igorm
57
// no message
58
//
59
// Revision 1.1  2001/08/09 13:39:33  lampret
60
// Major clean-up.
61
//
62
// Revision 1.1  2001/07/20 00:46:21  lampret
63
// Development version of RTL. Libraries are missing.
64
//
65
//
66
 
67
// synopsys translate_off
68
`include "timescale.v"
69
// synopsys translate_on
70
`include "or1200_defines.v"
71
 
72
module or1200_cfgr(
73
        // RISC Internal Interface
74
        clk, rst, spr_addr, spr_dat_o
75
);
76
 
77
//
78
// RISC Internal Interface
79
//
80
input           clk;            // Clock
81
input           rst;            // Reset
82
input   [31:0]   spr_addr;       // SPR Address
83
output  [31:0]   spr_dat_o;      // SPR Read Data
84
 
85
//
86
// Internal wires & registers
87
//
88
reg     [31:0]   spr_dat_o;      // SPR Read Data
89
 
90
`ifdef OR1200_CFGR_IMPLEMENTED
91
 
92
//
93
// Implementation of VR, UPR and configuration registers
94
//
95
always @(spr_addr)
96
`ifdef OR1200_SYS_FULL_DECODE
97
        if (!spr_addr[31:4])
98
`endif
99 562 lampret
                case(spr_addr[3:0])              // synopsys parallel_case
100 504 lampret
                        `OR1200_SPRGRP_SYS_VR: begin
101
                                spr_dat_o[`OR1200_VR_REV_BITS] = `OR1200_VR_REV;
102
                                spr_dat_o[`OR1200_VR_RES1_BITS] = `OR1200_VR_RES1;
103
                                spr_dat_o[`OR1200_VR_CFG_BITS] = `OR1200_VR_CFG;
104
                                spr_dat_o[`OR1200_VR_VER_BITS] = `OR1200_VR_VER;
105
                        end
106
                        `OR1200_SPRGRP_SYS_UPR: begin
107
                                spr_dat_o[`OR1200_UPR_UP_BITS] = `OR1200_UPR_UP;
108
                                spr_dat_o[`OR1200_UPR_DCP_BITS] = `OR1200_UPR_DCP;
109
                                spr_dat_o[`OR1200_UPR_ICP_BITS] = `OR1200_UPR_ICP;
110
                                spr_dat_o[`OR1200_UPR_DMP_BITS] = `OR1200_UPR_DMP;
111
                                spr_dat_o[`OR1200_UPR_IMP_BITS] = `OR1200_UPR_IMP;
112
                                spr_dat_o[`OR1200_UPR_MP_BITS] = `OR1200_UPR_MP;
113
                                spr_dat_o[`OR1200_UPR_DUP_BITS] = `OR1200_UPR_DUP;
114
                                spr_dat_o[`OR1200_UPR_PCUP_BITS] = `OR1200_UPR_PCUP;
115
                                spr_dat_o[`OR1200_UPR_PMP_BITS] = `OR1200_UPR_PMP;
116
                                spr_dat_o[`OR1200_UPR_PICP_BITS] = `OR1200_UPR_PICP;
117
                                spr_dat_o[`OR1200_UPR_TTP_BITS] = `OR1200_UPR_TTP;
118
                                spr_dat_o[`OR1200_UPR_RES1_BITS] = `OR1200_UPR_RES1;
119
                                spr_dat_o[`OR1200_UPR_CUP_BITS] = `OR1200_UPR_CUP;
120
                        end
121
                        `OR1200_SPRGRP_SYS_CPUCFGR: begin
122
                                spr_dat_o[`OR1200_CPUCFGR_NSGF_BITS] = `OR1200_CPUCFGR_NSGF;
123
                                spr_dat_o[`OR1200_CPUCFGR_HGF_BITS] = `OR1200_CPUCFGR_HGF;
124
                                spr_dat_o[`OR1200_CPUCFGR_OB32S_BITS] = `OR1200_CPUCFGR_OB32S;
125
                                spr_dat_o[`OR1200_CPUCFGR_OB64S_BITS] = `OR1200_CPUCFGR_OB64S;
126
                                spr_dat_o[`OR1200_CPUCFGR_OF32S_BITS] = `OR1200_CPUCFGR_OF32S;
127
                                spr_dat_o[`OR1200_CPUCFGR_OF64S_BITS] = `OR1200_CPUCFGR_OF64S;
128
                                spr_dat_o[`OR1200_CPUCFGR_OV64S_BITS] = `OR1200_CPUCFGR_OV64S;
129
                                spr_dat_o[`OR1200_CPUCFGR_RES1_BITS] = `OR1200_CPUCFGR_RES1;
130
                        end
131
                        `OR1200_SPRGRP_SYS_DMMUCFGR: begin
132
                                spr_dat_o[`OR1200_DMMUCFGR_NTW_BITS] = `OR1200_DMMUCFGR_NTW;
133
                                spr_dat_o[`OR1200_DMMUCFGR_NTS_BITS] = `OR1200_DMMUCFGR_NTS;
134
                                spr_dat_o[`OR1200_DMMUCFGR_NAE_BITS] = `OR1200_DMMUCFGR_NAE;
135
                                spr_dat_o[`OR1200_DMMUCFGR_CRI_BITS] = `OR1200_DMMUCFGR_CRI;
136
                                spr_dat_o[`OR1200_DMMUCFGR_PRI_BITS] = `OR1200_DMMUCFGR_PRI;
137
                                spr_dat_o[`OR1200_DMMUCFGR_TEIRI_BITS] = `OR1200_DMMUCFGR_TEIRI;
138
                                spr_dat_o[`OR1200_DMMUCFGR_HTR_BITS] = `OR1200_DMMUCFGR_HTR;
139
                                spr_dat_o[`OR1200_DMMUCFGR_RES1_BITS] = `OR1200_DMMUCFGR_RES1;
140
                        end
141
                        `OR1200_SPRGRP_SYS_IMMUCFGR: begin
142
                                spr_dat_o[`OR1200_IMMUCFGR_NTW_BITS] = `OR1200_IMMUCFGR_NTW;
143
                                spr_dat_o[`OR1200_IMMUCFGR_NTS_BITS] = `OR1200_IMMUCFGR_NTS;
144
                                spr_dat_o[`OR1200_IMMUCFGR_NAE_BITS] = `OR1200_IMMUCFGR_NAE;
145
                                spr_dat_o[`OR1200_IMMUCFGR_CRI_BITS] = `OR1200_IMMUCFGR_CRI;
146
                                spr_dat_o[`OR1200_IMMUCFGR_PRI_BITS] = `OR1200_IMMUCFGR_PRI;
147
                                spr_dat_o[`OR1200_IMMUCFGR_TEIRI_BITS] = `OR1200_IMMUCFGR_TEIRI;
148
                                spr_dat_o[`OR1200_IMMUCFGR_HTR_BITS] = `OR1200_IMMUCFGR_HTR;
149
                                spr_dat_o[`OR1200_IMMUCFGR_RES1_BITS] = `OR1200_IMMUCFGR_RES1;
150
                        end
151
                        `OR1200_SPRGRP_SYS_DCCFGR: begin
152
                                spr_dat_o[`OR1200_DCCFGR_NCW_BITS] = `OR1200_DCCFGR_NCW;
153
                                spr_dat_o[`OR1200_DCCFGR_NCS_BITS] = `OR1200_DCCFGR_NCS;
154
                                spr_dat_o[`OR1200_DCCFGR_CBS_BITS] = `OR1200_DCCFGR_CBS;
155
                                spr_dat_o[`OR1200_DCCFGR_CWS_BITS] = `OR1200_DCCFGR_CWS;
156
                                spr_dat_o[`OR1200_DCCFGR_CCRI_BITS] = `OR1200_DCCFGR_CCRI;
157
                                spr_dat_o[`OR1200_DCCFGR_CBIRI_BITS] = `OR1200_DCCFGR_CBIRI;
158
                                spr_dat_o[`OR1200_DCCFGR_CBPRI_BITS] = `OR1200_DCCFGR_CBPRI;
159
                                spr_dat_o[`OR1200_DCCFGR_CBLRI_BITS] = `OR1200_DCCFGR_CBLRI;
160
                                spr_dat_o[`OR1200_DCCFGR_CBFRI_BITS] = `OR1200_DCCFGR_CBFRI;
161
                                spr_dat_o[`OR1200_DCCFGR_CBWBRI_BITS] = `OR1200_DCCFGR_CBWBRI;
162
                                spr_dat_o[`OR1200_DCCFGR_RES1_BITS] = `OR1200_DCCFGR_RES1;
163
                        end
164
                        `OR1200_SPRGRP_SYS_ICCFGR: begin
165
                                spr_dat_o[`OR1200_ICCFGR_NCW_BITS] = `OR1200_ICCFGR_NCW;
166
                                spr_dat_o[`OR1200_ICCFGR_NCS_BITS] = `OR1200_ICCFGR_NCS;
167
                                spr_dat_o[`OR1200_ICCFGR_CBS_BITS] = `OR1200_ICCFGR_CBS;
168
                                spr_dat_o[`OR1200_ICCFGR_CWS_BITS] = `OR1200_ICCFGR_CWS;
169
                                spr_dat_o[`OR1200_ICCFGR_CCRI_BITS] = `OR1200_ICCFGR_CCRI;
170
                                spr_dat_o[`OR1200_ICCFGR_CBIRI_BITS] = `OR1200_ICCFGR_CBIRI;
171
                                spr_dat_o[`OR1200_ICCFGR_CBPRI_BITS] = `OR1200_ICCFGR_CBPRI;
172
                                spr_dat_o[`OR1200_ICCFGR_CBLRI_BITS] = `OR1200_ICCFGR_CBLRI;
173
                                spr_dat_o[`OR1200_ICCFGR_CBFRI_BITS] = `OR1200_ICCFGR_CBFRI;
174
                                spr_dat_o[`OR1200_ICCFGR_CBWBRI_BITS] = `OR1200_ICCFGR_CBWBRI;
175
                                spr_dat_o[`OR1200_ICCFGR_RES1_BITS] = `OR1200_ICCFGR_RES1;
176
                        end
177
                        `OR1200_SPRGRP_SYS_DCFGR: begin
178
                                spr_dat_o[`OR1200_DCFGR_NDP_BITS] = `OR1200_DCFGR_NDP;
179
                                spr_dat_o[`OR1200_DCFGR_WPCI_BITS] = `OR1200_DCFGR_WPCI;
180
                                spr_dat_o[`OR1200_DCFGR_RES1_BITS] = `OR1200_DCFGR_RES1;
181
                        end
182
                        default: spr_dat_o = 32'h0000_0000;
183
                endcase
184 562 lampret
`ifdef OR1200_SYS_FULL_DECODE
185 504 lampret
        else
186
                spr_dat_o = 32'h0000_0000;
187
`endif
188
 
189
`else
190
 
191
//
192
// When configuration registers are not implemented, only
193
// implement VR and UPR
194
//
195
always @(spr_addr)
196
`ifdef OR1200_SYS_FULL_DECODE
197
        if (!spr_addr[31:4])
198
`endif
199
                case(spr_addr[3:0])
200
                        `OR1200_SPRGRP_SYS_VR: begin
201
                                spr_dat_o[`OR1200_VR_REV_BITS] = `OR1200_VR_REV;
202
                                spr_dat_o[`OR1200_VR_RES1_BITS] = `OR1200_VR_RES1;
203
                                spr_dat_o[`OR1200_VR_CFG_BITS] = `OR1200_VR_CFG;
204
                                spr_dat_o[`OR1200_VR_VER_BITS] = `OR1200_VR_VER;
205
                        end
206
                        `OR1200_SPRGRP_SYS_UPR: begin
207
                                spr_dat_o[`OR1200_UPR_UP_BITS] = `OR1200_UPR_UP;
208
                                spr_dat_o[`OR1200_UPR_DCP_BITS] = `OR1200_UPR_DCP;
209
                                spr_dat_o[`OR1200_UPR_ICP_BITS] = `OR1200_UPR_ICP;
210
                                spr_dat_o[`OR1200_UPR_DMP_BITS] = `OR1200_UPR_DMP;
211
                                spr_dat_o[`OR1200_UPR_IMP_BITS] = `OR1200_UPR_IMP;
212
                                spr_dat_o[`OR1200_UPR_MP_BITS] = `OR1200_UPR_MP;
213
                                spr_dat_o[`OR1200_UPR_DUP_BITS] = `OR1200_UPR_DUP;
214
                                spr_dat_o[`OR1200_UPR_PCUP_BITS] = `OR1200_UPR_PCUP;
215
                                spr_dat_o[`OR1200_UPR_PMP_BITS] = `OR1200_UPR_PMP;
216
                                spr_dat_o[`OR1200_UPR_PICP_BITS] = `OR1200_UPR_PICP;
217
                                spr_dat_o[`OR1200_UPR_TTP_BITS] = `OR1200_UPR_TTP;
218
                                spr_dat_o[`OR1200_UPR_RES1_BITS] = `OR1200_UPR_RES1;
219
                                spr_dat_o[`OR1200_UPR_CUP_BITS] = `OR1200_UPR_CUP;
220
                        end
221
                        default: spr_dat_o = 32'h0000_0000;
222
                endcase
223
`ifdef OR1200_SYS_FULL_DECODE
224
        else
225
                spr_dat_o = 32'h0000_0000;
226
`endif
227
 
228
`endif
229
 
230
endmodule

powered by: WebSVN 2.1.0

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