• 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. PCB Design
  3. verilog-A to .lib translation in PSpice

Stats

  • Locked Locked
  • Replies 0
  • Subscribers 164
  • Views 13894
  • Members are here 0
More Content
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

verilog-A to .lib translation in PSpice

archive
archive over 9 years ago

Hey,

  I have the following verilog-A coded component that defines a simple nonlinear function:

// VerilogA for memr, memr_f, veriloga

`include "constants.vams"
`include "disciplines.vams"

module memr_f(vp,vn,vout,vref);
electrical vp,vn,vout,vref;
parameter real vth=1,vo=1,Io=1e-9;
real vd,id;

analog begin
vd = V(vp) - V(vn);
if (vd>vth) begin
id = Io*(exp(vd/vo)-exp(vth/vo));
end else if (vd<-vth) begin
id = -Io*(exp(-vd/vo)-exp(vth/vo));
end else begin
id=0;
end

I(vout,vref) <+ -id;
end


endmodule

I want to make this as a sub-circuit in Orcad. So, I wrote the below code and saved it as .lib and created a new library with a new part with ports vp, vn, vout and vref.

.SUBCKT memr_f vp vn vout vref
.func vd() {v(vp)-v(vn)}
.func id() {IF(vd >= 1.0, 1e-5*(exp(vd/0.1)-exp(vd/0.1)), IF(vd <=- 1.0, -1e-5*(exp(-vd/0.1)-exp(1.0/0.1)), 0))}
Is vout vref {id()}
.ENDS

When running this, I get an error 'File does not exist' and when I click ok, I get 'Ocad contains an invalid path'. I want to know if there are any errors in the netlist I wrote which is equivalent to the above verilog-A code. Can you help me in this

  • Cancel
Cadence Guidelines

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