byucc.jhdl.DRC
Class DesignRuleChecker

java.lang.Object
  extended bybyucc.jhdl.DRC.DesignRuleChecker
All Implemented Interfaces:
DesignRuleConstants

public class DesignRuleChecker
extends java.lang.Object
implements DesignRuleConstants

This class performs checks against design rules. It contains DesignRule objects. It also manages violation reports.

Author:
Michael Halcrow , Anthony L. Slade

Field Summary
protected  CellList descendents
          descendents is a list of all of the children of topCell
static int FULLDETAIL
           
protected static JHDLOutput jout
          Use joutDRC for outputting messages about warnings and errors.
static int LONGLIST
           
static int SHORTLIST
           
static int SUMMARY
           
protected  Cell topCell
          topCell is the Cell to be checked; all descendents of this cell are (generally) checked also.
protected  CellList violatingCells
          Contains a list of all cells that have a rule violation flagged
static int VIOLATIONS
           
 
Fields inherited from interface byucc.jhdl.DRC.DesignRuleConstants
MSGHEADER_ERROR, MSGHEADER_NOTICE, MSGHEADER_STATUS, MSGHEADER_WARNING, MSGTYPE_ERR_ALL, MSGTYPE_ERR_EXPERTWARN, MSGTYPE_ERR_NOEXPERT, MSGTYPE_ERROR_BITS, MSGTYPE_MUTE, MSGTYPE_NOTICE, MSGTYPE_NOTICE_BITS, MSGTYPE_NOTICE_NOEXPERT, MSGTYPE_STATUS, MSGTYPE_STATUS_BITS, MSGTYPE_STATUS_NOEXPERT, MSGTYPE_WARN_ALL, MSGTYPE_WARN_NOEXPERT, MSGTYPE_WARNING_BITS, SHOW_NUM_RULES_CHECKED_EVERY
 
Constructor Summary
DesignRuleChecker()
          Initializes the DesignRuleChecker without a Cell to check initially.
DesignRuleChecker(Cell topCell)
          Initializes the DesignRuleChecker to check the Cell topCell.
DesignRuleChecker(Cell parentCell, Cell topCell)
           
 
Method Summary
protected  void addToCellList(CellList list, Cell cl)
          I wasn't sure it would be a good idea to make the insert method of the CellList class public.
 void addViolatingCell(Cell cell)
          Adds a violating cell to the internal list of violating cells.
 void addViolatingCells(java.util.Vector violatingCells)
          Adds the elements from the Vector passed in to the master Vector containing violating cells.
static boolean checkRule(Cell parent, Cell toCheck, DesignRule rule)
          A static utility methods to check one rule against a component set.
static boolean checkRule(Cell parent, Cell toCheck, DesignRule rule, boolean drbFlag)
          A static utility methods to check one rule against a component set.
static boolean checkRule(Cell parent, Cell toCheck, DesignRule rule, DesignRuleBrowser drb)
          A static utility methods to check one rule against a component set.
static boolean checkRules(Cell parent, Cell toCheck, DesignRule[] rules)
          A static utility methods to check a set of rules against a component set.
static boolean checkRules(Cell parent, Cell toCheck, DesignRule rule, boolean useBrowser)
          A static utility methods to check a set of rules against a component set.
static boolean checkRules(Cell parent, Cell toCheck, java.util.Vector rules)
          A static utility methods to check a set of rules against a component set.
static boolean checkRules(Cell parent, Cell toCheck, java.util.Vector rules, boolean useBrowser)
          A static utility methods to check a set of rules against a component set.
protected static boolean displayMsgHeader(boolean display)
           
 boolean doCheck()
          Initiates the design rule check on topCell
 boolean doCheck(Cell newCell)
          Initiates the design rule check on a new topCell
