Difference between revisions of "Relay"
From Vlsiwiki
(Created page with 'module relay (c1, c2, pin, nin) ; inout c1, c2 ; input pin, nin electrical c1, c2, pin, nin; parameter real r=1 ; analog begin @(cross(V(pin,nin))) discontinuity(0) ; if (V(pi…') |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | module relay (c1, c2, pin, nin) ; | + | `include "discipline.h" <br /> |
− | inout c1, c2 ; | + | `include "constants.h" <br /> |
− | input pin, nin | + | module relay (c1, c2, pin, nin); |
− | electrical c1, c2, pin, nin; | + | inout c1, c2;<br /> |
− | parameter real r=1 ; | + | input pin, nin;<br /> |
− | analog begin @(cross(V(pin,nin))) discontinuity(0) ; | + | electrical c1, c2, pin, nin; |
− | if (V(pin,nin) >= 0) | + | parameter real r=1 ; |
− | I(c1,c2) <+ V(c1,c2)/r; | + | analog begin @(cross(V(pin,nin))) discontinuity(0) ; <br /> |
− | else | + | if (V(pin,nin) >= 0)<br /> |
− | end endmodule | + | I(c1,c2) <+ V(c1,c2)/r; <br /> |
+ | else | ||
+ | I(c1,c2) <+ 0 ; | ||
+ | end endmodule | ||
+ | |||
+ | example from http://www.eda.org/verilog-ams/htmlpages/public-docs/lrm/VerilogA/verilog-a-lrm-1-0.pdf |
Latest revision as of 00:19, 13 November 2009
`include "discipline.h"
`include "constants.h"
module relay (c1, c2, pin, nin); inout c1, c2;
input pin, nin;
electrical c1, c2, pin, nin; parameter real r=1 ; analog begin @(cross(V(pin,nin))) discontinuity(0) ;
if (V(pin,nin) >= 0)
I(c1,c2) <+ V(c1,c2)/r;
else I(c1,c2) <+ 0 ; end endmodule
example from http://www.eda.org/verilog-ams/htmlpages/public-docs/lrm/VerilogA/verilog-a-lrm-1-0.pdf