135 serv_soc_wb

135 : serv_soc_wb

Design render

How it works

RISC-V SoC based on the SERV

This is a RISC-V SoC based on the SERV and SERVILE cores from https://github.com/olofk/serv.git. The SERV core has been adapted to support the RV32E specifications. The register file was implemented via an DFF-based SRAM of 19x32 bit, 15 General Purpose Registers (GPR) and 4 CSR.

The SoC is composed of a SERV core, a GPIO, an UART a 64-bit timer and a QSPI controller. All components connected via a wishbone bus interconect. The QSPI controller allows the SoC to access an external QSPI FLASH and RAM memories using the QSPI Pmod board.

The following diagram ilustrates the main system interconection.

alt text

Memory Map

Peripheral Address
QSPI-FLASH 0x00000000 - 0x00FFFFFF
QSPI-RAM1 0x01000000 - 0x017FFFFF
QSPI-RAM2 0x01800000 - 0x01FFFFFF
UART-16550 0x90000000 - 0x90000007
GPIO 0x91000000 - 0x9100001F
MTIMEL 0xFFFFFFF0 - 0xFFFFFFF3
MTIMEH 0xFFFFFFF4 - 0xFFFFFFF7
MTIMECMPL 0xFFFFFFF8 - 0xFFFFFFFB
MTIMECMPH 0xFFFFFFFC - 0xFFFFFFFF

NOTE: The whole system works maximum at 25Mhz on gf180mcu and 50MHz on sky130A.

It is worth mentioning that the SoC can execute code from both FLASH and SRAM memories, the execution from SRAM is posible thanks to an small bootloader loaded into the FLASH that receives the program from the UART and dumps it into the SRAM.

Pinout interface

The following is the pinout on the tiny tapeout chip:

The gpio_o can be connected to any type of output, LEDs, LCDs, etc and the gpio_i can be connected to any kind of input, buttons, sensors etc.

The uart must be connected to your laptop via an usb-serial converter (e.g., rs232rl or similar).

# Input (ui) Output (uo) Bidirectional (uio)
0 gpio_i[0] gpio_o[0] cs_flash
1 gpio_i[1] gpio_o[1] sio0
2 gpio_i[2] gpio_o[2] sio1
3 gpio_i[3] gpio_o[3] sck
4 gpio_i[4] gpio_o[4] sio2
5 gpio_i[5] gpio_o[5] sio3
6 gpio_i[6] gpio_o[6] cs_ram0
7 uart0_rx uart0_tx cs_ram1

How to test

Install the RISC-V toolchain with RV32E support

1. Prerequisites on Ubuntu
#using bash
sudo apt-get install autoconf automake autotools-dev curl python3 python3-pip python3-tomli libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev libslirp-dev libncurses-dev
2. Prerequisites on MacOS
# using homebrew
brew install python3 gawk gnu-sed make gmp mpfr libmpc isl zlib expat texinfo flock libslirp ncurses ninja bison m4 wget
3. Configure and compile the crosscompiler for RV32E:
git clone --recursive https://github.com/riscv/riscv-gnu-toolchain.git
cd riscv-gnu-toolchain
mkdir -p /opt/riscv32e # you can pickup any location in your system, this examples is for ubuntu
./configure --prefix=/opt/riscv32e --with-arch=rv32e --with-abi=ilp32e
make -j$(nproc)
# Make the instalation directory available and accesible ( you need to run this every time you open a new terminal session)
export PATH=/opt/riscv32e/bin:$PATH 
# This command will permanently add the toolchain directory to your user environment; In this way the toolchain will be available everytime you open a terminal session.
echo 'export PATH=/opt/riscv32e/bin:$PATH' >> ~/.bashrc 

Run Examples

The following sugested schematic should be implemented to try out the proposed examples. The SoC requires external Flash and SRAM memories under the SPI or QSPI protocols; you can either use the QSPI Pmod board or individual memories W25Q128 and APS6404L as depicted in the schematic. The clock must be established to run at 25MHz, which is the maximum achievable SoC frequency. It is worth noting that any lower clk frequency can be used, in that case you need to modify the bootloader frequency accordingly.

The examples require to connect switches to the gpio_i[*] ports and LEDs to the gpio_o[*] ports. However, if you want to try your own programs, you can use these ports to connect any peripheral of your preference.

Finally, an USB to Serial converter is required to evaluate and interact with most of the examples. Furthermore, programming the SoC is also possible via the UART.

