[JASA 1C2] SoC Harness Functions User Logic Debug – Caravel SoC

Version: 2024/05/29

Table of Contents:

  1. Introduction
  2. Software Setup
  3. Hardware Setup
  4. Firmware
  5. User Logic Debug Function
  6. Caravel’s logic analyzer

1. Introduction

To evaluate the feasibility of realizing the JASA Chip 1 using eFabless design and manufacturing processes, we will assess the “user circuit debug function” using the “Marmot1” logic placed in the MPW-6 open project area. This evaluation involves creating a Caravel program and testing its functionality. By running “Marmot1” on MPW-6, we aim to demonstrate the design flow intended for use in JASA Chip 1.

2. Software Setup

Please follow the software setup in the previous investigation.

3. Hardware Setup

3.1 Pinouts

Caravel mprj_io[#]Caravel Mgmt. SoCMarmot IOF0Marmot GPIO
0JTAG
1SDOTDO
2SDITDI
3CSBTMS
4SCKTCK
5ser_rxuart0_rx
6ser_txuart0_tx
7irqspi1_csb[1]gpio[24]
8flash2_csbspi0_flash_csb
9flash2_sckspi0_flash_sck
10flash2_io[0]spi0_flash_io[0]
11flash2_io[1]spi0_flash_io[1]
12spi0_flash_io[2]
13spi0_flash_io[3]
14spi1_csb[0]gpio[0]
15spi1_sckgpio[1]
16spi1_io[0]gpio[2]
17spi1_io[1]gpio[3]
18spi1_io[2]gpio[4]
19spi1_io[3]gpio[5]
20spi2_csb
21spi2_sck
22spi2_io[0]
23spi2_io[1]
24spi2_io[2]
25spi2_io[3]
26i2c0_sdagpio[12]
27i2c0_sclgpio[13]
28i2c1_sdagpio[14]
29i2c1_sclgpio[15]
30uart1_rxgpio[16]
31uart1_txgpio[17]
32uart2_rxgpio[18]
33uart2_txgpio[19]
34uart3_rxgpio[20]
35uart3_txgpio[21]
36uart4_rxgpio[22]
37uart4_txgpio[23]

3.2. Prepare the Caravel Board:

Ensure the Caravel board is powered off before starting the setup.
Ensure that the M.2 card with Marmot1 MPW-6 is properly inserted into the M.2 connector and securely fastened with a screw.。

3.3. Hardware Connection:

Connect an external SPI Flash module W25Q32 (flash2) to the Caravel board as below:

Caravel BoardMarmot IOF0Flash2
3V3VCC
GNDGND
mprj_io[8]spi0_flash_csbCS
mprj_io[9]spi0_flash_sckCLK
mprj_io[10]spi0_flash_io[0]DI
mprj_io[11]spi0_flash_io[1]DO

Connect an AHT20 sensor module to the Caravel board as below:

Caravel BoardMarmot IOF0AHT20
3V3VIN
GNDGND
mprj_io[26]i2c0_sdaSDA
mprj_io[27]i2c0_sclSCL

And the USB to TTL module (3.3V) as below:。

Caravel BoardMarmot IOF0USB to TTL
GNDGND
mprj_io[5]uart0_rxTx
mprj_io[6]uart0_txRx

Our hardware setup is now complete and ready for testing.

4. Firmware

4.1. PicoRV32 Core

Run below commands to build the firmware and flash it to the Caravel Management SoC:

cd ~/caravel_samples/picorv32/marmot make clean make sudo make flash

After flashing the firmware to the PicoRV32 Core, the LED D3 on Caravel board will start blinking.

4.2. Rocket Core

The firmware for the Rocket Core will be put in the external SPI flash memory “flash2” (W25Q32).

To flash the external SPI Flash (W25Q32), we will use the user passthru mode.
At first, we need to connect the CS pin of SPI Flash to mprj_io[3] instead of mprj_io[8].

Run below commands to build the firmware and flash it to the external SPI flash memory:

cd ~/caravel_samples/rocket/hello make clean make sudo make flash2

After flashing the “flash2”, we need to reconnect the CS pin to mprj_io[8] so that the Rocket core can access and execute commands from the SPI Flash memory.

Press RESET button and we can see the Rocket Core output via UART (baudrate 115200).。

5. User Logic Debug Function

5.1. GPIO

Follow the steps below:

  1. Connect the CS pin of “flash2” to mprj_io[3]
  2. Run below commands to flash the firmware to the Rocket Core:
cd ~/caravel_samples/rocket/gpio make clean make sudo make flash2
  1. Connect the CS pin of “flash2” back to mprj_io[8]
  2. Press RESET button

We could get the signal from gpio pins.
Please check the table Pinouts for the corresponding pin.
For example, gpio0 is mprj_io[14] on the Caravel board.

5.2. UART

Caravel mprj_io[#]Caravel Mgmt. SoCMarmot IOF0Marmot GPIO
5ser_rxuart0_rx
6ser_txuart0_tx
30uart1_rxgpio[16]
31uart1_txgpio[17]
32uart2_rxgpio[18]
33uart2_txgpio[19]
34uart3_rxgpio[20]
35uart3_txgpio[21]
36uart4_rxgpio[22]
37uart4_txgpio[23]

Follow the steps below:

  1. Connect the CS pin of “flash2” to mprj_io[3]
  2. Run below commands to flash the firmware to the Rocket Core:
cd ~/caravel_samples/rocket/uart make clean make sudo make flash2
  1. Connect the CS pin of “flash2” back to mprj_io[8]
  2. Press RESET button

We could see the output from UART0:

And UART1 – UART4

5.3. I2C

Caravel mprj_io[#]Marmot IOF0
26i2c0_sda
27i2c0_scl
28i2c1_sda
29i2c1_scl

Follow the steps below:

  1. Connect the CS pin of “flash2” to mprj_io[3]
  2. Run below commands to flash the firmware to the Rocket Core:
cd ~/caravel_samples/rocket/i2c make clean make sudo make flash2
  1. Connect the CS pin of “flash2” back to mprj_io[8]
  2. Press RESET button

We can read the temperature and humidity from AHT20 sensor and output them to UART0.

5.4. SPI

Caravel mprj_io[#]Marmot IOF0
14spi1_csb[0]
15spi1_sck
16spi1_mosi
17spi1_miso

Follow the steps below:

  1. Connect the CS pin of “flash2” to mprj_io[3]
  2. Run below commands to flash the firmware to the Rocket Core:
cd ~/caravel_samples/rocket/spi make clean make sudo make flash2
  1. Connect the CS pin of “flash2” back to mprj_io[8]
  2. Press RESET button

6. Caravel’s logic analyzer

The logic analyzer is a 128-bit port going to/from the user area and management SoC. It allows the SoC to “probe” any desired signals from the user area after fabrication (but they cannot be changed once fabricated). This is useful for debugging signals during the bringup process, possibly to discover bugs in the hardware, or to verify that they are working correctly.

In the Marmot1 user logic, the lowest 32-bit port is connected to gpio0 – gpio31.。

To run LA test, follow the steps below:

  1. Run below commands to flash the firmware to PicoRV32 Core:
cd ~/caravel_samples/picorv32/la make clean make sudo make flash
  1. Connect the CS pin of “flash2” to mprj_io[3]
  2. Run below commands to flash the firmware to the Rocket Core:
cd ~/caravel_samples/rocket/gpio make clean make sudo make flash2
  1. Connect the CS pin of “flash2” back to mprj_io[8]
  2. Press RESET button

We could get logs on UART0 from PicoRV32. The baud rate of PicoRV32 UART is 9600.