Home > Community > Forums > Custom IC Design > Ladder signal", My own signal"

## Email

Recipients email * (separate multiple addresses with commas)

Message *

 Send yourself a copy

## Subscribe

Intro copy of the newsletter section here, some intro copy of the newsletter. Instruction of how to subscribe to this newsletter.

First Name *

Last Name *

Email *

Company / Institution *

 Send Yourself A Copy

# Ladder signal", My own signal"

Last post Tue, Feb 26 2013 4:54 AM by Ricardo Alves. 8 replies.
 Started by StreamCX 14 Apr 2010 06:17 PM. Topic has 8 replies and 2524 views
• #### Wed, Apr 14 2010 6:17 PM

• StreamCX
• Joined on Sat, Jan 31 2009
• Posts 73
• Points 1,205
 How to realize signal in schematic such on picture on Cadence 5?I need "ladder" from 0V to -2.04V with step 0.008 V (step can be smaller), 256 time intervaks.
Filed under: , ,
• Post Points: 20
• #### Wed, Apr 14 2010 10:19 PM

Re: Ladder signal", My own signal"
 The easiest way to do this is to create a Verilog A view. For example, this code:``include "disciplines.vams"module ladder (outp,outm);electrical outp,outm;// extent of the signal outputparameter real vmin=0;parameter real vmax=2.56;// number of steps in the "ladder"parameter integer maxcount=256;// is it periodic? Set to 0 if you want it to be one shotparameter integer periodic=1;// period of time between steps in the ladderparameter real period=10n;// rise, fall, and delay of each stepparameter real tr=0.1n;parameter real tf=0.1n;parameter real td=0;// internal variablesreal scale;integer count;analog begin @(initial_step) begin count=0; scale=(vmax-vmin)/(maxcount-1); end @(timer(period,period)) if(periodic) count=(count+1)%maxcount; else count=min(count+1,maxcount-1); V(outp,outm) <+ transition(count*scale,td,tr,tf);endendmodule `Then on the instance of ladder specify vmax=-2.04 . There's a parameter in this code called periodic, which allows you to specify whether the ladder repeats.Attached are some pictures (one zoomed out, one zoomed in). This was with periodic=0.Regards,Andrew. ladder1.png
• Post Points: 5
• #### Wed, Apr 14 2010 10:20 PM

Re: Ladder signal", My own signal"
 Couldn't add two pictures at once. Here's the zoomed in file.. Andrew. ladder2.png
• Post Points: 20
• #### Wed, Apr 14 2010 11:26 PM

• StreamCX
• Joined on Sat, Jan 31 2009
• Posts 73
• Points 1,205
Re: Ladder signal", My own signal"
 Andrew Beckett ,thanks.How to add this signal to input pin of analog scheme? How to add this Verilog A instance "lader" to schematic? Does Cadence 5 have verilog A? Can I attache this code to symbol from Cadence schematic library such as vpwl?I must use this signal in schematic analog scheme (ADC)
Filed under:
• Post Points: 20
• #### Wed, Apr 14 2010 11:47 PM

Re: Ladder signal", My own signal"
 VerilogA has been supported in spectre for 10-15 years (I forget when) and is certainly supported in IC5X.You do not attach it to a vpwl or any other source. The code itself is a new source.To use it, do File->New->Cellview (in the CIW). Set the Tool to "VerilogA-Editor" and fill in the library name as whatever you want, and call the cell name "ladder" (you could call it something different if you like). OK this form.Then in the resulting editor, paste in the behavioural model code I provided. Change the module name from ladder if you called the cell something other than ladder. Save and exit the editor. It should syntax check the file, and then prompt you to create a symbol. You can then place this component in your testbench, and it will generate the ladder waveform (set vmax=-2.04 when you place it). I just noticed that my code omitted a line specifying the direction of the pins. Here's the corrected code: ``include "disciplines.vams"module ladder (outp,outm);output outp,outm;electrical outp,outm;// extent of the signal outputparameter real vmin=0;parameter real vmax=2.56;// number of steps in the "ladder"parameter integer maxcount=256;// is it periodic? Set to 0 if you want it to be one shotparameter integer periodic=1;// period of time between steps in the ladderparameter real period=10n;// rise, fall, and delay of each stepparameter real tr=0.1n;parameter real tf=0.1n;parameter real td=0;// internal variablesreal scale;integer count;analog begin @(initial_step) begin count=0; scale=(vmax-vmin)/(maxcount-1); end @(timer(period,period)) if(periodic) count=(count+1)%maxcount; else count=min(count+1,maxcount-1); V(outp,outm) <+ transition(count*scale,td,tr,tf);endendmodule``Regards,``Andrew. `
• Post Points: 35
• #### Thu, Apr 15 2010 8:42 PM

• StreamCX
• Joined on Sat, Jan 31 2009
• Posts 73
• Points 1,205
Re: Ladder signal", My own signal"
 Thanks.
• Post Points: 5
• #### Tue, Feb 26 2013 3:20 AM

Re: Ladder signal", My own signal"
 I am having some problems in implementation of the ladder using the code you provided. I can create the signal attached in figure, but i am not able to create a ladder that starts for example in -60mV and has the final value of 60mV (vmin = -60mV and vmax = 60mV)Can you help me please.Regards,Ricardo
• Post Points: 20
• #### Tue, Feb 26 2013 3:46 AM

Re: Ladder signal", My own signal"
 Ricardo,There's a deliberate mistake in the transition statement in the code - I forgot to add vmin to the signal, so it's always referred to 0. I ran it with this netlist://V1 (lad 0) ladder vmin=-60m vmax=60m maxcount=32 periodic=0 period=80nR1 (lad 0) resistor r=1kahdl_include "ladder.va"tran tran stop=5uAnd it produces the attached picture (I set it to have 32 steps to make the steps more obvious).Here's the fixed code:````include "disciplines.vams" module ladder (outp,outm); output outp,outm; electrical outp,outm; // extent of the signal output parameter real vmin=0; parameter real vmax=2.56; // number of steps in the "ladder" parameter integer maxcount=256; // is it periodic? Set to 0 if you want it to be one shot parameter integer periodic=1; // period of time between steps in the ladder parameter real period=10n; // rise, fall, and delay of each step parameter real tr=0.1n; parameter real tf=0.1n; parameter real td=0; // internal variables real scale; integer count; analog begin @(initial_step) begin count=0; scale=(vmax-vmin)/(maxcount-1); end @(timer(period,period)) if(periodic) count=(count+1)%maxcount; else count=min(count+1,maxcount-1); V(outp,outm) <+ transition(count*scale+vmin,td,tr,tf); end endmodule``` Regards,Andrew. ladder.png
• Post Points: 20
• #### Tue, Feb 26 2013 4:54 AM

Re: Ladder signal", My own signal"
 Thanks Andrew, it worked.Best Regards,Ricardo Alves
• Post Points: 5