* All Tools:

- New: Added FreeBSD/Ubuntu patches from Otacilio De Araujo
       (<otaciliodearaujo@gmail.com>).

  * ./cumulus:
    - Change: In placeandroute.py, raise ErrorMessages (from crlcore) instead
        of deprecated strings.
    - Change: In pyRouteCk, the clock grid now systematically covers the core
        area instead of only the area where clock signals are useds. This is
        to alleviate the constraint of alignement on the pvsseck pads (they
        must be in direct regard of the clock grid).
This commit is contained in:
Jean-Paul Chaput 2012-12-03 08:30:49 +00:00
parent 1d20cf1beb
commit c72726a0c2
1 changed files with 128 additions and 119 deletions

View File

@ -2,8 +2,9 @@
import os import os
import re import re
import CRL
from Hurricane import * from Hurricane import *
from helpers import ErrorMessage
import CRL
import Mauka import Mauka
#import Knik #import Knik
@ -20,6 +21,7 @@ import Mauka
from math import * from math import *
missingCORIOLIS_TOP = "Missing environment variable CORIOLIS_TOP" missingCORIOLIS_TOP = "Missing environment variable CORIOLIS_TOP"
global POWER, OCCUPIED, FREE global POWER, OCCUPIED, FREE
@ -58,6 +60,18 @@ nb_vss_pins = 0
global ck_contact_list_to_create global ck_contact_list_to_create
ck_contact_list_to_create = [] ck_contact_list_to_create = []
def getNetFromPlug ( plug ):
net = plug.getNet()
if net: return net
masterNet = plug.getMasterNet()
if masterNet.getName() in [ 'vddi', 'vssi', 'vdde', 'vsse' ]:
cell = plug.getCell()
net = cell.getNet(masterNet.getName())
return net
################## ##################
## PlaceCentric ## ## PlaceCentric ##
################## ##################
@ -67,13 +81,13 @@ def pyPlaceCentric ( cell, instance ) :
UpdateSession.open() UpdateSession.open()
if not instance : if not instance :
raise "\n[Coriolis ERROR] PlaceCentric: the instance does not exist.\n" raise ErrorMessage(2,"PlaceCentric: the instance does not exist.")
w = cell.getAbutmentBox().getWidth() w = cell.getAbutmentBox().getWidth()
h = cell.getAbutmentBox().getHeight() h = cell.getAbutmentBox().getHeight()
if ( w < instance.getAbutmentBox().getWidth() ) or ( h < instance.getAbutmentBox().getHeight() ) : if ( w < instance.getAbutmentBox().getWidth() ) or ( h < instance.getAbutmentBox().getHeight() ) :
raise "\n[Coriolis ERROR] PlaceCentric : the instance's size is greater than this model.\n" raise ErrorMessage(2,"PlaceCentric : the instance's size is greater than this model.")
XCenter = cell.getAbutmentBox().getXCenter() XCenter = cell.getAbutmentBox().getXCenter()
YCenter = cell.getAbutmentBox().getYCenter() YCenter = cell.getAbutmentBox().getYCenter()
@ -118,10 +132,10 @@ def pyRouteCk ( cell, netCk ) :
UpdateSession.open() UpdateSession.open()
# Error if Pads have not already been placed # Error if Pads have not already been placed
if pad_north == [] : raise "\n[Coriolis ERROR] RouteCk : Pads in the north haven't been placed.\n" if pad_north == [] : raise ErrorMessage(2,"RouteCk : Pads in the north haven't been placed.")
if pad_south == [] : raise "\n[Coriolis ERROR] RouteCk : Pads in the south haven't been placed.\n" if pad_south == [] : raise ErrorMessage(2,"RouteCk : Pads in the south haven't been placed.")
if pad_east == [] : raise "\n[Coriolis ERROR] RouteCk : Pads in the east haven't been placed.\n" if pad_east == [] : raise ErrorMessage(2,"RouteCk : Pads in the east haven't been placed.")
if pad_west == [] : raise "\n[Coriolis ERROR] RouteCk : Pads in the west haven't been placed.\n" if pad_west == [] : raise ErrorMessage(2,"RouteCk : Pads in the west haven't been placed.")
# pad_list contains all pads # pad_list contains all pads
pad_list = [] pad_list = []
@ -153,6 +167,8 @@ def pyRouteCk ( cell, netCk ) :
def pyAlimVerticalRail ( cell, xcoord ) : def pyAlimVerticalRail ( cell, xcoord ) :
'''x is in pitch, it is where the vertical alimentation call back are placed''' '''x is in pitch, it is where the vertical alimentation call back are placed'''
print 'pyAlimVerticalRail'
global PITCH, SLICE global PITCH, SLICE
global standard_instances_list, nb_alims_verticales, nb_lignes, standard_instances_masque global standard_instances_list, nb_alims_verticales, nb_lignes, standard_instances_masque
global nb_vdd_pins, nb_vss_pins global nb_vdd_pins, nb_vss_pins
@ -163,24 +179,25 @@ def pyAlimVerticalRail ( cell, xcoord ) :
# Error message if wrong abutment box # Error message if wrong abutment box
if ( box.getXMin() == box.getXMax() ) or ( box.getYMin() == box.getYMax() ) : if ( box.getXMin() == box.getXMax() ) or ( box.getYMin() == box.getYMax() ) :
err = "\n[Stratus ERROR] AlimVerticalRail : Can't place the rail vertical in the abutment box of model %s." %str(cell.getName()) \ message = "AlimVerticalRail : Can't place the rail vertical in the abutment box of model %s." %str(cell.getName()) \
+ "\n The abutment box doesn't exist !" \ + " The abutment box doesn't exist !" \
+ "\n Maybe you should use DefAb function or ResizeAb function to define un box before the placement of Rail Vertical.\n" + " Maybe you should use DefAb function or ResizeAb function to define un box before the placement of Rail Vertical."
raise err raise ErrorMessage(2,message)
# Check the value of x # Check the value of x
nb_col = cell.getAbutmentBox().getWidth() / DbU_lambda(PITCH) nb_col = cell.getAbutmentBox().getWidth() / DbU_lambda(PITCH)
if ( xcoord >= nb_col ) or ( xcoord < 0 ) : if ( xcoord >= nb_col ) or ( xcoord < 0 ) :
err = "\n[Stratus ERROR] AlimVerticalRail : Illegal argument x , x must be between %d and %d\n" % ( 0, nb_col ) print 'This is it'
raise err message = "AlimVerticalRail : Illegal argument x , x must be between %d and %d\n" % ( 0, nb_col )
raise ErrorMessage(2,message)
# To get the informations about the placement # To get the informations about the placement
reference = getStandardInstancesMasque ( cell ) reference = getStandardInstancesMasque ( cell )
if not reference : if not reference :
err = "\n[Stratus ERROR] AlimVerticalRail : No instance is placed in the model " + str(cell.getName()) + ".\n" \ message = "AlimVerticalRail : No instance is placed in the model " + str(cell.getName()) + ".\n" \
+ "Please place some instances before the placement of Rail Vertical.\n" + "Please place some instances before the placement of Rail Vertical.\n"
raise err raise ErrorMessage(2,message)
# Placement verification # Placement verification
#verifyPlacement ( cell ) # NON !! #verifyPlacement ( cell ) # NON !!
@ -201,7 +218,7 @@ def pyAlimVerticalRail ( cell, xcoord ) :
inv_orientation = OrientationID inv_orientation = OrientationID
orientation = OrientationMY orientation = OrientationMY
else : else :
raise "\n[Stratus ERROR] AlimVerticalRail : Strawberry.\n" raise ErrorMessage(2,"AlimVerticalRail : Strawberry.")
# print "Placement of vertical rail" # print "Placement of vertical rail"
# print "Reference ", reference # print "Reference ", reference
@ -245,18 +262,18 @@ def pyAlimVerticalRail ( cell, xcoord ) :
powerNet = None powerNet = None
for net in cell.getPowerNets(): for net in cell.getPowerNets():
if powerNet: if powerNet:
raise "\n[Coriolis ERROR] AlimVerticalRail : more than 1 Power Net found !\n" raise ErrorMessage(2,"AlimVerticalRail : more than 1 Power Net found !")
powerNet = net powerNet = net
if not powerNet: if not powerNet:
raise "\n[Coriolis ERROR] AlimVerticalRail : no Power Net found !\n" raise ErrorMessage(2,"AlimVerticalRail : no Power Net found !")
groundNet = None groundNet = None
for net in cell.getGroundNets(): for net in cell.getGroundNets():
if groundNet: if groundNet:
raise "\n[Coriolis ERROR] AlimVerticalRail : more than 1 Ground Net found !\n" raise ErrorMessage(2,"AlimVerticalRail : more than 1 Ground Net found !")
groundNet = net groundNet = net
if not groundNet: if not groundNet:
raise "\n[Coriolis ERROR] AlimVerticalRail : no Ground Net found !\n" raise ErrorMessage(2,"AlimVerticalRail : no Ground Net found !")
pin_height = 10 pin_height = 10
pin_width = 10 pin_width = 10
@ -306,22 +323,22 @@ def pyAlimHorizontalRail ( cell, ycoord ) :
# Error message if wrong abutment box # Error message if wrong abutment box
if ( box.getXMin() == box.getXMax() ) or ( box.getYMin() == box.getYMax() ) : if ( box.getXMin() == box.getXMax() ) or ( box.getYMin() == box.getYMax() ) :
err = "\n[Stratus ERROR] AlimHorizontalRail : Can't place the rail horizontal in the abutment box of model " + str(cell.getName()) \ err = "\nAlimHorizontalRail : Can't place the rail horizontal in the abutment box of model " + str(cell.getName()) \
+ "\n The abutment box doesn't exist !" \ + "\n The abutment box doesn't exist !" \
+ "\n Maybe you should use DefAb function or ResizeAb function to define un box before the placement of Rail Horizontal.\n" + "\n Maybe you should use DefAb function or ResizeAb function to define un box before the placement of Rail Horizontal.\n"
raise err raise ErrorMessage(2,err)
# Check the value of y # Check the value of y
if ( ycoord >= nb_lignes ) or ( ycoord < 0 ) : if ( ycoord >= nb_lignes ) or ( ycoord < 0 ) :
err = "\n[Stratus ERROR] AlimHorizontalRail : Illegal argument y, y must be between %d and %d\n" % ( 0, nb_lignes ) err = "\nAlimHorizontalRail : Illegal argument y, y must be between %d and %d\n" % ( 0, nb_lignes )
raise err raise ErrorMessage(2,err)
# To get the informations about the placement # To get the informations about the placement
reference = getStandardInstancesMasque ( cell ) reference = getStandardInstancesMasque ( cell )
if not reference : if not reference :
err = "\n[Stratus ERROR] AlimHorizontalRail : No instance is placed in the model " + str(cell.getName()) + ".\n" err = "AlimHorizontalRail : No instance is placed in the model " + str(cell.getName()) + ".\n"
raise err raise ErrorMessage(2,err)
# get layers # get layers
metal4 = getDataBase().getTechnology().getLayer ( "METAL4" ) metal4 = getDataBase().getTechnology().getLayer ( "METAL4" )
@ -397,18 +414,18 @@ def pyAlimConnectors ( cell ) :
# Error message if wrong abutment box # Error message if wrong abutment box
if ( box.getXMin() == box.getXMax() ) or ( box.getYMin() == box.getYMax() ) : if ( box.getXMin() == box.getXMax() ) or ( box.getYMin() == box.getYMax() ) :
err = "\n[Stratus ERROR] AlimConnectors : can't place connectors. The abutment box don't exist.\n" \ err = "\nAlimConnectors : can't place connectors. The abutment box don't exist.\n" \
+ "The abutment box don't exist !\n" \ + "The abutment box don't exist !\n" \
+ "Maybe you should use DefAb function or ResizeAb function to define un box before the placement of alim connectors.\n" + "Maybe you should use DefAb function or ResizeAb function to define un box before the placement of alim connectors.\n"
raise err raise ErrorMessage(2,err)
# avoir les infos actuelles de placement # avoir les infos actuelles de placement
getStandardInstancesMasque ( cell ) getStandardInstancesMasque ( cell )
if not reference : if not reference :
err = "\n[Stratus ERROR] AlimConnectors : no instance placed in the model " + str(cell.getName()) + "." \ err = "\nAlimConnectors : no instance placed in the model " + str(cell.getName()) + "." \
+ "Please place some instances before the placement of alim connectors.\n" + "Please place some instances before the placement of alim connectors.\n"
raise err raise ErrorMessage(2,err)
metal1 = getDataBase().getTechnology().getLayer("METAL1") metal1 = getDataBase().getTechnology().getLayer("METAL1")
string = getVddVss ( cell, 0 ) string = getVddVss ( cell, 0 )
@ -424,13 +441,11 @@ def pyAlimConnectors ( cell ) :
netPair = cell.getNet ( string ) netPair = cell.getNet ( string )
if not netPair: if not netPair:
err = "\n[Stratus ERROR] AlimConnectors : can't get net " + string + ".\n" raise ErrorMessage(2,"AlimConnectors : can't get net %s."%string)
raise err
netImpair = cell.getNet ( inv_string ) netImpair = cell.getNet ( inv_string )
if not netImpair: if not netImpair:
err = "\n[Stratus ERROR] AlimConnectors : can't get net " + inv_string + ".\n" raise ErrorMessage(2,"AlimConnectors : can't get net %s.\n"%inv_string)
raise err
for i in range ( nb_lignes + 1 ) : for i in range ( nb_lignes + 1 ) :
pin_width = DbU_lambda(12) pin_width = DbU_lambda(12)
@ -584,16 +599,15 @@ def pyPadNorth ( cell, core, args ) :
largeur = 0 largeur = 0
for ins in args : for ins in args :
if ins.getPlacementStatus() : if ins.getPlacementStatus() :
err = "\n[Coriolis ERROR] PadNorth : the instance " + str(ins.getName()) + " is already placed.\n" raise ErrorMessage(2,"PadNorth : the instance %s is already placed."%str(ins.getName()))
raise err
if ins.getAbutmentBox().getHeight() >= north_espace_width : if ins.getAbutmentBox().getHeight() >= north_espace_width :
raise "\n[Coriolis ERROR] PadNorth : not enough space for all pads.\n" raise ErrorMessage(2,"PadNorth : not enough space for all pads.")
largeur += ins.getAbutmentBox().getWidth() largeur += ins.getAbutmentBox().getWidth()
if largeur > north_espace_longueur : if largeur > north_espace_longueur :
raise "\n[Coriolis ERROR] PadNorth : not enough space for all pads.\n" raise ErrorMessage(2,"PadNorth : not enough space for all pads.")
# calculer l interval entre les pads # calculer l interval entre les pads
interval = ( north_espace_longueur - largeur ) / ( nb_pads + 1 ) interval = ( north_espace_longueur - largeur ) / ( nb_pads + 1 )
@ -624,8 +638,7 @@ def pyPadNorth ( cell, core, args ) :
pad_height = getPadHeight ( cell ) pad_height = getPadHeight ( cell )
if _x <= ( ( cellAB.getXMin() + pad_height ) + coreAB.getXMin() ) / 2 \ if _x <= ( ( cellAB.getXMin() + pad_height ) + coreAB.getXMin() ) / 2 \
or _x >= ( ( cellAB.getXMax() - pad_height ) + coreAB.getXMax() ) / 2 : or _x >= ( ( cellAB.getXMax() - pad_height ) + coreAB.getXMax() ) / 2 :
err = "\n[Stratus ERROR] PadNorth : pad" + str ( ins.getName() ) + " must be closer to the center.\n" raise ErrorMessage(2,"PadNorth : pad %s must be closer to the center.\n"%str(ins.getName()))
raise err
# x calcule pour le pad suivant # x calcule pour le pad suivant
x_init = _x + interval + pad_width x_init = _x + interval + pad_width
@ -669,16 +682,15 @@ def pyPadSouth ( cell, core, args ) :
largeur = 0 largeur = 0
for ins in args : for ins in args :
if ins.getPlacementStatus() : if ins.getPlacementStatus() :
err = "\n[Coriolis ERROR] PadSouth : the instance " + str(ins.getName()) + " is already placed.\n" raise ErrorMessage(2,"PadSouth : the instance %s is already placed."%str(ins.getName()))
raise err
if ins.getAbutmentBox().getHeight() >= south_espace_width : if ins.getAbutmentBox().getHeight() >= south_espace_width :
raise "\n[Coriolis ERROR] PadSouth : not enough space for all pads.\n" raise ErrorMessage(2,"PadSouth : not enough space for all pads.")
largeur += ins.getAbutmentBox().getWidth() largeur += ins.getAbutmentBox().getWidth()
if largeur > south_espace_longueur : if largeur > south_espace_longueur :
raise "\n[Coriolis ERROR] PadSouth : not enough space for all pads.\n" raise ErrorMessage(2,"PadSouth : not enough space for all pads.")
# calculer l'interval entre les pads # calculer l'interval entre les pads
interval = ( south_espace_longueur - largeur ) / ( nb_pads + 1 ) interval = ( south_espace_longueur - largeur ) / ( nb_pads + 1 )
@ -708,8 +720,7 @@ def pyPadSouth ( cell, core, args ) :
pad_height = getPadHeight ( cell ) pad_height = getPadHeight ( cell )
if _x <= ( ( cellAB.getXMin() + pad_height ) + coreAB.getXMin() ) / 2 \ if _x <= ( ( cellAB.getXMin() + pad_height ) + coreAB.getXMin() ) / 2 \
or _x >= ( ( cellAB.getXMax() - pad_height ) + coreAB.getXMax() ) / 2 : or _x >= ( ( cellAB.getXMax() - pad_height ) + coreAB.getXMax() ) / 2 :
err = "\n[Stratus ERROR] PadSouth : pad " + str ( ins.getName() ) + " must be closer to the center.\n" raise ErrorMessage(2,"PadSouth : pad %s must be closer to the center."%str(ins.getName()))
raise err
# x calcule pour le pad suivant # x calcule pour le pad suivant
x_init = _x + interval + pad_width x_init = _x + interval + pad_width
@ -753,16 +764,15 @@ def pyPadEast ( cell, core, args ) :
largeur = 0 largeur = 0
for ins in args : for ins in args :
if ins.getPlacementStatus() : if ins.getPlacementStatus() :
err = "\n[Coriolis ERROR] PadEast : the instance " + str(insGetName()) + " is already placed.\n" raise ErrorMessage(2,"PadEast : the instance %s is already placed."%str(insGetName()))
raise err
if ins.getAbutmentBox().getHeight() >= east_espace_width : if ins.getAbutmentBox().getHeight() >= east_espace_width :
raise "\n[Coriolis ERROR] PadEast : not enough space for pads.\n" raise ErrorMessage(2,"PadEast : not enough space for pads.")
largeur += ins.getAbutmentBox().getWidth() largeur += ins.getAbutmentBox().getWidth()
if largeur > east_espace_longueur : if largeur > east_espace_longueur :
raise "\n[Coriolis ERROR] PadEast : not enough space for all pads.\n" raise ErrorMessage(2,"PadEast : not enough space for all pads.")
# calculer l'interval entre les pads # calculer l'interval entre les pads
interval = ( east_espace_longueur - largeur ) / ( nb_pads + 1 ) interval = ( east_espace_longueur - largeur ) / ( nb_pads + 1 )
@ -796,8 +806,7 @@ def pyPadEast ( cell, core, args ) :
pad_height = getPadHeight ( cell ) pad_height = getPadHeight ( cell )
if _y <= ( ( cellAB.getYMin() + pad_height ) + coreAB.getYMin() ) / 2 \ if _y <= ( ( cellAB.getYMin() + pad_height ) + coreAB.getYMin() ) / 2 \
or _y >= ( ( cellAB.getYMax() - pad_height ) + coreAB.getYMax() ) / 2 : or _y >= ( ( cellAB.getYMax() - pad_height ) + coreAB.getYMax() ) / 2 :
err = "\n[Stratus ERROR] PadEast : pad " + str ( ins.getName() ) + " must be closer to the center.\n" raise ErrorMessage(2,"PadEast : pad %s must be closer to the center.\n"%str(ins.getName()))
raise err
# y calcule pour le pad suivant # y calcule pour le pad suivant
y_init = _y + interval + pad_width y_init = _y + interval + pad_width
@ -841,16 +850,15 @@ def pyPadWest ( cell, core, args ) :
largeur = 0 largeur = 0
for ins in args : for ins in args :
if ins.getPlacementStatus() : if ins.getPlacementStatus() :
err = "\n[Coriolis ERROR] PadWest : the instance " + str(ins.getName()) + " is already placed.\n" raise ErrorMessage(2,"PadWest : the instance %s is already placed."%str(ins.getName()))
raise err
if ins.getAbutmentBox().getHeight() >= west_espace_width : if ins.getAbutmentBox().getHeight() >= west_espace_width :
raise "\n[Coriolis ERROR] PadWest : not enough space for pads.\n" raise ErrorMessage(2,"PadWest : not enough space for pads.")
largeur += ins.getAbutmentBox().getWidth() largeur += ins.getAbutmentBox().getWidth()
if largeur > west_espace_longueur : if largeur > west_espace_longueur :
raise "\n[Coriolis ERROR] PadWest : not enough space for pads.\n" raise ErrorMessage(2,"PadWest : not enough space for pads.")
# calculer l'interval entre les pads # calculer l'interval entre les pads
interval = int ( ( west_espace_longueur - largeur ) / ( nb_pads + 1 ) ) interval = int ( ( west_espace_longueur - largeur ) / ( nb_pads + 1 ) )
@ -881,8 +889,7 @@ def pyPadWest ( cell, core, args ) :
if _y <= ( ( cellAB.getYMin() + pad_height ) + coreAB.getYMin() ) / 2 \ if _y <= ( ( cellAB.getYMin() + pad_height ) + coreAB.getYMin() ) / 2 \
or _y >= ( ( cellAB.getYMax() - pad_height ) + coreAB.getYMax() ) / 2 : or _y >= ( ( cellAB.getYMax() - pad_height ) + coreAB.getYMax() ) / 2 :
err = "\n[Stratus ERROR] PadWest : pad " + str ( ins.getName() ) + " must be closer to the center.\n" raise ErrorMessage(2,"PadWest : pad %s must be closer to the center.\n"%str(ins.getName()))
raise err
# y calcule pour le pad suivant # y calcule pour le pad suivant
y_init = _y + interval + pad_width y_init = _y + interval + pad_width
@ -916,10 +923,10 @@ def pyPowerRing ( cell, core, n ) :
UpdateSession.open() UpdateSession.open()
if pad_north == [] : raise "\n[Stratus ERROR] PowerRing : Pads in the north haven't been placed\n" if pad_north == [] : raise ErrorMessage(2,"PowerRing : Pads in the north haven't been placed")
if pad_south == [] : raise "\n[Stratus ERROR] PowerRing : Pads in the south haven't been placed\n" if pad_south == [] : raise ErrorMessage(2,"PowerRing : Pads in the south haven't been placed")
if pad_east == [] : raise "\n[Stratus ERROR] PowerRing : Pads in the east haven't been placed\n" if pad_east == [] : raise ErrorMessage(2,"PowerRing : Pads in the east haven't been placed")
if pad_west == [] : raise "\n[Stratus ERROR] PowerRing : Pads in the west haven't been placed\n" if pad_west == [] : raise ErrorMessage(2,"PowerRing : Pads in the west haven't been placed")
############################# #############################
# PARAMETRE DU PLACEMENT ## # PARAMETRE DU PLACEMENT ##
@ -954,12 +961,19 @@ def pyPowerRing ( cell, core, n ) :
via3 = db.getTechnology().getLayer ( "VIA34" ) via3 = db.getTechnology().getLayer ( "VIA34" )
# Recuperer les nets ( qui connectent les connectors du plot : vdde , vsse , vddi , vssi , ck ) # Recuperer les nets ( qui connectent les connectors du plot : vdde , vsse , vddi , vssi , ck )
model = cell.getInstance ( pad_north[0].getName() ).getMasterCell() instance = cell.getInstance( pad_north[0].getName() )
vddp = cell.getInstance ( pad_north[0].getName() ).getPlug ( model.getNet ( "vdde" ) ).getNet() model = instance.getMasterCell()
vssp = cell.getInstance ( pad_north[0].getName() ).getPlug ( model.getNet ( "vsse" ) ).getNet() vddp = instance.getPlug ( model.getNet("vdde") ).getNet()
vdd = cell.getInstance ( pad_north[0].getName() ).getPlug ( model.getNet ( "vddi" ) ).getNet() vssp = instance.getPlug ( model.getNet("vsse") ).getNet()
vss = cell.getInstance ( pad_north[0].getName() ).getPlug ( model.getNet ( "vssi" ) ).getNet() vdd = instance.getPlug ( model.getNet("vddi") ).getNet()
ck = cell.getInstance ( pad_north[0].getName() ).getPlug ( model.getNet ( "ck" ) ).getNet() vss = instance.getPlug ( model.getNet("vssi") ).getNet()
ck = instance.getPlug ( model.getNet("ck" ) ).getNet()
# If nets are globals, get them from the netlist.
if not vddp: vddp = cell.getNet('vdde')
if not vssp: vssp = cell.getNet('vsse')
if not vdd: vdd = cell.getNet('vddi')
if not vss: vss = cell.getNet('vssi')
if not ck: ck = cell.getNet('cki')
# Prendre la hauteur, la longueur, Xmin et Ymin de ce modele # Prendre la hauteur, la longueur, Xmin et Ymin de ce modele
cell_height = cell.getAbutmentBox().getHeight() cell_height = cell.getAbutmentBox().getHeight()
@ -975,7 +989,7 @@ def pyPowerRing ( cell, core, n ) :
limit = DbU_lambda ( int ( DbU_getLambda ( smaller ) / 2 ) ) - pad_height limit = DbU_lambda ( int ( DbU_getLambda ( smaller ) / 2 ) ) - pad_height
if ( (2*n + 1) * DbU_lambda(RING_INTERVAL) + (2*n) * DbU_lambda(RING_WIDTH) ) >= limit : # 2*n + 1 spaces + 2*n width if ( (2*n + 1) * DbU_lambda(RING_INTERVAL) + (2*n) * DbU_lambda(RING_WIDTH) ) >= limit : # 2*n + 1 spaces + 2*n width
raise "\n[Stratus ERROR] : PowerRing : too many rings, not enough space\n" raise ErrorMessage(2,"PowerRing : too many rings, not enough space")
# la distance entre les couronnes et le core # la distance entre les couronnes et le core
marge = DbU_lambda ( int ( DbU_getLambda ( limit - (2*n + 1 ) * DbU_lambda(RING_INTERVAL) - (2*n) * DbU_lambda(RING_WIDTH) ) ) / 2 ) marge = DbU_lambda ( int ( DbU_getLambda ( limit - (2*n + 1 ) * DbU_lambda(RING_INTERVAL) - (2*n) * DbU_lambda(RING_WIDTH) ) ) / 2 )
@ -1130,8 +1144,7 @@ def pyPowerRing ( cell, core, n ) :
elif re.search ( "METAL1", element_layer_name ) : old_contact = Contact ( vss, metal1, _x, _y , element.getHeight(), element.getHeight() ) elif re.search ( "METAL1", element_layer_name ) : old_contact = Contact ( vss, metal1, _x, _y , element.getHeight(), element.getHeight() )
elif re.search ( "METAL3", element_layer_name ) : old_contact = Contact ( vss, metal3, _x, _y , element.getHeight(), element.getHeight() ) elif re.search ( "METAL3", element_layer_name ) : old_contact = Contact ( vss, metal3, _x, _y , element.getHeight(), element.getHeight() )
else : else :
err = "\n[Coriolis ERROR] : wrong layer of pin in the west of core : ", element_layer_name, ".\n" raise ErrorMessage(2,"wrong layer of pin in the west of core : %s.\n" % element_layer_name)
raise err
# Connection du cote de l'ouest # Connection du cote de l'ouest
if element.getAccessDirection() == WEST : if element.getAccessDirection() == WEST :
@ -1199,8 +1212,7 @@ def pyPowerRing ( cell, core, n ) :
vertical = Vertical ( contact, old_contact, metal3, _x, DbU_lambda(RING_WIDTH) ) vertical = Vertical ( contact, old_contact, metal3, _x, DbU_lambda(RING_WIDTH) )
old_contact = contact old_contact = contact
else : else :
err = "\n[Stratus ERROR] : wrong layer of pin in the west of core : ", element_layer_name, ".\n" raise ErrorMessage(2,"wrong layer of pin in the west of core : %s.\n"% element_layer_name)
raise err
# Connection du cote du sud # Connection du cote du sud
if element.getAccessDirection() == SOUTH : if element.getAccessDirection() == SOUTH :
@ -1220,8 +1232,7 @@ def pyPowerRing ( cell, core, n ) :
vertical = Vertical ( contact, old_contact, metal3, _x, DbU_lambda(RING_WIDTH) ) vertical = Vertical ( contact, old_contact, metal3, _x, DbU_lambda(RING_WIDTH) )
old_contact = contact old_contact = contact
else : else :
err = "\n[Stratus ERROR] : wrong layer of pin in the west of core : ", element_layer_name, ".\n" raise ErrorMessage(2,"wrong layer of pin in the west of core : %s."%element_layer_name)
raise err
# End of while # End of while
@ -1242,8 +1253,7 @@ def pyPowerRing ( cell, core, n ) :
elif re.search ( "METAL1", element_layer_name ) : old_contact = Contact ( vdd, metal1, _x, _y , element.getHeight(), element.getHeight() ) elif re.search ( "METAL1", element_layer_name ) : old_contact = Contact ( vdd, metal1, _x, _y , element.getHeight(), element.getHeight() )
elif re.search ( "METAL3", element_layer_name ) : old_contact = Contact ( vdd, metal3, _x, _y , element.getHeight(), element.getHeight() ) elif re.search ( "METAL3", element_layer_name ) : old_contact = Contact ( vdd, metal3, _x, _y , element.getHeight(), element.getHeight() )
else : else :
err = "\n[Stratus ERROR] : wrong layer of pin in the west of core : ", element_layer_name, ".\n" raise ErrorMessage(2,"wrong layer of pin in the west of core : %s."%element_layer_name)
raise err
# Connection du cote de l'ouest # Connection du cote de l'ouest
if element.getAccessDirection() == WEST : if element.getAccessDirection() == WEST :
@ -1311,8 +1321,7 @@ def pyPowerRing ( cell, core, n ) :
vertical = Vertical ( contact, old_contact, metal3, _x, DbU_lambda(RING_WIDTH) ) vertical = Vertical ( contact, old_contact, metal3, _x, DbU_lambda(RING_WIDTH) )
old_contact = contact old_contact = contact
else : else :
err = "\n[Stratus ERROR] : wrong layer of pin in the west of core : ", element_layer_name, ".\n" raise ErrorMessage(2,"wrong layer of pin in the west of core : %s."%element_layer_name)
raise err
# Connection du cote du sud # Connection du cote du sud
if element.getAccessDirection() == SOUTH : if element.getAccessDirection() == SOUTH :
@ -1332,8 +1341,7 @@ def pyPowerRing ( cell, core, n ) :
vertical = Vertical ( contact, old_contact, metal3, _x, DbU_lambda(RING_WIDTH) ) vertical = Vertical ( contact, old_contact, metal3, _x, DbU_lambda(RING_WIDTH) )
old_contact = contact old_contact = contact
else : else :
err = "\n[Stratus ERROR] : wrong layer of pin in the west of core : ", element_layer_name, ".\n" raise ErrorMessage(2,"wrong layer of pin in the west of core : %s."%element_layer_name)
raise err
# End of while # End of while
@ -1509,8 +1517,8 @@ def pyPowerRing ( cell, core, n ) :
if net.isSupply() or net.isClock() : if net.isSupply() or net.isClock() :
for component in NetExternalComponents.get(net): for component in NetExternalComponents.get(net):
plug = instance.getPlug ( net ) plug = instance.getPlug ( net )
NET = plug.getNet() NET = getNetFromPlug( plug )
if ( not NET ) : raise "Error plug : %s must be connected\n" % str(plug.getName()) if ( not NET ) : raise ErrorMessage(2,"Error plug : %s must be connected" % str(plug.getName()))
layer = getNonCLayer ( component.getLayer() ) layer = getNonCLayer ( component.getLayer() )
@ -1632,16 +1640,14 @@ def create_inst ( model, name, cell ) :
# Error : if the cell the instance has to be instanciated in does not exist # Error : if the cell the instance has to be instanciated in does not exist
if not cell : if not cell :
err = "\n[Coriolis ERROR] Cannot create instance " + name + " : the cell does not exist.\n" raise ErrorMessage(2,"Cannot create instance %s : the cell does not exist."%name)
raise err
# Load model in the database # Load model in the database
modelmastercell = CRL.AllianceFramework.get().getCell ( model, CRL.Catalog.State.Views ) modelmastercell = CRL.AllianceFramework.get().getCell ( model, CRL.Catalog.State.Views )
# Error : if the model is not found in the libraries # Error : if the model is not found in the libraries
if not modelmastercell : if not modelmastercell :
err = "\n[Coriolis ERROR] Cannot create instance " + name + " : model " + model + "does not exist in the database.\n" raise ErrorMessage(2,"Cannot create instance %s : model %s does not exist in the database."%(name,model))
raise err
inst = Instance ( cell, name, modelmastercell ) inst = Instance ( cell, name, modelmastercell )
@ -1658,13 +1664,11 @@ def place ( inst, x, y, orientation ) :
# Error : if the hurricane instance does not exist # Error : if the hurricane instance does not exist
if not inst : if not inst :
err = "\n[Coriolis ERROR] Layout : The instance of " + str ( inst.getName() ) + " has not been created.\n" raise ErrorMessage(2,"Layout : The instance of %s has not been created."%str(inst.getName()))
raise err
# Error : if the instance is already placed # Error : if the instance is already placed
if inst.getPlacementStatus() == PlacementStatusFIXED : if inst.getPlacementStatus() == PlacementStatusFIXED :
err = "\n[Stratus ERROR] Placement : the instance " + str ( inst.getName() ) + " is already placed.\n" raise ErrorMessage(2,"Placement : the instance %s is already placed."%str(inst.getName()))
raise err
UpdateSession.open() UpdateSession.open()
@ -1782,7 +1786,7 @@ def verifyPlacement ( cell ) :
# Error : if the orientation is different from 0, 2, 4 ,6 # Error : if the orientation is different from 0, 2, 4 ,6
#if not element_orientation in [0,2,4,6] : #if not element_orientation in [0,2,4,6] :
if element_orientation in [1,3,5,7] : if element_orientation in [1,3,5,7] :
err = "\n[Stratus ERROR] Placement of cells : please check your file of layout with DRUC.\n" err = "Placement of cells : please check your file of layout with DRUC."
# err += "Error Detail :" + "\n" # err += "Error Detail :" + "\n"
# err += " instance " + str(element[2].getName()) + " of model " + str(element[2].getMasterCell().getName()) + "\n" # err += " instance " + str(element[2].getName()) + " of model " + str(element[2].getMasterCell().getName()) + "\n"
# err += " in cell " + str(element[2].getCell().getName()) + "\n" # err += " in cell " + str(element[2].getCell().getName()) + "\n"
@ -1792,7 +1796,7 @@ def verifyPlacement ( cell ) :
# err += " in cell " + str(standard_instances_list[0][2].getCell().getName()) + "\n" # err += " in cell " + str(standard_instances_list[0][2].getCell().getName()) + "\n"
# err += " reference ymin is " + str(YMin) + " orientation " + str(orientation) + "\n" # err += " reference ymin is " + str(YMin) + " orientation " + str(orientation) + "\n"
# err += " element ymin is", element[0], "orientation", element_orientation + "\n" # err += " element ymin is", element[0], "orientation", element_orientation + "\n"
raise err raise ErrorMessage(2,err)
if distance < 0 : distance = -distance if distance < 0 : distance = -distance
@ -1801,7 +1805,7 @@ def verifyPlacement ( cell ) :
# odd number # odd number
if nb_case % 2 : if nb_case % 2 :
if ( element_orientation - orientation ) in [4,-4] : if ( element_orientation - orientation ) in [4,-4] :
err = "\n[Stratus ERROR] Placement of cells : please check your file of layout with DRUC\n" err = "Placement of cells : please check your file of layout with DRUC\n"
# err += "Error Detail :" + "\n" # err += "Error Detail :" + "\n"
# err += " instance " + str(element[2].getName()) + " of model " + str(element[2].getMasterCell().getName()) + "\n" # err += " instance " + str(element[2].getName()) + " of model " + str(element[2].getMasterCell().getName()) + "\n"
# err += " in cell " + str(element[2].getCell().getName()) + "\n" # err += " in cell " + str(element[2].getCell().getName()) + "\n"
@ -1811,12 +1815,12 @@ def verifyPlacement ( cell ) :
# err += " in cell " + str(standard_instances_list[0][2].getCell().getName()) + "\n" # err += " in cell " + str(standard_instances_list[0][2].getCell().getName()) + "\n"
# err += " reference ymin is " + str(YMin) + " orientation " + orientation + "\n" # err += " reference ymin is " + str(YMin) + " orientation " + orientation + "\n"
# err += " element ymin is " + element[0] + " orientation " + element_orientation + "\n" # err += " element ymin is " + element[0] + " orientation " + element_orientation + "\n"
raise err raise ErrorMessage(2,err)
# even number # even number
else : else :
if ( element_orientation - orientation ) in [2,-2,6,-6] : if ( element_orientation - orientation ) in [2,-2,6,-6] :
err = "\n[Stratus ERROR] Placement of cells : please check your file of layout with DRUC\n" err = "Placement of cells : please check your file of layout with DRUC\n"
# err += "Error Detail :" # err += "Error Detail :"
# err += " instance " + str(element[2].getName()) + " of model " + str(element[2].getMasterCell().getName()) + "\n" # err += " instance " + str(element[2].getName()) + " of model " + str(element[2].getMasterCell().getName()) + "\n"
# err += " in cell " + str(element[2].getCell().getName()) + "\n" # err += " in cell " + str(element[2].getCell().getName()) + "\n"
@ -1826,7 +1830,7 @@ def verifyPlacement ( cell ) :
# err += " in cell " + str(standard_instances_list[0][2].getCell().getName()) + "\n" # err += " in cell " + str(standard_instances_list[0][2].getCell().getName()) + "\n"
# err += " reference ymin is " + str(YMin) + " orientation " + orientation + "\n" # err += " reference ymin is " + str(YMin) + " orientation " + orientation + "\n"
# err += " element ymin is " + element[0] + " orientation " + element_orientation + "\n" # err += " element ymin is " + element[0] + " orientation " + element_orientation + "\n"
raise err raise ErrorMessage(2,err)
################################### ###################################
def temporarySave ( cell = None ) : def temporarySave ( cell = None ) :
@ -1850,7 +1854,7 @@ def getVddVss ( cell, y ) :
global reference global reference
if reference == [] : raise "\n[Coriolis ERROR] getVddVss : Reference is not token.\n" if reference == [] : raise ErrorMessage(2,"getVddVss : Reference is not token.")
# in order to know if it is vdd or vss # in order to know if it is vdd or vss
distance = y - int ( DbU_getLambda ( reference[1] ) ) / 50 distance = y - int ( DbU_getLambda ( reference[1] ) ) / 50
@ -1866,8 +1870,7 @@ def getVddVss ( cell, y ) :
if distance % 2 : return "vss" if distance % 2 : return "vss"
else : return "vdd" else : return "vdd"
else : else :
err = "\n[Stratus ERROR] get_vdd_vss : Illegal orientation of reference " + orientation + ".\n" raise ErrorMessage(2,"get_vdd_vss : Illegal orientation of reference %s.\n"%orientation)
raise err
########################### ###########################
def getPadHeight ( cell ) : def getPadHeight ( cell ) :
@ -1882,7 +1885,7 @@ def getPadHeight ( cell ) :
break break
if padFound : return pad_height if padFound : return pad_height
else : raise "\n[Coriolis ERROR] getPadHeight : No pad found.\n" else : raise ErrorMessage(2,"getPadHeight : No pad found.")
################### ###################
def isPad ( ins ) : def isPad ( ins ) :
@ -2075,10 +2078,16 @@ def createGrid ( my_tuple ) :
else : else :
return position return position
_Xmin = None #_Xmin = None
_Ymin = None #_Ymin = None
_Xmax = None #_Xmax = None
_Ymax = None #_Ymax = None
coreBox = cell.getInstance('core').getAbutmentBox()
#print coreBox
_Xmin = coreBox.getXMin()
_Ymin = coreBox.getYMin()
_Xmax = coreBox.getXMax()
_Ymax = coreBox.getYMax()
ck_contact_list = [] ck_contact_list = []
getNetInstances ( cell, net, Transformation ( 0, 0, OrientationID ) ) getNetInstances ( cell, net, Transformation ( 0, 0, OrientationID ) )
@ -2154,7 +2163,7 @@ def createGrid ( my_tuple ) :
gridContact = Contact(northSegment, via5, x, 0, DbU_lambda(11), DbU_lambda(11)) gridContact = Contact(northSegment, via5, x, 0, DbU_lambda(11), DbU_lambda(11))
northContacts.append(x) northContacts.append(x)
else : else :
raise "\n[Stratus ERROR] RouteCK : bad pad placement.\n" raise ErrorMessage(2,"RouteCK : bad pad placement.")
elif y >= gridBoundingBox.getYMin() and y <= gridBoundingBox.getYMax() : elif y >= gridBoundingBox.getYMin() and y <= gridBoundingBox.getYMax() :
layer = metal6 layer = metal6
@ -2175,16 +2184,16 @@ def createGrid ( my_tuple ) :
gridContact = Contact(westSegment, via5, 0, y, DbU_lambda(11), DbU_lambda(11)) gridContact = Contact(westSegment, via5, 0, y, DbU_lambda(11), DbU_lambda(11))
westContacts.append(y) westContacts.append(y)
else : else :
raise "\n[Stratus ERROR] RouteCK : bad pad placement.\n" raise ErrorMessage(2,"RouteCK : bad pad placement.")
else : else :
err = "\n[Stratus ERROR] RouteCk: The pads ("+ str(instance.getName()) +") must be in direct regard of the clock grid\n" err = "RouteCk: The pads ("+ str(instance.getName()) +") must be in direct regard of the clock grid\n"
err += "coordinates are : x1,y1 = " \ err += "coordinates are : (x1,y1) = (%s,%s) and (x2,y2) = (%s,%s)." \
+ str(DbU_getLambda(gridBoundingBox.getXMin())) + "," \ % ( DbU.getValueString(gridBoundingBox.getXMin())
+ str(DbU_getLambda(gridBoundingBox.getYMin())) + "and x2,y2 = " \ , DbU.getValueString(gridBoundingBox.getYMin())
+ str(DbU_getLambda(gridBoundingBox.getXMax())) + "," \ , DbU.getValueString(gridBoundingBox.getXMax())
+ str(DbU_getLambda(gridBoundingBox.getYMax())) + ".\n" , DbU.getValueString(gridBoundingBox.getYMax()) )
raise err raise ErrorMessage(2,err)
compContact = Contact ( net, via5, x, y, DbU_lambda(11), DbU_lambda(11) ) compContact = Contact ( net, via5, x, y, DbU_lambda(11), DbU_lambda(11) )
@ -2298,10 +2307,9 @@ def getNetInstances ( cell, net, transformation) :
# Si c est une instance de type leaf # Si c est une instance de type leaf
if ins.isLeaf() : if ins.isLeaf() :
if ins.getPlacementStatus() == PlacementStatusUNPLACED : if ins.getPlacementStatus() == PlacementStatusUNPLACED :
raise "Error getNetInstances : instance %s is unplaced" % str(ins.getName()) raise ErrorMessage(2,"getNetInstances : instance %s is unplaced" % str(ins.getName()))
else : else :
if not isPad ( ins ) : if not isPad ( ins ) :
# get transformation final de cette instance # get transformation final de cette instance
ins_transformation = transformation.getTransformation ( ins.getTransformation() ) ins_transformation = transformation.getTransformation ( ins.getTransformation() )
@ -2340,13 +2348,13 @@ def getNetInstances ( cell, net, transformation) :
break break
if not nbSeg : if not nbSeg :
raise "Error getNetInstances : net %s in model %s does not have a segment\n" % ( str ( plug.getMasterNet().getName()), str(ins.getMasterCell().getName()) ) raise ErrorMessage(2,"getNetInstances : net %s in model %s does not have a segment\n" % ( str ( plug.getMasterNet().getName()), str(ins.getMasterCell().getName()) ) )
if ( not ck_contact_list ) : print "Error in function getNetInstances : no segment found" if ( not ck_contact_list ) : print "Error in function getNetInstances : no segment found"
else : else :
if ins.getPlacementStatus() == PlacementStatusUNPLACED : if ins.getPlacementStatus() == PlacementStatusUNPLACED :
raise "Error getNetInstances : instance %s is unplaced" % str(ins.getName()) raise ErrorMessage(2,"getNetInstances : instance %s is unplaced" % str(ins.getName()))
else : else :
getNetInstances ( cell, plug.getMasterNet(), transformation.getTransformation ( ins.getTransformation () )) getNetInstances ( cell, plug.getMasterNet(), transformation.getTransformation ( ins.getTransformation () ))
@ -2376,4 +2384,5 @@ def Segment ( component1, component2, layer, width ) :
if component1.getX() == component2.getX() : return Vertical ( component1, component2, layer, component1.getX(), width ) if component1.getX() == component2.getX() : return Vertical ( component1, component2, layer, component1.getX(), width )
elif component1.getY() == component2.getY() : return Horizontal ( component1, component2, layer, component1.getY(), width ) elif component1.getY() == component2.getY() : return Horizontal ( component1, component2, layer, component1.getY(), width )
else : raise "\n[Coriolis ERROR] Segment : the components must be horizontaly or verticaly aligned.\n" else:
raise ErrorMessage(2,"Segment : the components must be horizontaly or verticaly aligned.")