Giter VIP home page Giter VIP logo

carbon1-sw's Introduction

Carbon1 Software

This repository contains drivers to build a minimal bare-metal software for the Carbon1 RISC-V tape-out.

About

Carbon1 is an open-source RISC-V MCU written in SpinalHDL and taped out with Cadence for IHP's 130nm SG13S semiconductor process. The design uses a VexRiscv RV32IMC CPU with standard low-speed peripherals (UART, GPIO, I2C, SPI) and system (MTIMER, PLIC) components. Moreover, it has a 512 Byte on-chip RAM, which provides space for the stack and data segments, and fetches instructions from an external SPI NOR device through the SPI controller.

The chip was developed with the Elements SDK, an open-source hard-/software co-design tool to develop, debug and maintain all stacks of an open-source System on Chip (SoC). Additionally, the project can generate all necessary files for the ASIC flow and allows the reproduction of the chip.

Known Issues

  • I2C: Used tri-state IOs with pull-ups instead of open-drain. The potocol looks well with an oscilloscopei, but it is active high and therefore not I2C conform.

Approved Components

  • VexRiscv RV32IMC
  • SPI Controller XIP
  • On-Chip RAM
  • UART TX+RX
  • UART IRQ on RX
  • PLIC
  • GPIO
  • MTIMER

Development Board

X2 / JTAG

X2 has an ARM 20-Pin JTAG interface pinout; therefore, all compatible JTAG debugger can be used.

X4 / UART+I2C

Use a jumper to connect pin 5 with 7 (UART CTS/RTS) to bypass the flow control when the UART-USB converter only has a TX and RX pin.

Description Pin Pin Description
UART TXD

1

2

VCC 3.3V
UART RXD

3

4

VCC 3.3V
UART CTS

5

6

I2C SDA
UART RTS

7

8

I2C SCL
GND

9

10 GND

X5 / GPIO

Description Pin Pin Description
GPIO4

1

2

GPIO0
GPIO5

3

4

GPIO1
GPIO6

5

6

GPIO2
GND

7

8

GPOP3
GND

9

10 GND

X6 / SPI XIP

Description Pin Pin Description
SPI XIP nCS

1

2

VCC 3.3V
SPI XIP CLK

3

4

VCC 3.3V
SPI XIP MOSI

5

6

TP28
SPI XIP MISO

7

8

nRESET
GND

9

10 GND

Installation

Download a pre-build risc-v gcc.

wget https://github.com/stnolting/riscv-gcc-prebuilt/releases/download/rv32i-2.0.0/riscv32-unknown-elf.gcc-10.2.0.rv32i.ilp32.newlib.tar.gz
mkdir riscv32-unknown-elf
tar -xvf riscv32-unknown-elf.gcc-10.2.0.rv32i.ilp32.newlib.tar.gz -C riscv32-unknown-elf/
rm riscv32-unknown-elf.gcc-10.2.0.rv32i.ilp32.newlib.tar.gz

Install OpenOCD with VexRiscv support (when debugging is required).

git clone [email protected]:aesc-silicon/elements-openocd.git
cd elements-openocd
./bootstrap && ./configure && make -j `nproc`
cd ../

Compile

A makefile exists in the root directory to build the kernel image.

make

Structure

driver/ and include/ contain driver for all IPs.

carbon/ contains the start-up code and main loop.

Flash

Carbon1 has a read-only SPI XIP controller and does not support programming the external memory.

Bus Pirate

Connect a Bus Pirate with all four SPI XIP pins on pin header X6 and execute the corresponding make rule.

make flash_buspirate

flashrom first reads the entire SPI flash content. Unfortunately, the SPI NOR has a size of 64MB and the flash procedure takes 20 minutes.

Sponsores

This project included support from other people whom I would like to thank:

* Steffen Reith (Hochschule RheinMain)
* Matthias Harter (Hochschule RheinMain)
* Andreas Grothe (Hochschule RheinMain)
* Elvira Liandres (Fraunhofer IIS)

This tape-out was funded by Hochschule RheinMain and PHYTEC Messtechnik GmbH sponsored the circuit boards.

License

Copyright (c) 2022 Daniel Schultz. Released under the license.

carbon1-sw's People

Contributors

dnltz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.