The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> 2 way switch in verilog ams
https://designers-guide.org/forum/YaBB.pl?num=1549519298

Message started by Yuan on Feb 6th, 2019, 10:01pm

Title: 2 way switch in verilog ams
Post by Yuan on Feb 6th, 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?

Title: Re: 2 way switch in verilog ams
Post by Geoffrey_Coram on 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?

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.