"lucknow." is an open-source project where i'll publish a collection of digital designs i've created at the heart of the city of lucknow, india!
-
./core/l0
- 32-bit, single-cycle, compute core
- rv32i + zicsr
- all code executes in machine mode (m-mode)
- harvard memory architecture
- traps follow the privileged spec (ecall, ebreak, illegal instruction, misaligned/out of bounds access)
- no interrupts, no minstret
- passes the official riscv-tests rv32ui suite and the rv32mi tests that apply to it (see
core/l0/docs/CHIP.md) - can be used as a design block in systems where a minimal ccu (central control unit) is required
- educational/hobby purpose
-
./soc/k0 (work in progress)
- core l0 plus the m extension (mul, mulh, mulhsu, mulhu in one clock; div, divu, rem, remu in 34 clocks, one bit per clock) and the a extension (lr.w, sc.w, and the nine word amos; one word reservation, any store clears it)
- one memory map for both ports (qemu virt like): boot rom @
0x0000_1000(reset vector), ram @0x8000_0000. the instruction port and the data port see the same ram, so code can be stored and run (fence.iworks) valid/readystyle handshakes on both ports: the core stalls while a fetch or access is not ready,bus.svcan add wait states (FETCH_WAIT,DATA_WAIT) to model slow memory- uart @
0x1000_0000: 16550 register layout (what the 8250 driver and earlycon use), byte accesses, 8N1 at clk/UART_CLKS_PER_BIT(>= 4);UART_ECHO=1prints the bytes in simulation. transmit and receive, 16 byte fifos in each direction whenFCRbit 0 is set (a 16550A: usens16550ain a device tree, trigger levels and a character timeout interrupt), otherwise one byte each way (a 16450), overrun and framing error inLSR, received data / transmitter empty / line status interrupts (IER,IIR), divisor latches (DLAB) are stored only. with the fifos off a program has to drain the receiver within one byte time - clint @
0x0200_0000(qemu virt / sifive layout, one hart):msip@+0x0,mtimecmp@+0x4000,mtime@+0xBFF8, word accesses;mtimecounts clocks - plic @
0x0C00_0000(sifive / qemu virt layout): 31 level sources (uart is source 10, like qemu virt), 3 bit priorities, one context (machine mode of the hart), claim / complete, threshold; word accesses - machine interrupts: timer (mip.MTIP) and software (mip.MSIP) from the clint, external (mip.MEIP) from the plic,
mie,mstatus.MIE/MPIE, taken between instructions (an interrupted instruction does nothing and is replayed aftermret,mepcis its pc),mtvecdirect and vectored mode;wfiis a no-op - counters:
mcycle/minstret(64 bit,mcycleh/minstreth),cycle/instretaliases,time/timehread from the clint'smtime - machine and user mode:
mstatus.MPP(00 or 11),mretenters the mode inMPP, ecall from user is cause 8, machine csrs,mret,wfiand counters not inmcounterenare illegal in user mode, writing a read only csr is illegal; no pmp.mstatushas MIE, MPIE and MPP only,mipis read only - boot rom:
a0= 0,a1= device tree at0x807F_0000, jumps to ram - runs a no-mmu Linux 6.12 to a shell, see
soc/k0/docs/LINUX.md soc.svwires the core to the bus; unmapped accesses, stores to the rom, non-byte uart accesses and non-word clint or plic accesses are access faults- passes riscv-tests rv32ui (including
fence_i), rv32mi (includingillegalandinstret_overflow), rv32um and rv32ua, also with wait states - not done yet: more peripherals, s-mode (and a second plic context) and an mmu
the open silicon tools (simulation, sky130 analog and digital flows) live in one directory outside the repository.
.env says where; eda.sh is the only script that sets them up.
cp .env.example .env # once: set EDA to the tools directory
./eda.sh # menu: install, verify, shell, view, demo
source eda.sh # put the tools on PATH in the current shellwhat is installed and where: TOOLS.md. the flows (analog, digital, mixed signal) and what was verified:
FLOWS.md. the l0 place and route runs: core/l0/librelane/RUNS.md.
╱|、
(˚ˎ 。7
|、˜〵
じしˍ,)ノ
the repository and everything within is licensed under the GNU General Public License v3.0. Refer to COPYING.md for the full license text.