I used Magic for PEX on an OpAmp GDS (attached bel...
# magic
h
I used Magic for PEX on an OpAmp GDS (attached below) generated using a GDSFactory-based generator in OpenFASoC. The netlist was generated using the
extract.bash
script attached below. The resulting SPICE netlist has no resistances and some capacitances are floating. I also tried with the
extract do resistance
,
ext2spice rthresh 0
,
extract do capacitance
, and
ext2spice cthresh 0
options but still no resistances were generated. Magic version:
8.3.452
@Tim Edwards, could you please take a look? Any help would be greatly appreciated. Thanks! cc: @mehdi
t
The correct script for doing full RCX extraction is kind of complicated and looks like the following:
Copy code
load <cellname>
flatten my_flat_cell
load my_flat_cell
select top cell
extract do local
extract all
ext2sim labels on
ext2sim
extresist tolerance 10
extresist
ext2spice lvs
ext2spice cthresh 0
ext2spice extresist on
ext2spice
(I posted this in an earlier message, Nov. 27). You can add a few extra lines to delete the original cell after flattening and then rename the flattened cell back to the original cell name so that the extracted netlist has the original cell name and not "my_flat_cell". The main point is that
ext2spice rthresh
does not generate parasitic resistances. It generates "lumped resistances" which are useful for capturing simplified wire delays but which won't work in SPICE.
You didn't attach a script, by the way.
m
Thanks @Tim Edwards Wasn't this released a while back? @Yukidamayaki FYI.
t
@mehdi: Was what released a while back?
m
this:
Copy code
load <cellname>
flatten my_flat_cell
load my_flat_cell
extract do local
extract all
ext2sim labels on
ext2sim
extresist tolerance 10
extresist
ext2spice lvs
ext2spice cthresh 0
ext2spice extresist on
ext2spice
t
I guess the question is what do you mean by "released"? I have posted that sequence of commands numerous times. It is not part of any of my tools, although I should probably incorporate that and other common command sequences to make them more accessible. Harald Pretl did that, though; that script or something like it should be in the IIC-OSIC-TOOLS set.
๐Ÿ‘ 1
๐ŸŒ 1
@mehdi: The
run_lvspex.sh
script is doing the flattening and renaming part correctly. It is not doing the R-C extraction part correctly. There is no
ext2sim
or
extresist
in the code, so you're not going to get any parasitic resistances.
m
Great, thanks!
t
@mehdi: Another thing I just noticed in the posted script: It is wasting a lot of time by redundantly extracting the circuit multiple times. Once you have done
extract all
, there are multiple
.ext
files with the extraction information---Subsequently you can make multiple calls to
ext2spice
with different options enabled to get netlists appropriate for LVS, simulaton, or RCX. There is no need to re-extract;
ext2spice
will be using the
.ext
files only. (The "simulation" netlist appears to be parasitic capacitance extraction only; I'm assuming you're using this "correctly", meaning that it is a way to get a somewhat more realistic simulation without getting the simulator bogged down with a full R-C extracted netlist).
h
Sorry, I forgot to attach files.
The correct script for doing full RCX extraction is kind of complicated and looks like the following:
Thanks a lot, I'll check this out!
I tried. The
.sim
file has resistances but not the
.spice
file. Is this expected behaviour?
https://open-source-silicon.slack.com/archives/C016YSAP6TZ/p1701220776615659?thread_ts=1701064529.481459&amp;cid=C016YSAP6TZ This thread seems to mention a similar problem. Shouldn't this be fixed on revision 452?
t
@Harsh Khandeparkar: I forgot one line in the script which is that you need
select top cell
after the
load
line. However, you have other issues, the main one being that you have written GDS using a tool other than magic, and it does not make the library name equal to the top cell name, which is how magic identifies a top-level cell in the GDS. So either you need to assume that the top level cell name is equal to the root name of the file, or you need to pass another argument to the script with the name of the top-level cell. Assuming the former (filename is "opamp.gds" so the top level cell is expected to be "opamp"), then the attached modified script would be appropriate.
h
The top cell name is renamed to
opamp
.
It is working now. Thank you! One final doubt: Will adding
ext2spice merge aggressive
have any impact on the correctness of the output?
t
I would definitely avoid using
merge aggressive
as that will change device dimensions.
merge conservative
is probably all right to use, but it may still change device parameters like drain/source area/perimeter, since one value has to apply to all merged devices. Since SPICE is going to expand any merged devices into individual ones, then
merge
has no impact on simulation and only serves to reduce the file size.
๐Ÿ‘ 2