From 441cb714750d630f3b8511ce747975c6d0a03eaa Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 30 Jun 2020 10:00:29 +0200 Subject: [PATCH 1/6] * New: In Anabatic::NetBuilder, to tackle once and for all the GCell configurations for Libre-SOC manage up to 9 METAL1 terminals in 1G to 4G configurations. --- anabatic/src/NetBuilder.cpp | 14 ++++++++++++-- anabatic/src/anabatic/NetBuilder.h | 10 ++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/anabatic/src/NetBuilder.cpp b/anabatic/src/NetBuilder.cpp index 5a02f52e..a7a4144f 100644 --- a/anabatic/src/NetBuilder.cpp +++ b/anabatic/src/NetBuilder.cpp @@ -583,7 +583,9 @@ namespace Anabatic { case Conn_1G_4M1: case Conn_1G_5M1: case Conn_1G_6M1: - case Conn_1G_7M1: _do_1G_xM1(); break; + case Conn_1G_7M1: + case Conn_1G_8M1: + case Conn_1G_9M1: _do_1G_xM1(); break; // End 1G_xM1 cascaded cases. case Conn_1G_1M2: @@ -604,12 +606,18 @@ namespace Anabatic { case Conn_2G_4M1: case Conn_2G_5M1: case Conn_2G_6M1: + case Conn_2G_7M1: + case Conn_2G_8M1: + case Conn_2G_9M1: case Conn_3G_1M1: if (_do_xG_1M1()) break; case Conn_3G_2M1: case Conn_3G_3M1: case Conn_3G_4M1: case Conn_3G_5M1: case Conn_3G_6M1: + case Conn_3G_7M1: + case Conn_3G_8M1: + case Conn_3G_9M1: case Conn_3G_2M3: case Conn_3G_3M3: case Conn_3G_4M3: @@ -619,7 +627,9 @@ namespace Anabatic { case Conn_4G_4M1: case Conn_4G_5M1: case Conn_4G_6M1: - case Conn_4G_7M1: _do_xG_xM1_xM3(); break; + case Conn_4G_7M1: + case Conn_4G_8M1: + case Conn_4G_9M1: _do_xG_xM1_xM3(); break; // End xG_xM1_xM3 cascaded cases. case Conn_4G_1M2: if (_do_4G_1M2()) break; diff --git a/anabatic/src/anabatic/NetBuilder.h b/anabatic/src/anabatic/NetBuilder.h index e1797a6c..2acbb7c9 100644 --- a/anabatic/src/anabatic/NetBuilder.h +++ b/anabatic/src/anabatic/NetBuilder.h @@ -262,6 +262,8 @@ namespace Anabatic { , Conn_1G_5M1 = CONNEXITY_VALUE( 1, 5, 0, 0, 0 , 0 ) , Conn_1G_6M1 = CONNEXITY_VALUE( 1, 6, 0, 0, 0 , 0 ) , Conn_1G_7M1 = CONNEXITY_VALUE( 1, 7, 0, 0, 0 , 0 ) + , Conn_1G_8M1 = CONNEXITY_VALUE( 1, 8, 0, 0, 0 , 0 ) + , Conn_1G_9M1 = CONNEXITY_VALUE( 1, 9, 0, 0, 0 , 0 ) , Conn_1G_1M2 = CONNEXITY_VALUE( 1, 0, 1, 0, 0 , 0 ) , Conn_1G_2M2 = CONNEXITY_VALUE( 1, 0, 2, 0, 0 , 0 ) , Conn_1G_3M2 = CONNEXITY_VALUE( 1, 0, 3, 0, 0 , 0 ) @@ -279,6 +281,9 @@ namespace Anabatic { , Conn_2G_4M1 = CONNEXITY_VALUE( 2, 4, 0, 0, 0 , 0 ) , Conn_2G_5M1 = CONNEXITY_VALUE( 2, 5, 0, 0, 0 , 0 ) , Conn_2G_6M1 = CONNEXITY_VALUE( 2, 6, 0, 0, 0 , 0 ) + , Conn_2G_7M1 = CONNEXITY_VALUE( 2, 7, 0, 0, 0 , 0 ) + , Conn_2G_8M1 = CONNEXITY_VALUE( 2, 8, 0, 0, 0 , 0 ) + , Conn_2G_9M1 = CONNEXITY_VALUE( 2, 9, 0, 0, 0 , 0 ) , Conn_2G_1M2 = CONNEXITY_VALUE( 2, 0, 1, 0, 0 , 0 ) , Conn_2G_2M2 = CONNEXITY_VALUE( 2, 0, 2, 0, 0 , 0 ) , Conn_2G_3M2 = CONNEXITY_VALUE( 2, 0, 3, 0, 0 , 0 ) @@ -295,6 +300,9 @@ namespace Anabatic { , Conn_3G_4M1 = CONNEXITY_VALUE( 3, 4, 0, 0, 0 , 0 ) , Conn_3G_5M1 = CONNEXITY_VALUE( 3, 5, 0, 0, 0 , 0 ) , Conn_3G_6M1 = CONNEXITY_VALUE( 3, 6, 0, 0, 0 , 0 ) + , Conn_3G_7M1 = CONNEXITY_VALUE( 3, 7, 0, 0, 0 , 0 ) + , Conn_3G_8M1 = CONNEXITY_VALUE( 3, 8, 0, 0, 0 , 0 ) + , Conn_3G_9M1 = CONNEXITY_VALUE( 3, 9, 0, 0, 0 , 0 ) , Conn_3G_1M2 = CONNEXITY_VALUE( 3, 0, 1, 0, 0 , 0 ) , Conn_3G_2M2 = CONNEXITY_VALUE( 3, 0, 2, 0, 0 , 0 ) , Conn_3G_1M3 = CONNEXITY_VALUE( 3, 0, 0, 1, 0 , 0 ) @@ -309,6 +317,8 @@ namespace Anabatic { , Conn_4G_5M1 = CONNEXITY_VALUE( 4, 5, 0, 0, 0 , 0 ) , Conn_4G_6M1 = CONNEXITY_VALUE( 4, 6, 0, 0, 0 , 0 ) , Conn_4G_7M1 = CONNEXITY_VALUE( 4, 7, 0, 0, 0 , 0 ) + , Conn_4G_8M1 = CONNEXITY_VALUE( 4, 8, 0, 0, 0 , 0 ) + , Conn_4G_9M1 = CONNEXITY_VALUE( 4, 9, 0, 0, 0 , 0 ) , Conn_4G_1M2 = CONNEXITY_VALUE( 4, 0, 1, 0, 0 , 0 ) , Conn_4G_1M3 = CONNEXITY_VALUE( 4, 0, 0, 1, 0 , 0 ) , Conn_1G_1Pad = CONNEXITY_VALUE( 1, 0, 0, 0, 1 , 0 ) From 010fc79f4f6fe19e0cd78cbaa824af74e27ea0a2 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 30 Jun 2020 14:54:42 +0200 Subject: [PATCH 2/6] Added rule minWidth_nWell to oroshi rule loader. --- oroshi/python/dtr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oroshi/python/dtr.py b/oroshi/python/dtr.py index 4296b15a..1e127cc7 100644 --- a/oroshi/python/dtr.py +++ b/oroshi/python/dtr.py @@ -5,7 +5,8 @@ from helpers import trace class Rules ( object ): - ruleSet = [ 'minSpacing_nWell' + ruleSet = [ 'minWidth_nWell' + , 'minSpacing_nWell' , 'minWidth_pImplant' , 'minSpacing_pImplant' , 'minSpacing_rpolyh_pImplant' From e4041d5e26d2927b181dda6031baefbdd27b4cd0 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 14 Jul 2020 19:49:54 +0200 Subject: [PATCH 3/6] Improved Hurricane/Python database reset. * Change: In CRL/helpers/__init__.py, to ensure a complete restart of the database the __init__.py must be called again, but it's not the case with reload() (see Python doc). So helpers.resetCoriolis() must explicitly removes the Coriolis related Python modules from sys.modules (calling "del sys.modules[moduleName]"). That list of Coriolis Python modules is built by calling helpers.tagConfModules(), it will tag all modules added to sys.modules since startup. It will remove (much) more than Coriolis modules, but that should be ok. * Change: In CRL/etc/{node*,symbolic}/TECH/__init__.py, add a call to helpers.tagConfModules() for the techno modules to be erased on reset. --- crlcore/etc/node180/scn6m_deep_09/__init__.py | 2 + crlcore/etc/node45/freepdk45/__init__.py | 2 + crlcore/etc/node600/phenitec/__init__.py | 2 + crlcore/etc/symbolic/cmos/__init__.py | 3 ++ crlcore/etc/symbolic/cmos/plugins.py | 1 + crlcore/etc/symbolic/cmos45/__init__.py | 2 + crlcore/python/helpers/__init__.py | 45 ++++++++++++------- 7 files changed, 40 insertions(+), 17 deletions(-) diff --git a/crlcore/etc/node180/scn6m_deep_09/__init__.py b/crlcore/etc/node180/scn6m_deep_09/__init__.py index 3e87f4a0..8f89f0ad 100644 --- a/crlcore/etc/node180/scn6m_deep_09/__init__.py +++ b/crlcore/etc/node180/scn6m_deep_09/__init__.py @@ -39,3 +39,5 @@ import node180.scn6m_deep_09.devices import node180.scn6m_deep_09.dtr_scn6m_deep_09 Cfg.Configuration.popDefaultPriority() + +helpers.tagConfModules() diff --git a/crlcore/etc/node45/freepdk45/__init__.py b/crlcore/etc/node45/freepdk45/__init__.py index c245b98c..d02344fa 100644 --- a/crlcore/etc/node45/freepdk45/__init__.py +++ b/crlcore/etc/node45/freepdk45/__init__.py @@ -38,3 +38,5 @@ import node45.freepdk45.stratus1 import node45.freepdk45.devices Cfg.Configuration.popDefaultPriority() + +helpers.tagConfModules() diff --git a/crlcore/etc/node600/phenitec/__init__.py b/crlcore/etc/node600/phenitec/__init__.py index 5ba0b2db..de569860 100644 --- a/crlcore/etc/node600/phenitec/__init__.py +++ b/crlcore/etc/node600/phenitec/__init__.py @@ -38,3 +38,5 @@ import node600.phenitec.stratus1 import node600.phenitec.devices Cfg.Configuration.popDefaultPriority() + +helpers.tagConfModules() diff --git a/crlcore/etc/symbolic/cmos/__init__.py b/crlcore/etc/symbolic/cmos/__init__.py index 0a07e2a8..4cb5139a 100644 --- a/crlcore/etc/symbolic/cmos/__init__.py +++ b/crlcore/etc/symbolic/cmos/__init__.py @@ -14,6 +14,7 @@ import Cfg +import helpers import helpers.io helpers.io.vprint( 1, ' o Loading "symbolic.cmos" technology.' ) helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) @@ -37,3 +38,5 @@ import symbolic.cmos.plugins import symbolic.cmos.stratus1 Cfg.Configuration.popDefaultPriority() + +helpers.tagConfModules() diff --git a/crlcore/etc/symbolic/cmos/plugins.py b/crlcore/etc/symbolic/cmos/plugins.py index 7dc461b9..c0c8b359 100644 --- a/crlcore/etc/symbolic/cmos/plugins.py +++ b/crlcore/etc/symbolic/cmos/plugins.py @@ -27,3 +27,4 @@ Cfg.getParamInt ( "chip.block.rails.vSpacing" ).setInt ( l( 6) ) Cfg.getParamInt ( 'clockTree.minimumSide' ).setInt ( l(600) ) Cfg.getParamString( 'clockTree.buffer' ).setString( 'buf_x2') Cfg.getParamString( 'clockTree.placerEngine' ).setString( 'Etesian') +Cfg.getParamInt ( 'block.spareSide' ).setInt ( 10 ) diff --git a/crlcore/etc/symbolic/cmos45/__init__.py b/crlcore/etc/symbolic/cmos45/__init__.py index 111afeec..7d038c3d 100644 --- a/crlcore/etc/symbolic/cmos45/__init__.py +++ b/crlcore/etc/symbolic/cmos45/__init__.py @@ -37,3 +37,5 @@ import symbolic.cmos45.plugins import symbolic.cmos45.stratus1 Cfg.Configuration.popDefaultPriority() + +helpers.tagConfModules() diff --git a/crlcore/python/helpers/__init__.py b/crlcore/python/helpers/__init__.py index 2f74af65..cdddc6b3 100644 --- a/crlcore/python/helpers/__init__.py +++ b/crlcore/python/helpers/__init__.py @@ -10,23 +10,20 @@ # | Author : Jean-Paul Chaput | # | E-mail : Jean-Paul.Chaput@lip6.fr | # | =============================================================== | -# | Python : "./crlcore/__init__.py" | +# | Python : "./crlcore/helpers/__init__.py" | # +-----------------------------------------------------------------+ # # This is file is mandatory to tell python that 'helpers' is a module # rather than an ordinary directory, thus enabling the uses of the # 'dot' notation in import. +#print 'helpers.__init__()' import sys import os import os.path import re import traceback -import Hurricane -import Viewer -import CRL -import helpers.io quiet = False sysConfDir = None @@ -35,7 +32,17 @@ ndaDir = None techno = 'symbolic/cmos' technoDir = None moduleGlobals = globals() -confModules = [ ] +sysModules = set() +confModules = set() + +if not sysModules: + for moduleName in sys.modules.keys(): + sysModules.add( moduleName ) + +import Hurricane +import Viewer +import CRL +import helpers.io def stype ( o ): return str(type(o)).split("'")[1] @@ -348,10 +355,10 @@ def setSysConfDir ( quiet=False ): if sysConfDir != None: #if not quiet: print ' o helpers.staticInitialization() Already run, exit.' return - + reSysConfDir = re.compile(r'.*etc\/coriolis2') if not quiet: print ' o Locating configuration directory:' - + for path in sys.path: if reSysConfDir.match(path): sysConfDir = path @@ -397,9 +404,10 @@ setSysConfDir( False ) def unloadUserSettings (): + global confModules + print ' o Unloading Python user\'s modules.' - global confModules for moduleName in confModules: refcount = sys.getrefcount( sys.modules[moduleName] ) warning = '' @@ -411,16 +419,12 @@ def unloadUserSettings (): # ] ) print ' - %-34s %-35s' % ('"%s".'%moduleName, warning) del sys.modules[ moduleName ] - confModules = [] + confModules = set() return def loadUserSettings (): - global confModules - rvalue = False - beforeModules = set() - for moduleName in sys.modules.keys(): beforeModules.add( moduleName ) if os.path.isfile('./coriolis2/settings.py'): if os.path.isfile('./coriolis2/__init__.py'): @@ -434,17 +438,24 @@ def loadUserSettings (): else: import symbolic.cmos + tagConfModules() + + return rvalue + + +def tagConfModules (): + global sysModules + global confModules + confModules = set() for moduleName in sys.modules.keys(): - if not (moduleName in beforeModules): + if not (moduleName in sysModules): confModules.add( moduleName ) #print 'Configuration modules:' #for moduleName in confModules: # print '-', moduleName - return rvalue - def resetCoriolis (): print ' o Full reset of Coriolis/Hurricane databases.' From 8ce2a7e318484379f99f619c2a80666309719ccd Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 14 Jul 2020 19:51:01 +0200 Subject: [PATCH 4/6] In Etesian, do not reset the placement if we are using a sub-block. * Bug: In EtesianEngine::place(), reset the placement *only* if we are *not* placing a sub-block *and* the top cell abutment box is empty. * Bug: In EtesianEngine::place(), set the instance placement status of all intermediate instances to PLACED, so the AP driver will save them (we were having partially saved layout when using hierarchical designs). * Bug: In EtesianEngine::resetPlacement(), reset the PLACED flag and the abutment box on the top cell or sub-block to be placed. --- etesian/src/EtesianEngine.cpp | 18 ++++++++++++------ katana/src/KatanaEngine.cpp | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 48d8867c..0950c3a3 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -519,8 +519,8 @@ namespace Etesian { // if (not getBlockCell()->getAbutmentBox().isEmpty() ) // setFixedAbHeight( getBlockCell()->getAbutmentBox().getHeight() ); - // getBlockCell()->setAbutmentBox( Box() ); - // getBlockCell()->resetFlags( Cell::Flags::Placed ); + getBlockCell()->setAbutmentBox( Box() ); + getBlockCell()->resetFlags( Cell::Flags::Placed ); UpdateSession::close(); dots.finish( Dots::Reset ); @@ -1002,8 +1002,10 @@ namespace Etesian { getConfiguration()->print( getCell() ); adjustSliceHeight(); - resetPlacement(); - if (getBlockCell()->getAbutmentBox().isEmpty()) setDefaultAb(); + if ( (getCell() == getBlockCell()) and getCell()->getAbutmentBox().isEmpty() ) { + resetPlacement(); + setDefaultAb(); + } findYSpin(); toColoquinte(); @@ -1020,7 +1022,6 @@ namespace Etesian { preplace(); - float_t minPenaltyIncrease, maxPenaltyIncrease, targetImprovement; int detailedIterations, detailedEffort; unsigned globalOptions=0, detailedOptions=0; @@ -1085,9 +1086,14 @@ namespace Etesian { rp->invalidate(); } } - UpdateSession::close(); getCell()->setFlags( Cell::Flags::Placed ); + for ( Occurrence occurrence : getCell()->getNonTerminalNetlistInstanceOccurrences(getBlockInstance()) ) { + Instance* instance = static_cast(occurrence.getEntity()); + if (instance->getPlacementStatus() == Instance::PlacementStatus::UNPLACED) + instance->setPlacementStatus( Instance::PlacementStatus::PLACED ); + } + UpdateSession::close(); } diff --git a/katana/src/KatanaEngine.cpp b/katana/src/KatanaEngine.cpp index 7eb94921..012edc3a 100644 --- a/katana/src/KatanaEngine.cpp +++ b/katana/src/KatanaEngine.cpp @@ -419,6 +419,7 @@ namespace Katana { return NULL; } + void KatanaEngine::openSession () { Session::_open(this); } From 960e0cda1890bbe974b07013cc64307921f5d8f7 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 14 Jul 2020 19:53:34 +0200 Subject: [PATCH 5/6] In CRL::NamingScheme::vlogTovhdl(), remove '%' invalid VHDL character. --- crlcore/src/ccore/alliance/vst/VhdlPortMap.cpp | 13 ++++++++++--- crlcore/src/ccore/toolbox/NamingScheme.cpp | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/crlcore/src/ccore/alliance/vst/VhdlPortMap.cpp b/crlcore/src/ccore/alliance/vst/VhdlPortMap.cpp index 13a5d54d..306a52f2 100644 --- a/crlcore/src/ccore/alliance/vst/VhdlPortMap.cpp +++ b/crlcore/src/ccore/alliance/vst/VhdlPortMap.cpp @@ -52,8 +52,10 @@ namespace Vhdl { const Signal* signal = entity->getGlobal( getString(masterNet->getName()) ); if (signal) return signal->getBit(); - cerr << Error( "PortMap::_lookup() VHDL extension missing on parent of global <%s>." + cerr << Error( "PortMap::_lookup() VHDL extension missing on parent of global \"%s\"\n" + " In parent cell \"%s\"." , getString(masterNet).c_str() + , getString(instance->getCell()->getName()).c_str() ) << endl; } else { Net* net = plug->getNet(); @@ -61,12 +63,17 @@ namespace Vhdl { Bit* bit = BitExtension::get( net ); if (bit) return bit; - cerr << Error( "PortMap::_lookup() VHDL extension missing on <%s>." + cerr << Error( "PortMap::_lookup() VHDL extension missing on \"%s\"." + " In cell \"%s\"." , getString(net).c_str() + , getString(net->getCell()->getName()).c_str() ) << endl; } else { - cerr << Error( "PortMap::_lookup() Unconnected <%s>." + cerr << Error( "PortMap::_lookup() Unconnected \"%s\",\n" + " In instance \"%s\" of \"%s\"." , getString(plug).c_str() + , getString(instance->getName()).c_str() + , getString(instance->getMasterCell()->getName()).c_str() ) << endl; } } diff --git a/crlcore/src/ccore/toolbox/NamingScheme.cpp b/crlcore/src/ccore/toolbox/NamingScheme.cpp index e14c317e..3670e400 100644 --- a/crlcore/src/ccore/toolbox/NamingScheme.cpp +++ b/crlcore/src/ccore/toolbox/NamingScheme.cpp @@ -73,6 +73,7 @@ namespace CRL { if (translated == '\\') translated = '_'; if (translated == '.' ) translated = '_'; + if (translated == '%' ) translated = '_'; if (translated == '$' ) translated = '_'; if (translated == '?' ) translated = '_'; if (translated == ':' ) translated = '_'; From 34c1795630e9c414bbdbe4629cdcc97441412fcd Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 14 Jul 2020 19:55:20 +0200 Subject: [PATCH 6/6] Support for long in CRL/overlay.Configuration.__setattr__(). --- crlcore/python/helpers/overlay.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crlcore/python/helpers/overlay.py b/crlcore/python/helpers/overlay.py index b59a3877..3ba25cf6 100644 --- a/crlcore/python/helpers/overlay.py +++ b/crlcore/python/helpers/overlay.py @@ -62,6 +62,8 @@ class Configuration: Cfg.getParamEnumerate(attr).setInt( val ) else: Cfg.getParamInt(attr).setInt( val ) + elif isinstance(val, long): + p = Cfg.getParamInt( attr ) # all params have a type elif isinstance(val, float): p = Cfg.getParamDouble( attr ).setDouble( val ) elif '%' in val: