• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. Ladder signal", My own signal"

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 125
  • Views 5133
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Ladder signal", My own signal"

StreamCX
StreamCX over 15 years ago

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.

[URL=http://img227.imageshack.us/i/voltagest.jpg/][img]img227.imageshack.us/.../URL]

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago

    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 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,td,tr,tf);
    end

    endmodule

    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.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago

     Couldn't add two pictures at once. Here's the zoomed in file..

     Andrew.

    • ladder2.png
    • View
    • Hide
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StreamCX
    StreamCX over 15 years ago

    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)

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago

    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 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,td,tr,tf);
    end

    endmodule

    Regards,
    Andrew. 
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StreamCX
    StreamCX over 15 years ago

     Thanks.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Ricardo Alves
    Ricardo Alves over 12 years ago

    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 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    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=80n
    R1 (lad 0) resistor r=1k

    ahdl_include "ladder.va"
    tran tran stop=5u

    And 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
    • View
    • Hide
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Ricardo Alves
    Ricardo Alves over 12 years ago
    Thanks Andrew, it worked.

    Best Regards,
    Ricardo Alves
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information