The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 23rd, 2019, 11:46am
Pages: 1
Send Topic Print
2 way switch in verilog ams (Read 183 times)
Yuan
New Member
*
Offline



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;
           end
     else begin
           V(p, n) <+ 0.0;
               I(g, n) <+ 0.0
           end
   end
endmodule

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
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1957
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-2019 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 editor@designers-guide.org. Consider submitting a paper or model.