GNU CGEN for RISC V Tool Chain Customization
summary
Demo shows GNU CGEN generates libopcodes and libinsn to produce assembler, disassembler and a table‑driven simulator integrated with GDB and aims for a 24‑hour turnaround from instruction spec to toolchain. It supports RV32 and RV64 with per‑machine ISAs, works around a word‑size bug by generating two sets of files, and implements the proposed bit‑manip extension — B subextension implemented in 7 days — patches for simulator/GDB are under review though regression tests remain manual.
AI-written summary · about
chapters (41)
- 0:00Intro
- 1:19Preparatory Material
- 1:57Structure of This Tutorial • A short introduction to CGEN
- 3:00What is CGEN?
- 4:20Where CGEN fits
- 5:46A Hardware View of the World
- 6:29A Software View of the World
- 7:20General CGEN Entites
- 8:48Architecture and ISAS
- 9:57Defining the Hardware Hierarchy
- 11:43Low Level Hardware: Registers
- 13:49The ISA: Instruction Fields and Operands
- 15:46The ISA: Instructions
- 18:03The Key Files cpu/riscv.cpu
- 20:24Configuring the Build System opcodes/configure ac
- 20:55Code Changes opcodes/disassemble.c
- 21:27Configure and Build $ mkdir bd
- 22:27Mandatory Components
- 23:50Configure and Build the GNU Assembler
- 24:21Extending cpu/riscv.cpu
- 25:02Semantic Information
- 26:15Hand-written: riscv.c
- 29:14Hand-written: sim-main.h
- 29:46Simulator Configuration
- 30:36Configure, Build and Run Under GDB
- 31:13Preprocessor Macros Function macros
- 32:14Macro Example from RISC-V
- 33:03Multiple ISAs for Assembler/Disassembler
- 34:44Multiple ISAs for the Simulator Define a new much for 32-bit RISC-V Define a new CPU for 32-bit RISC-V
- 35:05Multiple ISAs for the Simulator: A Problem Problem: CPUs have to have the same word-bitsize
- 35:28sim/riscv/Makefile.in: Split arch Rule
- 35:53sim/riscv/Makefile.in: Split cpu Rule
- 36:47sim/riscv/Makefile.in: Using XLEN
- 38:18Multiple Disassembler/Assembler Extensions
- 40:49Multiple Simulator Extensions
- 42:25Pseudo Assembler Instructions
- 44:29RVEXT Attribute for Bitmanip
- 44:41RVEXT Macros for Bitmanip
- 44:53Add Generic B Supporting Machs
- 45:20Enumerate 'B' Instructions with Semantics
- 46:26Current Status and Issues: CGEN • CGEN is now in git
related talks
22mGigue: A JIT Code Binary Generator for Hardware Testing
28mLLVM for RISCV
24mRISC V LLVM: Towards A Production-Ready LLVM-Based Toolchain
18mRGen: A Sail Extension for Generating RISC-V Compiler, Simulator, and Application Support
16mAutomatic Test Generation and Verification for RISC-V Vector Extension
01h 10mWhy RISC-V Through ISA Customization Demonstration
01h 05mTutorial: Toolchains
20mAnalysis for Code Size Opportunities in RISC V
