1 |
11 |
rafaelcalc |
|
2 |
|
|

|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
Steel is a microprocessor core that implements the RV32I and Zicsr instruction sets of the RISC-V specifications. It is designed to be easy to use and targeted for embedded systems projects.
|
6 |
|
|
|
7 |
|
|
## Key features
|
8 |
|
|
|
9 |
|
|
* Simple and easy to use
|
10 |
|
|
* Implements the RV32I base instruction set + Zicsr extension + M-mode privileged architecture
|
11 |
|
|
* 3 pipeline stages, single-issue
|
12 |
|
|
* Hardware described in Verilog
|
13 |
|
|
* Full documentation
|
14 |
|
|
* Passed all RISC-V Compliance Suite tests for the RV32I and Zicsr instruction sets
|
15 |
|
|
* 1.36 CoreMarks/MHz
|
16 |
|
|
|
17 |
|
|
## Getting started
|
18 |
|
|
|
19 |
|
|
To start using Steel, follow these steps:
|
20 |
|
|
|
21 |
|
|
1. Import all files inside the **rtl** directory into your project
|
22 |
|
|
2. Instantiate the core into a Verilog/SystemVerilog module (an instantiation template is provided below)
|
23 |
|
|
3. Connect Steel to a clock source, a reset signal and memory. There is an interface to fetch instructions and another to read/write data, so we recommend a dual-port memory
|
24 |
|
|
|
25 |
|
|
There are also interfaces to request for interrupts and to update the time register. The signals of these interfaces must be hardwired to zero if unused. [Read the docs](https://rafaelcalcada.github.io/steel-core/) for more information about this signals.
|
26 |
|
|
|
27 |
|
|
```verilog
|
28 |
|
|
steel_top #(
|
29 |
|
|
|
30 |
|
|
// You must provide a 32-bit value. If omitted the boot address is set to 0x00000000
|
31 |
|
|
// ---------------------------------------------------------------------------------
|
32 |
|
|
|
33 |
|
|
.BOOT_ADDRESS()
|
34 |
|
|
|
35 |
|
|
) core (
|
36 |
|
|
|
37 |
|
|
// Clock source and reset
|
38 |
|
|
// ---------------------------------------------------------------------------------
|
39 |
|
|
|
40 |
|
|
.CLK(), // System clock (input, required, 1-bit)
|
41 |
|
|
.RESET(), // System reset (input, required, 1-bit, synchronous, active high)
|
42 |
|
|
|
43 |
|
|
// Instruction fetch interface
|
44 |
|
|
// ---------------------------------------------------------------------------------
|
45 |
|
|
.I_ADDR(), // Instruction address (output, 32-bit)
|
46 |
|
|
.INSTR(), // Instruction data (input, required, 32-bit)
|
47 |
|
|
|
48 |
|
|
// Data read/write interface
|
49 |
|
|
// ---------------------------------------------------------------------------------
|
50 |
|
|
|
51 |
|
|
.D_ADDR(), // Data address (output, 32-bit)
|
52 |
|
|
.DATA_IN(), // Data read from memory (input, required, 32-bit)
|
53 |
|
|
.DATA_OUT(), // Data to write into memory (output, 32-bit)
|
54 |
|
|
.WR_REQ(), // Write enable (output, 1-bit)
|
55 |
|
|
.WR_MASK(), // Write byte mask (output, 4-bit)
|
56 |
|
|
|
57 |
|
|
// Interrupt request interface (hardwire to zero if unused)
|
58 |
|
|
// ---------------------------------------------------------------------------------
|
59 |
|
|
|
60 |
|
|
.E_IRQ(), // External interrupt request (optional, active high, 1-bit)
|
61 |
|
|
.T_IRQ(), // Timer interrupt request (optional, active high, 1-bit)
|
62 |
|
|
.S_IRQ() // Software interrupt request (optional, active high, 1-bit)
|
63 |
|
|
|
64 |
|
|
// Time register update interface (hardwire to zero if unused)
|
65 |
|
|
// ---------------------------------------------------------------------------------
|
66 |
|
|
|
67 |
|
|
.REAL_TIME(), // Value read from a real-time counter (optional, 64-bit)
|
68 |
|
|
|
69 |
|
|
);
|
70 |
|
|
```
|
71 |
|
|
|
72 |
|
|
## Documentation
|
73 |
|
|
|
74 |
|
|
Steel documentation is available at [https://rafaelcalcada.github.io/steel-core/](https://rafaelcalcada.github.io/steel-core/) and provides information on:
|
75 |
|
|
* How to compile software for Steel
|
76 |
|
|
* I/O signals and communication to other devices
|
77 |
|
|
* Configuration
|
78 |
|
|
* Exceptions, interrupts and trap handling
|
79 |
|
|
* Implementation details
|
80 |
|
|
* Timing diagrams
|
81 |
|
|
|
82 |
|
|
## License
|
83 |
|
|
|
84 |
|
|
Steel is distributed under the MIT License. Read the `LICENSE.md` file before using Steel.
|
85 |
|
|
|
86 |
|
|
## About the author
|
87 |
|
|
|
88 |
|
|
The author is a computer engineering student at UFRGS (graduates at the end of 2020).
|
89 |
|
|
|
90 |
|
|
Contact: rafaelcalcada@gmail.com / rafaelcalcada@hotmail.com
|
91 |
|
|
|
92 |
|
|
## Acknowledgements
|
93 |
|
|
|
94 |
|
|
My colleague [Francisco Knebel](https://github.com/FranciscoKnebel) deserves special thanks for his collaboration with this work.
|