Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clone this wiki locally
VAPP - The Berkeley Verilog-A Parser and Processor
VAPP is a MATLAB tool that translates Verilog-A device models into ModSpec. There is also a fork that works with Octave. VAPP is a subproject of the Berkeley Model and Algorithm Prototyping Platform (MAPP).
Download and Installation
The current release of VAPP is: 2017-02-27-release.
Git users, please refer to the README on the VAPP Github main page.
Non git users can access a zip file containing the latest VAPP snapshot using the following links.
For further instructions about installing VAPP, please refer to the README on Github or in the zip files provided in the links above.
The Purpose of VAPP
Device models are used by simulators as computational representations of physical devices. Most device models today are written in Verilog-A, a general-purpose, industry-standard, high-level language for analog behavioral modelling and simulation. Verilog-A code is not directly executable; it needs to be translated to simulator-specific code that can only be run within the simulator's analyses. This makes Verilog-A models difficult to test or debug independent of a given simulator, particularly within closed-source/commercial ones; the problem is compounded by inconsistencies between different simulators' interpretations of Verilog-A.
To alleviate this issue, our MAPP project includes an open, standalone, low-level device description API named ModSpec, with implementations available in MATLAB and (soon) C++. VAPP translates Verilog-A device models (with certain syntax restrictions, as well as enhancements) to a differential-algebraic equation (DAE) representation that underlies ModSpec, then prints out ModSpec code (currently, only in MATLAB). The translated ModSpec code is human-readable (to an extent similar to the source Verilog-A code), executable standalone (without the need for any specific simulator), and also immediately usable by any simulator that supports the ModSpec API (currently, MAPP and (soon to be released) Xyce).
Device Model Development Workflow using MAPP and VAPP
The above graphic shows a suggested workflow for device model developers who want to develop models in a computational environment such as MATLAB and then publish them using Verilog-A. In the first step, model developers implement, test and debug their model code using ModSpec in MATLAB/Octave. Second, robust model code is then ported to Verilog-A manually. Third, the Verilog-A model is converted back into ModSpec using VAPP so that the Verilog-A code can be validated by comparing the translated code against the original ModSpec code. The Verilog-A model is ready to be deployed if the simulation results obtained by using VAPP generated code match the results from the original code.
VAPP requires MATLAB R2012a or later.
There is an Octave compatible version of VAPP which is maintained in a separate branch in this repository. For more information see the Octave Compatibility section below.
VAPP has a simple user interface command:
va2modspec which takes a Verilog-A file as input and prints out the corresponding ModSpec file.
Basic usage of this command is simply
For further information, run
help va2modspec in MATLAB.
For a quick introduction and a complete example use case run
For an introduction to VAPP try the following help documents.
help va2modspec help VAPPquickstart help VAPPexamples
VAPP comes with a suite of examples. Each example consists of a different model and a MAPP script to perform an analysis using that model. The following models are available within the examples.
We maintain a separate Octave compatible branch in the VAPP repo. The reason for a separate branch is that Octave does not (yet) support a number of object-oriented programming constructs that recent versions of MATLAB do, and that are used by VAPP for better program structuring and efficiency. The Octave-compatible version of VAPP runs more slowly than the main version.
To obtain the Octave compatible version of VAPP, please choose one of the options below.
Option 1: Use git
Clone this repository and change into the cloned directory.
git clone https://github.com/jaijeet/VAPP.git cd VAPP
git checkout 2017-02-27-release-github-Octave_compatible
Then, follow the instructions in README.
Option 2: Download a snapshot zip file
Download a snapshot of the Octave compatible VAPP using this link: VAPP-2017-02-27-Octave_compatible.zip.
Unzip the downloaded file, enter the created directory, and follow the instructions in README.