Giter Club home page Giter Club logo

ntuzxy / veriloga-wave-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from colsonzhang/veriloga-wave-generator

0.0 0.0 0.0 187 KB

The codes are used to generate the VerilogA code which can be directly used in the spectre simulation .The generated VerilogA code's fuction is to generate the specific waveforms according to your setting.And the setting is done in the python code (main.py), which will facilitate greatly the coding works.

Python 100.00%

veriloga-wave-generator's Introduction

The Verilog-A code generator

Usage

  1. modify the args in the main.py
  2. python main.py

Description

The codes are used to generate the VerilogA code which can be directly used in the spectre simulation .

The generated VerilogA code's fuction is to generate the specific waveforms according to your setting.

And the setting is done in the python code (main.py), which will facilitate greatly the coding works.

Special Notes

Due to the limit of the type integer holding values ranging from -2^31 to 2^31 - 1, the with of the input signal should not exceed 32 !!! If the signal's width > 32, you'd better split the signal into 2 signals.

Demo

The code below is the description about the waveform in python , including the I/O path, comment, module_name and waveforms info .

# input template file path
template_path ='./template.va'
# output file path
save_path = './generate.va'

# the comment in the veriloga file
comment = 'This file is generated by the VA_GEN .'
# the module name
module_name = 'Va_TimeGen_1'

# the expected output signals 
# signal-name | signal-width | waves-length | waves-value 
signal_args = [
    ['signal_1', 8, 4, [0, 1, 2, 3]],
    ['signal_2', 1, 4, [0, 1, 0, 1]]
]

The detailed meaning of the wavefoms info list is in the table below. The signal_args must contain at least 1 signal array.

signal[0] siganl[1] signal[2] signal[3]
meaning port name port width waves' length waves' values
example 'signal_1' 8 4 [0, 255, 128, 20]

When you have done the setting, you can execute python main.py to get the VerilogA code.

And then you can open the virtuoso and create a Verilog-A cell.

Note !!! The cell name must be consistent with the module_name in you setting.

img

Then you can use the editor to open the VerilogA file and copy the generated content to it.

Last, you can build the VerilogA.

If it goes well, the window will jump up. And you can enter yes to automatically genrate the symbol.

img

The symbol is just like this.

img

And you can invoke the VerilogA cell easily like this.

Note !!! The wave's frequency is consistent with the input clk frequency and the amplitude is consisitent with the input VDD-GND. So you must give the CLK, VDD and GND signals when invoking the module.

img

The simulation result is as below.

img

veriloga-wave-generator's People

Contributors

colsonzhang 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.