Skip to content

Conversation

@KrzysztofHerman
Copy link
Contributor

Unifies xschem symbols not to have spiceprefix. It cancels #605.
It also cleans up lvs_format entry not to have spiceprefix.

Signed-off-by: KrzysztofHerman <herman@ihp-microelectronics.com>
@d-m-bailey
Copy link
Contributor

@KrzysztofHerman Could you help me understand this change?

My understanding is that klayout expects device names to begin the the standard spice prefix for the respective models. M for mosfets, D for diodes, etc.

However, the ngspice models are defined as subcircuits, so X needs to be added. The format variable in the xschem symbol will allow this.

In sky130, the magic extraction rules were designed to extract as X devices also. For ihp-sg13g2, are we expected to use the lvs variant of the ihp-sg13g2.tech file so that the same source can be used for both klayout and magic/netgen?

@H-Ojiro

@d-m-bailey
Copy link
Contributor

@KrzysztofHerman @RTimothyEdwards @FaragElsayed2
We are checking the effect of these changes on LVS in Klayout and netgen/magic.

We attempted to run LVS against the magic extracted netlist using the lvs variant (extracts devices as M, C, D, Q, etc. instead of X). This is the same as Klayout extraction. The intention was to verify that LVS passes netgen and Klayout using the same source netlist that would be created by the changes in this PR.

We ran into a problem with the 3 terminal capacitor/resistor devices and 4 terminal bipolar devices. The lvs variant will not extract these. Also, spice format does not allow a 3 terminal capacitor/resistor and netgen did not correctly recognize the devices as output by xschem. The Klayout rule deck has special processing for 3 terminal capacitors/resistors and 4 terminal bipolar devices that allows LVS to pass.

The cdl (Calibre) format for 3 terminal resistors/capacitors adds the third terminal as a comment

C0 TOP BOTTOM rfcmin $SUB=VSS

I don't know if magic can handle this or not. Klayout rules could be modified to process this, I think.

Is it iHP's intention to configure xschem to produce an LVS netlist that will pass Klayout LVS without modification? If that is the case, we can create scripts that will modify that netlist to pass magic/netgen LVS. Or do you want to create a netlist that will pass all LVS - Klayout, magic/netgen, Calibre, etc.?

Copy link
Contributor

@d-m-bailey d-m-bailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sergeiandreyev @KrzysztofHerman

I think that the spice format for LVS using klayout and netgen is different.
Either the netlist will be created for klayout and converted to netgen or created for netgen and converted to klayout.

Which does iHP want to support natively?

@FaragElsayed2 @RTimothyEdwards @atorkmabrains

G {}
K {type=pad
lvs_format="@spiceprefix@name @pinlist @model"
lvs_format="@name @pinlist @model"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What device type are bondpads?
If extracted as black boxes the prefix should be X.
If extracted as capacitors the prefix should be C.

G {}
K {type=diode
lvs_format="@spiceprefix@name @pinlist @model l=@l w=@w"
lvs_format="@name @pinlist @model l=@l w=@w"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What device type are dantenna?
If extracted as black boxes the prefix should be X.
If extracted as diodes the prefix should be D.

G {}
K {type=diode
lvs_format="@spiceprefix@name @pinlist @model m=@m"
lvs_format="@name @pinlist @model m=@m"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If extracted as black boxes the prefix should be X.
If extracted as diodes the prefix should be D.

G {}
K {type=diode
lvs_format="@spiceprefix@name @pinlist @model m=@m"
lvs_format="@name @pinlist @model m=@m"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If extracted as black boxes the prefix should be X.
If extracted as diodes the prefix should be D.

G {}
K {type=diode
lvs_format="@spiceprefix@name @pinlist @model m=@m"
lvs_format="@name @pinlist @model m=@m"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If extracted as black boxes the prefix should be X.
If extracted as diodes the prefix should be D.

G {}
K {type=diode
lvs_format="@spiceprefix@name @pinlist @model m=@m"
lvs_format="@name @pinlist @model m=@m"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If extracted as black boxes the prefix should be X.
If extracted as diodes the prefix should be D.

G {}
K {type=diode
lvs_format="@spiceprefix@name @pinlist @model l=@l w=@w"
lvs_format="@name @pinlist @model l=@l w=@w"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If extracted as black boxes the prefix should be X.
If extracted as diodes the prefix should be D.

G {}
K {type=esd
lvs_format="@spiceprefix@name @pinlist @model m=@m"
lvs_format="@name @pinlist @model m=@m"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If extracted as black boxes the prefix should be X.
If extracted as diodes the prefix should be D.
If extracted as mosfet the prefix should be M.

G {}
K {type=vertical_npn
lvs_format="@spiceprefix@name @pinlist @model le=900e-9 we=70.0n m=@Nx"
lvs_format="@name @pinlist @model le=900e-9 we=70.0n m=@Nx"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If extracted as black boxes the prefix should be X.
If extracted as bipolar the prefix should be Q.

G {}
K {type=vertical_npn
lvs_format="@spiceprefix@name @pinlist @model le=900e-9 we=70.0n m=@Nx"
lvs_format="@name @pinlist @model le=900e-9 we=70.0n m=@Nx"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If extracted as black boxes the prefix should be X.
If extracted as bipolar the prefix should be Q.

@RTimothyEdwards
Copy link
Contributor

Magic can be patched to handle the unfortunate use of CDLisms like 3-terminal capacitors and resistors that violate SPICE syntax, but I really strongly disapprove of the industry standard that thinks it makes sense to extract unsimulatable netlists for no apparent good reason.

@d-m-bailey
Copy link
Contributor

@RTimothyEdwards When you say the industry standard CDLism of 3 terminal capacitors are you referring to this syntax

C1 net1 net2 cap_model L=3 W=4 $SUB=vss

or an actual 3 terminal instance?

C1 net1 net2 vss cap_model L=3 W=4

Simulation (ngspice) uses a subckt model which is totally doable in magic, right?

X1 net1 net2 net3 cap_model L=3 W=4

I think we need to figure out how to handle X devices in klayout.

@sergeiandreyev @KrzysztofHerman
Supporting non-CDL syntax for klayout LVS means that other tools will break (my CVC-RV for instance). In particular, switching the anode and cathode order for the nmoscl_* diodes as primitive devices is going to cause erc errors if the klayout LVS input netlist is used for verification.

@RTimothyEdwards
Copy link
Contributor

@d-m-bailey : Maybe I should have said "industry standards"? Are both commonly used? I mainly intended to mean anything that is a syntax introduced by commercial tools that makes it incompatible with, say, ngspice or Xyce, or otherwise presents something as appearing to be a SPICE low-level component when it isn't.

@d-m-bailey
Copy link
Contributor

@RTimothyEdwards the only industry standard that I've seem is the form that should work with ngspice or xyce.

C1 net1 net2 c0 m=m $[cap_model]  $SUB=vss L=3 W=4

CVC handles the converted X device form.

C1 net1 net2 cap_model L=3 W=4 $sum=vss 

Which has everything after the first $ is ignored.

Creating a custom reader for klayout that handles ill-defined devices is leading to inconsistencies across tools, I think.

Custom devices might be better handled as X devices, but I haven't seen that in klayout yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants