Python PLI Introduction
This project is an experiment in embedding Python in Verilog using VPI. Python is a dynamic object-oriented langauge with capabilities that lends itself to rapid application development and exploration. VPI is a simulation API on which Verilog extension applications can be developed. The combination of the two is a dynamic programming environment for testbench and simulation model development in Python. More importantly, the layered structure of the software of this project provides a solid base for experimentation and learning.The base layer software, APVM, is the low-level C/Python interface that makes it possible to query the Verilog simulation database and to interact with the Verilog scheduler using VPI from Python. This layer of software also provides some framework facilities to aid in the creation of Verilog PLI applications.
Oroboro is a layer upon APVM which provides a simple task abstraction built on Python "generators", and a simple 'signal' mechanism for interacting with HDL nets. These two features, combined with the dynamic nature of Python yield a fairly expressive simulation system with enough features to enable one to write multi-threaded test generators or simulation models entirely in Python.
APVM/Oroboro offers the following features.
- a cooperative multi-tasking programming model
- synchronization operations
- dynamic task creation
- four-valued logic vector datatype
- Python logging from Verilog and Python
- a configuration system
- netlist inspection and traversal
- GUI demos with GTK and TCL/Tk
Documentation
Documentation exists as a series of notes describing different aspects of the project. The source distribution also includes application notes about compiling ports for various simulators and operating systems.
- Oroboro - PDF
- Oroboro Tasks and The Verilog Scheduler - PDF
- APVM - A Python VPI Module - PDF
- Temporal Expressions in Oroboro - PDF