Using Hardware Description Languages in TINA, part 4: Creating Analog Components with Verilog-AMS

Creating Analog Components with Verilog-AMS

Hardware Description Languages (HDL) are powerful tools to describe and simulate complex electronic devices.

In this tutorial video

we will show how you can create a macro from a Verilog-AMS (.vams) code and use in TINA. You can create macros from VHDL, Verilog and Verilog-A files in a similar way.

Watch our tutorial video to see how  you can create a macro from a Verilog-AMS (.vams) code and use in TINA.

Download the FREE trial demo of TINA Design Suite and get:

  1. One year free access to TINACloud (the cloud-based, multi-language, installation-free online version of TINA now running in your browser anywhere in the world.)
  2. An immediate 20% discount from the offline version of TINA
  3. Free license for your second computer, laptop etc.
Click here to download the FREE trial demo of TINA

 

www.tina.com

You can also find below the script of the video: 

Using Hardware Description Languages in TINA, part 4: Creating Analog Components with Verilog-AMS

In this tutorial video we will show how you can create a DAC Converter macro-model from a  Verilog-AMS (.vams) code and use in TINA. You can create macros from VHDL, Verilog and Verilog-A files in a similar way.

Let’s demonstrate the details. 

We will first create the Generator with serial output (SPI). This is given in VHDL. Next, we will create a DAC Converter macro given in Verilog AMS.

Open TINA

Click the  Tools menu

Select  New Macro Wizard

Type a name for the new macro

In our case: SPI

Change the Settings from Current circuit to From file

Click the  Open icon

Select TINA examples

Open the Examples

Verilog-AMS folder

Change the file type to .VHD

then Select the spi file and click Open

Press the Next button

You can either Select the  Auto generate shape

or you can load a shape from the library

Let’s select the  Auto Generate shape option

then Click Next

You can browse the code and see how easy to create an SPI output in VHDL

Click Next again

and save the macro (SPI.tsm) into the default Macrolib folder.

You can insert the Macro by pressing the Insert button or you can select the

“Insert/Macro…” from the menu.

Click the Insert button

The macro will be attached to your cursor. Place it wherever you wish on the workspace.

Next, we will create a DAC Converter macro from a .VAMS code and we will use the VHDL macro (created previously) and the Verilog-AMS macro in the same circuit to demonstrate that in TINA you can use VHDL and Verilog (Verilog-A, Verilog-AMS) macros in the same circuit.

Click the  Tools menu

Select  New Macro Wizard

Type a name for the new macro

In our case: DAC

Change the Settings from Current circuit to From file

Click the Open icon

Select TINA examples

Open the Examples

Verilog-AMS folder

Change the file type to .VAMS

then Select the dac vams.vams file and click Open

Press the Next button

Select the  Auto Generate shape option

Press the Next button

Change the orientation of the  pins  listed ont he screen   into right

Click the appropriate modul to be selected then  click the left button under the orientation field then select right  

Change the position of the pins on the right side by using the “Move up” or “Move down” buttons.

Change the position of the moduls on the left side as well:

Click Next

and save your tsm file under the name DAC into your default Macrolib folder

Click Insert

and place the DAC macro on the workspace

Double-click the DAC macro,

then press the Enter Macro button to check its content

The content of the Macro appears

Now, close the HDL Editor Window of TINA

Let’s create the following circuit to test the new DAC model:

 Connect the DAC inputs with the appropriate SPI outputs 

Draw a wire starting from the CLK pin

From the Meters Toolbar select the Voltage Pin and connect to the wire

Double-click the Voltage Pin & rename the label into CLK

Continue connecting the DAC inputs with the appropriate SPI outputs

Start drawing the wire from  VREF

Select the Voltage Source (VS1) from the Basic Toolbar and connect it to VREF.

Next, connect the Ground to VS1

Connect the Battery (V1) to VDD, and a Ground to AGND

Finally connect a Voltage Pin to VOUTA (Analog Output)

then rename it

Let’s test the circuit by Running Transient  Analysis

Click Analysis on the menu then select Transient

then Click OK

Let’s test the circuit for a time period of 1ms 

Click Analysis on the menu then select Transient again

Click the Analysis menu on the Toolbar, then select the Transient mode again. 

In the Transient Analysis dialog box change the value of the

End display field to 1m 

Our DAC Converter works as expected.