• 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. Differences in resistor noise Verilog-A model

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 63
  • Views 17170
  • 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

Differences in resistor noise Verilog-A model

JimmyLin
JimmyLin over 6 years ago

For noise simulation of VerilogA in Spectre,

I try to simulate the thermal noise of a resister.

Following are four different ways of coding and the outputs are different.

Code 1

module res (p, n);
inout p, n;
electrical p, n;
parameter real R = 5000;

analog begin
  I(p, n) <+ V(p,n) / R;
I(p, n) <+ white_noise(4 * `P_K * $temperature / R);
end endmodule

Output Noise Voltage: 8.28788e-17 [V^2/Hz]

Code 2

module res (p, n);
inout p, n;
electrical p, n;
parameter real R = 5000;

analog begin
I(p, n) <+ V(p,n) / R;
V(p, n) <+ white_noise(4 * `P_K * $temperature * R);
end endmodule

Output Noise Voltage: 8.28788e-17 [V^2/Hz]

Code 3

module res (p, n);
inout p, n;
electrical p, n;
parameter real R = 5000;

analog begin
  V(p, n) <+ I(p,n) * R;
V(p, n) <+ white_noise(4 * `P_K * $temperature * R);
end endmodule

Output Noise Voltage: 8.28788e-17 [V^2/Hz]

Code 4

module res (p, n);
inout p, n;
electrical p, n;
parameter real R = 5000;

analog begin
  V(p, n) <+ I(p,n) * R;
I(p, n) <+ white_noise(4 * `P_K * $temperature / R);
end endmodule

Output Noise Voltage: 3.31515 [V^2/Hz]

Why there is such a difference and what mistake did I make?

Thank you!

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    I split this into a separate post because it broke the Forum Guidelines by being about a different topic (yes, both questions were on Verilog-A, but that's really where the similarity ended; putting multiple different questions in the same thread makes it harder for somebody to identify if they have a similar issue). 

    The root cause is that you cannot have both a current and voltage source on the same branch in Verilog-A. Spectre gives a clear warning:

    WARNING (VACOMP-1117): "forum51d.va", line 9: Ignoring the contribution
    statement on line 9 which contributes either a potential to a flow
    source or a flow to a potential source. The value retention guidelines
    in the Verilog-AMS LRM state that a branch can have either a flow
    contribution or a potential contribution but not both.

    In my case forum51d was your fourth code, and line 9 was this:

    V(p, n) <+ I(p,n) * R;

    Because this was omitted, the resistor was open circuit (the average current through the white_noise current source line would be 0), and so there was a conductance of 1e-12 added across the resistor to provide a path to ground.

    What this means is that the voltage across the resistor would be the noise current through that 1TOhm gmin resistor (the 1e-12 conductance), which gives you a voltage of:

    sqrt(4*1.38064852e-23*300.15/5000)*1e12 = 1.820773V

    converting that to V^2/Hz gives 3.315213V - essentially what you got.

    The reason why the other way around (Code 2) doesn't have this problem is because spectre omits the current source (so it won't behave as a resistor), but it's directly a voltage source (so closed circuit).

    So the root cause is the illegal Verilog-A construct of having both voltage and current source contributions at the same time on the same branch.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • JimmyLin
    JimmyLin over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    Really appreciate your reply.

    It seems obvious that we should check the warning before going to the result.

    But I don't see any warning about the ignorance of contribution statement in my output log.

    Is that an option in spectre to display the warning or the log is in a certain directory?

    Thank you so much for answering!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to JimmyLin

    This is probably because the model has been compiled in a previous run, and the warnings only appear during VerilogA compilation.

    You could go into the netlist dir and delete the input.ahdlsimDB dir, or you could enable the "AHDL Linter" (which in ADE can be found on the Simulation->Options->Analog form, Miscellaneous Tab, near the bottom). If you can't find it there, you can go to Setup->Environment and in the userCmdLineOptions you can enter "-ahdllint" .

    This will force it to recompile, and the messages will be in the spectre output log.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • JimmyLin
    JimmyLin over 6 years ago in reply to Andrew Beckett

    I go to ADE -> Simulation -> Option -> Analog -> Miscellaneous -> AHDL LINTER OPTIONS (APS ONLY) -> Linter check -> on

    The warning messages now appear in the spectre output log.

    Thank you very much!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to JimmyLin

    The messages would also appear if you change the VerilogA view in any way (without having to turn on the linter) - it's just the fact that it's been compiled already that meant that the messages are not repeated on each run.

    Anyway, glad you can see them now.

    Regards,

    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