Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / ss / api / sam / src / SS_VirtualCpu.h
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T2 Processor File: SS_VirtualCpu.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_VirtualCpu_h__
#define __SS_VirtualCpu_h__
#include "SS_Cpu.h"
#include "SS_VirtualStrand.h"
class SS_VirtualCpu
{
public:
SS_VirtualCpu( SS_Model* _model );
// create() is called for every cpu module line in the rc file
static SS_VirtualStrand* create( SS_Model* (*model)(), Sam::VCPU_Config* config, Sam::VCPU_ImpIntf* interface );
// remove() is called when the model is removed from sam.
static void remove( SS_Model* ss );
// snapshot is called loas save and load the cpu snapshot file
static int snapshot( SS_Model* model, const char* dir_name, const char* file_name, bool load );
// advance nn number of cycles
static int cycle ( uint64_t nn=1 );
static uint_t id; // The cpu's id
static SS_VirtualCpu* list; // The list of the cpu's allocated
SS_VirtualCpu* next; // The next pointer of a node in the list of cpu's
SS_Cpu* cpu; // The actual cpu
SS_VirtualStrand* strand; // The virtual strands of this cpu.
static SS_AsiSpace::Error ss_asi_ext_ld64(SS_Node *, void *asi_ptr, SS_Strand* s, SS_Vaddr va, uint64_t *data );
static SS_AsiSpace::Error ss_asi_ext_st64(SS_Node *, void *asi_ptr, SS_Strand* s, SS_Vaddr va, uint64_t data );
};
#endif