OpenCores
URL https://opencores.org/ocsvn/yifive/yifive/trunk

Subversion Repositories yifive

[/] [yifive/] [trunk/] [caravel_yifive/] [verilog/] [rtl/] [syntacore/] [scr1/] [README.md] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 dinesha
# SCR1 RISC-V Core
2
 
3
SCR1 is an open-source and free to use RISC-V compatible MCU-class core, designed and maintained by Syntacore. It is industry-grade and silicon-proven (including full-wafer production), works out of the box in all major EDA flows and Verilator, and comes with extensive collateral and documentation.
4
 
5
![SCR1 cluster](./docs/img/scr1_cluster.svg)
6
 
7
## Key features
8
 
9
* Open sourced under SHL-license (see LICENSE file) - unrestricted commercial use allowed
10
* RV32I or RV32E ISA base + optional RVM and RVC standard extensions
11
* Machine privilege mode only
12
* 2 to 4 stage pipeline
13
* Optional Integrated Programmable Interrupt Controller with 16 IRQ lines
14
* Optional RISC-V Debug subsystem with JTAG interface
15
* Optional on-chip Tightly-Coupled Memory
16
* 32-bit AXI4/AHB-Lite external interface
17
* Written in SystemVerilog
18
* Optimized for area and power
19
* 3 predefined recommended configurations
20
* A number of fine-tuning options for custom configuration
21
* Verification suite provided
22
* Extensive documentation
23
 
24
For more information on core architecture, see [SCR1 External Architecture Specification](https://github.com/syntacore/scr1/blob/master/docs/scr1_eas.pdf).
25
 
26
For more information on project usage, see [SCR1 User Manual](https://github.com/syntacore/scr1/blob/master/docs/scr1_um.pdf).
27
 
28
## Repository contents
29
 
30
|Folder | Description
31
|------ | -----------
32
|**dependencies**                  | **Dependent submodules**
33
|├─ riscv-tests                    | Common source files for RISC-V ISA tests
34
|├─ riscv-compliance               | Common source files for RISC-V Compliance tests
35
|└─ coremark                       | Common source files for EEMBC's CoreMark® benchmark
36
|**docs**                          | **SCR1 documentation**
37
|├─ scr1_eas.pdf                   | SCR1 External Architecture Specification
38
|└─ scr1_um.pdf                    | SCR1 User Manual
39
|**sim**                           | **Tests and scripts for simulation**
40
|├─ tests/common                   | Common source files for tests
41
|├─ tests/riscv_isa                | RISC-V ISA tests platform specific source files
42
|├─ tests/riscv_compliance         | RISC-V Compliance platform specific source files
43
|├─ tests/benchmarks/dhrystone21   | Dhrystone 2.1 benchmark source files
44
|├─ tests/benchmarks/coremark      | EEMBC's CoreMark® benchmark platform specific source files
45
|├─ tests/isr_sample               | Sample program "Interrupt Service Routine"
46
|├─ tests/hello                    | Sample program "Hello"
47
|└─ verilator_wrap                 | Wrappers for Verilator simulation
48
|**src**                           | **SCR1 RTL source and testbench files**
49
|├─ includes                       | Header files
50
|├─ core                           | Core top source files
51
|├─ top                            | Cluster source files
52
|└─ tb                             | Testbench files
53
 
54
## SCR1 source file lists
55
 
56
SCR1 source file lists of SCR1 can be found in [./src](https://github.com/syntacore/scr1/tree/master/src):
57
 
58
* **core.files**    - all synthesized file sources of the SCR1 core
59
* **ahb_top.files** - synthesized file sources of AHB cluster
60
* **axi_top.files** - synthesized file sources of AXI cluster
61
* **ahb_tb.files**  - testbench file sources for AHB cluster (for simulation only)
62
* **axi_tb.files**  - testbench file sources for AXI cluster (for simulation only)
63
 
64
Library with header files to include is [./src/includes/](https://github.com/syntacore/scr1/tree/master/src/includes)
65
 
66
## Simulation quick start guide
67
 
68
The project contains testbenches, test sources and scripts to quickly start the SCR1 simulation. Before starting the simulation, make sure you have:
69
 
70
* installed RISC-V GCC toolchain,
71
* installed one of the supported simulators,
72
* initialized submodules with test sources.
73
 
74
### Requirements
75
 
76
#### Operating system
77
 
78
GCC toolchain and make-scripts are supported by most popular Linux-like operating systems.
79
 
80
To run from Windows you can use an additional compatibility layer, such as WSL or Cygwin.
81
 
82
#### RISC-V GCC toolchain
83
 
84
RISC-V GCC toolchain is required to compile the software. You can use pre-built binaries or build the toolchain from scratch.
85
 
86
##### Using pre-built binary tools
87
 
88
Pre-built RISC-V GCC toolchain with support for all SCR1 architectural configurations is available for download from http://syntacore.com/page/products/sw-tools.
89
 
90
1. Download the archive for your platform.
91
2. Extract the archive to preferred directory ``.
92
3. Add the `/bin` folder to the $PATH environment variable:
93
```
94
    export PATH=/bin:$PATH
95
```
96
 
97
##### Building tools from source
98
 
99
You can build the RISC-V GCC toolchain from sources, stored in official repo https://github.com/riscv/riscv-gnu-toolchain
100
 
101
Instructions on how to prepare and build the toolchain can be found on https://github.com/riscv/riscv-gnu-toolchain/blob/master/README.md
102
 
103
We recommend using the multilib compiler. Please note that RV32IC, RV32E, RV32EM, RV32EMC, RV32EC architectural configurations are not included in the compiler by default. If you plan to use them, you will need to include the appropriate libraries by yourself before building.
104
 
105
After the building, be sure to add the `/bin` folder to the $PATH environment variable
106
 
107
 
108
#### HDL simulators
109
 
110
Currently supported simulators:
111
 
112
* Verilator (last verified version: v4.102)
113
* Intel ModelSim (last verified version: INTEL FPGA STARTER EDITION vsim 2020.1_3)
114
* Mentor Graphics ModelSim (last verified version: Modelsim PE Student Edition 10.4a)
115
* Synopsys VCS (last verified version: vcs-mx_vL-2016.06)
116
* Cadence NCSim
117
 
118
Please note that RTL simulator executables should be in your $PATH variable.
119
 
120
#### Tests preparation
121
 
122
The simulation package includes the following tests:
123
 
124
* **hello** - "Hello" sample program
125
* **isr_sample** - "Interrupt Service Routine" sample program
126
* **riscv_isa** - RISC-V ISA tests (submodule)
127
* **riscv_compliance** - RISC-V Compliance tests (submodule)
128
* **dhrystone21** - Dhrystone 2.1 benchmark
129
* **coremark** - EEMBC's CoreMark® benchmark (submodule)
130
 
131
After the main SCR1 repository has been cloned execute the following command:
132
```
133
    git submodule update --init --recursive
134
```
135
 
136
This command will initialized submodules with test sources.
137
 
138
### Running simulation
139
 
140
To build RTL, compile and run tests from the repo root folder you have to call Makefile.
141
By default, you may simply call Makefile without any parameters:
142
``` sh
143
    make
144
```
145
 
146
In this case simulation will run on Verilator with following parameters: `CFG=MAX BUS=AHB TRACE=0 TARGETS="hello isr_sample riscv_isa riscv_compliance dhrystone21 coremark"`.
147
 
148
Makefile supports:
149
 
150
* choice of simulator - `run_ = `
151
* selection of external interface - `BUS = `,
152
* configuration setup - `CFG = `,
153
* parameters for CUSTOM configuration - `ARCH = , VECT_IRQ = <0, 1>, IPIC = <0, 1>, TCM = <0, 1>`
154
* tests subset to run - `TARGETS = `
155
* enabling tracelog - `TRACE = <0, 1>`
156
* and any additional options to pass to the simulator - `SIM_BUILD_OPTS`.
157
 
158
Examples:
159
``` sh
160
    make run_verilator_wf CFG=MAX BUS=AXI TARGETS="riscv_isa riscv_compliance" TRACE=1
161
    make run_vcs CFG=BASE BUS=AHB TARGETS="dhrystone21 coremark" SIM_BUILD_OPTS="-gui"
162
    make run_modelsim CFG=CUSTOM BUS=AXI ARCH=I VECT_IRQ=1 IPIC=1 TCM=0 TARGETS=isr_sample
163
```
164
 
165
Build and run parameters can be configured in the `./Makefile`.
166
 
167
After all the tests have finished, the results can be found in `build//test_results.txt`.
168
 
169
**IMPORTANT:** To ensure correct rebuild, please clean build directory between simulation runs:
170
``` sh
171
    make clean
172
```
173
 
174
Please refer to the *"Simulation environment"* chapter of the [SCR1 User Manual](https://github.com/syntacore/scr1/blob/master/docs/scr1_um.pdf) for more information on setting up a simulation run.
175
 
176
## SCR1 SDKs
177
 
178
FPGA-based SDKs are available at the .
179
 
180
Repo contains:
181
 
182
* Pre-build images and open designs for several standard FPGAs boards:
183
  * Digilent Arty (Xilinx)
184
  * Digilent Nexys 4 DDR (Xilinx)
185
  * Arria V GX Starter (Intel)
186
  * Terasic DE10-Lite (Intel)
187
* Software package:
188
  * Bootloader
189
  * Zephyr RTOS
190
  * Tests\SW samples
191
* User Guides for SDKs and tools
192
 
193
## Contacts
194
 
195
Report an issue: 
196
 
197
Ask a question: scr1@syntacore.com

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.