alt text

  1. Flash the nmon bootloader:

    • Program the flash memory using the nmon_25MHz.bin bootloader, this step is required to be done only once. You can use any FLASH programer (e.g., serprog).

    Eventually further guidelines might be provided regarding options for flashing the bootloader

  2. Compile the program

    cd ./sw/1-blink_led
    make clean build nmon
    
  3. Program the SERV-E-SoC with the compiled application

    # check the actual USB port in your system
    expect nmon-loader.sh application.nmon /dev/ttyUSB0 115200
    

    Eventually another way of programming the SoC can be provided in the future.

The following is a set of basic examples that have been prepared to use the SERV-E SoC. Every example has details about how to compile and program on the SERV-E SoC.

0-ricv-nmon: This is a basic bootloader living in the flash memory, it can be used to dump a program into de SRAM comming from the uart port.

1-blink_led: Basic blink led.

2-gpio_echo: Simple GPIO echo, copies inputs and put it to the outputs.

3-uart_stub_1: Uses the nmon uart function to access the uart.

4-uart_stub_2: Uses the nmon uart function to access the uart.

5-uart_puts: Explicit uart driver implementation, just transmision from SoC to PC.

6-uart_getc: Explicit uart driver implementation RX/TX.

7-systmr-irq: Timer IRQ implementation example.

8-FreeRTOS-demo1: Simple FreeRTOS port for the SoC.

9-FreeRTOS-demo2: Simple FreeRTOS port for the SoC.

External hardware

This project requires an external SPI Flash/Ram memory. The project has been proven using QPMOD. You also need to connect an USB to Serial conversor to interact with the system.

FPGA proven design

This design has been proved on an FPGA device via the DE10-nano board. Currently working on porting the design into an open source friendly FPGA device.

IO

#InputOutputBidirectional
0gpio_i[0]gpio_o[0]cs_flash
1gpio_i[1]gpio_o[1]sio0
2gpio_i[2]gpio_o[2]sio1
3gpio_i[3]gpio_o[3]sck
4gpio_i[4]gpio_o[4]sio2
5gpio_i[5]gpio_o[5]sio3
6gpio_i[6]gpio_o[6]cs_ram0
7uart0_rxuart0_txcs_ram1

Chip location

