Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Verilog-A genvar expression

Status
Not open for further replies.

carbon9

Member level 3
Joined
Dec 31, 2006
Messages
60
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,745
Hello,

I'm trying to implement a voltage controlled capacitor in Verilog-A. I tried to use the following script:

Code:
`include "disciplines.vams"
`include "constants.vams"


module capacitor(p,n);
  inout p,n;
  electrical p,n;
  analog begin
   if(V(p,n)>=0 && V(p,n)<2.5)
		  I(p,n) <+ ddt(V(p,n));
		  else
		  I(p,n) <+ 0.1*ddt(p,n);
		  

  
  end
endmodule

However, Verilog compiler does not compile this module. I found this expression in Verilog-A reference manual: "The $table_model() system function has the same restrictions as analog operators. That is, it cannot be used inside of if(), case(), or for() statements unless these statements are controlled by genvar-constant expressions." So, since my analog operator is ddt operator above inside the if statement, it will not compile. However, the manual says something about "genvar" expression. How can I use this to make my module working?

Regards,
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top