You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains the source code for my Minimal RISC-V SoC.
4
+
5
+
## Author
6
+
7
+
Matias Wang Silva, 2024/2025
8
+
9
+
## License
10
+
11
+
MIT
2
12
3
13
## Naming conventions
4
14
5
15
The code follows the [lowRISC coding style](https://github.com/lowRISC/style-guides/blob/master/VerilogCodingStyle.md) for Verilog for the most part. I wrote this myself in my free time so there will be deviations for no real reason.
6
16
7
-
* signals use snake case
8
-
- note: logical word units are joined without underscore
9
-
- eg: memwrite expands to memory write (one action)
10
-
- eg: mem_to_reg expands to memory to register (no joining)
11
-
* parameters use ALL CAPS
12
-
* task names, module names are all snake case
13
-
* common abbreviations are used where possible (reg for register, mem for memory, ctrl for control, etc)
17
+
- signals use snake case
18
+
- note: logical word units are joined without underscore
19
+
- eg: memwrite expands to memory write (one action)
20
+
- eg: mem_to_reg expands to memory to register (no joining)
21
+
- parameters use ALL CAPS
22
+
- task names, module names are all snake case
23
+
- common abbreviations are used where possible (reg for register, mem for memory, ctrl for control, etc)
14
24
15
25
## Development
16
26
17
27
While there is a great open source toolset for the iCESugar v1.5, it remains difficult to navigate the web of broken links to find what is really needed to get Verilog synthesized and 'running on' the FPGA. After lots of searching and reading tutorials, I've condensed it to this:
18
28
19
-
*`yosys` for synthesis
20
-
- https://github.com/YosysHQ/yosys
21
-
*`nextpnr` for place n route
22
-
- https://github.com/YosysHQ/nextpnr
23
-
*`iverilog` for Verilog compilation and simulation
24
-
- https://github.com/steveicarus/iverilog
25
-
*`icestorm` for a few useful tools for the iCE40 family of FPGAs
26
-
- https://github.com/YosysHQ/icestorm
27
-
*`icesprog` for uploading the bitstream to the iCESugar board specifically
28
-
- http://github.com/wuxx/icesugar
29
+
-`yosys` for synthesis
30
+
-<https://github.com/YosysHQ/yosys>
31
+
-`nextpnr` for place n route
32
+
-<https://github.com/YosysHQ/nextpnr>
33
+
-`iverilog` for Verilog compilation and simulation
34
+
-<https://github.com/steveicarus/iverilog>
35
+
-`icestorm` for a few useful tools for the iCE40 family of FPGAs
36
+
-<https://github.com/YosysHQ/icestorm>
37
+
-`icesprog` for uploading the bitstream to the iCESugar board specifically
38
+
-<http://github.com/wuxx/icesugar>
29
39
30
-
I recommend building each of these tools from source to ensure the latest (working) version and in the case of `icesprog` you'll also need to add the binary directory to your `$PATH`. Each of these tools has their own required dependencies so look them up to find them. Then, a standard `make -j4` and `sudo make install` suffices, apart from the odd case when a `./configure` was needed. While I was wrapping my head around this, I found https://f4pga.readthedocs.io/en/latest/flows/index.html quite helpful in explaining each step of the design flow and how that interlinks with these open source tools.
40
+
I recommend building each of these tools from source to ensure the latest (working) version and in the case of `icesprog` you'll also need to add the binary directory to your `$PATH`. Each of these tools has their own required dependencies so look them up to find them. Then, a standard `make -j4` and `sudo make install` suffices, apart from the odd case when a `./configure` was needed. While I was wrapping my head around this, I found <https://f4pga.readthedocs.io/en/latest/flows/index.html> quite helpful in explaining each step of the design flow and how that interlinks with these open source tools.
31
41
32
42
## TODO
33
43
34
-
* turn instrmem and regfile into BRAM, memory maybe SPRAM
35
-
* write a simple linker script
36
-
* add pipeline stalls
37
-
* rename pc_incr to pc
38
-
* double sw hazard, extra pipeline?
39
-
* if a clocked module requires the output of a previous stage, it should take it directly from that previous stage, not the pipeline register!
44
+
- turn instrmem and regfile into BRAM, memory maybe SPRAM
45
+
- write a simple linker script
46
+
- add pipeline stalls
47
+
- rename pc_incr to pc
48
+
- double sw hazard, extra pipeline?
49
+
- if a clocked module requires the output of a previous stage, it should take it directly from that previous stage, not the pipeline register!
### Homebrew formula for GTKWave for MacOS (M-series)
69
+
### Homebrew formula for GTKWave for MacOS (M-series)
60
70
61
71
GTKWave underwent a complete rewrite and somewhere along the line compatibility with newer Macs was broken. The author does not work on a Mac so couldn't provide correct build instructions. Some nice guy on the internet created a custom Homebrew formula with all the right steps to compile from source. I'm also testing a new waveform visualizer called "surfer".
62
72
@@ -80,17 +90,18 @@ Format of the process file: I wasn't able to find any strict documentation on th
0 commit comments