xref: /qemu/include/hw/riscv/spike.h (revision 3139929d)
15b4beba1SMichael Clark /*
25b4beba1SMichael Clark  * Spike machine interface
35b4beba1SMichael Clark  *
45b4beba1SMichael Clark  * Copyright (c) 2017 SiFive, Inc.
55b4beba1SMichael Clark  *
65b4beba1SMichael Clark  * This program is free software; you can redistribute it and/or modify it
75b4beba1SMichael Clark  * under the terms and conditions of the GNU General Public License,
85b4beba1SMichael Clark  * version 2 or later, as published by the Free Software Foundation.
95b4beba1SMichael Clark  *
105b4beba1SMichael Clark  * This program is distributed in the hope it will be useful, but WITHOUT
115b4beba1SMichael Clark  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
125b4beba1SMichael Clark  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
135b4beba1SMichael Clark  * more details.
145b4beba1SMichael Clark  *
155b4beba1SMichael Clark  * You should have received a copy of the GNU General Public License along with
165b4beba1SMichael Clark  * this program.  If not, see <http://www.gnu.org/licenses/>.
175b4beba1SMichael Clark  */
185b4beba1SMichael Clark 
194996b128SMichael Clark #ifndef HW_RISCV_SPIKE_H
204996b128SMichael Clark #define HW_RISCV_SPIKE_H
215b4beba1SMichael Clark 
227a5951f6SMarkus Armbruster #include "hw/boards.h"
23ec150c7eSMarkus Armbruster #include "hw/riscv/riscv_hart.h"
24ec150c7eSMarkus Armbruster #include "hw/sysbus.h"
25ec150c7eSMarkus Armbruster 
26a7172791SAnup Patel #define SPIKE_CPUS_MAX 8
27a7172791SAnup Patel #define SPIKE_SOCKETS_MAX 8
28a7172791SAnup Patel 
29a7172791SAnup Patel #define TYPE_SPIKE_MACHINE MACHINE_TYPE_NAME("spike")
30db1015e9SEduardo Habkost typedef struct SpikeState SpikeState;
318110fa1dSEduardo Habkost DECLARE_INSTANCE_CHECKER(SpikeState, SPIKE_MACHINE,
328110fa1dSEduardo Habkost                          TYPE_SPIKE_MACHINE)
33a7172791SAnup Patel 
34db1015e9SEduardo Habkost struct SpikeState {
355b4beba1SMichael Clark     /*< private >*/
36a7172791SAnup Patel     MachineState parent;
375b4beba1SMichael Clark 
385b4beba1SMichael Clark     /*< public >*/
39a7172791SAnup Patel     RISCVHartArrayState soc[SPIKE_SOCKETS_MAX];
40db1015e9SEduardo Habkost };
415b4beba1SMichael Clark 
425b4beba1SMichael Clark enum {
435b4beba1SMichael Clark     SPIKE_MROM,
448d8897acSAnup Patel     SPIKE_HTIF,
455b4beba1SMichael Clark     SPIKE_CLINT,
465b4beba1SMichael Clark     SPIKE_DRAM
475b4beba1SMichael Clark };
485b4beba1SMichael Clark 
495b4beba1SMichael Clark #endif
50