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

Subversion Repositories or1k

[/] [or1k/] [branches/] [mp3_stable/] [or1200/] [rtl/] [verilog/] [cfgr.v] - Blame information for rev 1778

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

Line No. Rev Author Line
1 218 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
// Revision 1.6  2001/10/14 13:12:09  lampret
48
// MP3 version.
49
//
50
// Revision 1.1.1.1  2001/10/06 10:18:35  igorm
51
// no message
52
//
53
// Revision 1.1  2001/08/09 13:39:33  lampret
54
// Major clean-up.
55
//
56
// Revision 1.1  2001/07/20 00:46:21  lampret
57
// Development version of RTL. Libraries are missing.
58
//
59
//
60
 
61
// synopsys translate_off
62
`include "timescale.v"
63
// synopsys translate_on
64
`include "defines.v"
65
 
66
module cfgr(
67
        // RISC Internal Interface
68
        clk, rst, spr_addr, spr_dat_o
69
);
70
 
71
//
72
// RISC Internal Interface
73
//
74
input           clk;            // Clock
75
input           rst;            // Reset
76
input   [31:0]   spr_addr;       // SPR Address
77
output  [31:0]   spr_dat_o;      // SPR Read Data
78
 
79
//
80
// Internal wires & registers
81
//
82
reg     [31:0]   spr_dat_o;      // SPR Read Data
83
 
84
`ifdef CFGR_IMPLEMENTED
85
 
86
//
87
// Implementation of VR, UPR and configuration registers
88
//
89
always @(spr_addr)
90
`ifdef SYS_FULL_DECODE
91
        if (!spr_addr[31:4])
92
`endif
93
                case(spr_addr[3:0])
94
                        `SPRGRP_SYS_VR: begin
95
                                spr_dat_o[`VR_REV_BITS] = `VR_REV;
96
                                spr_dat_o[`VR_RES1_BITS] = `VR_RES1;
97
                                spr_dat_o[`VR_CFG_BITS] = `VR_CFG;
98
                                spr_dat_o[`VR_VER_BITS] = `VR_VER;
99
                        end
100
                        `SPRGRP_SYS_UPR: begin
101
                                spr_dat_o[`UPR_UP_BITS] = `UPR_UP;
102
                                spr_dat_o[`UPR_DCP_BITS] = `UPR_DCP;
103
                                spr_dat_o[`UPR_ICP_BITS] = `UPR_ICP;
104
                                spr_dat_o[`UPR_DMP_BITS] = `UPR_DMP;
105
                                spr_dat_o[`UPR_IMP_BITS] = `UPR_IMP;
106
                                spr_dat_o[`UPR_MP_BITS] = `UPR_MP;
107
                                spr_dat_o[`UPR_DUP_BITS] = `UPR_DUP;
108
                                spr_dat_o[`UPR_PCUP_BITS] = `UPR_PCUP;
109
                                spr_dat_o[`UPR_PMP_BITS] = `UPR_PMP;
110
                                spr_dat_o[`UPR_PICP_BITS] = `UPR_PICP;
111
                                spr_dat_o[`UPR_TTP_BITS] = `UPR_TTP;
112
                                spr_dat_o[`UPR_RES1_BITS] = `UPR_RES1;
113
                                spr_dat_o[`UPR_CUP_BITS] = `UPR_CUP;
114
                        end
115
                        `SPRGRP_SYS_CPUCFGR: begin