Controller Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux tt_um_chip_rom (Chip ROM) tt_um_factory_test (Tiny Tapeout Factory Test) tt_um_utoss_riscv (UTOSS RISC-V core) tt_um_memory_game_top (Number Memory Game) tt_um_danielpenas42 (Ball Display) tt_um_machinelearning (7-Segment Neural Predictor) tt_um_microlane_demo (microlane demo project) tt_um_pixel_processor (Tiny Pixel Processor) tt_um_jpigdon_gps_accelerator_top (GPS_Accelerator) tt_um_rgb_mixer (rgb_mixer) tt_um_bgao43 (Tiny TPU Systolic Array) tt_um_main (Pong in Verilog) tt_um_joannec34_teenytpu (teenytpu) tt_um_apa102_ws2812_squidgeefish (APA102 to WS2812 Translator) tt_um_uacj_bouncing_DVD_screensaver (Custom DVD Screensaver for VGA) tt_um_logoUACJ_MOGA (VGA_screensaver_UACJ) tt_um_grace_spi_led_driver (SPI-Controlled 8-Channel LED Driver) tt_um_rebeccargb_universal_decoder (Universal Binary to Segment Decoder) tt_um_rebeccargb_hardware_utf8 (Hardware UTF Encoder/Decoder) tt_um_happyhop_deadcast2 (happyhop) tt_um_dino7 (Dino-7: 7-Segment Runner Game) tt_um_arty3_mac_engine (Simple MAC Engine w/ Postproc) tt_um_uacj (Custom DVD Screensaver for VGA) tt_um_algofoogle_dottee (DOTTEE VGA demo (TTGF26a)) tt_um_mattvenn_signal_generator (Simple Signal Generator) tt_um_urish_simon (Simon Says memory game) tt_um_tpu (Tensor Processing Unit For GF) tt_um_gojimmypi_ttgf_UART_FSM_TRNG_Lab (Hardware Entropy Explorer: UART/SPI TRNG and PUF) tt_um_wokwi_465483277165299713 (First Tinytapeout) tt_um_prem_pipeline_test (Programmable_Pipeline-RISC-V) tt_um_wokwi_467219410242853889 (Tiny Tapeout testtest 111233) tt_um_wokwi_465549494272929793 (Pacos first design) tt_um_wokwi_465731371445677057 (Arturo's first Wokwi design) tt_um_wokwi_465732744934845441 (Tiny Tapeout Template_1234) tt_um_wokwi_465736492859711489 (Tiny Tapeout Workshop JuanF) tt_um_wokwi_465731430225727489 (Rafa’s first Wokwi design) tt_um_wokwi_465731458365332481 (7 segment Display Fli-Flop Try-out) tt_um_wokwi_465732744245929985 (DiseñoCursoTiny) tt_um_wokwi_465731490568160257 (Matt’s first Wokwi design) tt_um_wokwi_465736691688630273 (test1) tt_um_wokwi_465731458628527105 (Mi copia del Tiny Tapeout) tt_um_wokwi_465731520738845697 (El primer diseño) tt_um_wokwi_465731521356457985 (Tiny Tapeout Template Copy) tt_um_gen1_digital_companion_tile (Gen1 Digital Companion Tile) tt_um_wokwi_465732827753495553 (Tiny Tapeout Template Ayman) tt_um_wokwi_465731394728267777 (Julian_Proyecto) tt_um_wokwi_465731458535202817 (Tiny Tapeout Template Copy) tt_um_wokwi_465732847401723905 (Basic Circuit) tt_um_wokwi_465731452481768449 (El primer diseño de Matt para Wokwi) tt_um_wokwi_465731502018614273 (Tiny Tapeout Template flip flop) tt_um_wokwi_465732616714924033 (Tiny Tapeout RJAP) tt_um_wokwi_465731575275296769 (ocxpkeWokwiDesign) tt_um_wokwi_465732880722332673 (Pedro Template) tt_um_wokwi_465731858252480513 (Paula's first Wokwi design) tt_um_wokwi_465731455677830145 (Tiny Tapeout JMCG) tt_um_wokwi_465737601403996161 (Tiny Number Simon) tt_um_ttmul (Balanced Ternary Multiplier) tt_um_wokwi_465731466664816641 (Tiny Tapeout Workshop Malaga 2jun2026) tt_um_8bit_risc_cpu (8-bit RISC CPU) tt_um_wokwi_451184391728659457 (Simple Sprinkler) tt_um_fhw_appel_spiPWMio (spiPWMio) tt_um_divadnauj_GB_serv_soc_wb (serv_soc_wb) tt_um_8bitcustomcomputer (SAP 8 Bit Computer) tt_um_bioimpedance (Very Low Resource Digital Implementation of Bioimpedance Analysis) tt_um_mgj_bist8 (BIST-8: Built-In Self-Test for 8-bit CLA Adder) tt_um_roberto_tiny_radar_tile (BioPulse Tile) tt_um_systolic_mac_2x2 (2x2 Systolic Array Matrix Multiplier) tt_um_peg_top (2x2 CNN Accelerator PE Grid with UART) tt_um_AlvaroRub_ringcounter (Counter16Outputs) tt_um_wokwi_465731440267947009 (Antonio's first Wokwi design) tt_um_wokwi_465732706576877569 (Guille's first Wokwi design.) tt_um_wokwi_465731481873367041 (MIPS-Lite 8-bit Processor) tt_um_wokwi_465736612213902337 (Juan`s first Worki design) tt_um_wokwi_465731439156454401 (Rhyloo’s first Wokwi design) tt_um_wokwi_465732536551273473 (Tiny Tapeout Marcos Fernandez) tt_um_wokwi_465737290543084545 (Tiny Tapeout Template) tt_um_wokwi_465630130495825921 (ram 1 bit Copy) tt_um_wokwi_465731403724006401 (sdft wokwi 1) tt_um_top (RHD2164-MCU-SPI Bridge) tt_um_line_follower_arvaloez (Line Follower Robot controller) tt_um_xoroshiro64plus_v2 (xoroshiro64) tt_um_ohuettenhofer_tiny_qsim (Tiny Quantum Circuit Simulator) tt_um_santhosh_ring_osc_gf (Ring Oscillator PVT Sensor & TRNG (GF180)) tt_um_santhosh_stoch_stdp_pair_gf (Stochastic neuron + STDP controller (merged, GF180)) tt_um_santhosh_rsd_char_gf (RRAM Characterization Platform (DC sweep + endurance + retention + histogram, GF180)) tt_um_santhosh_xbar_ctrl_gf (Memristive Crossbar Peripheral Controller (GF180)) tt_um_joseph_bf (BF) tt_um_hydrocomms (FSK Modem) tt_um_systolic_array (2x2 MAC Systolic array with DFT) tt_um_kluterirv_rv32e_core (Minimal RV32E SoC with UART Loader) tt_um_algofoogle_ttgf26a_vco (VCO driven by DAC) tt_um_fer_logo_music_vga (UNIZG-FER VGA project) tt_um_maqsudbek_dyadic_pwm (Dyadic PWM) tt_um_waferspace_vga_screensaver (Wafer.space Logo VGA Screensaver) tt_um_htfab_vga_tester (Video mode tester)