aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 13cd16783ba1779da119205729c6d5f1e690d852 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
RISCV de1_murax_franz
========================

Der fabelhafte RISCV Softcore auf dem Terasic DE1 Board! Für Franz.

### Murax Plattform mit RISCV Prozessor aus SpinalHDL

  * 50 MHz Taktfrequenz
  * UART mit 115200 Baud
  * GPIO an den Roten LEDs
  * Timer

siehe:

  * https://github.com/SpinalHDL/VexRiscv
  * https://spinalhdl.github.io/SpinalDoc-RTD/dev/index.html

### VHDL aus SpinalHDL

```
cd VexRiscV
sbt "runMain vexriscv.demo.de1_murax_franz"
cp ./de1_murax_franz.vhd ../src/
```

### VHDL Simulation des Prozessors

UART sendet 'A' und LEDs wechseln nach 1 Sekunde...

```
cd sim
cd de1_murax_franz
make sim
```

### FPGA Synthese und Download

```
cd pnr
cd de1_murax_franz
make prog
```

### Software Build mit gcc

Der Code liegt schon als fertiges Intel HEX im VexRiscV Projekt. SpinalHDL
generiert dann aus dem Intel HEX Format den VHDL ROM Code. Man muss also
nicht unbedingt den Code kompilieren. Wenn man kompiliert, dann muss das
Intel HEX File aus dem VexRiscV Projekt überschrieben werden.


```
cd VexRiscvSocSoftware/projects/murax/demo
make
cp ./build/demo.hex ../../../../VexRiscv/src/main/ressource/hex/muraxDemo.hex
```

Dann nochmal VexRiscV bauen und nochmal FPGA Synthese. Der Code landet via VHDL im
FPGA.

### UART anschliessen an MAC

Die UART läuft mit 115200 Baud. Mit einem FTDI USB UART Adapter kann man die UART vom DE1 Board anschliessen. Es wird eine Nachricht gesendet und die Eingaben kommen zurück. Auf MacOS:

```
screen /dev/tty.usbserial-FTALDMJL 115200
```

### Installation VexRiscV / SpinalHDL

see: https://github.com/SpinalHDL/VexRiscv#dependencies

SpinalHDL is a Scala application. Scala runs on the JAVA virtual machine.

```
sudo apt install openjdk-8-jdk
```

The  SCALA build tool "sbt" will install all dependencies for the VexRiscV for example SpinalHDL
locally. This is similar to pythons pip mechanism.

```
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
sudo apt update
sudo apt install sbt
```

### Installation GCC Compiler


```
wget -O riscv.tar.gz  https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz
tar -xvzf riscv.tar.gz
sudo mv riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14 /opt/riscv
export PATH="$PATH:/opt/riscv/bin"
cd VexRiscvSocSoftware/projects/murax/demo
make
```

### Debug mit OpenOCD

Habe ich nicht ausprobiert, aber die JTAG Pins sind auf dem Expansionport 1 vom DE1 Board.

```
GPIO_1[1] - JTAG_TCK
GPIO_1[3] - JTAG_TMS
GPIO_1[5] - JTAG_TDI
GPIO_1[7] - JTAG_TDO
```