Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TOF — Tapeout Object Format

CI License

A flat-text format for hardware integration contracts. One fact per line. Permitted nesting is field under register (two spaces) and enum under field (four spaces). Deterministic grammar. Designed to be readable in a git diff, parseable by an LLM, and consumed by machines without an XML/JSON library.

tapeout 1
ip dma_engine revision v2.0 top dma_top

register CONTROL offset 0x00000000 reset 0x00000000 block dma_regs @ dma.rdl:15
  field EN [0:0] reset 0x0 sw rw @ dma.rdl:16
  field START [1:1] reset 0x0 sw rw @ dma.rdl:17

port clk_i input @ rtl/dma_top.sv:3
port data_o output [63:0] @ rtl/dma_top.sv:9
port awvalid_i input bus axi_s role AWVALID

protocol axi4_lite
signal AWVALID protocol axi4_lite on master output on slave input required

interrupt completion_irq_o dest plic irq 7 @ rtl/dma_top.sv:12
reset rst_ni polarity active_low @ rtl/dma_top.sv:4

bind field:dma_regs.CONTROL.EN -> define:DMA_CONTROL_EN_MASK value 0x00000001 confirmed
bind bus:axi_s -> bus:noc_m0 confirmed

finding REG-001 confirmed blocking "CONTROL.MODE reset changed" before 0x0 after 0x2 register dma_regs.CONTROL field MODE @ dma.rdl:18

Install

pip install tapeout-tof

(PyPI package name is tapeout-tof; the import is still tof.)

Usage

from tof import parse_tapeout, emit_ip, IpSnapshot

# parse a .tapeout file
doc = parse_tapeout(open("review.tapeout").read())
print(doc.ip.registers[0].qualified_name)  # "dma_regs.CONTROL"

# emit from a snapshot
text = emit_ip(snapshot, top="dma_top")

Develop

pip install -e ".[dev]"
ruff check tof/ tests/
pytest -q

Grammar

The formal grammar is at tof/grammar.ebnf. Full keywords, one fact per line. Unknown keywords fail the parse. Format version is tapeout 1; new statements are additive and optional so existing files still parse.

License

Licensed under the Apache License, Version 2.0.

Docs

Full format specification: docs.tapeoutlabs.com

Links

Authors

About

Tapeout Object Format (.tapeout) - flat-text hardware integration contract (parser + emitter)

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages