Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: N2_Model.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 | #ifndef __N2_Model_h__ | |
24 | #define __N2_Model_h__ | |
25 | /************************************************************************ | |
26 | ** | |
27 | ** Copyright (C) 2006, Sun Microsystems, Inc. | |
28 | ** | |
29 | ** Sun considers its source code as an unpublished, proprietary | |
30 | ** trade secret and it is available only under strict license provisions. | |
31 | ** This copyright notice is placed here only to protect Sun in the event | |
32 | ** the source is deemed a published work. Disassembly, decompilation, | |
33 | ** or other means of reducing the object code to human readable form | |
34 | ** is prohibited by the license agreement under which this code is | |
35 | ** provided to the user or company in possession of this copy. | |
36 | ** | |
37 | *************************************************************************/ | |
38 | #include "SS_Model.h" | |
39 | #include "N2_Csr.h" | |
40 | ||
41 | class N2_Cpu; | |
42 | class N2_Strand; | |
43 | class SS_CKMemory; | |
44 | ||
45 | class N2_Model : public SS_Model | |
46 | { | |
47 | public: | |
48 | enum | |
49 | { | |
50 | NO_CORES_PER_CPU = 8, | |
51 | NO_STRANDS_PER_CORE = 8, | |
52 | NO_STRANDS_PER_CPU = NO_CORES_PER_CPU * NO_STRANDS_PER_CORE, | |
53 | ||
54 | NO_CPUS = 1, | |
55 | NO_CORES = NO_CPUS * NO_CORES_PER_CPU, | |
56 | NO_STRANDS = NO_CPUS * NO_STRANDS_PER_CPU | |
57 | }; | |
58 | ||
59 | N2_Model(); | |
60 | ||
61 | void create_cpu( uint_t no_cpu ); | |
62 | ||
63 | N2_Cpu* cpu_ptr( int cpu_id ) { return (N2_Cpu*)cpu[cpu_id]; } | |
64 | N2_Strand* strand_ptr( int strand_id ) | |
65 | { | |
66 | int cpu_id = strand_id / NO_STRANDS_PER_CPU; | |
67 | int local_strand_id = strand_id % NO_STRANDS_PER_CPU; | |
68 | return (N2_Strand*)(cpu[cpu_id]->strand[local_strand_id]); | |
69 | } | |
70 | ||
71 | N2_Csr csr; | |
72 | ||
73 | // ras enable from frontend | |
74 | void ras_enable(char* cmd); | |
75 | ||
76 | SS_CKMemory *ck_memory; | |
77 | ||
78 | ||
79 | }; | |
80 | ||
81 | #endif |