[JASA 1C1] SoC Harness Functions - Caravel SoC



Version: 2024/03/26

Table of Contents:

  1. Introduction
  2. Software Setup
  3. Hardware Setup
  4. Power-On Procedure
  5. Firmware
  6. Initial Functional Testing
  7. Conclusion

1. Introduction

This guide is designed to assist you in the process of bringing up the Caravel board with Google MPW-6 (Marmot1) M.2 card, ensuring that it operates as expected and is ready for further development and testing.

The bring-up process is a critical phase in the development lifecycle, serving as the initial validation of the hardware components and functionality. It involves powering on the hardware, verifying basic operations, and identifying any potential issues or abnormalities that may need to be addressed.

2. Software Setup

2.1. Prerequisites

  • Host OS: Ubuntu 22.04.
  • Python 3.6 or later installed.
  • pip3 installed.

2.1. Install support packages

$ sudo apt update $ sudo apt upgrade $ sudo apt install openocd fakeroot verilator python3 meson gtkterm gawk texinfo git python3-pip bison device-tree-compiler autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev build-essential flex gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build

2.2. Installation of cross-compiler toolchain for 64bit RISC-V

$ cd ~ $ git clone --recursive https://github.com/riscv/riscv-gnu-toolchain $ pushd riscv-gnu-toolchain $ ./configure --prefix=$HOME/RISCV --enable-multilib $ make newlib linux -j8 $ popd

Add to PATH

$ export PATH=$PATH:$HOME/RISCV/bin $ echo 'export PATH=$PATH:$HOME/RISCV/bin' >> ~/.bashrc

2.3. Install pyftdi

$ pip3 install pyftdi

3. Hardware Setup

The hardware setup for the development board is straightforward and ensures ease of testing for our project. Follow the steps below to set up the development board for testing:

3.1. Prepare Breakout Board:

Locate the breakout board with the M.2 edge connector, which is designed to accommodate our project. If necessary, remove the screw securing the existing breakout board module to the development board.

3.2. Insert Breakout Board:

Insert the breakout board into the socket on the development board, aligning the M.2 edge connector with the corresponding socket on the breakout board.
Insert the breakout board at a 45-degree angle into the ZIF (Zero Insertion Force) connector on the development board.

M2_inserted

3.3. Secure Breakout Board:

Press down gently on the breakout board to ensure it is properly seated in the ZIF connector. Once properly aligned, secure the breakout board in place by tightening the screw to hold it securely in the ZIF connector.

Caravel

3.4. Connect USB Cable:

Locate connector J1 on the development board, designated for connecting to a host computer or workstation.
Connect one end of a micro-B USB cable to connector J1 on the development board.

3.5. Connect to Host Device:

Connect the other end of the micro-B USB cable to a USB port on the computer.

With the USB cable connected from the development board's connector J1 to the host computer, power is supplied to the board. The USB connection serves as the power source for the board, providing the necessary voltage for its operation.

Our hardware setup is now complete and ready for testing.

4. Power-On Procedure

Connect the USB cable from the computer to the microUSB port J1 on the board. Ensure that the USB cable is securely plugged in and that there are no loose connections.

As the USB cable is plugged in, carefully observe the behavior of the system. Ensure that the LED Power D4 indicator is illuminated. This indicator signifies that power is successfully supplied to the board through the USB connection.

If the LED Power D4 does not light up as expected, it may indicate a power supply issue or a problem with the USB connection. In such cases, verify the integrity of the USB cable and ensure that the power source is providing sufficient power to the board. Additionally, check for any loose connections or damaged components that may be causing the issue.

5. Firmware

5.1. Clone the caravel_board repository

$ cd ~ $ git clone https://github.com/efabless/caravel_board

5.2. Build the firmware

The prebuilt firmware can be found in ~/caravel_board/firmware/chipignite/blink/blink.hex after cloning the repository.

To build/rebuild the firmware from source code:

  1. Change the toolchain path and build options in ~/caravel_board/firmware/chipignite/blink/Makefile as following:
  • Toolchain path (see 2.2)
-TOOLCHAIN_PATH=/usr/local/bin/ +TOOLCHAIN_PATH=~/RISCV/bin/
  • Build options
-ARCH=rv32i -#ARCH=rv32i_zicsr +#ARCH=rv32i +ARCH=rv32i_zicsr
  1. Run below commands to build the firmware:
cd ~/caravel_board/firmware/chipignite/blink make clean hex

5.3. Flash the firmware

Run below commands to flash the firmware

cd ~/caravel_board/firmware/chipignite/blink make flash

6. Initial Functional Testing

After ensuring that the development board is powered on and properly connected to the host device, we can proceed with the initial functional testing to verify basic operations and functionalities. Below are the steps for conducting the initial functional testing:

6.1. LED Indicators:

Verify that LED D3 is blinking at a regular interval, indicating proper functionality.

6.2. GPIO Pins:

Test the GPIO pins on the development board to confirm their functionality.
Use an oscilloscope to check the GPIO pins:

  • Connect the oscilloscope probe to the GPIO pin under test.
  • Observe the output waveform on the oscilloscope.
  • Verify that the GPIO pin toggles between high and low logic states as expected.
  • Repeat the test for each GPIO pin to ensure all pins are functioning correctly.

7. Conclusion

The completion of the initial functional testing signifies the successful verification of the Caravel SoC functionality. Through meticulous observation of LED indicator D3 blinking as expected and thorough testing of GPIO pins using an oscilloscope, we have validated the proper operation of the Caravel SoC.

This testing phase serves as a crucial milestone in the development process, affirming the functionality and integrity of the Caravel SoC module. The absence of any significant issues or abnormalities during testing instills confidence in the reliability of the hardware platform.

Looking ahead, the focus will shift towards the next phase of development, which entails the bring-up and validation of the Rocket SoC. With the Caravel SoC functioning as expected, we are poised to proceed with confidence into the next stage of testing and integration.