• 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. Custom IC SKILL
  3. Getting transistor instance name from spectre simulation...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 3607
  • 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

Getting transistor instance name from spectre simulation for use in VerilogA

Jereme
Jereme over 1 year ago

Hello, 

I am trying to make some verilogA models for use in a Cadence simulation. I have a sample circuit with 9 transistors that are nshort and have names MN0-MN8. I invoke the model within the devices model card as follows: 

inline subckt nshort (d g s b)
parameters l=1 w=1 
nshort (d g1 s b) nshort_main w=w l=l 

vrts_nshort (g g1 s d b) rts_nshort w=w l=l 

....

ends nshort

Then the rts_nshort  is defined in a verilogA file as follows: 

`include "constants.h"
`include "discipline.h"
module rts_nshort(p,n,s,d,b);
inout p, n, s, d, b;
electrical p, n, s, d, b;
parameter real w=0;
parameter real l=0;
real dVg, tc, te;
real activate = 0;
real Vd = 0;
real Vg = 0;
real amp1 = 0;
real amp2 = 0;
real amp3 = 0;
real amp4 = 0;
real amp5 = 0;
real amp6 = 0;
real amp7 = 0;
real amp8 = 0;
real amp9 = 0;
real amp10 = 0;

analog begin

Vg = V(p,s);
Vd = V(d,s);

...

end

endmodule

 

In my testing with the help of some display statements I am able to determine that this VerilogA file is invoked for each nshort transistor in the design which is good, but the question is, it is possible to inform the verilogA code which transistor is currently being simulated?  For instance, it is currently simulating MN0, would it possible for the VerilogA file to be informed of this? I want to later use these transistor names to simulate specific activity in a device. 
So I guess overall, I am wondering When using Verilog-A models in Spectre, how can you identify the specific transistor instance that invokes the model? 


Thank you in advance for your help with this. 


Virtuoso version: 6.1.8-64b
Spectre version: 21.1.0.612.isr15
Let me know if there is any other tool version that would be helpful. 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    A slightly unusual thing to do (usually accessing the instance name is done for reporting), but you can do it as follows (using an adaptation of your example):

    `include "constants.h"
    `include "discipline.h"
    module rts_nshort(p,n,s,d,b);
    inout p, n, s, d, b;
    electrical p, n, s, d, b;
    parameter real w=0;
    parameter real l=0;
    real dVg, tc, te;
    real activate = 0;
    real Vd = 0;
    real Vg = 0;
    real amp1 = 0;
    real amp2 = 0;
    real amp3 = 0;
    real amp4 = 0;
    real amp5 = 0;
    real amp6 = 0;
    real amp7 = 0;
    real amp8 = 0;
    real amp9 = 0;
    real amp10 = 0;
    
    string moduleName;
    
    analog begin
    
    Vg = V(p,s);
    Vd = V(d,s);
    
    $swrite(moduleName,"%M");
    // remove the ".vtrs_nshort" from the end
    moduleName=moduleName.substr(0,moduleName.len()-13);
    if (moduleName=="NM0") begin
      $strobe("Inside NM0");
    end
    $strobe("Module Name is ",moduleName);
    
    end
    
    endmodule

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Jereme
    Jereme over 1 year ago in reply to Andrew Beckett

    Hello Andrew, thank you for your reply. This was exactly what I was looking for, thank you!!!! 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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