• 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. write a verilog-A for inverter

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 63
  • Views 11936
  • 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

write a verilog-A for inverter

Hagar Hendy
Hagar Hendy over 2 years ago

i want to define vdd correctly, there is an error that i am using wrong data type. i defined it as electrical signal and at the same time the value of the vdd is 1.2 V so it constant, so how can i do that ? 

here is the code that i used 

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

module inverter_1 (out,in);

output out;
input in;
electrical out, in;
integer d_out,vdd;

analog begin
vdd= 1;
@(cross(V(in) - 0.5*V(vdd)));
if (V(in)>0.5*V(vdd))
d_out =0;
else
d_out =1 ;
V(out) <+ transition(d_out,0,10ns)*V(vdd);
end
endmodule

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago

    You have vdd as a variable (which is set to 1, not 1.2) but yet you are referring to it as the voltage of a node called vdd with electrical discipline - but you have not defined it as a electrical node.

    If you change all the V(vdd) to just vdd, and change the 10ns to 10n, the code will work.

    Either that, or have vdd as one of the signals passed into the inverter, and remove the real vdd and vdd=1 from the code.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Hagar Hendy
    Hagar Hendy over 2 years ago in reply to Andrew Beckett

    thank you so much, it works 

    • 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