Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / ss / api / pli / src / SS_ValSync.h
CommitLineData
920dae64
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: SS_ValSync.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_ValSync_h__
25#define __SS_ValSync_h__
26
27#include <stdio.h>
28#include <assert.h>
29#include <map>
30#include <list>
31#include "SS_Types.h"
32#include "SS_Strand.h"
33
34class SS_ValSync
35{
36 public:
37 SS_ValSync( SS_Strand* _strand );
38
39 void ctr_read( SS_Registers::Index idx, uint64_t data );
40 void ctr_write( SS_Registers::Index idx, uint64_t data );
41
42 void asi_read( uint8_t asi, SS_Vaddr va, uint64_t data );
43 void asi_write( uint8_t asi, SS_Vaddr va, uint64_t data );
44
45 void csr_read( SS_Paddr pa, uint64_t data, bool little_endian );
46 void csr_write( SS_Paddr pa, uint64_t data, bool little_endian );
47
48 void set_multi_entry( uint8_t asi ) { multi_entry[asi] = true; }
49
50 protected:
51 SS_Strand* strand;
52 std::map<SS_Registers::Index,uint64_t> ctr_rd;
53 // ASI_READ follow-me is a multi-entry FIFO queue, so that we can have
54 // a command sequence like: ASI_READ, ASI_READ, ldxa, ldxa. If we use
55 // single-entry queue, then the command sequence must be: ASI_READ, ldxa,
56 // ASI_READ, ldxa, which is harder for testbench to line up the commands
57 // properly. But not all ASI_READ follow-me's need the multi-entry
58 // functionality, most will be happy with just keeping one entry (the
59 // latest one) in the queue.
60 std::map<SS_Vaddr,std::list<uint64_t>*> asi_rd[SS_Asi::MAX];
61 std::map<SS_Paddr,uint64_t> csr_rd;
62 // set true means a particular asi can have multi-entry ASI FOLLOW-ME
63 bool multi_entry[SS_Asi::MAX];
64};
65
66#endif
67
68
69