engine
Class Strength

java.lang.Object
  |
  +--engine.Strength

class Strength
extends java.lang.Object

Constants & functions for strength manipulation. Strengths will be represented packed as a byte value, as follows:

      7                                0
      +-+--------------+-+--------------+
      |0|  Strength0   |0|  Strength1   |          this is for an ambiguous signal (has both 0 & 1 strength) if the value is X,
      +-+--------------+-+--------------+           and for an unambiguous strength signal if value is other than X
 or:
      7                                0      \
      +-+--------------+-+--------------+      |
      |1| MinStrength1 |0| MaxStrength1 |      |   these formats are for an unambiguous value 
      +-+--------------+-+--------------+      |   signal with ambiguous strength
                                               |   (the first one for a 1 value , the second for 0)
 or:                                           |   if MinStrength == MaxStrength => a simple unambiguous signal
      7                                0       |
      +-+--------------+-+--------------+      |
      |0| MinStrength0 |1| MaxStrength0 |      |
      +-+--------------+-+--------------+     /
     
A byte with value 0xff represents an invalid strength;


Field Summary
(package private) static java.lang.String[] bitToString
           
static byte defaultStrength
           
static byte defaultTriregStrength
           
static byte formatMask
          'b10001000 masks the format bits
static byte highz
           
static byte[] initStrengthDefaults
          Default strengths for initial valus of nets.
static byte large
           
static byte medium
           
static byte nothing
          Use this to mark that a part of strngth has no relevance
static byte pull
           
(package private) static byte[] reduceTable1
          Strength reduction values for r?mos and r?tran
(package private) static byte[] reduceTable2
          Strength reduction values for ?mos and ?tran
static byte small
           
static java.lang.String[] strengthToString
           
static byte strong
           
static byte supply
           
static byte weak
           
(package private) static int X
           
(package private) static int Z
           
 
Constructor Summary
(package private) Strength()
           
 
Method Summary
static byte getMax0Strength(byte s)
           
static byte getMax1Strength(byte s)
           
static byte getStrength(byte strength0, byte strength1)
           
static byte getStrength(byte strength0, byte strength1, int bit)
          Builds the strength byte according to strengths 0, 1 and sets the mask according to bit
static byte getStrength0(byte strength)
           
static byte getStrength1(byte strength)
           
static byte getStrengthForValue(byte strength, int value)
           
static boolean isAmbiguous(byte strength, int bit)
          An ambiguous strength is either the strength of an X signel or the strength of an unambiguous signel with a range of strengths
static int reconcileDrivers(int[][] truthTable, byte strength1, byte strength2, int bit1, int bit2)
          Does all the crap needed fot strength & value reconciliation ( :-( ) Read it _ONLY_ if it's past 4A.M.
static byte reduce(byte strength, byte[] table)
          reduces the strengths according to the
static java.lang.String strengthToString(byte strength, int bit)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

nothing

public static final byte nothing
Use this to mark that a part of strngth has no relevance

supply

public static final byte supply

strong

public static final byte strong

pull

public static final byte pull

large

public static final byte large

weak

public static final byte weak

medium

public static final byte medium

small

public static final byte small

highz

public static final byte highz

reduceTable1

static final byte[] reduceTable1
Strength reduction values for r?mos and r?tran

reduceTable2

static final byte[] reduceTable2
Strength reduction values for ?mos and ?tran

initStrengthDefaults

public static final byte[] initStrengthDefaults
Default strengths for initial valus of nets. @see engine.Assignable for net types.

strengthToString

public static final java.lang.String[] strengthToString

formatMask

public static final byte formatMask
'b10001000 masks the format bits

X

static final int X

Z

static final int Z

bitToString

static final java.lang.String[] bitToString

defaultStrength

public static final byte defaultStrength

defaultTriregStrength

public static final byte defaultTriregStrength
Constructor Detail

Strength

Strength()
Method Detail

strengthToString

public static java.lang.String strengthToString(byte strength,
                                                int bit)

getStrength

public static byte getStrength(byte strength0,
                               byte strength1)

getStrength

public static byte getStrength(byte strength0,
                               byte strength1,
                               int bit)
Builds the strength byte according to strengths 0, 1 and sets the mask according to bit

getStrength1

public static byte getStrength1(byte strength)

getStrength0

public static byte getStrength0(byte strength)

getMax0Strength

public static byte getMax0Strength(byte s)
Returns:
the maximum strengh value for this strength when the signal is 0

getMax1Strength

public static byte getMax1Strength(byte s)
Returns:
the maximum strengh value for this strength when the signal is 1

reduce

public static byte reduce(byte strength,
                          byte[] table)
reduces the strengths according to the

getStrengthForValue

public static byte getStrengthForValue(byte strength,
                                       int value)
Returns:
the strength for the given value, or 0xff if the strength isn't defined

isAmbiguous

public static boolean isAmbiguous(byte strength,
                                  int bit)
An ambiguous strength is either the strength of an X signel or the strength of an unambiguous signel with a range of strengths

reconcileDrivers

public static int reconcileDrivers(int[][] truthTable,
                                   byte strength1,
                                   byte strength2,
                                   int bit1,
                                   int bit2)
Does all the crap needed fot strength & value reconciliation ( :-( ) Read it _ONLY_ if it's past 4A.M. and can't sleep.