-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions about LVS #336
Comments
the problem is: X is a subcircuit. You have to call a transistor M. if You use XM models in Your simulation, remove the X for LVS. |
As far as I know, Klayout LVS generally require CDL netlist whilst currently Qucs-s only generate .cir netlist. Starting from february, the QUCS-S 25 version will accommodate CDL type netlist. I think then it'd be much easier for checking LVS. For more, you can go through this issue - ra3xdh/qucs_s#1213 |
@olisnr Yes, that what I understood, but shouldn't an LVS be able to extract the hierarchy from a subcircuit? I'm not too used to LVS, is it common for LVS "engine" not to descend into sub-circuits?
That's what I saw too, but then it seems that it was updated to be compatible with spice netlists? At least the GUI accepts Thanks for the info about Qucs-S and CDL export, that's a good thing. So I wonder: Should IHP's LVS be updated to manage subcircuits? Or should it be the role of a script do it forehand? |
Hi @adrienluitot, @Ikram-rs22, you're welcome to try the Qucs-s build w/ CDL export support (our fork) before official merge: |
@sergeiandreyev I downloaded and built Qucs-S latest git version. But as I explained above, it didn't "fix my problem" (i'm not sure it is a problem, maybe it's an expected behaviour). |
@adrienluitot the XM in the simulation is a subcircuit. but the LVS-script will find a M device not a subcircuit. so if You want to compair a schematic spice with the LVS extracted .cdl You need to change the XM to M. .cdl can have subcircuits like spice, but not devices as subcircuits. |
KLayout LVS works with hierarchy as well (subcircuits referencing other subcircuits), for each 3. Component DefinitionsEach component is defined in a single line with specific parameters: MOSFETs
Example:
Resistors
Example:
Capacitors
Example:
Inductors
Example:
|
In case you didn't know. We are upgrading Qucs to use Verilog. The schematic dump is there, and usable. See e.g. It would be better if the LVS tool supported Verilog. This will save time, and make it much easier to get the metadata across, and back (which is needed anyway). |
well, I guess this change, if agreed, will impact every tool in the open-source domain (KLayout, netgen, etc.) - currently support of Verilog netlists is only available in commercial EDA software |
The intent is not to follow commercial software. "Netlisting" and "flattening" are lock-in mechanisms that we do not need in FOSS. We use Verilog schematics as the primary source for circuit drawings including metadata, for everyone to use across a variety of tools. This data interchange not something an EDA software seller will make a priority. Sure, ngSpice does not understand Verilog, and I cannot help it. But then, creating Spice netlists from Verilog is absolutely straightforward. Reading Verilog into Qucs will be a matter of weeks from now... How about parallelising? Klayout? Xschem? |
Okay I made several tests, and maybe the problem comes from Qucs-S or the PDK in Qucs-S.
(I don't know why, it doesn't seem to export the The thing is, What do you think about it? Is the PDK wrongly implemented for Qucs-S? By the way, I don't know if it's correct just to replace the |
The MOSFETs in the most of PDKs is not a MOSFET device but a subcircuit. The |
I agree, at least for simulations, but maybe not in the case of a LVS. |
I'll take care of it. |
@ra3xdh: I would like to make the following suggestion to solve the problem: Introduce the following per global settings on/off switchable special treatment of subcircuit instances during CDL netlisting: As a preparation step during CDL netlist export:
|
Xschem does this simpler: it has symbols that have a effective You name Your transistor i think the way Xschem handle this is very good. i would do the same in QUCS. |
Thanks for the remark. This is already covered by our roadmap with work currently in progress. In Qucs we will use attributes as defined in the standard. See LRM 2.9 Attributes
What does it mean? Use modules like
Or specify as part of instanciation, possible override
The key here is that "attributes" are not "parameters". Attributes are metadata that most tools can safely ignore, while parameters are not. Note how parameters have ranges, types and other semantics that attributes should better not interfere with. Xschem should also consider drawing that line. |
@felix-salfelder i dont understand ""attributes" are not "parameters"". do You mean attributs are the name of the symbol or the color of the pins, and parameters are and i think |
On Sat, Jan 25, 2025 at 01:51:20PM -0800, olisnr wrote:
@felix-salfelder i dont understand ""attributes" are not "parameters"". do You mean attributs are the name of the symbol or the color of the pins, and parameters are `W` and `L`?
Eventually this is about terminology. A "parameter" is often used to
carry a numerical constant that has to do with model "parameter"isation.
`W` and `L` are normally called "parameters". Parameters are relevant
during model selection. "Polarity", "level" etc.
(For more details, see Section 3.4 Parameters in the LRM, and examples
therein.)
Attributes is just another word they made up, to refer to something
else, metadata. Yes, attributes can carry style information, such as
color, appearance, position on screen etc. Attributes may be attached to
objects (not neccessarily device types or instances) any time. With this
in mind, attributes are simply not parameters, and should be treated
accordingly.
and i think `(* CDL_type="X" ` makes no sense, it would be `(* spice_type="X" `
Perhaps I got distracted by reading about CDL, thought the letter is the
one you'd use in a CDL file. Anyway, choose a name that indicates the
actual intent and use. "LVS_type" might cut it, "klayout_LVS_type" might
be more appropriate.
Note how little sense spice_type makes to begin with. No two Spices
use these letters in the same way. To get anywhere, there whould have to
be ngspice_type, xyce_type, klayout_type, some_commercial_spice_type
(depending on the use case), likely more.
|
@felix-salfelder thanks a lot for Your explanations. what is the LRM? |
the idea behind |
On Sun, Jan 26, 2025 at 11:48:59AM -0800, olisnr wrote:
what is the LRM?
You are welcome. I was referring to the Verilog-AMS Language Reference
Manual.
This one here looks like the current version.
https://accellera.org/images/downloads/standards/v-ams/VAMS-LRM-2023.pdf
|
@felix-salfelder @olisnr
|
On Mon, Jan 27, 2025 at 06:37:42AM -0800, Thomas Zecha wrote:
Please transform the following subcircuit excerpt (it's a MOS primitiv) from IHP open source library according to your _'spiceprefix=X'_-rule as an example how this should like like. Thank you:
```
.SUBCKT IHP_PDK_nonlinear_components_sg13_lv_nmos gnd d g s b w=0.35u …
X1 d g s b sg13_lv_nmos w={w} …
.ENDS
```
Verilog-A has "module" as a substitute/extension for ".subckt". So the
snippet in question would look more like
```
(* [..] *)
module IHP_PDK_nonlinear_components_sg13_lv_nmos(gnd, d, g, s, b);
inout electrical gnd, d, g, s, b;
parameter real w=.35u from (0:inf);
[..]
sg13_lv_nmos #(.w(w) [..]) n1(d, g, s, b);
endmodule
```
Now, specific applications need extra letters, add them like
```
module IHP_PDK_nonlinear_components_sg13_lv_nmos(gnd, d, g, s, b);
[..]
(* LVS_letter="X", ngspice_letter="N", xyce_letter="X" *) [..]
sg13_lv_nmos #(.w(w) [..]) n1(d, g, s, b);
endmodule
```
If instances of IHP_PDK_.._nmos should carry those additional letters
you may put it like
```
(* LVS_letter="X", ngspice_letter="N", xyce_letter="X" *) [..]
module IHP_PDK_nonlinear_components_sg13_lv_nmos(gnd, d, g, s, b);
[..]
sg13_lv_nmos #(.w(w) [..]) n1(d, g, s, b);
endmodule
```
Where to put what mostly depends on some more context that I do not
have. By dropping disciplines, parameter ranges, case sensitivity, and
considering the desired letter attribute, you could easily recover the
.SUBCKT block above. There is no more need to carry it along.
LRM Annex E explains how Spice is made available in Verilog-A. Note that
anything Spice remains implementation defined. In oder to use Verilog-A
features such as attributes, the primary source form needs an upgrade
like the one shown above.
Hope this answers your question.
|
@felix-salfelder @olisnr Reading your comments I got the impression that implementing the 'spiceprefix=X' feature for qucs-s-schematics as well as -SPICE libraries is on your roadmap. This seems to be wrong, or? |
Qucs and Qucs-S are different projects. The sources of Qucs-S and Qucs has diverged.
@ThomasZecha , please open an issue in Qucs-S repository to discuss the technical details of MOS devices CDL handling implementation in Qucs-S. |
@felix-salfelder i think it should be done like in Xscheme: MOSFET is |
Hello,
I'm using Qucs-S to generate a (ngspice) netlist and KLayout for the layout. I'm trying to use the LVS with KLayout, but there are pretty odd things.
At first I thought the netlist generated by Qucs-S was not at all compatible. I tried to edit it by hand to have something that corresponds quite well to the netlist generated by KLayout, but it still didn't work. I kept having a result like that:
So, I tried to copy the exact same netlist from
TOP_extracted.cir
. And it worked, the LVS matched.Then I tried to change the component name, to match Qucs-S, so I changed something like
M$46
toXMN0
.And then again, nothing matched.
So I changed
XM0
toMN0
and it matched back.I don't know if this is the expected behaviour? It looks like the LVS doesn't support X sub circuits.
Also, does someone has a good/recommended flow to extract a netlist from Qucs-S in order to use it for an LVS ?
The text was updated successfully, but these errors were encountered: