Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / n2 / lib / cpu / src / N2_Cpu.h
CommitLineData
920dae64
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: N2_Cpu.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_Cpu_h__
24#define __N2_Cpu_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_Node.h"
39#include "N2_Model.h"
40#include "SS_Cpu.h"
41#include "N2_State.h"
42#include "N2_MemErrDetector.h"
43
44class N2_Core;
45class N2_Strand;
46
47class N2_Cpu : public SS_Cpu
48{
49 public:
50 enum { BITS_PER_CMP_REGISTER = 64 };
51
52 N2_Cpu( SS_Model& _model, const char* _name, uint_t strand_id_base=0 );
53
54 void hard_reset();
55 void warm_reset(bool intp=true);
56 void xtrn_reset();
57
58 void strand_running_update( uint_t strand_id, int cosim=0, uint64_t data=0 );
59
60 N2_Core* core[N2_Model::NO_CORES_PER_CPU];
61 N2_StrandAvailable strand_available;
62 N2_StrandEnable strand_enable;
63 N2_StrandEnableStatus strand_enable_status;
64 N2_StrandRunning strand_running;
65 N2_StrandRunningStatus strand_running_status;
66 N2_XirSteering xir_steering;
67 N2_TickEnable tick_enable;
68 N2_TwStatus tw_status;
69 N2_OverlapMode overlap_mode;
70 N2_IntrW intr_w;
71 N2_RstVecMask rst_vec_mask;
72
73 N2_MemErrDetector mem_err_detector;
74
75 protected:
76 static SS_AsiSpace::Error set_strand_available( SS_Node*, void*, SS_Strand*, SS_Vaddr, uint64_t data );
77 static SS_AsiSpace::Error set_strand_enable( SS_Node*, void*, SS_Strand*, SS_Vaddr, uint64_t data );
78 static SS_AsiSpace::Error set_strand_running( SS_Node*, void*, SS_Strand*, SS_Vaddr, uint64_t data );
79 static SS_AsiSpace::Error set_strand_running_w1s( SS_Node*, void*, SS_Strand*, SS_Vaddr, uint64_t data );
80 static SS_AsiSpace::Error set_strand_running_w1c( SS_Node*, void*, SS_Strand*, SS_Vaddr, uint64_t data );
81 static SS_AsiSpace::Error set_xir_steering( SS_Node*, void*, SS_Strand*, SS_Vaddr, uint64_t data );
82 static SS_AsiSpace::Error set_tick_enable( SS_Node*, void*, SS_Strand*, SS_Vaddr, uint64_t data );
83 static SS_AsiSpace::Error intr_w_st64 ( SS_Node*, void*, SS_Strand*, SS_Vaddr, uint64_t data );
84 static SS_AsiSpace::Error rst_vec_st64 ( SS_Node*, void*, SS_Strand*, SS_Vaddr, uint64_t );
85
86 void snapshot( SS_SnapShot& ss );
87 void ras_enable(char*);
88
89 void set_stepping( uint_t strand_id );
90};
91
92#endif