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

Subversion Repositories or1k

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

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

powered by: WebSVN 2.1.0

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