Commit | Line | Data |
---|---|---|
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 %{ | |
36 | SS_Memory* get_memory() { return &SS_Memory::memory; } | |
37 | %} | |
38 | ||
39 | typedef unsigned char uint8_t; | |
40 | typedef signed char int8_t; | |
41 | typedef unsigned short uint16_t; | |
42 | typedef signed short int16_t; | |
43 | typedef unsigned int uint32_t; | |
44 | typedef unsigned int uint_t; | |
45 | typedef signed int int32_t; | |
46 | typedef unsigned long uint64_t; | |
47 | typedef signed long int64_t; | |
48 | ||
49 | typedef 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 | ||
56 | class 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 | ||
81 | class SS_Ram | |
82 | { | |
83 | public: | |
84 | SS_Ram( SS_AddressMap* map, SS_Paddr lo, SS_Paddr hi ); | |
85 | }; | |
86 | ||
87 | ||
88 | ||
89 |