Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: SS_Node.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 __SS_Node_h__ | |
24 | #define __SS_Node_h__ | |
25 | ||
26 | #include "SS_AsiMap.h" | |
27 | ||
28 | // class SS_Node is the base class for cpu, core, micro-core nodes, | |
29 | // e.g parents with one or more children; a cpu can have a number of | |
30 | // cores, a core can have a number of strands. The SS_Strand class | |
31 | // is on purpose not derived from SS_Node, as strands are leafs in the | |
32 | // cpu tree hierarchy. SS_Strand requires a parent SS_Node. Thus for | |
33 | // a cpu with only one strand, say a Cheetah, a single parent (Ch_Cpu | |
34 | // derived from SS_Node) and one child (Ch_Strand derivded from SS_Strand) | |
35 | // is expected. | |
36 | // | |
37 | // Each SS_Node has an asi_map that on construction time is populated | |
38 | // with asi mapped control registers. This asi_map is merged with the | |
39 | // strands private asi_map by merge_asi_map() as part of constructing | |
40 | // a cpu model. | |
41 | // | |
42 | // All the children of a parent SS_Node share the contents of the asi map. | |
43 | // If there is more then one direct or indirect SS_Strand child in the | |
44 | // SS_Node then care should be taken to make access to the asi mapped | |
45 | // contents MP-safe. | |
46 | ||
47 | class SS_Node | |
48 | { | |
49 | public: | |
50 | SS_Node( const char* name ); | |
51 | SS_Node( SS_Node& _parent, const char* name ); | |
52 | virtual ~SS_Node(); | |
53 | ||
54 | void merge_asi_map( SS_AsiMap& a ); | |
55 | ||
56 | const char* get_node_name() { return name; } | |
57 | ||
58 | void get_name( char* dst ); | |
59 | ||
60 | SS_AsiMap asi_map; | |
61 | ||
62 | protected: | |
63 | SS_Node* parent; | |
64 | const char* name; | |
65 | }; | |
66 | ||
67 | #endif |