OpenCores
URL https://opencores.org/ocsvn/aor3000/aor3000/trunk

Subversion Repositories aor3000

[/] [aor3000/] [trunk/] [sim/] [tester/] [shared_mem.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 alfik
/*
2
 * This file is subject to the terms and conditions of the BSD License. See
3
 * the file "LICENSE" in the main directory of this archive for more details.
4
 *
5
 * Copyright (C) 2014 Aleksander Osman
6
 */
7
 
8
#ifndef __SHARED_MEM_H
9
#define __SHARED_MEM_H
10
 
11
//------------------------------------------------------------------------------
12
 
13
typedef unsigned char  uint8;
14
typedef unsigned short uint16;
15
typedef unsigned int   uint32;
16
typedef unsigned long  uint64;
17
 
18
typedef char  int8;
19
typedef short int16;
20
typedef int   int32;
21
typedef long  int64;
22
 
23
//------------------------------------------------------------------------------
24
 
25
union memory_t {
26
    uint8  bytes [134217728];
27
    uint16 shorts[67108864];
28
    uint32 ints  [33554432];
29
};
30
 
31
struct tlb_t {
32
    uint32 vpn;
33
    uint32 asid;
34
    uint32 pfn;
35
    uint32 n;
36
    uint32 d;
37
    uint32 v;
38
    uint32 g;
39
};
40
 
41
struct processor_state_t {
42
    uint32 reg[31];
43
    uint32 pc;
44
    //lo, hi not compared
45
 
46
    tlb_t tlb[64];
47
 
48
    uint32 index_p;
49
    uint32 index_index;
50
 
51
    uint32 random;
52
 
53
    uint32 entrylo_pfn;
54
    uint32 entrylo_n;
55
    uint32 entrylo_d;
56
    uint32 entrylo_v;
57
    uint32 entrylo_g;
58
 
59
    uint32 context_ptebase;
60
    uint32 context_badvpn;
61
 
62
    uint32 bad_vaddr;
63
 
64
    uint32 entryhi_vpn;
65
    uint32 entryhi_asid;
66
 
67
    uint32 sr_cp_usable;
68
    uint32 sr_rev_endian;
69
    uint32 sr_bootstrap_vec;
70
    uint32 sr_tlb_shutdown;
71
    uint32 sr_parity_err;
72
    uint32 sr_cache_miss;
73
    uint32 sr_parity_zero;
74
    uint32 sr_switch_cache;
75
    uint32 sr_isolate_cache;
76
    uint32 sr_irq_mask;
77
    uint32 sr_ku_ie;
78
 
79
    uint32 cause_branch_delay;
80
    uint32 cause_cp_error;
81
    uint32 cause_irq_pending;
82
    uint32 cause_exc_code;
83
 
84
    uint32 epc;
85
};
86
 
87
struct report_t {
88
    uint32 counter;
89
    uint32 exception;
90
    processor_state_t state;
91
};
92
 
93
struct processor_t {
94
    uint32 initialize_do;
95
 
96
    uint32 read_do;
97
    uint32 read_address;
98
    uint32 read_byteenable;
99
    uint32 read_data;
100
 
101
    uint32 write_do;
102
    uint32 write_address;
103
    uint32 write_byteenable;
104
    uint32 write_data;
105
 
106
    uint32 check_do;
107
 
108
    uint32   report_do;
109
    report_t report;
110
};
111
 
112
struct shared_mem_t {
113
    memory_t mem;
114
 
115
    uint32 reset_vector[1024];
116
 
117
    processor_state_t initial;
118
 
119
    uint32 test_finished;
120
 
121
    uint32 irq2_at_event;
122
 
123
    uint32 irq3_at_event;
124
 
125
    uint32 check_at_event;
126
 
127
    processor_t proc_ao;
128
    processor_t proc_vmips;
129
};
130
 
131
//------------------------------------------------------------------------------
132
 
133
#endif //__SHARED_MEM_H

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.