protected static int getCurrentMsgType()
          Returns the current message outputting mode/type.
 DesignRuleViolation[] getDesignRuleViolations()
          Returns an array of violations to the previous design rule check routine
 DesignRuleViolation[] getDesignRuleViolations(int[] drcvIds)
          Returns an array of violations to the previous design rule check routine.
 DesignRuleViolation[] getDesignRuleViolationsArray()
          Returns an array of violations to the previous design rule check routine.
 DesignRuleViolation[] getDesignRuleViolationsArray(int[] drcvIds)
          Returns an array of violations to the previous design rule check routine.
 DesignRuleViolation[] getDesignRuleViolationsForCells(Cell[] cells)
          Returns the set of design rule violations associated with a specific set of cells.
 DesignRuleViolation[] getDesignRuleViolationsForSeverityLevel(int severityLevel)
          Returns the set of design rule violations for a specific severity level.
 java.util.Vector getDesignRuleViolationsVector()
          Returns a Vector of violations to the previous design rule check routine.
 java.util.Vector getDesignRuleViolationsVector(int[] drcvIds)
          This uses an algorithm of O(n^2).
 int getNumRulesChecked()
          Returns the number of design rules checked.
 int getNumRulesFailed()
          Returns the number of design rules checked and failed.
 int getNumRulesPassed()
          Returns the number of design rules checked and passed.
 java.lang.String getReport()
          Returns the full report from the last check routine.
 java.lang.String getReport(int reportFormat)
          Returns a complete report of the test(s) performed.
 Cell getTopCell()
          Returns a reference to the top-level cell which this DesignRuleChecker is checking
 void initDRC(Cell topCell)
          Common constructor code for initialization.
static void msg(JHDLException je)
          Outputs the stack trace of je to the user based on the value of currentMessageType.
static void msg(JHDLException je, int type)
          Outputs the stack trace of je to the user based on the value of type.
protected static void msg(java.lang.String msg)
          Outputs the message msg to the user based on the value of currentMessageType.
static void msg(java.lang.String msg, int type)
          Outputs the message msg to the user based on the value of type.
static void msgln(java.lang.String msg)
          Outputs the message msg to the user based on the value of currentMessageType.
static void msgln(java.lang.String msg, int type)
          Outputs the message msg to the user based on the value of type.
 void registerDesignRule(DesignRule dr)
          Registers new DesignRules with this DesignRuleChecker.
 void registerRule(DesignRule dr)
          Registers new DesignRules with this DesignRuleChecker.
 void registerViolation(DesignRule dr)
          Registers a violation of a rule.
static boolean runTest(Cell parent, Cell toCheck, java.util.Vector rules)
          A static utility methods to check a set of rules against a component set for the purpose of checking the integrity of this class.
 void setCell(Cell newCell)
          Set the topCell to the new cell specified
protected static int setCurrentMsgType(int type)
          Sets the current format of message output to that dictated by type
static boolean setExpertMode(boolean newMode)
          Use this method to turn expert mode on or off.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUMMARY

public static final int SUMMARY
See Also:
Constant Field Values

SHORTLIST

public static final int SHORTLIST
See Also:
Constant Field Values

LONGLIST

public static final int LONGLIST
See Also:
Constant Field Values

FULLDETAIL

public static final int FULLDETAIL
See Also:
Constant Field Values

VIOLATIONS

public static final int VIOLATIONS
See Also:
Constant Field Values

topCell

protected Cell topCell
topCell is the Cell to be checked; all descendents of this cell are (generally) checked also.


descendents

protected CellList descendents
descendents is a list of all of the children of topCell


jout

