Agent skill

Compiler Toolchain

by hdl-tools in hdl-tools/digital-chip-design-agents

Compiler toolchain development for custom processor ISAs — LLVM/GCC backend, assembler, linker scripts, runtime libraries, and regression validation.

MITAuto-check: notes

Install Compiler Toolchain

skills CLI
$ npx skills add hdl-tools/digital-chip-design-agents --skill compiler-toolchain -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hdl-tools/digital-chip-design-agents compiler-toolchain --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/hdl-tools/digital-chip-design-agents.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/compiler/skills/compiler-toolchain .claude/skills/compiler-toolchain && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
compiler-toolchain
GitHub stars
212
Token cost
~2.8k tokens
SKILL.md length
1,239 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

Compiler toolchain development for custom processor ISAs — LLVM/GCC backend, assembler, linker scripts, runtime libraries, and regression validation.

  • Works in 2 steps: memory/compiler/knowledge.md — known… → memory/compiler/run_state.md — current…
  • Building a compiler for a custom RISC-V extension
  • SKILL.md covers Invocation, Pre-run Context, Purpose and Supported EDA Tools, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Compiler Toolchain is an agent skill from hdl-tools/digital-chip-design-agents. Compiler toolchain development for custom processor ISAs — LLVM/GCC backend, assembler, linker scripts, runtime libraries, and regression validation. Use when building a compiler for a custom RISC-V extension, proprietary ISA, or any processor where no existing toolchain targets it correctly.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Digital HDL Design Full-stack Agents. The licence is MIT.

When your agent uses it

  • Building a compiler for a custom RISC-V extension
  • Proprietary ISA
  • Any processor where no existing toolchain targets it correctly

