krishna95
New Member
Offline
Posts: 5
|
I am trying to model a laser component which takes in voltage and outputs electric field (EF). The output field should be a two element quantity as it contains real and imaginary parts in it. I wrote a verilogA code (copied below) for the laser (las1 component) and converted it into a symbol for cadence schematic simulation. The input port can be connected to a voltage and the output port has two vector notation <0:1> as shown in the schematic.png (attached) Here's the issue. I tried to connect a port/pin to the output <0:1> and the schematic recognizes the output as two port network and yields a check error. The simulation also yields an error
FATAL: The following branches form a loop of rigid branches (shorts) when added to the circuit: I5:out[1]_flow (from O to 0) Is there any way to make the out port recognized as a single port but with two output values ?
// VerilogA for Tutorials, las1, veriloga
`include "constants.vams" `include "disciplines.vams"
//verilog code for the laser model. It takes in voltage an dmultiplies with gain to get output field
//definition of new Optics discipline //output electric field is labelled as EF nature Efield access=EF; units="V/m"; abstol=1e3; endnature
discipline Optics potential Efield; enddiscipline
module las1(ampin,out); input ampin; output [0:1] out; electrical ampin; Optics [0:1] out; parameter real gain = 1 from [0:2]; analog begin EF(out[0])<+gain*V(ampin); EF(out[1])<+(gain-1)*V(ampin); end endmodule
|