]>
Commit | Line | Data |
---|---|---|
5b4beba1 MC |
1 | /* |
2 | * Spike machine interface | |
3 | * | |
4 | * Copyright (c) 2017 SiFive, Inc. | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify it | |
7 | * under the terms and conditions of the GNU General Public License, | |
8 | * version 2 or later, as published by the Free Software Foundation. | |
9 | * | |
10 | * This program is distributed in the hope it will be useful, but WITHOUT | |
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
13 | * more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License along with | |
16 | * this program. If not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
4996b128 MC |
19 | #ifndef HW_RISCV_SPIKE_H |
20 | #define HW_RISCV_SPIKE_H | |
5b4beba1 | 21 | |
ec150c7e MA |
22 | #include "hw/riscv/riscv_hart.h" |
23 | #include "hw/sysbus.h" | |
db1015e9 | 24 | #include "qom/object.h" |
ec150c7e | 25 | |
a7172791 AP |
26 | #define SPIKE_CPUS_MAX 8 |
27 | #define SPIKE_SOCKETS_MAX 8 | |
28 | ||
29 | #define TYPE_SPIKE_MACHINE MACHINE_TYPE_NAME("spike") | |
db1015e9 | 30 | typedef struct SpikeState SpikeState; |
a7172791 AP |
31 | #define SPIKE_MACHINE(obj) \ |
32 | OBJECT_CHECK(SpikeState, (obj), TYPE_SPIKE_MACHINE) | |
33 | ||
db1015e9 | 34 | struct SpikeState { |
5b4beba1 | 35 | /*< private >*/ |
a7172791 | 36 | MachineState parent; |
5b4beba1 MC |
37 | |
38 | /*< public >*/ | |
a7172791 | 39 | RISCVHartArrayState soc[SPIKE_SOCKETS_MAX]; |
5b4beba1 MC |
40 | void *fdt; |
41 | int fdt_size; | |
db1015e9 | 42 | }; |
5b4beba1 | 43 | |
5b4beba1 MC |
44 | enum { |
45 | SPIKE_MROM, | |
46 | SPIKE_CLINT, | |
47 | SPIKE_DRAM | |
48 | }; | |
49 | ||
50 | #if defined(TARGET_RISCV32) | |
26cd0362 | 51 | #define SPIKE_V1_10_0_CPU TYPE_RISCV_CPU_BASE32 |
5b4beba1 | 52 | #elif defined(TARGET_RISCV64) |
26cd0362 | 53 | #define SPIKE_V1_10_0_CPU TYPE_RISCV_CPU_BASE64 |
5b4beba1 MC |
54 | #endif |
55 | ||
56 | #endif |