Example prompts

  • “/compiler-toolchain”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Bash

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. memory/compiler/knowledge.md — known failure patterns, successful tool flags, PDK/tool quirks.
  2. memory/compiler/run_state.md — current run identity (run_id, design_name, tool,

What it can do on your machine

Read from SKILL.md and the folder at commit 38736b1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are ld and markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Compiler Toolchain loads about 2.8k tokens when it runs. Until then it costs about 78 tokens; SKILL.md has 1,239 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~78
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from hdl-tools/digital-chip-design-agents at commit 38736b1, republished under its MIT licence (© hdl-tools). 1,239 words, ~2,765 tokens.

Download SKILL.mdSave it as .claude/skills/compiler-toolchain/SKILL.md (or your agent's skills folder).
name
compiler-toolchain
description
Compiler toolchain development for custom processor ISAs — LLVM/GCC backend, assembler, linker scripts, runtime libraries, and regression validation. Use when building a compiler for a custom RISC-V extension, proprietary ISA, or any processor where no existing toolchain targets it correctly.
allowed-tools
Read, Write, Bash
version
1.0.0
author
chuanseng-ng
license
MIT

Skill: Compiler Toolchain Development

Invocation

When this skill is loaded and a user presents a compiler or ISA task, do not execute stages directly. Immediately spawn the digital-chip-design-agents:compiler-orchestrator agent and pass the full user request and any available context to it. The orchestrator enforces the stage sequence, loop-back rules, and sign-off criteria defined below.

Use the domain rules in this file only when the orchestrator reads this skill mid-flow for stage-specific guidance, or when the user asks a targeted reference question rather than requesting a full flow execution.

Pre-run Context

Before executing or advising on any stage, read the following files if they exist:

  1. memory/compiler/knowledge.md — known failure patterns, successful tool flags, PDK/tool quirks. Incorporate its guidance into every stage decision. If absent, proceed without it.
  2. memory/compiler/run_state.md — current run identity (run_id, design_name, tool, last_stage). Use this to resume correctly after interruption. If absent, a new run is starting; the orchestrator will create this file before the first stage.

This pre-run read applies whether this skill is loaded by a user or called by the orchestrator mid-flow. It ensures the fix database is consulted before any diagnosis step.

Purpose

Build and validate a complete compiler toolchain (LLVM or GCC based) for a custom processor ISA. Bridges hardware and software — without a working toolchain no software can run on the designed chip.


Supported EDA Tools

Open-Source
  • LLVM/Clang (clang, llc, llvm-mc, llvm-objdump) — primary toolchain for new ISA backends
  • GCC and GNU Binutils (gcc, as, ld, objdump) — alternative backend; well-tested for RISC-V extensions
  • QEMU (qemu-system-*) — instruction-accurate ISA emulation for toolchain validation without hardware
Proprietary
  • Green Hills MULTI (dialect greenhills) — safety-critical compiler and debugger IDE
  • IAR Embedded Workbench (dialect iar) — certified compiler for ARM/RISC-V
  • Arm Compiler 6 (armcc, dialect arm) — LLVM-based compiler for Arm targets

Stage: isa_analysis

ISA Feature → Toolchain Component Mapping
ISA FeatureToolchain Component
Instruction encodingAssembler, disassembler
Register fileRegister allocator, ABI
Calling conventionABI, function call lowering
Branch/jumpControl flow, delay slot handling
Load/store addressingMemory access patterns
SIMD/vectorAuto-vectorisation, intrinsics
AtomicsMemory model, concurrency
Multiply/divideInteger arithmetic lowering
FPU presenceFP ABI (hard-float vs soft-float)
Custom instructionsIntrinsics, builtin functions
ABI Requirements (define before any backend code)
  1. Argument passing: which registers, stack spill rules
  2. Return value registers
  3. Callee-saved vs caller-saved register classification
  4. Stack alignment (8 or 16 byte)
  5. Data type sizes and alignments
  6. Struct layout (padding, packing rules)
  7. Thread-local storage model (if RTOS target)
Output Required
  • ISA-to-toolchain mapping table
  • ABI specification document
  • List of LLVM/GCC backend files to create/modify
  • Target triple: <arch>-<vendor>-<os>

Stage: backend_dev

LLVM Backend — Implement in This Order
  1. RegisterInfo.td: register classes, aliases, reserved registers
  2. InstrInfo.td: all instruction definitions with encoding
  3. CallingConv.td: argument and return value register rules
  4. SchedModel.td: latency and throughput per instruction class
  5. TargetMachine.cpp: entry point, subtarget selection
  6. ISelDAGToDAG.cpp: selection DAG → machine instruction lowering
  7. FrameLowering.cpp: stack frame, prologue/epilogue
  8. AsmPrinter.cpp: assembly text emission
Testing per Component
  • TableGen: llvm-tblgen compiles .td without errors
  • Codegen: llc compiles C snippets; verify .s output manually
  • MC layer: llvm-mc --show-encoding verifies instruction encoding
QoR Metrics to Evaluate
  • All ISA instruction classes: lowerable from LLVM IR
  • Calling convention: function call round-trip test passes
  • No illegal instructions in generated assembly
  • Basic integer test program: compiles, links, executes on ISS
Common Issues & Fixes
IssueFix
TableGen pattern not matchingAdd explicit Pat<> with matching operand types
Stack corruptVerify prologue saves all callee-saved regs
Calling convention mismatchCross-check CCAssignToReg vs ABI spec
Output Required
  • Complete LLVM backend source tree
  • Regression test files (llc lit tests)
  • Build instructions (CMake)

Stage: assembler_dev

Domain Rules
  1. LLVM MC layer provides assembler via .td instruction definitions
  2. For every instruction: encode-decode round-trip test
  3. Define all ELF relocation types: R_<ARCH>_*
  4. Directives: .section, .global, .type, .size, .align all working
  5. DWARF: verify .debug_info emitted for a C function (needed for GDB)
  6. Branch offsets: verify PC-relative encoding for forward and backward branches
  7. Immediate ranges: verify truncation and sign-extension at instruction boundaries
QoR Metrics to Evaluate
  • All instructions: encode-decode round-trip passes
  • All relocation types: defined and tested
  • ELF output: readable by readelf -a
  • DWARF: basic debug info emitted
Output Required
  • Assembler integrated in LLVM MC layer
  • Encoding test suite (one test per instruction format)
  • Relocation definition table

Stage: linker_config

Linker Script Template
ld
MEMORY {
  FLASH (rx)  : ORIGIN = 0x00000000, LENGTH = 512K
  RAM   (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
}
ENTRY(_start)
SECTIONS {
  .text   : { *(.text.reset) *(.text*) *(.rodata*) } > FLASH
  .data   : { *(.data*) }  > RAM AT > FLASH
  .bss    : { *(.bss*) *(COMMON); PROVIDE(__bss_end = .); } > RAM
  .stack  : { . = ALIGN(16); PROVIDE(__stack_top = .); . += STACK_SIZE; } > RAM
}
Domain Rules
  1. Memory regions must match chip memory map exactly
  2. Startup code (crt0.S): copy .data LMA→VMA; zero .bss; call main()
  3. Stack defined via linker symbol __stack_top; size configurable at link time
  4. All relocation types from assembler stage must be handled
  5. Verify: bare-metal binary links, loads, executes from reset vector
Show full SKILL.md (477 more words)Show less
QoR Metrics to Evaluate
  • Binary links without undefined symbols
  • .data initialised correctly at runtime
  • .bss zeroed at startup
  • Stack pointer: correct value at entry
Output Required
  • Linker scripts per memory configuration
  • Startup code (crt0.S)
  • Linker configuration documentation

Stage: runtime_libs

Required Libraries
LibraryContentsSource
compiler-rtInteger multiply/divide, soft-floatLLVM
newlib/picolibcC standard library (bare-metal)Port
libstdc++/libc++C++ standard libraryLLVM/GCC
libmMath librarynewlib
Porting newlib
  1. Implement syscall stubs: _write, _read, _sbrk, _exit, _close
  2. _sbrk: heap using __heap_start/__heap_end linker symbols
  3. _write: route to UART or semihosting for debug output
  4. C++ global constructors: add .init_array section to linker script
QoR Metrics to Evaluate
  • printf, malloc, memcpy, strlen: all functional
  • Soft-float: bit-exact results vs IEEE 754 (if no HW FPU)
  • Heap: no corruption under stress allocation/free test
  • C++ constructors: called before main()
Output Required
  • Ported and compiled runtime libraries
  • Syscall stub implementations
  • Library test results

Stage: toolchain_validation

Validation Tiers
TierPass Criteria
Smoke (hello world)100%
Unit (per-instruction asm tests)100%
Compiler (C feature tests)≥ 99%
Runtime (C library tests)≥ 99%
Application (representative workloads)Correct output
PerformanceWithin 10% of target
QoR Metrics to Evaluate
  • Compiler regression: ≥ 99% pass
  • Runtime tests: ≥ 99% pass
  • Application workloads: correct output vs golden
  • No miscompilation (wrong output = P0 blocker)
Output Required
  • Regression report (per tier, pass/fail counts)
  • Miscompilation root cause (if any)
  • Performance comparison vs target

Stage: toolchain_signoff

Sign-off Checklist
  • Compiler: generates correct code for custom ISA
  • Assembler: encodes all instructions correctly
  • Linker: correct scripts for all memory configurations
  • Runtime: libgcc/compiler-rt, newlib, libm all pass tests
  • Binutils: objdump, readelf, nm, objcopy work for target
  • Debugger: GDB or LLDB with target support functional
  • ISS: instruction-set simulator available
  • All regression tiers: PASS
  • Documentation: ABI spec, getting started guide, known issues
Output Required
  • Toolchain release package
  • Validation report
  • ABI specification (final)
  • Known issues list

Memory

Write on stage completion

After each stage completes (regardless of whether an orchestrator session is active), write or overwrite one JSON record in memory/compiler/experiences.jsonl keyed by run_id. This ensures data is persisted even if the flow is interrupted or called without full orchestrator context.

Use run_id = compiler_<YYYYMMDD>_<HHMMSS> (set once at flow start; reuse on each stage update). Every JSON record written must include a top-level "run_id" field whose value matches this key — this is what makes overwrites unambiguous. Set signoff_achieved: false until the final sign-off stage completes.

Run state (write before first stage, update after each stage)

Write memory/compiler/run_state.md as the first action before launching any tool:

markdown
run_id:      compiler_<YYYYMMDD>_<HHMMSS>
design_name: <design>
tool:        <primary tool>
start_time:  <ISO-8601>
last_stage:  <first stage name>

Update last_stage after each stage completes. This file lets wakeup-loop prompts and resumed sessions identify the correct run without relying on in-memory state. Create the file and parent directories if they do not exist.

Optional: claude-mem index

If mcp__plugin_ecc_memory__add_observations is available in this session, emit each applied fix as an observation to entity chip-design-compiler-fixes after writing to experiences.jsonl. Skip silently if the tool is absent — JSONL is the canonical record.

© hdl-tools, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/compiler/skills/compiler-toolchain of hdl-tools/digital-chip-design-agents.

Open the folder on GitHubat commit 38736b1

Compare with similar skills

Compiler Toolchain next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Compiler Toolchain compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Compiler Toolchain this skillhdl-tools/digital-chip-design-agents212—~2.8kAutomated safety check: NotesMIT
Gccdavila7/claude-code-templates32k—~1.6kAutomated safety check: PassMIT
Compile Knowledgesickn33/agentic-awesome-skills47k1 repos~2.3kAutomated safety check: PassMIT
Compileratopile/atopile4k—~1kAutomated safety check: PassMIT
Testing Core Processorsmastra-ai/mastra29k—~1.1kAutomated safety check: PassCustom licence
Gcczhinkgit/embeddedskills733—~993Automated safety check: PassMIT

Similar skills

  • Gcc

    davila7/claude-code-templates

    Git Context Controller (GCC) - Manages agent memory as a versioned file system under .GCC/.

    32k GitHub stars~1.6k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Compile Knowledge

    sickn33/agentic-awesome-skills

    Compile durable, non-obvious findings into an interlinked markdown knowledge store — atomic files, [[wiki-links]], a maintained index — so an agent gets smarter across sessions instead of relearning…

    47k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Compiler

    atopile/atopile

    How the atopile compiler builds and links TypeGraphs from .ato (ANTLR front-end → AST → TypeGraph → Linker → DeferredExecutor), plus the key invariants and test entrypoints.

    4k GitHub stars~1k tokensUpdated 3 mo ago
    Frontend & DesignAuto-check passed
  • Testing Core Processors

    mastra-ai/mastra

    A skill your agent uses when writing or debugging integration tests for error processors in packages/core/src/processors/.

    29k GitHub stars~1.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Gcc

    zhinkgit/embeddedskills

    GCC 嵌入式工程构建工具(CMake + arm-none-eabi-gcc),用于扫描 CMake 型嵌入式工程、 列出预设、配置、编译、重建、清理和分析 ELF 大小。当用户提到 GCC、arm-none-eabi、 CMake 嵌入式编译、Ninja 构建、ELF 大小分析、arm-gcc、交叉编译、cmake --build、 cmake --preset 时自动触发,也兼容…

    733 GitHub stars~993 tokensUpdated 1 mo ago
    Auto-check passed
  • Jq JSON Processor

    penpot/penpot

    Process, filter, and transform JSON data using jq - the lightweight and flexible command-line JSON processor.

    61k GitHub stars~663 tokensUpdated today
    Auto-check passed

More from hdl-tools/digital-chip-design-agents

All 17 skills in this repo
  • Architecture

    hdl-tools/digital-chip-design-agents

    Microarchitecture exploration, PPA estimation, risk assessment, and architecture sign-off for digital chip design.

    212 GitHub stars~3.7k tokensUpdated 5 days ago
    Auto-check: notes
  • Dft

    hdl-tools/digital-chip-design-agents

    Design for Test — scan architecture planning, scan insertion, ATPG pattern generation, MBIST for embedded memories, and JTAG boundary scan.

    212 GitHub stars~3.3k tokensUpdated 5 days ago
    Auto-check: notes
  • Embedded Firmware

    hdl-tools/digital-chip-design-agents

    Embedded firmware and device drivers — BSP development, peripheral driver implementation (UART, SPI, I2C, GPIO, DMA, Timer), RTOS integration (FreeRTOS, Zephyr), and system validation.

    212 GitHub stars~2.6k tokensUpdated 5 days ago
    Auto-check: notes
  • Formal Verification

    hdl-tools/digital-chip-design-agents

    Formal property verification (FPV) and logical equivalence checking (LEC).

    212 GitHub stars~3.4k tokensUpdated 5 days ago
    Auto-check: notes
  • Fpga Emulation

    hdl-tools/digital-chip-design-agents

    FPGA prototyping — ASIC-to-FPGA RTL adaptation, multi-FPGA partitioning, synthesis and timing closure on FPGA, hardware bring-up, and software validation on the prototype.

    212 GitHub stars~3.4k tokensUpdated 5 days ago
    Auto-check: notes
  • Functional Verification

    hdl-tools/digital-chip-design-agents

    UVM-based functional verification — testbench architecture, test planning, directed and constrained-random stimulus, functional and code coverage closure, formal assist, and regression sign-off.

    212 GitHub stars~4.5k tokensUpdated 5 days ago
    Auto-check: notes

Questions about Compiler Toolchain

What does Compiler Toolchain do?

Compiler toolchain development for custom processor ISAs — LLVM/GCC backend, assembler, linker scripts, runtime libraries, and regression validation. Compiler Toolchain is an agent skill from hdl-tools/digital-chip-design-agents. Compiler toolchain development for custom processor ISAs — LLVM/GCC backend, assembler, linker scripts, runtime libraries, and regression validation.

When should I use Compiler Toolchain?

Compiler Toolchain fits situations like: building a compiler for a custom RISC-V extension; proprietary ISA; any processor where no existing toolchain targets it correctly.

How do I install Compiler Toolchain in Claude Code?

Run `npx skills add hdl-tools/digital-chip-design-agents --skill compiler-toolchain -a claude-code`. Or copy the skill folder (plugins/compiler/skills/compiler-toolchain in hdl-tools/digital-chip-design-agents) into .claude/skills/compiler-toolchain in your project. Claude Code loads it when a task matches its description.

How do I install Compiler Toolchain in Codex?

Run `npx skills add hdl-tools/digital-chip-design-agents --skill compiler-toolchain -a codex`. Or copy the skill folder (plugins/compiler/skills/compiler-toolchain in hdl-tools/digital-chip-design-agents) into .agents/skills/compiler-toolchain in your project. Codex loads it when a task matches its description.

Can I use Compiler Toolchain in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hdl-tools/digital-chip-design-agents --skill compiler-toolchain -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/compiler-toolchain, .gemini/skills/compiler-toolchain, .github/skills/compiler-toolchain and .opencode/skills/compiler-toolchain in your project.

What does Compiler Toolchain need to run?

SKILL.md names no scripts, command-line tools or credentials: Compiler Toolchain is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Bash.

Does Compiler Toolchain access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Compiler Toolchain safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Compiler Toolchain use?

Compiler Toolchain is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Compiler Toolchain use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Compiler Toolchain?

Skills that share tags, products or a category with Compiler Toolchain: Gcc (davila7/claude-code-templates, 32k stars), Compile Knowledge (sickn33/agentic-awesome-skills, 47k stars), Compiler (atopile/atopile, 4k stars) and Testing Core Processors (mastra-ai/mastra, 29k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Compiler Toolchain?

hdl-tools (a GitHub organization) maintains it in hdl-tools/digital-chip-design-agents, which has 212 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 3, 2026.

Source: hdl-tools/digital-chip-design-agents on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.