• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. Model simple inductor in SystemVerilog using EEnet

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 67
  • Views 16409
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Model simple inductor in SystemVerilog using EEnet

analogcad2
analogcad2 over 4 years ago

I have a simple SV capacitor model using EEnet as shown below. This simulates with no issues when driven by 1V square wave as shown below:

`timescale 1ns/1ps
import EE_pkg::*;

module CapGeq ( P );

inout EEnet P;
parameter real c=1e-9; // capacitance
parameter real rs=0; // series resistance
parameter real ic=0; // initial capacitor voltage at time zero
parameter real tinc=10e-9; // timestep for computing voltage update (sec)

bit ck;
real dV,Icap,Tcap, Vout;

always #(tinc*1s) ck=!ck; //toggle clock at defined rate

always@(P.I,ck) begin //on input change or clock cycle;
dV=Icap*($realtime-Tcap)/(c*1s); //voltage change is I*DT/C
Icap=P.I; Tcap=$realtime; //save new current and time
Vout += dV; //update voltage
end

assign P='{Vout,0,0}; //drive output as ideal voltage source

endmodule

Output waveform:

However I try to replicate inductor SV model using similar strategy as shown below:

`timescale 1ns/1ps
import EE_pkg::*;
import cds_rnm_pkg::*;

module indGeq(P);
inout EEnet P;

parameter real L=50e-6; // inductunce, 50uH
parameter real rs=0; // series resistance
parameter real iL=0; // initial inductor voltage at time zero
parameter real tinc=1e-9; // timestep for computing voltage update (sec)

bit ck;
real dI,Vind,Tind,Iout;

//initial Vind=iL;

always #(tinc*1s) ck=!ck;

always @(P.V,ck) begin //on input change or clock cycle;
dI=Vind*($realtime-Tind)/(L*1s); //current change is Vind*dt/L;
Vind=P.V; //save new voltage
Tind=$realtime; //save new time
Iout+=dI; //update current
end

assign P = '{0,Iout,0}; //drive output as ideal current source

endmodule

However, I see "Iout" and Vind both are zero all the time. Can anyone explain why this model is not working?

  • Cancel
Parents
  • ronvogelsong
    ronvogelsong over 4 years ago

    Your output is being driven as an ideal voltage source.  You need a resistance of `wrealZState to make it an ideal current source!   Oooops!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • ronvogelsong
    ronvogelsong over 4 years ago

    Your output is being driven as an ideal voltage source.  You need a resistance of `wrealZState to make it an ideal current source!   Oooops!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information