byucc.jhdl.DRC
Class DesignRule

java.lang.Object
  extended bybyucc.jhdl.DRC.DesignRule
All Implemented Interfaces:
DesignRuleConstants
Direct Known Subclasses:
AddPropertyMissing, Bufg, ClockWires, DeadHardware, IBufsAndOBufs, IOBufs, MultipleDrivers, NoConnect, Template

public abstract class DesignRule
extends java.lang.Object
implements DesignRuleConstants

This class is to be the super class of Design Rule subclasses. This class offers an interface through which subclasses of the DesignRuleChecker class can perform individual design rule checks. This system will allow us to easily create unique design rules to be added to the DesignRuleChecker.

Author:
Michael Halcrow , Anthony L. Slade

Field Summary
protected  CellList cellList
           
protected  DesignRuleChecker checker
          A reference to the DesignRuleChecker in which this rule is used.
protected  boolean checkOk
          Whether the most recent check of this instance of the rule was okay
protected  java.lang.String description
          A full text description of this rule
protected  boolean enabled
          Enabled flag
protected  java.lang.String failureReport
          Contains a String description of the failure of this rule
protected  java.lang.String name
          The name of this rule
protected  java.lang.String oneLineDescription
          A one-line (80-character) text description of this rule
protected  java.util.Vector violatingCells
          Contains a list of the cells involved in a violation.
 
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
DesignRule()
          Constructor for the DesignRule class.
 
Method Summary
protected  void addToCellList(Cell cl)
           
protected static 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.
protected  void addViolatingCell(Cell vCell)
          Adds a violating cell to the violatingCells Vector.
 boolean checkOk()
          Indicates whether or not the most recent run for this rule passed.
protected static boolean displayMsgHeader(boolean display)
           
protected abstract  boolean doCheck()
          Initiates the design rule check for this DesignRule.
 java.lang.String getDescription()
          Returns the string description for this rule.
 DesignRuleChecker getDesignRuleChecker()
          Utility method to return a reference to the DesignRuleChecker class that houses this rule.
 java.lang.String getName()
          Returns the name of this rule.
 java.lang.String getOneLineDescription()
          Returns the one-line (80-character) string description for this rule.
 java.lang.String getReport()
          Returns a string containing a full failure report from the last check against this rule.
 java.util.Vector getViolatingCells()
          A utility class for returning a reference to the Vector object containing references to all the violating cells from the last time this rule was checked.
protected static void msg(JHDLException je)
          Outputs the stack trace of je to the user based on the value of currentMessageType.
protected 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.
protected static void msg(java.lang.String msg, int type)
          Outputs the message msg to the user based on the value of type.
protected static void msgln(java.lang.String msg)
          Outputs the message msg to the user based on the value of currentMessageType.
protected static void msgln(java.lang.String msg, int type)
          Outputs the message msg to the user based on the value of type.
 void registerViolation()
          Registers that the most recent run against this rule failed.
 void resetState()
          Resets all flags to their default values in this instance of DesignRule
protected static int setCurrentMsgType(int type)
          Sets the current format of message output to that dictated by type
 void setDesignRuleCheckerReference(DesignRuleChecker checker)
          Sets the local reference to the DesignRuleChecker object for this rule.
 void setName(java.lang.String name)
          Sets the name of this rule.
protected  void setReport(java.lang.String report)
          Sets the report.
protected abstract  void sortCell(Cell cl)
          To be implemented by subclasses so they may sort cells into appropriate containers.
 java.lang.String toString()
          Returns the name of the rule object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

violatingCells

protected java.util.Vector violatingCells
Contains a list of the cells involved in a violation.


cellList

protected CellList cellList

oneLineDescription

protected java.lang.String oneLineDescription
A one-line (80-character) text description of this rule


description

protected java.lang.String description
A full text description of this rule


name

protected java.lang.String name
The name of this rule


enabled

protected boolean enabled
Enabled flag


checkOk

protected boolean checkOk
Whether the most recent check of this instance of the rule was okay


failureReport

protected java.lang.String failureReport
Contains a String description of the failure of this rule


checker

protected DesignRuleChecker checker
A reference to the DesignRuleChecker in which this rule is used. This allows this DesignRule to have access to some of the special methods and features of that checker.

Constructor Detail

DesignRule

public DesignRule()
Constructor for the DesignRule class.

Method Detail

getDesignRuleChecker

public DesignRuleChecker getDesignRuleChecker()
Utility method to return a reference to the DesignRuleChecker class that houses this rule. Note that this implies that only one checker at any given time should reference any particular DesignRule object.

Returns:
A reference to the DesignRuleChecker that references this rule.

doCheck

protected abstract boolean doCheck()
Initiates the design rule check for this DesignRule. Before this method is called, the sortCell method is called on all of the descendants of the top-level cell. This must be implemented by the writer of the design rule.

Returns:
true if the design rule checked is kept, otherwise false.

sortCell

protected abstract void sortCell(Cell cl)
To be implemented by subclasses so they may sort cells into appropriate containers. This method is called by the DesignRuleChecker for each descendant of the top-level cell. The DesignRuleChecker calls this method before it calls the doCheck method. Note this this may not apply to sorting cells only; for example, it could deal with wires, where the design rule only applied to the properties of the wires.

Parameters:
cl - A subcell of the top-level design. The sorting method may look at its Class (or its attributes) to determine whether it will store a reference to it. It may alternatively store the wires attached to it.

addToCellList

protected static 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 {Anthony}. This does not reference any local variables, so I changed it to a static utility method {Michael}.

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

addToCellList

protected void addToCellList(Cell cl)

getViolatingCells

public java.util.Vector getViolatingCells()
A utility class for returning a reference to the Vector object containing references to all the violating cells from the last time this rule was checked.

Returns:
A reference to the Vector object containing references to all the violating cells from the last time this rule was checked.

addViolatingCell

protected void addViolatingCell(Cell vCell)
Adds a violating cell to the violatingCells Vector.

Parameters:
vCell - The violating cell to add to the violatingCells Vector.

getName

public java.lang.String getName()
Returns the name of this rule.


setName

public void setName(java.lang.String name)
Sets the name of this rule.


setDesignRuleCheckerReference

public void setDesignRuleCheckerReference(DesignRuleChecker checker)
Sets the local reference to the DesignRuleChecker object for this rule.


checkOk

public boolean checkOk()
Indicates whether or not the most recent run for this rule passed.


registerViolation

public void registerViolation()
Registers that the most recent run against this rule failed.


resetState

public void resetState()
Resets all flags to their default values in this instance of DesignRule


getReport

public java.lang.String getReport()
Returns a string containing a full failure report from the last check against this rule.

Returns:
a string containing a full failure report from the last check against this rule.

getDescription

public java.lang.String getDescription()
Returns the string description for this rule.

Returns:
the string description for this rule.

getOneLineDescription

public java.lang.String getOneLineDescription()
Returns the one-line (80-character) string description for this rule.

Returns:
the one-line (80-character) string description for this rule.

setReport

protected void setReport(java.lang.String report)
Sets the report.


toString

public java.lang.String toString()
Returns the name of the rule object.


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.

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 joutDRC.

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

msgln

protected 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 joutDRC. End-of-line characters are added to the end of the outputted message.

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

msg

protected 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 joutDRC.

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

protected 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 joutDRC. 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

protected 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 joutDRC.


msg

protected 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 joutDRC (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.


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