116
                                spr_dat_o[`CPUCFGR_NSGF_BITS] = `CPUCFGR_NSGF;
117
                                spr_dat_o[`CPUCFGR_HGF_BITS] = `CPUCFGR_HGF;
118
                                spr_dat_o[`CPUCFGR_OB32S_BITS] = `CPUCFGR_OB32S;
119
                                spr_dat_o[`CPUCFGR_OB64S_BITS] = `CPUCFGR_OB64S;
120
                                spr_dat_o[`CPUCFGR_OF32S_BITS] = `CPUCFGR_OF32S;
121
                                spr_dat_o[`CPUCFGR_OF64S_BITS] = `CPUCFGR_OF64S;
122
                                spr_dat_o[`CPUCFGR_OV64S_BITS] = `CPUCFGR_OV64S;
123
                                spr_dat_o[`CPUCFGR_RES1_BITS] = `CPUCFGR_RES1;
124
                        end
125
                        `SPRGRP_SYS_DMMUCFGR: begin
126
                                spr_dat_o[`DMMUCFGR_NTW_BITS] = `DMMUCFGR_NTW;
127
                                spr_dat_o[`DMMUCFGR_NTS_BITS] = `DMMUCFGR_NTS;
128
                                spr_dat_o[`DMMUCFGR_NAE_BITS] = `DMMUCFGR_NAE;
129
                                spr_dat_o[`DMMUCFGR_CRI_BITS] = `DMMUCFGR_CRI;
130
                                spr_dat_o[`DMMUCFGR_PRI_BITS] = `DMMUCFGR_PRI;
131
                                spr_dat_o[`DMMUCFGR_TEIRI_BITS] = `DMMUCFGR_TEIRI;
132
                                spr_dat_o[`DMMUCFGR_HTR_BITS] = `DMMUCFGR_HTR;
133
                                spr_dat_o[`DMMUCFGR_RES1_BITS] = `DMMUCFGR_RES1;
134
                        end
135
                        `SPRGRP_SYS_IMMUCFGR: begin
136
                                spr_dat_o[`IMMUCFGR_NTW_BITS] = `IMMUCFGR_NTW;
137
                                spr_dat_o[`IMMUCFGR_NTS_BITS] = `IMMUCFGR_NTS;
138
                                spr_dat_o[`IMMUCFGR_NAE_BITS] = `IMMUCFGR_NAE;
139
                                spr_dat_o[`IMMUCFGR_CRI_BITS] = `IMMUCFGR_CRI;
140
                                spr_dat_o[`IMMUCFGR_PRI_BITS] = `IMMUCFGR_PRI;
141
                                spr_dat_o[`IMMUCFGR_TEIRI_BITS] = `IMMUCFGR_TEIRI;
142
                                spr_dat_o[`IMMUCFGR_HTR_BITS] = `IMMUCFGR_HTR;
143
                                spr_dat_o[`IMMUCFGR_RES1_BITS] = `IMMUCFGR_RES1;
144
                        end
145
                        `SPRGRP_SYS_DCCFGR: begin
146
                                spr_dat_o[`DCCFGR_NCW_BITS] = `DCCFGR_NCW;
147
                                spr_dat_o[`DCCFGR_NCS_BITS] = `DCCFGR_NCS;
148
                                spr_dat_o[`DCCFGR_CBS_BITS] = `DCCFGR_CBS;
149
                                spr_dat_o[`DCCFGR_CWS_BITS] = `DCCFGR_CWS;
150
                                spr_dat_o[`DCCFGR_CCRI_BITS] = `DCCFGR_CCRI;
151
                                spr_dat_o[`DCCFGR_CBIRI_BITS] = `DCCFGR_CBIRI;
152
                                spr_dat_o[`DCCFGR_CBPRI_BITS] = `DCCFGR_CBPRI;
153
                                spr_dat_o[`DCCFGR_CBLRI_BITS] = `DCCFGR_CBLRI;
154
                                spr_dat_o[`DCCFGR_CBFRI_BITS] = `DCCFGR_CBFRI;
155
                                spr_dat_o[`DCCFGR_CBWBRI_BITS] = `DCCFGR_CBWBRI;
156
                                spr_dat_o[`DCCFGR_RES1_BITS] = `DCCFGR_RES1;
157
                        end
158
                        `SPRGRP_SYS_ICCFGR: begin
