Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / ss / api / pli / src / SS_RegCompare.h
CommitLineData
920dae64
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: SS_RegCompare.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_RegCompare_h__
25#define __SS_RegCompare_h__
26
27#include "SS_Strand.h"
28#include "SS_PliSocket.h"
29
30class SS_RegCompare
31{
32 public:
33 // make sure CTR_CMPR_MAX is larger than the registers in RegId
34 // (of bin/SS_RegCompare.h).
35 enum { CTR_G=0, CTR_W=1, CTR_F=2, CTR_INSTR=254, CTR_OPCODE=255, CTR_CMPR_MAX=256 };
36
37 SS_RegCompare( SS_Strand* _strand, SS_PliSocket* _socket );
38
39 void debug_output( FILE* _dbg_out ) { dbg_out = _dbg_out; }
40
41 void initialise();
42 void compare();
43 void dump_regs();
44 bool is_initialise() { return inited; }
45
46 void cmpr_on() { for (int i=0; i<CTR_CMPR_MAX; i++) cmpr_list[i]=true; }
47 void cmpr_on( int ii ) { assert(ii<CTR_CMPR_MAX); cmpr_list[ii]=true; }
48 void cmpr_off() { for (int i=0; i<CTR_CMPR_MAX; i++) cmpr_list[i]=false; }
49 void cmpr_off( int ii ) { assert(ii<CTR_CMPR_MAX); cmpr_list[ii]=false; }
50 bool is_cmpr( int ii ) { return cmpr_list[ii]; }
51
52 protected:
53 uint64_t grf[(1 + SS_Strand::MAX_GL) * 8];
54 uint64_t wrf[(1 + SS_Strand::MAX_WP) * 16];
55 uint32_t frf[64];
56
57 FILE* dbg_out;
58
59 SS_PliSocket* socket;
60 bool inited;
61
62 // 'true' to one entry means its corresponding register will be included
63 // in delta generation and replay comparison.
64 bool cmpr_list[CTR_CMPR_MAX];
65 // 'true' mean an instruction has generate one or more register delta
66 bool new_delta;
67
68 private:
69 SS_Strand* strand;
70};
71
72#endif
73
74