Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / ss / api / pli / src / SS_TlbSync.h
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T2 Processor File: SS_TlbSync.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_TlbSync_h__
#define __SS_TlbSync_h__
#include <list>
#include "SS_Strand.h"
#include "SS_TimedTlb.h"
#include "SS_PliSocket.h"
class SS_TlbSync
{
public:
SS_TlbSync( SS_Strand* _strand, SS_TimedTlb* _inst_tlb, SS_TimedTlb* _data_tlb );
void debug( uint_t level ) { debug_level = level; }
// pli_xxx() are the equivalent of the pli socket command packets
void pli_inst_tlb_read( uint32_t time );
void pli_inst_tlb_write( uint32_t time, int8_t entry );
void pli_inst_hwtw( uint32_t time, SS_Vaddr va, int8_t entry );
void pli_data_tlb_read( uint32_t time );
void pli_data_tlb_read_pop( uint32_t time );
void pli_data_tlb_write( uint32_t time, int8_t entry );
void pli_data_hwtw( uint32_t time, SS_Vaddr va, uint8_t asi, int8_t entry );
void pli_tlb_lookup( uint32_t time, uint8_t asi );
void pli_flush();
// inst_xxx() and data_xxx() respectively are called from the strand
static void inst_tlb_read( void* tlb_sync );
static int inst_tlb_write( void* tlb_sync );
static void inst_tlb_lookup( void* tlb_sync );
static void data_tlb_read( void* tlb_sync );
static int data_tlb_write( void* tlb_sync );
static void data_tlb_lookup( void* tlb_sync );
// socket file descriptor to RTL testbench, used to report error
SS_PliSocket* socket;
private:
void report_error(const char *fmt, ...);
SS_Strand* strand;
SS_TimedTlb* inst_tlb;
SS_TimedTlb* data_tlb;
std::list<uint32_t> inst_tlb_read_time;
std::list<uint32_t> inst_tlb_write_time;
std::list< int8_t> inst_tlb_write_entry;
std::list<uint32_t> data_tlb_read_time;
std::list<uint32_t> data_tlb_write_time;
std::list< int8_t> data_tlb_write_entry;
std::list<uint32_t> tlb_lookup_time;
std::list<uint8_t> tlb_lookup_asi;
uint_t debug_level;
};
#endif