and Verification Hardware Modeling, Generation, Simulation ...
An Open-Source Python-Based Hardware Generation ...
Transcript of An Open-Source Python-Based Hardware Generation ...
![Page 1: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/1.jpg)
An Open-Source Python-Based Hardware Generation, Simulation, and Verification
Framework
Shunning Jiang, Christopher Torng, Christopher Batten
Computer Systems Laboratory School of Electrical and Computer Engineering
Cornell University1
![Page 2: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/2.jpg)
Outline- Introduction- PyMTL features- PyMTL use cases
1
![Page 3: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/3.jpg)
The Traditional Flow
3
Traditional hardwaredescription language
- Example: Verilog✓ Fast edit-debug-sim loop✓ Single language for design and testbench
X Difficult to parameterizeX Require specific ways to build powerful testbench
* HDL: hardware description language* DUT: design under test* TB: test bench* synth: synthesis
![Page 4: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/4.jpg)
Hardware Preprocessing Frameworks (HPF)
4
✓ Fast edit-debug-sim loop✓ Single language for design and testbench
X Difficult to parameterizeX Require specific ways to build powerful testbench
✓ Better parametrization with insignificant coding style change
X Multiple languages create “semantic gap”X Still not easy to build powerful testbench
Traditional hardwaredescription language
- Example: Verilog
Hardware preprocessingframework (HPF)
- Example: Genesis2
![Page 5: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/5.jpg)
Hardware Generation Frameworks (HGF)
5
Traditional hardwaredescription language
- Example: Verilog✓ Fast edit-debug-sim loop✓ Single language for design and testbench
X Difficult to parameterizeX Require specific ways to build powerful testbench
Hardware preprocessingframework (HPF)
- Example: Genesis2✓ Better parametrization with
insignificant coding style change
X Multiple languages create “semantic gap”X Still not easy to build powerful testbench
Hardware generationframework (HGF)- Example: Chisel
✓ Powerful parametrization✓ Single language for design
X Slower edit-debug-sim loopX Yet still difficult to build powerful testbench (can only generate simple testbench)
![Page 6: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/6.jpg)
PyMTL is an Hardware Generation and Simulation framework
5
✓ Powerful parametrization✓ Single language for design and
testbench✓ Use host language for verification✓ Easy to create highly parameterized
generators✓
![Page 7: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/7.jpg)
PyMTL framework
4
![Page 8: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/8.jpg)
Outline- Introduction- PyMTL features- PyMTL use cases
![Page 9: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/9.jpg)
Eight features that make PyMTL productive- Multi-level modeling- Method-based interfaces- Highly parametrized static elaboration- Analysis and transform passes- Pure-Python simulation- Property-based random testing- Python/SystemVerilog integration- Fast simulation speed
9
![Page 10: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/10.jpg)
Multi-level modeling● Functional-level modeling: quickly
building reference model and testbench
● Cycle-level modeling: design space exploration
● Register-transfer-level modeling: generating hardware
Example: Accelerator designers only want to implement the accelerator in RTL. How about cache and processor to do end-to-end testing?
![Page 11: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/11.jpg)
Highly parametrized static elaborationPyMTL embeds the DSL into Python, so the hardware designs can use full Python’s expressive power to construct hardware.
6
![Page 12: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/12.jpg)
PyMTL passesPyMTL analysis/transform passes systematically traverse through the design and/or transform the module hierarchy by mutating the internal data structures.
6
![Page 13: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/13.jpg)
Property-based random testingSince the simulation is just executing a piece of Python code, we can leverage random testing frameworks that test Python software for testing hardware.
- hypothesis
7
![Page 14: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/14.jpg)
PyMTL/SystemVerilog integration- PyMTL can import SystemVerilog and co-simulate it with the same Python
test harness.- PyMTL can also compose multiple PyMTL/SystemVerilog designs and
translate the larger design into SystemVerilog.
8
![Page 15: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/15.jpg)
Fast pure-Python simulationWith Mamba techniques, the next version of PyMTL gets an order of magnitude of speedup when simulating in a pure-Python environment.
- Design the framework from the ground up with a just-in-time compiler in mind- Enhance the just-in-time compiler to recognize critical hardware constructs
9
![Page 16: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/16.jpg)
Outline- Introduction- PyMTL features- PyMTL use cases
- PyMTL in teaching: 400+ students across 2 universities- PyMTL in research: four ISCA/MICRO papers use PyMTL- PyMTL in silicon prototyping: three tape-outs, two of which completely use PyMTL
![Page 17: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/17.jpg)
PyMTL in Silicon Prototyping: BRGTC1 (2016)
- Fabricated in IBM 130nm- 2mm x 2mm die, 1.2M transistor
10
![Page 18: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/18.jpg)
PyMTL in Silicon Prototyping: BRGTC2 (2018)
- Advertisement: our open-source modular VLSI build system used in this tapeout https://github.com/cornell-brg/alloy-asic 11
- Fabricated in TSMC 28nm- 1mm x 1.25mm die, 6.7M transistor- Quad-core in-order RV32IMAF
![Page 19: An Open-Source Python-Based Hardware Generation ...](https://reader033.fdocuments.in/reader033/viewer/2022041710/6253b6bd956d7446392eb4c4/html5/thumbnails/19.jpg)
12
We expect a new release in 2019.
PyMTL: https://github.com/cornell-brg/pymtlModular ASIC Build system: https://github.com/cornell-brg/alloy-asic
PyMTL:- Multi-level modeling- Method-based interfaces- Highly parametrized static elaboration- Analysis and transform passes- Pure-Python simulation- Property-based random testing- Python/SystemVerilog integration- Fast simulation speed