Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / ss / api / pli / src / SS_TlbSync.h
CommitLineData
920dae64
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: SS_TlbSync.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
24#ifndef __SS_TlbSync_h__
25#define __SS_TlbSync_h__
26
27#include <list>
28#include "SS_Strand.h"
29#include "SS_TimedTlb.h"
30#include "SS_PliSocket.h"
31
32class SS_TlbSync
33{
34 public:
35 SS_TlbSync( SS_Strand* _strand, SS_TimedTlb* _inst_tlb, SS_TimedTlb* _data_tlb );
36
37 void debug( uint_t level ) { debug_level = level; }
38
39 // pli_xxx() are the equivalent of the pli socket command packets
40 void pli_inst_tlb_read( uint32_t time );
41 void pli_inst_tlb_write( uint32_t time, int8_t entry );
42 void pli_inst_hwtw( uint32_t time, SS_Vaddr va, int8_t entry );
43
44 void pli_data_tlb_read( uint32_t time );
45 void pli_data_tlb_read_pop( uint32_t time );
46 void pli_data_tlb_write( uint32_t time, int8_t entry );
47 void pli_data_hwtw( uint32_t time, SS_Vaddr va, uint8_t asi, int8_t entry );
48
49 void pli_tlb_lookup( uint32_t time, uint8_t asi );
50
51 void pli_flush();
52
53 // inst_xxx() and data_xxx() respectively are called from the strand
54 static void inst_tlb_read( void* tlb_sync );
55 static int inst_tlb_write( void* tlb_sync );
56 static void inst_tlb_lookup( void* tlb_sync );
57
58 static void data_tlb_read( void* tlb_sync );
59 static int data_tlb_write( void* tlb_sync );
60 static void data_tlb_lookup( void* tlb_sync );
61
62 // socket file descriptor to RTL testbench, used to report error
63 SS_PliSocket* socket;
64
65 private:
66 void report_error(const char *fmt, ...);
67
68 SS_Strand* strand;
69 SS_TimedTlb* inst_tlb;
70 SS_TimedTlb* data_tlb;
71
72 std::list<uint32_t> inst_tlb_read_time;
73 std::list<uint32_t> inst_tlb_write_time;
74 std::list< int8_t> inst_tlb_write_entry;
75
76 std::list<uint32_t> data_tlb_read_time;
77 std::list<uint32_t> data_tlb_write_time;
78 std::list< int8_t> data_tlb_write_entry;
79
80 std::list<uint32_t> tlb_lookup_time;
81 std::list<uint8_t> tlb_lookup_asi;
82
83 uint_t debug_level;
84};
85
86#endif
87
88
89
90
91
92
93