byucc.jhdl.base
Class BusConnection

java.lang.Object
  extended bybyucc.jhdl.base.Connection
      extended bybyucc.jhdl.base.BusConnection

public class BusConnection
extends Connection

Used to store connection information that can be used by netlisting code. Each connection represents a single port of a cell (of any width), and is contained by only one BusNet.

Author:
Eric Blake

Field Summary
 
Fields inherited from class byucc.jhdl.base.Connection
cell, is_atomic_port, port_name_index
 
Method Summary
 int getAtomicIndex()
          This is not defined in bus-wise netlisting
 int[] getAtomicMapping()
          Returns an array of the mapping of how this connection relates to the owning Net.
 int getAtomicMappingRangeCount()
          Returns the count of distinct contiguous ranges within the AtomicMapping.
 int getAtomicMappingRangeHigh(int range)
          Returns the mapped value of the high side of the range within the AtomicMapping.
 int getAtomicMappingRangeLow(int range)
          Returns the mapped value of the low side of the range within the AtomicMapping.
 int getAtomicMappingRangePosition(int range)
          Returns the index within this connection's atomic mapping that starts the nth range.
 BusNet getBusNet()
          Accessor to the owning BusNet
 java.lang.String getIndexString()
          Returns string of index range of the port
 
Methods inherited from class byucc.jhdl.base.Connection
getCell, getCellFullName, getCellName, getPortName, getPortNameIndex, getPortWidth, isAtomicPort, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAtomicIndex

public int getAtomicIndex()
This is not defined in bus-wise netlisting

Specified by:
getAtomicIndex in class Connection
Returns:
the index of an atomic bit within the port
Throws:
BuildException - stating this method should not be used

getIndexString

public java.lang.String getIndexString()
Returns string of index range of the port

Specified by:
getIndexString in class Connection
Returns:
string of the port's index range

getAtomicMapping

public int[] getAtomicMapping()
Returns an array of the mapping of how this connection relates to the owning Net. For example, if this connection was built as concat(gw(0), range(6,4), range(2,1)), getAtomicMapping returns { 1, 2, 4, 5, 6, 0 } (Note that the least significant atomic wire index is in array slot 0). Each entry of the array is the corresponding atomic index into the owning BusNet that contains the same atomic wire.

Returns:
array containing atomicmapping of this connection's bits

getAtomicMappingRangeCount

public int getAtomicMappingRangeCount()
Returns the count of distinct contiguous ranges within the AtomicMapping. For example, if this connection was built as concat(gw(0), range(6,4), range(2,1)), getAtomicMapping() returns { 1, 2, 4, 5, 6, 0 }, so this method returns 3 (the ranges are 0, 6:4, and 2:1).

Returns:
count of ranges within the atomicmapping.

getAtomicMappingRangeLow

public int getAtomicMappingRangeLow(int range)
Returns the mapped value of the low side of the range within the AtomicMapping. For example, if getAtomicMapping() returns { 1, 2, 4, 5, 6, 0 }, then getAtomicMappingRangeLow(0) returns 1, the low order index of the lowest order range in the mapping.

Parameters:
range - the range of the mapping to check
Returns:
the atomic index into the owning BusNet for the low side of the nth contiguous range.
Throws:
BuildException - if range is invalid

getAtomicMappingRangeHigh

public int getAtomicMappingRangeHigh(int range)
Returns the mapped value of the high side of the range within the AtomicMapping. For example, if getAtomicMapping() returns { 1, 2, 4, 5, 6, 0 }, then getAtomicMappingRangeHigh(0) returns 2, the high order index of the lowest order range in the mapping.

Parameters:
range - the range of the mapping to check
Returns:
the atomic index into the owning BusNet for the high side of the nth contiguous range.
Throws:
BuildException - if range is invalid

getAtomicMappingRangePosition

public int getAtomicMappingRangePosition(int range)
Returns the index within this connection's atomic mapping that starts the nth range. For example, if getAtomicMapping() returns { 1, 2, 4, 5, 6, 0 }, then getAtomicMappingRangePosition(1) returns 2, since the range 6:4 starts in array slot 2.

Parameters:
range - the range of the mapping to check
Returns:
the index of the atomic mapping that starts the nth contiguous range.
Throws:
BuildException - if range is invalid

getBusNet

public BusNet getBusNet()
Accessor to the owning BusNet

Returns:
the owning BusNet of which this is a subset


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