Home

Awesome

SCR1 RISC-V Core

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.

SCR1 cluster

Key features

For more information on core architecture, see SCR1 External Architecture Specification.

For more information on project usage, see SCR1 User Manual.

Repository contents

FolderDescription
dependencies                Dependent submodules
├─ riscv-tests                  Common source files for RISC-V ISA tests
├─ riscv-compliance              Common source files for RISC-V Compliance tests
└─ coremark                      Common source files for EEMBC's CoreMark® benchmark
docsSCR1 documentation
├─ scr1_eas.pdf                  SCR1 External Architecture Specification
└─ scr1_um.pdf                  SCR1 User Manual
simTests and scripts for simulation
├─ tests/common                  Common source files for tests
├─ tests/riscv_isa              RISC-V ISA tests platform specific source files
├─ tests/riscv_compliance        RISC-V Compliance platform specific source files
├─ tests/benchmarks/dhrystone21  Dhrystone 2.1 benchmark source files
├─ tests/benchmarks/coremark    EEMBC's CoreMark® benchmark platform specific source files
├─ tests/isr_sample              Sample program "Interrupt Service Routine"
├─ tests/helloSample program "Hello"
└─ verilator_wrapWrappers for Verilator simulation
srcSCR1 RTL source and testbench files
├─ includesHeader files
├─ coreCore top source files
├─ topCluster source files
└─ tbTestbench files

SCR1 source file lists

SCR1 source file lists of SCR1 can be found in ./src:

Library with header files to include is ./src/includes/

Simulation quick start guide

The project contains testbenches, test sources and scripts to quickly start the SCR1 simulation. Before starting the simulation, make sure you have:

Requirements

Operating system

GCC toolchain and make-scripts are supported by most popular Linux-like operating systems.

To run from Windows you can use an additional compatibility layer, such as WSL or Cygwin.

RISC-V GCC toolchain

RISC-V GCC toolchain is required to compile the software. You can use pre-built binaries or build the toolchain from scratch.

Using pre-built binary tools

Pre-built RISC-V GCC toolchain with support for all SCR1 architectural configurations is available for download from https://syntacore.com/tools/development-tools.

  1. Download the archive for your platform.
  2. Extract the archive to preferred directory <GCC_INSTALL_PATH>.
  3. Add the <GCC_INSTALL_PATH>/bin folder to the $PATH environment variable:
    export PATH=<GCC_INSTALL_PATH>/bin:$PATH
Building tools from source

You can build the RISC-V GCC toolchain from sources, stored in official repo https://github.com/riscv/riscv-gnu-toolchain

Instructions on how to prepare and build the toolchain can be found on https://github.com/riscv/riscv-gnu-toolchain/blob/master/README.md

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.

After the building, be sure to add the <GCC_INSTALL_PATH>/bin folder to the $PATH environment variable

HDL simulators

Currently supported simulators:

Please note that RTL simulator executables should be in your $PATH variable.

Tests preparation

The simulation package includes the following tests:

After the main SCR1 repository has been cloned execute the following command:

    git submodule update --init --recursive

This command will initialized submodules with test sources.

Running simulation

To build RTL, compile and run tests from the repo root folder you have to call Makefile. By default, you may simply call Makefile without any parameters:

    make

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".

Makefile supports:

Examples:

    make run_verilator_wf CFG=MAX BUS=AXI TARGETS="riscv_isa riscv_compliance" TRACE=1
    make run_vcs CFG=BASE BUS=AHB TARGETS="dhrystone21 coremark" SIM_BUILD_OPTS="-gui"
    make run_modelsim CFG=CUSTOM BUS=AXI ARCH=I VECT_IRQ=1 IPIC=1 TCM=0 TARGETS=isr_sample

Build and run parameters can be configured in the ./Makefile.

After all the tests have finished, the results can be found in build/<SIM_CFG>/test_results.txt.

IMPORTANT: To ensure correct rebuild, please clean build directory between simulation runs:

    make clean

Please refer to the "Simulation environment" chapter of the SCR1 User Manual for more information on setting up a simulation run.

SCR1 SDKs

FPGA-based SDKs are available at the https://github.com/syntacore/scr1-sdk.

Repo contains:

Contacts

Report an issue: https://github.com/syntacore/scr1/issues

Ask a question: scr1@syntacore.com