Compare commits

...

7 Commits

Author SHA1 Message Date
Jean-Paul Chaput 9b8ea64545 Add VHDL "ref" keyword to CRL::NamingScheme. Cleanup BlifParser debug. 2021-06-04 11:28:12 +02:00
Jean-Paul Chaput 1d7a415e9f Fix memory corruption after placement occurring on LibreSOC/ls180.
* Bug: In Cumulus/plugins.block.Block, re-order Etesian tool creation
    and virtual net flattening. Must investigate later why it is so
    sensitive to at least warn/stop cleanly.
2021-06-03 01:20:24 +02:00
Jean-Paul Chaput d2a621629a Build blockages for all fixed nets in Katana.
* Bug: In Katana::GlobalNetTable::getRootNet(), look for all fixed nets,
    not only supplies and clocks. There may be some as now H-Trees are
    not limited to clocks.
      Should solve ao68000 short circuit cases.
2021-06-02 14:53:45 +02:00
Jean-Paul Chaput d2e1ab3796 Add rgetInstanceMatching to utilities, as reminder and for later use. 2021-06-02 14:16:45 +02:00
Jean-Paul Chaput 1afc48fb4c Forgot to update pointers to merged nets in BlifParser. 2021-06-02 14:14:32 +02:00
Jean-Paul Chaput db26e14358 Add -fsanitize=address to the DEBUG flags. 2021-06-02 14:14:11 +02:00
Jean-Paul Chaput fed586385c Do not connect HTree to I/O pad if the net is internal.
* Bug: In Cumulus/plugins.chip.powerplane.Builder._connectHTree(), is was
    previously assumed that a net manged by a H-Tree was always coming from
    the outside (i.e. a clock or a reset signal).
      It is no longer the case, for example with the PLL internally generated
    clock.
      So prune internal signals in this method.
2021-06-02 14:13:53 +02:00
7 changed files with 72 additions and 51 deletions

View File

@ -94,12 +94,14 @@
set(ADDTIONAL_FLAGS "")
set(CXX_STANDARD "c++11")
endif()
#set(CMAKE_C_FLAGS_DEBUG " -Wall -fsanitize=address ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE)
set(CMAKE_C_FLAGS_DEBUG " -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE)
set(CMAKE_C_FLAGS_DEBUG " -Wall -fsanitize=address ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE)
#set(CMAKE_C_FLAGS_DEBUG " -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE)
set(CMAKE_C_FLAGS_RELEASE " -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C Compiler Release options." FORCE)
#set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall -fsanitize=address ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C++ Compiler Debug options." FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C++ Compiler Debug options." FORCE)
#set(CMAKE_C_FLAGS_RELEASE " -Wall -fsanitize=address ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C Compiler Release options." FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall -fsanitize=address ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C++ Compiler Debug options." FORCE)
#set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C++ Compiler Debug options." FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-std=${CXX_STANDARD} -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C++ Compiler Release options." FORCE)
#set(CMAKE_CXX_FLAGS_RELEASE "-std=${CXX_STANDARD} -Wall -fsanitize=address ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C++ Compiler Release options." FORCE)
#

View File

@ -726,11 +726,15 @@ namespace {
else if (not net) { // Net doesn't exist yet
plugNet->addAlias( netName );
}
else if (plugNet != net){ // Plus already connected to another net
else if (plugNet != net){ // Plug already connected to another net
if (not plugNet->isExternal()) {
net->merge( plugNet );
plugNet = net;
}
else {
plugNet->merge( net );
net = plugNet;
}
else plugNet->merge( net );
}
// if (subckt->getModel()->getCell()->getName() == "sm0") {

View File

@ -61,6 +61,7 @@ namespace CRL {
// VHDL reserved keywords (scalar).
if (loweredName == "in" ) return "in_v";
if (loweredName == "out" ) return "out_v";
if (loweredName == "ref" ) return "ref_v";
if (loweredName == "inout") return "inout_v";
if (loweredName == "true" ) return "bool_true";
if (loweredName == "false") return "bool_false";

View File

@ -312,6 +312,7 @@ class Block ( object ):
, IoPin.SOUTH : Side( self.conf, IoPin.SOUTH )
, IoPin.NORTH : Side( self.conf, IoPin.NORTH )
}
self.etesian = None
if not self.conf.cell.getAbutmentBox().isEmpty():
isBuilt = True
for instance in self.conf.cell.getInstances():
@ -467,7 +468,7 @@ class Block ( object ):
def flattenNets ( self ):
if self.flags & Block.FLATTENED: return
if self.conf.isCoreBlock:
self.conf.corona.flattenNets( self.conf.icore, self.conf.hTreeNames, Cell.Flags_NoClockFlatten )
self.conf.corona.flattenNets( None, self.excludedNets, Cell.Flags_NoClockFlatten )
else:
self.conf.cell.flattenNets( None, self.excludedNets, Cell.Flags_NoClockFlatten )
self.flags |= Block.FLATTENED
@ -633,6 +634,8 @@ class Block ( object ):
def initEtesian ( self ):
editor = self.conf.editor
if self.etesian:
return
if self.conf.isCoreBlock:
self.etesian = Etesian.EtesianEngine.create( self.conf.corona )
self.etesian.setBlock( self.conf.icore )
@ -641,9 +644,10 @@ class Block ( object ):
Breakpoint.stop( 100, 'Block.place(), corona loaded.')
else:
self.etesian = Etesian.EtesianEngine.create( self.conf.cell )
self.etesian.getCell().flattenNets( None, self.excludedNets, Cell.Flags_NoClockFlatten )
self.flattenNets()
def place ( self ):
self.initEtesian()
if self.conf.placeArea:
self.etesian.setPlaceArea( self.conf.placeArea )
if self.conf.useHFNS: self.etesian.doHFNS()
@ -793,7 +797,6 @@ class Block ( object ):
blockInstance.block.build()
if editor: editor.setCell( self.conf.cellPnR )
self.conf.cfg.apply()
self.initEtesian()
iteration = -1
while True:
iteration += 1
@ -803,9 +806,10 @@ class Block ( object ):
self.placeIoPins()
self.checkIoPins()
self.spares.build()
#if self.conf.useHFNS: self.findHfnTrees4()
#if self.conf.useHFNS: self.findHfnTrees4()
self.initEtesian()
self.addHTrees()
#if self.conf.useHFNS: self.addHfnBuffers()
#if self.conf.useHFNS: self.addHfnBuffers()
if editor: editor.fit()
#Breakpoint.stop( 0, 'Clock tree(s) done.' )
self.place()

View File

@ -478,6 +478,7 @@ class Builder ( object ):
message += [ '\n - {} {}'.format(plug,plug.getInstance()) ]
raise ErrorMessage( 1, message )
return
if not coronaNet.isExternal(): return
coronaPin = None
for pin in coronaNet.getPins():
coronaPin = pin

View File

@ -18,6 +18,7 @@ from Hurricane import Breakpoint
from Hurricane import Box
from Hurricane import Vertical
from Hurricane import RoutingPad
from helpers import trace
def breakpoint ( editor, level, message ):
@ -96,3 +97,45 @@ def hpathToName ( path ):
if len(s): s += '_'
s += head.getName()
return s
def getInstanceMatching ( cell, pattern, level=0 ):
"""
getInstanceMatching(): returns first instance with the word being searched.
"""
for instance in cell.getInstances():
name = instance.getName()
if pattern in name:
trace( 550, '\t{} {} match pattern "{}"\n'.format(' '*level,instance,pattern) )
return instance
return None
def rgetInstanceMatching ( cell, path, level=0 ):
"""
Get the instance designated by path (recursively). The path argument can be
either a string of instance names separated by dots or directly a list of
instances names.
It also "reconstructs" the actual full path name of the instances
found recursively.
"""
if isinstance(path,str):
path = path.split( '.' )
elif not isinstance(path, list):
raise ErrorMessage( 1, 'rgetInstanceMatching(): "path" argument is ' \
'neither a string or a list ({})."' \
.format(path) )
# Find instance at this level.
instance = getInstanceMatching( cell, path[0], level )
if instance is None:
raise ErrorMessage( 1, 'rgetInstanceMatching(): No instance "{}" in cell "{}".' \
.format(path[0], cell.getName()) )
iname = instance.getName()
# Last instance (leaf search), return it.
if len(path) == 1:
return instance, iname
# Chew down another level, another brick in the wall
rinstance, rname = rgetInstanceLike( instance.getMasterCell(), path[1:], level+1 )
# Accumulate the names recursively found "level0.level1.level2..."
return rinstance, '{}.{}'.format( iname, rname )

View File

@ -116,8 +116,6 @@ namespace {
inline Net* getCk () const;
inline Net* getBlockage () const;
inline void setBlockage ( Net* );
private:
bool guessGlobalNet ( const Name&, Net* );
private:
uint32_t _flags;
Name _vddCoreName;
@ -217,37 +215,6 @@ namespace {
}
bool GlobalNetTable::guessGlobalNet ( const Name& name, Net* net )
{
if (name == _vddCoreName) {
cmess1 << " - Using <" << net->getName() << "> as core (internal:vdd) power net." << endl;
_vdd = net;
return true;
}
if (name == _vssCoreName) {
cmess1 << " - Using <" << net->getName() << "> as core (internal:vss) ground net." << endl;
_vss = net;
return true;
}
if (name == _ckCoreName) {
cmess1 << " - Using <" << net->getName() << "> as core (internal:ck) clock net." << endl;
_ck = net;
if (NetRoutingExtension::isMixedPreRoute(_ck)) {
cmess1 << " (core clock net is already routed)" << endl;
_flags |= ClockIsRouted;
} else {
cmess1 << " (core clock net will be routed as an ordinary signal)" << endl;
}
return true;
}
return false;
}
Net* GlobalNetTable::getRootNet ( const Net* net, Path path ) const
{
cdebug_log(159,0) << " getRootNet:" << path << ":" << net << endl;
@ -255,21 +222,20 @@ namespace {
if (net == _blockage) return _blockage;
if (net->getType() == Net::Type::POWER ) return _vdd;
if (net->getType() == Net::Type::GROUND) return _vss;
if (net->getType() != Net::Type::CLOCK ) return NULL;
// Track up, *only* for clocks.
const Net* upNet = net;
if (not path.isEmpty()) {
cdebug_log(159,0) << " Path is *not* empty:" << path << endl;
DeepNet* deepClockNet = getTopCell()->getDeepNet( path, net );
if (deepClockNet) {
cdebug_log(159,0) << " Deep Clock Net:" << deepClockNet
<< " state:" << NetRoutingExtension::getFlags(deepClockNet) << endl;
DeepNet* deepNet = getTopCell()->getDeepNet( path, net );
if (deepNet) {
cdebug_log(159,0) << " Deep Clock Net:" << deepNet
<< " state:" << NetRoutingExtension::getFlags(deepNet) << endl;
return NetRoutingExtension::isFixed(deepClockNet) ? _blockage : NULL;
return NetRoutingExtension::isFixed(deepNet) ? _blockage : NULL;
} else {
cdebug_log(159,0) << " Top Clock Net:" << net
cdebug_log(159,0) << " Top DeepNet:" << net
<< " state:" << NetRoutingExtension::getFlags(net) << endl;
}