Giter VIP home page Giter VIP logo

anasymod's Introduction

Introduction

anasymod is a Python package for running FPGA emulations of mixed-signal systems. It supports digital blocks described with Verilog or VHDL and synthesizable analog models created using msdsl and svreal.

Installation

  1. Open a terminal, and note the current directory, since the pip commands below will clone some code from GitHub and place it in a subdirectory called src. If you prefer to place the cloned code in a different directory, you can specify that by providing the --src flag to pip.
  2. If you haven't already, install msdsl and svreal:
> pip install -e git+https://github.com/sgherbst/svreal.git#egg=svreal
> pip install -e git+https://github.com/sgherbst/msdsl.git#egg=msdsl
  1. Then install anasymod.
pip install -e git+https://github.com/sgherbst/anasymod.git#egg=anasymod

If you get a permissions error when running one of the pip commands, you can try adding the --user flag to the pip command. This will cause pip to install packages in your user directory rather than to a system-wide location.

Check to see if the anasymod command-line script is accessible by running:

> anasymod -h

If the anasymod script isn't found, then you'll have to add the directory containing it to the path. On Windows, a typical location is C:\Python3*\Scripts, while on Linux or macOS you might want to check ~/.local/bin (particularly if you used the --user flag).

Prerequites to run the examples

The examples included with anasymod use Icarus Verilog for running simulations, Xilinx Vivado for running synthesis and place-and-route, and GTKWave for viewing the simulation and emulation results. The instructions for setting up these tools are included below for various platforms.

Windows

Install Xilinx Vivado by going to the downloads page. Scroll to the latest version of the "Full Product Installation", and download the Windows self-extracting web installer. Launch the installer and follow the instructions. You'll need a Xilinx account (free), and will have to select a license, although the free WebPACK license option is fine you're just planning to work with small FPGAs like the one on the Pynq-Z1 board.

GTKwave and Icarus Verilog can be installed at the same time using the latest Icarus binary here.

Linux

Install Xilinx Vivado by going to the downloads page. Scroll to the latest version of the "Full Product Installation", and download the Linux self-extracting web installer. Then, in a terminal:

> sudo ./Xilinx_Vivado_SDK_Web_*.bin

A GUI will pop up and guide you through the rest of the installation. Note that you'll need a Xilinx account (free), and that you can select the free WebPACK license option if you're planning to work with relatively small FPGAs like the one on the Pynq-Z1 board.

Next, the Xilinx cable drivers must be installed (AR #66440):

> cd <YOUR_XILINX_INSTALL>/data/xicom/cable_drivers/lin(32|64)/install_script/install_drivers
> sudo ./install_drivers

Finally, some permissions cleanup is required (AR #62240)

> cd ~/.Xilinx/Vivado
> sudo chown -R $USER *
> sudo chmod -R 777 *
> sudo chgrp -R $USER *

Installing GTKWave and Icarus Verilog is much simpler; just run the following in a terminal:

> sudo apt-get install gtkwave iverilog

macOS

Unfortunately Xilinx Vivado does not run natively on macOS. But running Windows or Linux through a virtual machine on macOS should work.

Running the Simulation Example

From within the folder anasymod/tests, run

> anasymod -i buck --models --sim --view

This will generate a synthesizable model for a buck converter, run a simulation, and display the results.

Running the Emulation Example

For this test, you'll need a Pynq-Z1 board.

  1. To start, make sure that your board is set up correctly:
    1. Jumper JP4 should be set for "JTAG"
    2. Jumper "JP5" should be set for "USB"
  2. Plug the Pynq board into your computer using a micro USB cable.
  3. Move the Pynq board power switch to "ON"
  4. Go to the folder anasymod/tests and run the following command. It will take ~10 min to build the bitstream.
> anasymod -i buck --models --build
  1. Run the emulation with the following command:
> anasymod -i buck --emulate
  1. View the results with the following command:
> anasymod -i buck --view
  1. Note that you can adjust the emulation time using the --start_time and/or --stop_time options:
> anasymod -i buck --emulate --start_time 1.23e-6 --stop_time 4.56e-6

Contributing

To improve the quality of the software, users are encouraged to share modifications, enhancements or bug fixes with Infineon Technologies AG under [email protected].

anasymod's People

Contributors

rutschifx avatar sgherbst avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.