• 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
Parents
  • 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
Reply
  • 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
Children
No Data

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