Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / ss / dev / ram / src / SS_Ram.i
CommitLineData
920dae64
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: SS_Ram.i
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%module SS_Ram
25
26%{
27#include "SS_Ram.h"
28#include "SS_Memory.h"
29%}
30
31/*============================================================================*\
32 * get_memory() - return swig pointer to c++ SS_Memory *
33\*============================================================================*/
34
35%inline %{
36SS_Memory* get_memory() { return &SS_Memory::memory; }
37%}
38
39typedef unsigned char uint8_t;
40typedef signed char int8_t;
41typedef unsigned short uint16_t;
42typedef signed short int16_t;
43typedef unsigned int uint32_t;
44typedef unsigned int uint_t;
45typedef signed int int32_t;
46typedef unsigned long uint64_t;
47typedef signed long int64_t;
48
49typedef uint64_t SS_Paddr;
50
51/*============================================================================*\
52 * SS_Memory - This is the swig wrapper class around the C++ SS_Memory class *
53 * The file SS_Memory.py implement the PFE memory object, that uses this swig *
54\*============================================================================*/
55
56class SS_Memory
57{
58 public:
59 void allocate( uint64_t _ram_size, uint64_t _rom_size, uint_t pa_bits );
60
61 void load( const char* filename );
62 void load( const char* filename, uint64_t addr );
63 void save( const char* filename, uint64_t addr, uint64_t size );
64
65 void poke8( uint64_t addr, uint8_t data );
66 void poke16( uint64_t addr, uint16_t data );
67 %extend { /* python 2.4 became pedantic about int values with signbit set, this avoids the nagging */
68 void poke32( uint64_t addr, uint64_t data ) { self->poke32(addr,uint32_t(data)); }
69 }
70 void poke64( uint64_t addr, uint64_t data );
71
72 uint8_t peek8u ( uint64_t addr );
73 int8_t peek8s ( uint64_t addr );
74 uint16_t peek16u( uint64_t addr );
75 int16_t peek16s( uint64_t addr );
76 uint32_t peek32u( uint64_t addr );
77 int32_t peek32s( uint64_t addr );
78 uint64_t peek64 ( uint64_t addr );
79};
80
81class SS_Ram
82{
83 public:
84 SS_Ram( SS_AddressMap* map, SS_Paddr lo, SS_Paddr hi );
85};
86
87
88
89