source: XOpenSparcT1/trunk/T1-common/include/ifu.h @ 6

Revision 6, 5.0 KB checked in by pntsvt00, 14 years ago (diff)

versione iniziale opensparc

RevLine 
[6]1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T1 Processor File: ifu.h
5* Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
6* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
7*
8* The above named program is free software; you can redistribute it and/or
9* modify it under the terms of the GNU General Public
10* License version 2 as published by the Free Software Foundation.
11*
12* The above named program is distributed in the hope that it will be
13* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15* General Public License for more details.
16*
17* You should have received a copy of the GNU General Public
18* License along with this work; if not, write to the Free Software
19* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20*
21* ========== Copyright Header End ============================================
22*/
23////////////////////////////////////////////////////////////////////////
24/*
25//
26//  Module Name: ifu.h
27//  Description:       
28//  All ifu defines
29*/
30
31//--------------------------------------------
32// Icache Values in IFU::ICD/ICV/ICT/FDP/IFQDP
33//--------------------------------------------
34// Set Values
35`define IC_SZ      16384
36// IC_IDX_HI = log(icache_size/4ways) - 1
37`define IC_IDX_HI  11
38
39// !!IMPORTANT!! a change to IC_LINE_SZ will mean a change to the code as
40//   well.  Unfortunately this has not been properly parametrized.
41//   Changing the IC_LINE_SZ param alone is *not* enough.
42`define IC_LINE_SZ  32
43
44// !!IMPORTANT!! a change to IC_TAG_HI will mean a change to the code as
45//   well.  Changing the IC_TAG_HI param alone is *not* enough to
46//   change the PA range.
47// highest bit of PA
48`define IC_TAG_HI    39
49
50
51// Derived Values
52// 4095
53`define IC_ARR_HI (`IC_SZ/4 - 1)
54
55// number of entries - 1 = 511
56`define IC_ENTRY_HI  ((`IC_SZ/`IC_LINE_SZ) - 1)
57
58// 12
59`define IC_TAG_LO    (`IC_IDX_HI + 1)
60
61// 28
62`define IC_TAG_SZ    (`IC_TAG_HI - `IC_IDX_HI)
63
64// 7
65`define IC_IDX_SZ  (`IC_IDX_HI - 4)
66
67// tags for all 4 ways + parity
68// 116
69`define IC_TAG_ALL   ((`IC_TAG_SZ * 4) + 4)
70
71// 115
72`define IC_TAG_ALL_HI   ((`IC_TAG_SZ * 4) + 3)
73
74
75//----------------------------------------------------------------------
76// For thread scheduler in IFU::DTU::SWL
77//----------------------------------------------------------------------
78// thread states:  (thr_state[4:0])
79`define THRFSM_DEAD     5'b00000
80`define THRFSM_IDLE     5'b00000
81`define THRFSM_HALT     5'b00010
82`define THRFSM_RDY      5'b11001
83`define THRFSM_SPEC_RDY 5'b10011
84`define THRFSM_RUN      5'b00101
85`define THRFSM_SPEC_RUN 5'b00111
86`define THRFSM_WAIT     5'b00001
87
88// thread configuration register bit fields
89`define TCR_READY   4
90`define TCR_URDY    3
91`define TCR_RUNNING 2
92`define TCR_SPEC    1
93`define TCR_ACTIVE  0
94
95
96//----------------------------------------------------------------------
97// For MIL fsm in IFU::IFQ
98//----------------------------------------------------------------------
99`define MILFSM_NULL   4'b0000
100`define MILFSM_WAIT   4'b1000
101`define MILFSM_REQ    4'b1100
102`define MILFSM_FILL0  4'b1001
103`define MILFSM_FILL1  4'b1011
104
105`define MIL_V  3
106`define MIL_R  2
107`define MIL_A  1
108`define MIL_F  0
109
110//---------------------------------------------------
111// Interrupt Block
112//---------------------------------------------------
113`define INT_VEC_HI  5
114`define INT_VEC_LO  0
115`define INT_THR_HI  12
116`define INT_THR_LO  8
117`define INT_TYPE_HI 17
118`define INT_TYPE_LO 16
119
120//-------------------------------------
121// IFQ
122//-------------------------------------
123// valid bit plus ifill
124`define CPX_IFILLPKT {1'b1, `IFILL_RET}
125`define CPX_INVPKT {1'b1, `INV_RET}
126`define CPX_STRPKT {1'b1, `ST_ACK}
127`define CPX_STRMACK {1'b1, `STRST_ACK}
128`define CPX_EVPKT {1'b1, `EVICT_REQ}
129`define CPX_LDPKT {1'b1, `LOAD_RET}
130`define CPX_ERRPKT {1'b1, `ERR_RET}
131`define CPX_FREQPKT {1'b1, `FWD_RQ_RET}
132
133`define CPX_REQFIELD `CPX_RQ_HI:`CPX_RQ_LO
134`define CPX_THRFIELD `CPX_TH_HI:`CPX_TH_LO
135`define CPX_RQ_SIZE  (`CPX_RQ_HI - `CPX_RQ_LO + 1)
136
137//`ifdef SPARC_L2_64B
138`define BANK_ID_HI 7
139`define BANK_ID_LO 6
140//`else
141//`define BANK_ID_HI 8
142//`define BANK_ID_LO 7
143//`endif
144
145//`define CPX_INV_PA_HI  116
146//`define CPX_INV_PA_LO  112
147
148`define IFU_ASI_VA_HI   17
149`define IFU_ASI_DATA_HI 47
150
151`define ICT_FILL_BITS  (32 - `IC_TAG_SZ)
152`define ICV_IDX_SZ  (`IC_IDX_HI - 5)
153
154//----------------------------------------
155// IFU Traps
156//----------------------------------------
157// precise
158`define INST_ACC_EXC    9'h008
159`define INST_ACC_ERR    9'h00a
160`define CORR_ECC_ERR    9'h063
161`define DATA_ACC_ERR    9'h032
162`define DATA_ERR        9'h078
163`define ASYN_DATA_ERR   9'h040
164`define INST_ACC_MMU_MS 9'h009
165`define FAST_MMU_MS     9'h064
166`define PRIV_OPC        9'h011
167`define ILL_INST        9'h010
168`define SIR             9'h004
169`define FP_DISABLED     9'h020
170`define REAL_TRANS_MS   9'h03e
171`define INST_BRK_PT     9'h076
172
173// disrupting
174`define SPU_MAINT        9'h074
175`define SPU_ENCINT       9'h070
176`define HSTICK_CMP       9'h05e
177`define RESUMABLE_ERR    9'h07e
178
179
180
Note: See TracBrowser for help on using the repository browser.