Products & Services Solutions Academia Support User Community Company

Learn more about RF Toolbox   

How to Export a Verilog-A Model

Representing a Circuit Object with a Model Object

Before you can write a Verilog-A model of an RF circuit object, you need to create an rfmodel.rational object to represent the component.

There are two ways to create an RF model object:

This section discusses using a rational function model. For more information on using the constructor, see the rfmodel.rational reference page.

When you use the rationalfit function to create an rfmodel.rational object that represents an RF component, the arguments you specify affect how quickly the resulting Verilog-A model runs in a circuit simulator.

You can use the rationalfit function with only the two required arguments. The syntax is:

model_obj = rationalfit(freq,data)

where

For faster simulation, create a model object with the smallest number of poles required to accurately represent the component. Use the following arguments, which are described in detail in the rationalfit function reference page, to control the number of poles:

The syntax is:

model_obj = rationalfit(freq,data,tol,weight,delayfactor)

where weight is a vector that specifies the weighting of the fit at each frequency.

If you plan to integrate the Verilog-A module into a large design for simulation using detailed models, such as transistor-level circuit models, the simulation time consumed by a Verilog-A module may have a trivial impact on the overall simulation time. In this case, there is no reason to take the time to optimize the rational function model of the component.

For more information on the rationalfit function arguments, see the rationalfit reference page.

Writing a Verilog-A Module

You use the writeva method to create a Verilog-A module that describes the RF model object. This method writes the module to a specified file.

The following code illustrates how to write a Verilog-A module for the model object model_obj to the file obj1.va. The module has differential input nets, inp and inn, and differential output nets, outp and outn. The method returns a status of True if the operation is successful and False otherwise.

status = writeva(model_obj,'obj1',{'inp','inn'},{'outp','outn'})

The writeva reference page describes the method arguments in detail.

An example of exporting a Verilog-A module appears in the RF Toolbox demo, Modeling a High-Speed Backplane (Part 3: Rational Function Model to a Verilog-A Module).

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS