-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install_SPIKE
50 lines (40 loc) · 1.25 KB
/
Install_SPIKE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#####################################################################
Author: Daniela Luiza Catelan
Professor at Federal University of Mato Grosso do Sul
#####################################################################
***********************************************************************
INSTALL: SPIKE SIMULATOR
https://github.com/riscv-software-src/riscv-isa-sim
***********************************************************************
1 -> riscv-gnu-toolchain
OBS: riscv-gnu-toolchain must be installed
export PATH=$PATH:/opt/riscv/bin
2 -> SPIKE (build steps)
$ git clone https://github.com/riscv-software-src/riscv-isa-sim.git
$ cd riscv-isa-sim
$ sudo apt-get install device-tree-compiler
$ mkdir build && cd build
$ cd build
$ ../configure --prefix=/opt/riscv
$ make
$ sudo make install
TEST: /opt/riscv/bin/spike
3 -> riscv-pk
$ git clone https://github.com/riscv/riscv-pk.git
$ cd riscv-pk
$ mkdir build && cd build
$ cd build
$ ../configure --prefix=/opt/riscv --host=riscv32-unknown-elf
$ make
$ sudo make install
TEST: /opt/riscv/bin/spike pk
-> RUN
file a.c
#include <stdio.h>
int main(void)
{
printf("\n HELLO RISCV\n");
return(0);
}
$ riscv32-unknown-elf-gcc -o a a.c
$ spike --isa=RV32I /opt/riscv/riscv32-unknown-elf/bin/pk a