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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1200/] [rtl/] [verilog/] [or1200_cfgr.v] - Blame information for rev 194

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

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

powered by: WebSVN 2.1.0

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