The Designer's Guide Community
Forum
Models in Minutes
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines. Feb 17th, 2019, 11:51pm
  HomeHelpSearchLoginRegisterPM to admin  
 
Pages: 1
Send Topic Print
2 way switch in verilog ams (Read 48 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: 1946
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
Trouble viewing this site? Copyright © 2002-2018 Designer's Guide Consulting. 'Designer's Guide' is a registered trademark of Designer's Guide LLC. All rights reserved.

Our colleges are not as safe as they seem. Sexual assault is pervasive and the treatment of the victim by the adminstration is often as damaging as the assault: Campus Survivors, Campus Survivors Forum.

Some of our other sites that you might find useful: Avendesora, Inform and QuantiPhy.