magic icon indicating copy to clipboard operation
magic copied to clipboard

About RC PEX file extraction using magic command

Open Elon-J opened this issue 2 years ago • 15 comments

When I use the command to extract a PEX file with RC, it doesn't work; it just has C in my PEX file. How can I solve this problem? It said that 'Cannot open file (UNNAMED).sim' attach the result and my extract file. The log file is in output.log, the GDS file is PMU_top_level, and the magic command is in run_lvspex.sh. Thank you! @msaligane

extract_PEX.zip

UNNAMED_problem

Elon-J avatar Aug 05 '22 05:08 Elon-J

The above output depends on a script run_lvspex.sh which is not in the zip file.

RTimothyEdwards avatar Aug 05 '22 13:08 RTimothyEdwards

There are a number of issues in the GDS itself, such as layers that don't exist in the sky130 process.

I am getting an error from the extresist command where it seems to be confused by $ in names. I will look into that. That does seem to prevent the generation of the .res.ext file which would explain why the output only has parasitic capacitors in it. (edited) Sorry, I failed to select the top level cell after loading the flattened layout. In fact, I have no problems getting the R-C extraction, so the error must be in the abovementioned run_lvspex.sh script.

RTimothyEdwards avatar Aug 05 '22 13:08 RTimothyEdwards

Hi Tim, sorry, I use the command below to run the extraction for R-C (the run_lvspex.sh script), Do I need to flatten the GDS first to use the resistor extract command? Thank you very much! $1 is the gds path and $2 is the top-level circuit name. Also attach the run_lvspex.sh scrpit below.

magic -rcfile ./sky130A/sky130A.magicrc -noconsole -dnull << EOF gds read $1 load $2 extract do local extract all ext2sim labels on ext2sim extresist tolerance 10 extresist ext2spice lvs ext2spice cthresh 0 ext2spice extresist on ext2spice -o ./EXTRACT_PEX/$2_pex.spice quit -noprompt EOF

run_lvspex.zip

Elon-J avatar Aug 06 '22 21:08 Elon-J

At the moment, yes, you need to flatten the circuit:

magic -rcfile ./sky130A/sky130A.magicrc -noconsole -dnull << EOF
gds read $1
load $2
select top cell
flatten $2_flat
load $2_flat
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 -o ./EXTRACT_PEX/$2_pex.spice
quit -noprompt
EOF

It is possible to rename the flattened circuit back to the original name, but the above script is simpler. Just bear in mind that the name of the top level subcircuit in the output file has the "_flat" extension.

RTimothyEdwards avatar Aug 07 '22 00:08 RTimothyEdwards

thank you very much, Tim! It's really helpful, let me try it again.

Elon-J avatar Aug 07 '22 00:08 Elon-J

Hi Tim, when I use the above command to extract the RC PEX file, the subcircuit pins will also be extract into the top level in the flattening step. When I try to use 'flatten -dotoplabels $2_flat' command to prevent this, it does not work well. Attach the screenshot below; the first picture is the original hierarchy gds, the second picture is flatten gds and the third one is the PEX file. After flatting the circuit, the pins in the subcircuits will also be extracted. How can I solve this problem? Thank you very much!

image image image

Elon-J avatar Aug 08 '22 17:08 Elon-J

If the circuit is flattened, then your PEX file should not have a subcircuit called DAC_COMP.

Flattening with no options will cause the subcircuit pins to become labels with the name of the subcircuit instance prepended; e.g., pin VOUT becomes label DCDC_DAC$2_0/VOUT. Since that is an ordinary label, then the top level pin D[1] will take precedence.

RTimothyEdwards avatar Aug 08 '22 18:08 RTimothyEdwards

I see, Let me try just to use these top-level pins to test, thank you very much, Tim!

Elon-J avatar Aug 09 '22 23:08 Elon-J

Hi, Tim, when I try to extract the whole RC PEX file for our circuit, I got an error. If the magic collapse when extracting this circuit? Or I don't use the right command? Attach the screenshot, gds file, magic command, and magic running log file. The gds file is in top_level.zip, the magic command is in run_lvspex.zip and the magic running log file is in output.log. Thank you very much! magic_extract_error

top_level.zip run_lvspex.zip output.log

Elon-J avatar Aug 15 '22 02:08 Elon-J

@RTimothyEdwards, Hi, Tim, I have a problem when I want to extract an RC PEX file for my top.gds file. The error is just like this: Screen Shot 2022-08-16 at 16 02 53 Screen Shot 2022-08-16 at 16 03 09

How can I solve it? Is this caused by too many labels when flattening the GDS file? Thank you very much! Attach the whole running package directory for your reference: extract_PEX.tar.gz

Elon-J avatar Aug 16 '22 20:08 Elon-J

Sorry for the delay; I was rather busy last week. I'm looking at it now and I can confirm the crash condition.

RTimothyEdwards avatar Aug 22 '22 16:08 RTimothyEdwards

No worries, Tim! I just use C extraction PEX file simulation recently, but I still have this problem for RC extraction currently @msaligane

Elon-J avatar Aug 30 '22 18:08 Elon-J