Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: SS_VirtualCpu.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 | #ifndef __SS_VirtualCpu_h__ | |
25 | #define __SS_VirtualCpu_h__ | |
26 | ||
27 | #include "SS_Cpu.h" | |
28 | #include "SS_VirtualStrand.h" | |
29 | ||
30 | class SS_VirtualCpu | |
31 | { | |
32 | public: | |
33 | SS_VirtualCpu( SS_Model* _model ); | |
34 | ||
35 | // create() is called for every cpu module line in the rc file | |
36 | static SS_VirtualStrand* create( SS_Model* (*model)(), Sam::VCPU_Config* config, Sam::VCPU_ImpIntf* interface ); | |
37 | ||
38 | // remove() is called when the model is removed from sam. | |
39 | static void remove( SS_Model* ss ); | |
40 | ||
41 | // snapshot is called loas save and load the cpu snapshot file | |
42 | static int snapshot( SS_Model* model, const char* dir_name, const char* file_name, bool load ); | |
43 | ||
44 | // advance nn number of cycles | |
45 | static int cycle ( uint64_t nn=1 ); | |
46 | ||
47 | static uint_t id; // The cpu's id | |
48 | static SS_VirtualCpu* list; // The list of the cpu's allocated | |
49 | ||
50 | SS_VirtualCpu* next; // The next pointer of a node in the list of cpu's | |
51 | SS_Cpu* cpu; // The actual cpu | |
52 | SS_VirtualStrand* strand; // The virtual strands of this cpu. | |
53 | ||
54 | static SS_AsiSpace::Error ss_asi_ext_ld64(SS_Node *, void *asi_ptr, SS_Strand* s, SS_Vaddr va, uint64_t *data ); | |
55 | static SS_AsiSpace::Error ss_asi_ext_st64(SS_Node *, void *asi_ptr, SS_Strand* s, SS_Vaddr va, uint64_t data ); | |
56 | }; | |
57 | ||
58 | #endif |