• 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. Simulation issue with ideal relay implemented in verilog...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 126
  • Views 16792
  • 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

Simulation issue with ideal relay implemented in verilog a

lahsivece
lahsivece over 11 years ago

 Hi ,

 I am trying to simulate a verilog a relay . Please find the code below (The designer's guide to verilog AMS; Chap 3 listing 13)

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

module SWITCH(inp, inn, outp, outn);
input inp,inn;
parameter real switch1=0;
electrical inp, inn, outp, outn;
analog begin
    @(cross(V(inp,inn)-switch1,1))
;
    if(V(inp,inn) > switch1)
        V(outp,outn) <+ 0.0;
    else
    I(outp,outn) <+ 0.0;

end

endmodule

The testbench for simulation and output wavforms are shown below.

If the "switch" waveform (which controls the switch) is switching, shouldn't the output be switching also. Please advise

 

  • OUTPUT.png
  • View
  • Hide
  • Cancel
Parents
  • lahsivece
    lahsivece over 11 years ago

     Hi Andrew,

    That was indeed the case . With a resitor added , relay behaves properly.

    Thanks for pointing this out.

    Regards

    Vishal. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • lahsivece
    lahsivece over 11 years ago

     Hi Andrew,

    That was indeed the case . With a resitor added , relay behaves properly.

    Thanks for pointing this out.

    Regards

    Vishal. 

    • 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