KenKundert / psf_utils

Read Spectre PSF files
49 stars 14 forks source link

ValueError: x and y must have same first dimension, but have shapes (117,) and (47,) #9

Open fmfs10 opened 2 years ago

fmfs10 commented 2 years ago

I've used psf_utils to extract data from a simple inverter circuit. When I extract psfascii and try to plot it, called tran.tran.tran, using the tutorial given by the Author, I receive the following error:

ValueError: x and y must have same first dimension, but have shapes (117,) and (47,)

The psf file was generated by Spectre, with psfascii format given as the output format.

Using "list-psf -l" I can see the following result:

Diagnose.ElapTimePerStep real (117 points) Diagnose.ElapsedTime real (117 points) Diagnose.MachineLoad real (117 points) Diagnose.Memory real (117 points) Diagnose.NumberOfStep real (117 points) Diagnose.StepSize real (117 points) I0.MN6.g0 V real (18 points) I0.MP7<0>.g0 V real (19 points) I0.MP7<1>.g0 V real (19 points) I11.MN6.g0 V real (48 points) I11.MP7<0>.g0 V real (48 points) I11.MP7<1>.g0 V real (48 points) I12.MN6.g0 V real (48 points) I12.MP7<0>.g0 V real (48 points) I12.MP7<1>.g0 V real (48 points) I17.MN6.g0 V real (48 points) I17.MP7<0>.g0 V real (48 points) I17.MP7<1>.g0 V real (48 points) I2.MN6.g0 V real (48 points) I2.MP7<0>.g0 V real (48 points) I2.MP7<1>.g0 V real (48 points) V2:p A real (76 points) V4:p A real (75 points) VDD V real (2 points) in V real (5 points) net13 V real (45 points) net4 V real (45 points) net5 V real (45 points) net6 V real (45 points) out V real (47 points)

So this error was actually expected, as "out" have 47 points and not 117

The file is not corrupted, as it can be read and plotted by ADE without any problem

KenKundert commented 2 years ago

To have any hope of diagnosing the problem I will need a copy of the PSF file. I will also need to see exactly how you requested the PSF ascii file format from Spectre and any options that affect that format.

It appears as if Spectre is somehow sparsifying the data, which is new to me. If you can turn that feature off the problem may go away.

fmfs10 commented 2 years ago

Sorry, I really forgot to give the psf file, here it is: tran.tran.tran.txt

The requested file was made using the following command: spectre input.scs ++aps=liberal -64 -multithread +error +info +debug +timer +varedefnerror +warn +note -log -raw ../psf -format psfascii

Spectre Version is: 21.1.0.246.isr4

KenKundert commented 2 years ago

Are there any Spectre options or transient options that might affect the PSF file?

Have you tried without using ++aps?

fmfs10 commented 2 years ago

I rerun the same netlist using 'spectremdl' instead of 'spectre', using the same operations for simulation, and now it is working. I have no idea why, but spectremdl generates a different simulation file for psfascii. (the data result, when plotted, is as expected the same).

Answering your question, it doesn't matter if ++aps is turned on or not

KenKundert commented 2 years ago

I'm glad you have a work around. Fixing this is not a high priority for me. As such, it may take a while.