PyRTL provides a collection of classes for pythonic register-transfer level design, simulation, tracing, and testing suitable for teaching and research. Simplicity, usability, clarity, and extensibility rather than performance or optimization is the overarching goal. Features include:
- Elaboration-through-execution, meaning all of Python can be used including introspection
- Design, instantiate, and simulate all in one file and without leaving Python
- Export to, or import from, common HDLs (BLIF-in, Verilog-out currently supported)
- Examine execution with waveforms on the terminal or export to a .vcd as projects scale
- Elaboration, synthesis, and basic optimizations all included
- Small and well-defined internal core structure means writing new transforms is easier
- Batteries included means many useful components are already available and more are coming every week
What README would be complete without a screenshot? Below you can see the waveform rendered right on the terminal for a small state machine written in PyRTL.
For users, more info and demo code is available on the PyRTL project web page.
If you are just getting started with PyRTL it is suggested that you start with the examples first
to get a sense of the "thinking with pyrtls" required to design hardware in this way. If you are looking
for a deeper understanding, dive into the code for the object Block
. It is the core data structure at the heart of
PyRTL and defines its semantics at a high level -- everything is converted to or from the small, simple set of
primitives defined there.
In the package you should find the following files and Directories
- pyrtl/ The src directory for the module
- pyrtl/rtllib/ Finished PyRTL libraries which are hopefully both useful and documented
- examples/ A set of hardware design examples that show the main idea behind pyrtl
- tests/ A set of unit tests for PyRTL which you can run with nosetests
- docs/ Location of the sphinx documentation
Testing requires the packages tox
and nose
. Once installed a complete test of the system should be possible with the simple command tox
and nothing more.