Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / ss / lib / cpu / src / SS_Node.h
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T2 Processor File: SS_Node.h
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
*
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
*
* The above named program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ========== Copyright Header End ============================================
*/
#ifndef __SS_Node_h__
#define __SS_Node_h__
#include "SS_AsiMap.h"
// class SS_Node is the base class for cpu, core, micro-core nodes,
// e.g parents with one or more children; a cpu can have a number of
// cores, a core can have a number of strands. The SS_Strand class
// is on purpose not derived from SS_Node, as strands are leafs in the
// cpu tree hierarchy. SS_Strand requires a parent SS_Node. Thus for
// a cpu with only one strand, say a Cheetah, a single parent (Ch_Cpu
// derived from SS_Node) and one child (Ch_Strand derivded from SS_Strand)
// is expected.
//
// Each SS_Node has an asi_map that on construction time is populated
// with asi mapped control registers. This asi_map is merged with the
// strands private asi_map by merge_asi_map() as part of constructing
// a cpu model.
//
// All the children of a parent SS_Node share the contents of the asi map.
// If there is more then one direct or indirect SS_Strand child in the
// SS_Node then care should be taken to make access to the asi mapped
// contents MP-safe.
class SS_Node
{
public:
SS_Node( const char* name );
SS_Node( SS_Node& _parent, const char* name );
virtual ~SS_Node();
void merge_asi_map( SS_AsiMap& a );
const char* get_node_name() { return name; }
void get_name( char* dst );
SS_AsiMap asi_map;
protected:
SS_Node* parent;
const char* name;
};
#endif