159
                                spr_dat_o[`ICCFGR_NCW_BITS] = `ICCFGR_NCW;
160
                                spr_dat_o[`ICCFGR_NCS_BITS] = `ICCFGR_NCS;
161
                                spr_dat_o[`ICCFGR_CBS_BITS] = `ICCFGR_CBS;
162
                                spr_dat_o[`ICCFGR_CWS_BITS] = `ICCFGR_CWS;
163
                                spr_dat_o[`ICCFGR_CCRI_BITS] = `ICCFGR_CCRI;
164
                                spr_dat_o[`ICCFGR_CBIRI_BITS] = `ICCFGR_CBIRI;
165
                                spr_dat_o[`ICCFGR_CBPRI_BITS] = `ICCFGR_CBPRI;
166
                                spr_dat_o[`ICCFGR_CBLRI_BITS] = `ICCFGR_CBLRI;
167
                                spr_dat_o[`ICCFGR_CBFRI_BITS] = `ICCFGR_CBFRI;
168
                                spr_dat_o[`ICCFGR_CBWBRI_BITS] = `ICCFGR_CBWBRI;
169
                                spr_dat_o[`ICCFGR_RES1_BITS] = `ICCFGR_RES1;
170
                        end
171
                        `SPRGRP_SYS_DCFGR: begin
172
                                spr_dat_o[`DCFGR_NDP_BITS] = `DCFGR_NDP;
173
                                spr_dat_o[`DCFGR_WPCI_BITS] = `DCFGR_WPCI;
174
                                spr_dat_o[`DCFGR_RES1_BITS] = `DCFGR_RES1;
175
                        end
176
                        default: spr_dat_o = 32'h0000_0000;
177
                endcase
178
`ifdef SYS_FULL_DECODE
179
        else
180
                spr_dat_o = 32'h0000_0000;
181
`endif
182
 
183
`else
184
 
185
//
186
// When configuration registers are not implemented, only
187
// implement VR and UPR
188
//
189
always @(spr_addr)
190
`ifdef SYS_FULL_DECODE
191
        if (!spr_addr[31:4])
192
`endif
193
                case(spr_addr[3:0])
194
                        `SPRGRP_SYS_VR: begin
195
                                spr_dat_o[`VR_REV_BITS] = `VR_REV;
196
                                spr_dat_o[`VR_RES1_BITS] = `VR_RES1;
197
                                spr_dat_o[`VR_CFG_BITS] = `VR_CFG;
198
                                spr_dat_o[`VR_VER_BITS] = `VR_VER;
199
                        end
200
                        `SPRGRP_SYS_UPR: begin
201
                                spr_dat_o[`UPR_UP_BITS] = `UPR_UP;
202
                                spr_dat_o[`UPR_DCP_BITS] = `UPR_DCP;
203
                                spr_dat_o[`UPR_ICP_BITS] = `UPR_ICP;
204
                                spr_dat_o[`UPR_DMP_BITS] = `UPR_DMP;
205
                                spr_dat_o[`UPR_IMP_BITS] = `UPR_IMP;
206
                                spr_dat_o[`UPR_MP_BITS] = `UPR_MP;
207
                                spr_dat_o[`UPR_DUP_BITS] = `UPR_DUP;
208
                                spr_dat_o[`UPR_PCUP_BITS] = `UPR_PCUP;
209
                                spr_dat_o[`UPR_PMP_BITS] = `UPR_PMP;
210
                                spr_dat_o[`UPR_PICP_BITS] = `UPR_PICP;
211
                                spr_dat_o[`UPR_TTP_BITS] = `UPR_TTP;
212
                                spr_dat_o[`UPR_RES1_BITS] = `UPR_RES1;
213
                                spr_dat_o[`UPR_CUP_BITS] = `UPR_CUP;
214
                        end
215
                        default: spr_dat_o = 32'h0000_0000;
216
                endcase
217
`ifdef SYS_FULL_DECODE
218
        else
219
                spr_dat_o = 32'h0000_0000;
220
`endif
221
 
222
`endif
223
 
224
endmodule

powered by: WebSVN 2.1.0

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