The Designer's Guide Community
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 26th, 2020, 10:44pm
Pages: 1
Send Topic Print
2 way switch in verilog ams (Read 415 times)
New Member

Posts: 1

2 way switch in verilog ams
Feb 06th, 2019, 10:01pm
I was trying to make a 2 branches switch between Vdd and ground, which controlled by a logic signal. Below is my code:

module dg_switch2(p, n, g, s);
   input s;
   output p, n, g;
   logic s;
   electrical p, n, g;

   analog begin
     if (s) begin
         I(p, n) <+ 0.0;
           V(g, n) <+ 0.0;
     else begin
           V(p, n) <+ 0.0;
               I(g, n) <+ 0.0

The problem is that when I connect a Vdc to port'p' and ground to port 'n', cadence report an error says that my there is a short circuit at my Vdc. It seems that I cannot connect both the voltage source and ground to my switch. What should I do fixed the error?
Back to top
View Profile   IP Logged
Senior Fellow

Posts: 1985
Massachusetts, USA
Re: 2 way switch in verilog ams
Reply #1 - Feb 7th, 2019, 8:28am
You should add some resistance.

What do you expect to happen when the switch is closed, V(p,n) <+ 0, and the voltage source Vdc is not zero?
Back to top

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2020 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to Consider submitting a paper or model.