RTimothyEdwards / capiche

Parasitic capacitance analysis of foundry metal stackups
GNU General Public License v2.0
10 stars 2 forks source link

Valueerror with GF180MCU #2

Open laurentc2 opened 1 year ago

laurentc2 commented 1 year ago

Using GF180MCU, I got hat error : Running Magic on input file poly_subs_w_0p18.tcl Running magic -dnull -noconsole -rcfile /usr/local/share/pdk/gf180mcuD/libs.tech/magic/gf180mcuD.magicrc poly_subs_w_0p18.tcl Traceback (most recent call last): File "./compute_coefficients.py", line 1383, in validate_fringe(process, stackupfile, startupfile, metals, substrates, limits, verbose) File "./compute_coefficients.py", line 563, in validate_fringe build_mag_files_w1(stackupfile, startupfile, File "/home/laurent/capiche/build_mag_files_w1.py", line 243, in build_mag_files_w1 csub = 1e-9 * float(tokens[3].replace('f', '').replace('F', '')) / 1000 ValueError: could not convert string to float: '0.121p'

RTimothyEdwards commented 1 year ago

Looks like I did not expect csub to be outside the range of femtoFarads. The replace('f', '') line will need to be changed to something that is a bit better at converting the metric prefixes to floating-point units.

RTimothyEdwards commented 1 year ago

Actually what caused this is that magic used to put all values in femtoFarads but now it chooses the metric prefix, so assuming that the netlist output from magic is always going to use f for capacitance units is no longer valid. I can fix that.

RTimothyEdwards commented 1 year ago

For the record, @laurentc2 provided a patch by email and I have applied it to the repository. This is not necessarily the last word on the subject, since a "correct" solution requires a routine that converts all SPICE metric prefixes that magic might produce in its output. However, pF and fF are probably the only value scales that will show up in the geometries being run through capiche. The patch has been applied, committed, and pushed.