Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / n2 / lib / cpu / src / N2_Model.h
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T2 Processor File: N2_Model.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 __N2_Model_h__
#define __N2_Model_h__
/************************************************************************
**
** Copyright (C) 2006, Sun Microsystems, Inc.
**
** Sun considers its source code as an unpublished, proprietary
** trade secret and it is available only under strict license provisions.
** This copyright notice is placed here only to protect Sun in the event
** the source is deemed a published work. Disassembly, decompilation,
** or other means of reducing the object code to human readable form
** is prohibited by the license agreement under which this code is
** provided to the user or company in possession of this copy.
**
*************************************************************************/
#include "SS_Model.h"
#include "N2_Csr.h"
class N2_Cpu;
class N2_Strand;
class SS_CKMemory;
class N2_Model : public SS_Model
{
public:
enum
{
NO_CORES_PER_CPU = 8,
NO_STRANDS_PER_CORE = 8,
NO_STRANDS_PER_CPU = NO_CORES_PER_CPU * NO_STRANDS_PER_CORE,
NO_CPUS = 1,
NO_CORES = NO_CPUS * NO_CORES_PER_CPU,
NO_STRANDS = NO_CPUS * NO_STRANDS_PER_CPU
};
N2_Model();
void create_cpu( uint_t no_cpu );
N2_Cpu* cpu_ptr( int cpu_id ) { return (N2_Cpu*)cpu[cpu_id]; }
N2_Strand* strand_ptr( int strand_id )
{
int cpu_id = strand_id / NO_STRANDS_PER_CPU;
int local_strand_id = strand_id % NO_STRANDS_PER_CPU;
return (N2_Strand*)(cpu[cpu_id]->strand[local_strand_id]);
}
N2_Csr csr;
// ras enable from frontend
void ras_enable(char* cmd);
SS_CKMemory *ck_memory;
};
#endif