• 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. Mixed-Signal Design
  3. How to define current in verilogams-wreal model ?

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 64
  • Views 10515
  • 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

How to define current in verilogams-wreal model ?

bikram1994
bikram1994 over 3 years ago

Hi All,

In verilog-a model we can define a node current like

I(pin) <+ 2u;

Is there any way to define the current in verilogams-wreal model?

Thanks in advance.

Regards,

Bikram Biswas

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    If it's a wreal model then the output is just a variable - you assign it with the normal assignment operator (i.e. "=") rather than a contribution statement. Without seeing the details of your model, it's hard to be more specific.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • bikram1994
    bikram1994 over 3 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thank you for the response.

    Let me explain the problem with an example.

    Verilog-A code of this block:

    `include "constants.vams"
    `include "disciplines.vams"

    module bias(en_1,en_2,VDD,VSS,V_out,I_out);

    input en_1;

    electrical en_1;

    input en_2;

    electrical en_2;

    input VDD;

    electrical VDD;

    input VSS;

    electrical VSS;

    output V_out;

    electrical V_out;

    output I_out;

    electrical I_out;

    analog begin

    if(V(en_1)>0.45) V(V_out) <+ 800m;

    else V(V_out) <+ 0;

    if(V(en_2)>0.45) I(I_out) <+ 2u;

    else I(I_out) <+ 0;

    end

    ensmodule

    verilogams_wreal model:

    `include "constants.vams"
    `include "disciplines.vams"

    `timescale 1ns/1ps

    module bias(en_1,en_2,VDD,VSS,V_out,I_out);

    input en_1;

    wreal en_1;

    input en_2;

    wreal en_2;

    input VDD;

    wreal VDD;

    input VSS;

    wreal VSS;

    output V_out;

    wreal V_out;

    output I_out;

    wreal I_out;

    real ts;

    initial begin
    ts = (0.04 / 13G) * 1e9;
    end

    always #ts begin

    if(en_1>0.45) V_out) = 800m;

    else V_out =0;

    if(en_2>0.45) I_out) = 2u;

    else I_out = 0;

    end

    ensmodule

    Here in verilogams-wreal model, can't we define voltage and current explicitly?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to bikram1994

    I didn't try your code, but there are some typos - you have some extra close parentheses:

    if(en_1>0.45) V_out) = 800m;

    else V_out =0;

    if(en_2>0.45) I_out) = 2u;

    else I_out = 0;

    I think if you remove those, it should work.

    Andrew

    • 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