JulianKemmerer/PipelineC
소개
PypelineC: 고수준 합성(HLS)과 유사한 자동 파이프라이닝을 언어 구성 요소 또는 컴파일러 기능으로 추가한 하드웨어 기술 언어(HDL)입니다.
프로그래밍 언어 및 런타임측정된 스타 증가
- in 24h
- +1
- in 7 days
- +1
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original██████╗ ██╗ ██╗██████╗ ███████╗██╗ ██╗███╗ ██╗███████╗ ██████╗
██╔══██╗╚██╗ ██╔╝██╔══██╗██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝
██████╔╝ ╚████╔╝ ██████╔╝█████╗ ██║ ██║██╔██╗ ██║█████╗ ██║
██╔═══╝ ╚██╔╝ ██╔═══╝ ██╔══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║
██║ ██║ ██║ ███████╗███████╗██║██║ ╚████║███████╗╚██████╗
╚═╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚═╝╚═╝ ╚═══╝╚══════╝ ╚═════╝

What is PypelineC?
A hardware description language (HDL) adding high level synthesis(HLS)-like automatic pipelining as a language construct/compiler feature. The goal is a portable HDL: one design you can take between FPGA and ASIC targets and clock rates without re-implementing it to meet timing.
If a computation can be written as a pure function without side effects (i.e. no registers/static variables) then it can be auto-pipelined. Conceptually similar to technologies like Intel's variable latency Hyper-Pipelining and Xilinx's retiming options. Sharing some of the compiler driven pipelining design goals of Google's XLS Project, the DFiantHDL language, and certain CIRCT dialects as well.
PypelineC consists of Pypeline (new, Python based) and PipelineC (legacy, C based). Pypeline is a work in progress in becoming feature complete with PipelineC, but already has many new features that PipelineC lacks.
Show me what you got. Be inspired by some awesome PypelineC projects others have done, see the showcase. Reach out to have your project added.
Example code for blinking an LED:
| Pypeline (examples/pypeline/blink.py) | PipelineC (examples/blink.c) |
|---|---|
|
|
| Pypeline | PipelineC | |
|---|---|---|
| Getting started | /docs directory | GitHub wiki |
| Easy to understand software-like syntax | Yes | Yes |
| Timing feedback from synthesis+pnr tools | Yes | Yes |
| Automatic pipelining of comb. logic | Yes | Yes |
| Dev board specific support packages | Yes | Yes |
| VHDL Output | Yes (human readable) | Yes (human readable) |
| VHDL based existing module import | Yes | Yes |
| Verilog Output | Yes (machine converted) | Yes (machine converted) |
| Verilog based existing module import | No | No |
| Traditional HDL simulator support | Yes | Yes |
| Native Simulation | Yes | No |
| Waveforms (VCD/FST) from native simulation, with named signals (New) | Yes | No |
| Valid-Ready handshaking | Yes | Yes |
| Globally visible point to point wires | Yes | Yes |
| Multiple clock domains / Clock domain crossings | Yes | Yes |
| Synchronous resets of registers, pipelines and library blocks | Yes | No (manual reset logic) |
| Parameterized/Template Functions+Types | Yes | No |
| Operator overloading | Yes | Yes (hacky) |
| User-visible automatic pipeline latency | Yes | No |
| Multi-cycle path constraints | Yes | Yes |
| Automatic multi-cycle path tuning (New) | Yes | No |
| Combinational area / delay optimization (New, experimental) | Yes | No |
| Automatic resource-shared state machines (New, experimental) | Yes | No |
| Single-cycle RISC-V CPU | RV32I with machine-mode traps, memory-mapped devices, a UART console, and exportable firmware | Macro cores with a separate firmware build |
| SoC system bus helpers | No | Yes |
| Design diagram webpage (files, MAINs, wires, call hierarchy) (New) | Yes | Yes (whole wires) |
| Generates software Helper Code | Yes | Yes |
match statements on enums (New) |
Yes | No (switch, #76) |
| Derived FSM style code | No | Yes |
| Documentation | Comprehensive, planned | Ad-hoc, organic |
| Compiler tests | Many, Automated | Limited, Hand-run |
Tools:
Currently Supported Tools (Linux only):
Synthesis:
Xilinx Vivado,
OpenXC7 (Xilinx 7-series: GHDL+Yosys+nextpnr-xilinx+Project X-Ray),
Intel Quartus,
Lattice Diamond,
GHDL+Yosys+nextpnr (ECP5/iCE40),
Gowin EDA,
Efinix Efinity,
Cologne Chip Toolchain,
PyRTL Models,
sky130 ASIC timing models (GHDL+Yosys+built-in liberty STA)
Simulation:
Modelsim,
Verilator,
cocotb,
CXXRTL,
EDAPlayground
Why Pypeline?
A portable HDL. Moving a traditional RTL design to a new FPGA, an ASIC process, or a higher clock rate usually means re-implementing parts of it just to meet timing: adding or moving pipeline stages, re-balancing multi-cycle paths, rewriting state machines. PypelineC keeps that work in the compiler instead. You write the logic once as pure functions, and the compiler pipelines them for each target, using timing feedback from that target's synthesis tools. Only the parts that really are clock-by-clock hardware (registers, RAMs, interconnect) are written cycle by cycle, so a design does not need to be rewritten for each new device or operating frequency.
Pypeline describes hardware directly, but replaces much of the ceremony of traditional RTL with compact Python syntax and reusable abstractions:
- RTL semantics without event-driven boilerplate. A typed function is a hardware
module, ordinary locals are combinational wires, and
Reg[T]is explicit state. There are no sensitivity lists or separate combinational and clocked process templates to maintain; the execution model states exactly what becomes wiring, a MUX, a register, or a module instance. - Reusable, parameterized hardware. Ordinary compile-time Python can create specialized functions and types with factory functions, including width- and type-parameterized structs, arrays, streams, FIFOs, and arithmetic blocks.
- Interfaces with direction and structure.
@interfacebundles bidirectional ports, including forward payloads and reverse ready/credit signals, while interface functions can generate reverse-path wiring instead of requiring every signal to be connected by hand. - Composition instead of port-map repetition. Calling a hardware function instantiates a module; types and return values carry connections through a hierarchy using normal function composition.
- A real elaboration language. Compile-time Python supports loops, constants, type introspection, user-defined factories, and custom operators, enabling libraries to express higher-level hardware patterns rather than repeatedly manipulating individual wires.
- Automation with conventional HDL output. Pure functions can use automatic pipelining and other implementation strategies, with synthesis timing feedback guiding the result. Higher-level parameterization is elaborated before Pypeline emits human-readable VHDL, rather than depending on every downstream tool to implement equivalent HDL language features. A raw VHDL escape hatch for existing IP or vendor-specific primitives keeps the generated design in established FPGA and simulation flows.
Fundamental design elements are state machines/stateful elements(registers, rams, etc), auto-pipelined stateless pure functions, and interconnects (wires,cdc,async fifos,etc).
By isolating complex logic into auto-pipelineable functions, and only writing literal clock by clock hardware description when absolutely necessary, PypelineC designs do not need to be rewritten for each new target device / operating frequency. The hope is to build shared, high performance, device agnostic, hardware designs described in a familiar and powerfully composable software-like look.
For software folks writing PypelineC should feel like solving a programming puzzle - the rules of the puzzle hide/imply hardware concepts. For hardware folks PypelineC is a better hardware description language trying to find middle ground between traditional RTL and HLS. It is my language of choice as an FPGA engineer :).
관련 프로젝트 살펴보기
불러오는 중…