protected static JHDLOutput jout
Use joutDRC for outputting messages about warnings and errors. ` * It can be used directly or through the overloaded msg and msgln methods. The String identifier for jout is "DRC".


violatingCells

protected CellList violatingCells
Contains a list of all cells that have a rule violation flagged

Constructor Detail

DesignRuleChecker

public DesignRuleChecker()
Initializes the DesignRuleChecker without a Cell to check initially.


DesignRuleChecker

public DesignRuleChecker(Cell topCell)
Initializes the DesignRuleChecker to check the Cell topCell.

Parameters:
topCell - The Cell to check.

DesignRuleChecker

public DesignRuleChecker(Cell parentCell,
                         Cell topCell)
Parameters:
parentCell -
topCell - The Cell to check.
Method Detail

initDRC

public void initDRC(Cell topCell)
Common constructor code for initialization.


registerRule

public void registerRule(DesignRule dr)
Registers new DesignRules with this DesignRuleChecker. This method does not check if the rule has been added previously; therefore, multiple registrations will result in redundant checks. Each registered DesignRule will have its doCheck method called when this DesgignRuleChecker has its doCheck method called.

Parameters:
dr - A new DesignRule register with this DesignRuleChecker.

registerDesignRule

public void registerDesignRule(DesignRule dr)
Registers new DesignRules with this DesignRuleChecker. This method does not check if the rule has been added previously; therefore, multiple registrations will result in redundant checks. Each registered DesignRule will have its doCheck method called when this DesgignRuleChecker has its doCheck method called.

Parameters:
dr - A new DesignRule register with this DesignRuleChecker.

doCheck

public boolean doCheck(Cell newCell)
Initiates the design rule check on a new topCell

Parameters:
newCell - The new cell to check.
Returns:
true if the design rules checked are kept, otherwise false.

doCheck

public boolean doCheck()
Initiates the design rule check on topCell

Returns:
true if the design rules checked are kept, otherwise false.

getReport

public java.lang.String getReport(int reportFormat)
Returns a complete report of the test(s) performed.


getReport

public java.lang.String getReport()
Returns the full report from the last check routine.

Returns:
The results from the last check routine.

getNumRulesChecked

public int getNumRulesChecked()
Returns the number of design rules checked.

Returns:
The number of design rules checked.

getNumRulesPassed

public int getNumRulesPassed()
Returns the number of design rules checked and passed.

Returns:
The number of design rules checked and passed.

getNumRulesFailed

public int getNumRulesFailed()
Returns the number of design rules checked and failed. NOTE: this does not indicate the exact number of times any given rule was violated. This method simply returns the number of rules that were violated at least once.

Returns:
The number of design rules checked and failed.

addToCellList

protected void addToCellList(CellList list,
                             Cell cl)
I wasn't sure it would be a good idea to make the insert method of the CellList class public. So I added this method as a kludge so that subclasses can use it to add to their own instances of CellList.

Parameters:
list - The CellList to which cl will be added
cl - A Cell to add to list

setCell

public void setCell(Cell newCell)
Set the topCell to the new cell specified

Parameters:
newCell - New Cell to be checked by this DRC

getTopCell

public Cell getTopCell()
Returns a reference to the top-level cell which this DesignRuleChecker is checking

Returns:
The top-level cell.

setExpertMode

public static boolean setExpertMode(boolean newMode)
Use this method to turn expert mode on or off. If expert mode is on, only a subset of the error/warning messages will be outputted and some error messages will be downgraded to warning messages).

Parameters:
newMode - If true expert mode will be turned on.
Returns:
false if expert mode was on previously, true if expert mode was off previously.

setCurrentMsgType

protected static int setCurrentMsgType(int type)
Sets the current format of message output to that dictated by type

Parameters:
type - should be one of MSGTYPE_MUTE, MSGTYPE_WARN_ALL, MSGTYPE_ERR_ALL, MSGTYPE_ERR_EXPERTWARN, MSGTYPE_WARN_NOEXPERT, MSGTYPE_ERR_NOEXPERT, MSGTYPE_NOTICE, MSGTYPE_STATUS, MSGTYPE_NOTICE_NOEXPERT, or MSGTYPE_STATUS_NOEXPERT.

getCurrentMsgType

protected static int getCurrentMsgType()
Returns the current message outputting mode/type.

Returns:
The current message outputting mode/type.

displayMsgHeader

protected static boolean displayMsgHeader(boolean display)
Parameters:
display - If true, the message header will be displayed, otherwise, it won't.
Returns:
The previous value of displayMsgHeader

msg

protected static void msg(java.lang.String msg)
Outputs the message msg to the user based on the value of currentMessageType. The message may be supressed given an appropriate value of currentMessageType; otherwise it will go to one of the four JHDLPrintWriters of the JHDLOutput jout.

Parameters:
msg - Message to be outputted to the user.

msgln

public static void msgln(java.lang.String msg)
Outputs the message msg to the user based on the value of currentMessageType. The message may be supressed given an appropriate value of currentMessageType; otherwise it will go to one of the four JHDLPrintWriters of the JHDLOutput jout. End-of-line characters are added to the end of the outputted message.

Parameters:
msg - Message to be outputted to the user.

msg

public static void msg(java.lang.String msg,
                       int type)
Outputs the message msg to the user based on the value of type. The message may be supressed given an appropriate value of type; otherwise it will go to one of the four JHDLPrintWriters of the JHDLOutput jout.

Parameters:
msg - Message to be outputted to the user.
type - should be one of MSGTYPE_MUTE, MSGTYPE_WARN_ALL, MSGTYPE_ERR_ALL, MSGTYPE_ERR_EXPERTWARN, MSGTYPE_WARN_NOEXPERT, MSGTYPE_ERR_NOEXPERT, MSGTYPE_NOTICE, MSGTYPE_STATUS, MSGTYPE_NOTICE_NOEXPERT, or MSGTYPE_STATUS_NOEXPERT.

msgln

public static void msgln(java.lang.String msg,
                         int type)
Outputs the message msg to the user based on the value of type. The message may be supressed given an appropriate value of type; otherwise it will go to one of the four JHDLPrintWriters of the JHDLOutput jout. End-of-line characters are added to the end of the outputted message.

Parameters:
msg - Message to be outputted to the user.
type - should be one of MSGTYPE_MUTE, MSGTYPE_WARN_ALL, MSGTYPE_ERR_ALL, MSGTYPE_ERR_EXPERTWARN, MSGTYPE_WARN_NOEXPERT, MSGTYPE_ERR_NOEXPERT, MSGTYPE_NOTICE, MSGTYPE_STATUS, MSGTYPE_NOTICE_NOEXPERT, or MSGTYPE_STATUS_NOEXPERT.

msg

public static void msg(JHDLException je)
Outputs the stack trace of je to the user based on the value of currentMessageType. The message may be supressed given an appropriate value of currentMessageType; otherwise it will go to one of the four JHDLPrintWriters of the JHDLOutput jout.


msg

public static void msg(JHDLException je,
                       int type)
Outputs the stack trace of je to the user based on the value of type. The message may be supressed given an appropriate value of type; otherwise it will go to one of the four JHDLPrintWriters of the JHDLOutput jout (identifier = "DRC").

Parameters:
je - JHDLException to be outputted to the user.
type - should be one of MSGTYPE_MUTE, MSGTYPE_WARN_ALL, MSGTYPE_ERR_ALL, MSGTYPE_ERR_EXPERTWARN, MSGTYPE_WARN_NOEXPERT, MSGTYPE_ERR_NOEXPERT, MSGTYPE_NOTICE, MSGTYPE_STATUS, MSGTYPE_NOTICE_NOEXPERT, or MSGTYPE_STATUS_NOEXPERT.

checkRule

public static boolean checkRule(Cell parent,
                                Cell toCheck,
                                DesignRule rule)
A static utility methods to check one rule against a component set.

Parameters:
parent - A reference to the Cell that calls this method.
toCheck - A reference to the Cell to check the rule against.
rule - An instance of the rule class to check against.
Returns:
True if the rule passes; false otherwise.

checkRule

public static boolean checkRule(Cell parent,
                                Cell toCheck,
                                DesignRule rule,
                                DesignRuleBrowser drb)
A static utility methods to check one rule against a component set.

Parameters:
parent - A reference to the Cell that calls this method.
toCheck - A reference to the Cell to check the rule against.
rule - An instance of the rule class to check against.
drb - An instance of a DesignRuleBrowser in which to display the results.
Returns:
True if the rule passes; false otherwise.

checkRule

public static boolean checkRule(Cell parent,
                                Cell toCheck,
                                DesignRule rule,
                                boolean drbFlag)
A static utility methods to check one rule against a component set.

Parameters:
parent - A reference to the Cell that calls this method.
toCheck - A reference to the Cell to check the rule against.
rule - An instance of the rule class to check against.
Returns:
True if the rule passes; false otherwise.

checkRules

public static boolean checkRules(Cell parent,
                                 Cell toCheck,
                                 DesignRule[] rules)
A static utility methods to check a set of rules against a component set.

Parameters:
parent - A reference to the Cell that calls this method.
toCheck - A reference to the Cell to check the rule against.
rules - An array of instances of the rule class to check against.
Returns:
True if the rule passes; false otherwise.

checkRules

public static boolean checkRules(Cell parent,
                                 Cell toCheck,
                                 java.util.Vector rules)
A static utility methods to check a set of rules against a component set.

Parameters:
parent - A reference to the Cell that calls this method.
toCheck - A reference to the Cell to check the rule against.
rules - A Vector of instances of the rule class to check against.
Returns:
True if the rule passes; false otherwise.

checkRules

public static boolean checkRules(Cell parent,
                                 Cell toCheck,
                                 java.util.Vector rules,
                                 boolean useBrowser)
A static utility methods to check a set of rules against a component set.

Parameters:
parent - A reference to the Cell that calls this method.
toCheck - A reference to the Cell to check the rule against.
rules - A Vector of instances of the rule class to check against.
useBrowser - The fact that this parameter exists makes this method get called. This method opens the Design Rule Browser to report on violations.
Returns:
True if the rule passes; false otherwise.

checkRules

public static boolean checkRules(Cell parent,
                                 Cell toCheck,
                                 DesignRule rule,
                                 boolean useBrowser)
A static utility methods to check a set of rules against a component set.

Parameters:
parent - A reference to the Cell that calls this method.
toCheck - A reference to the Cell to check the rule against.
rule - A an instance of the rule class to check against.
useBrowser - The fact that this parameter exists makes this method get called. This method opens the Design Rule Browser to report on violations.
Returns:
True if the rule passes; false otherwise.

runTest

public static boolean runTest(Cell parent,
                              Cell toCheck,
                              java.util.Vector rules)
A static utility methods to check a set of rules against a component set for the purpose of checking the integrity of this class.

Parameters:
parent - A reference to the Cell that calls this method.
toCheck - A reference to the Cell to check the rule against.
rules - A Vector of instances of the rule class to check against.
Returns:
True if the rule passes; false otherwise.

registerViolation

public void registerViolation(DesignRule dr)
Registers a violation of a rule.

Parameters:
dr - The design rule that contains the violation information.

addViolatingCells

public void addViolatingCells(java.util.Vector violatingCells)
Adds the elements from the Vector passed in to the master Vector containing violating cells.

Parameters:
violatingCells - A Vector contains violating cells to add to the master Vector containing violating cells.

getDesignRuleViolations

public DesignRuleViolation[] getDesignRuleViolations()
Returns an array of violations to the previous design rule check routine

Returns:
an array of design rule violations from the last check routine

getDesignRuleViolationsArray

public DesignRuleViolation[] getDesignRuleViolationsArray()
Returns an array of violations to the previous design rule check routine.

Returns:
an array of design rule violations from the last check routine

getDesignRuleViolationsVector

public java.util.Vector getDesignRuleViolationsVector()
Returns a Vector of violations to the previous design rule check routine.

Returns:
A Vector of design rule violations from the last check routine.

getDesignRuleViolations

public DesignRuleViolation[] getDesignRuleViolations(int[] drcvIds)
Returns an array of violations to the previous design rule check routine. Only those violations whose ID's are included in the ID array are included in the returned array.

Returns:
an array of design rule violations from the last check routine.

getDesignRuleViolationsArray

public DesignRuleViolation[] getDesignRuleViolationsArray(int[] drcvIds)
Returns an array of violations to the previous design rule check routine. Only those violations whose ID's are included in the ID array are included in the returned array.

Returns:
an array of design rule violations from the last check routine.

getDesignRuleViolationsVector

public java.util.Vector getDesignRuleViolationsVector(int[] drcvIds)
This uses an algorithm of O(n^2). But n will typically be between 0 and 3, and this is called only when the DRC report is requested. If this is ever called at all. Returns a Vector of violations to the previous design rule check routine. Only those violations whose ID's are included in the ID array are included in the returned Vector.

Returns:
A Vector of design rule violations from the last check routine.

getDesignRuleViolationsForSeverityLevel

public DesignRuleViolation[] getDesignRuleViolationsForSeverityLevel(int severityLevel)
Returns the set of design rule violations for a specific severity level.

Parameters:
severityLevel - The severity level of the rule set to return.
Returns:
An array containing all violations at the requested severity level.

getDesignRuleViolationsForCells

public DesignRuleViolation[] getDesignRuleViolationsForCells(Cell[] cells)
Returns the set of design rule violations associated with a specific set of cells.

Parameters:
cells - The cells that have violations associated with it them.
Returns:
An array of violations associates with the passed cells.

addViolatingCell

public void addViolatingCell(Cell cell)
Adds a violating cell to the internal list of violating cells.

Parameters:
cell - Cell object to add to the internal list of violating cells.


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.