From c6287c8d955c896bb707be7b98f46a6c460d1a45 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 27 May 2020 16:11:53 +0200 Subject: [PATCH] Correct Cell object detection while reading Oceane parameters. * Bug: In karakaze/AnalogDesign.readParameters(), when asserting the type of dspec[0], it can either be a type (for analog devices) or a Cell object (*not* a type). So the issubclass may fails. Now check first if dspec[0] is an *instance* of Cell. This is an anisotropy in the type of the first element of the devicesSpecs table, but suppress one superfluous parameter. --- karakaze/python/analogdesign.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/karakaze/python/analogdesign.py b/karakaze/python/analogdesign.py index aeba3eaa..19669aef 100644 --- a/karakaze/python/analogdesign.py +++ b/karakaze/python/analogdesign.py @@ -357,7 +357,9 @@ class AnalogDesign ( object ): self.parameters.read( path ); for dspec in self.devicesSpecs: - if issubclass(dspec[0],TransistorFamily): + if isinstance(dspec[0],Cell): + pass + elif issubclass(dspec[0],TransistorFamily): Tname = dspec[1].split('_')[0] Tparameters = self.parameters.getTransistor( Tname ) if not Tparameters: @@ -380,8 +382,6 @@ class AnalogDesign ( object ): trace( 110, '\t- \"%s\" : C:%fpF\n' % (Cname ,dspec[4]) ) elif issubclass(dspec[0],ResistorFamily): print WarningMessage( 'Resistor devices are not supported yet by Oceane parser (instance:"{}").'.format(dspec[1]) ) - elif dspec[0] == Cell: - pass else: print WarningMessage( 'Unsupported analog device type {0} (instance:"{1}").'.format(dspec[0],dspec[1]) ) trace( 110, '-,' )