Class representing a range of a port that sources data together with a list of destination ranges of other ports that should all receive the same data sent in this range.
More...
|
| void | addDestination (RuntimeRange< PortInstance > dst) |
| | Add a destination to the list of destinations of this range.
|
| int | compareTo (RuntimeRange<?> o) |
| | Override the base class to add additional comparisons so that ordering is never ambiguous.
|
| int | getNumberOfDestinationReactors () |
| | Return the total number of destination reactors for this range.
|
| SendRange | head (int newWidth) |
| | Return a new SendRange that is identical to this range but with width reduced to the specified width.
|
| List< Integer > | instances () |
| | Return the list of natural identifiers for the runtime instances in this range.
|
| List< NamedInstance<?> > | iterationOrder () |
| | Return a list containing the instance for this range and all of its parents, not including the top level reactor, in the order in which their banks and multiport channels should be iterated.
|
| SendRange | overlap (RuntimeRange<?> range) |
| | Return a range that is the subset of this range that overlaps with the specified range or null if there is no overlap.
|
| boolean | overlaps (RuntimeRange<?> range) |
| | Return true if the specified range has the same instance as this range and the ranges overlap.
|
| Set< Integer > | parentInstances (int n) |
| | Return a set of identifiers for runtime instances of a parent of this RuntimeRange's instance n levels above this RuntimeRange's instance.
|
| ReactorInstance | parentReactor () |
| | Return the nearest containing ReactorInstance for this instance.
|
| List< Integer > | permutation () |
| | Return the permutation vector that indicates the order in which the digits of the permuted mixed-radix representations of indices in this range should be incremented.
|
| List< Integer > | radixes () |
| | Return the radixes vector containing the width of this instance followed by the widths of its containers, not including the top level, which always has radix 1 and value 0.
|
| | SendRange (PortInstance instance, int start, int width, Set< ReactorInstance > interleaved, Connection connection) |
| | Create a new send range.
|
| | SendRange (RuntimeRange< PortInstance > src, RuntimeRange< PortInstance > dst, Set< ReactorInstance > interleaved, Connection connection) |
| | Create a new send range representing sending from the specified src to the specified dst.
|
| MixedRadixInt | startMR () |
| | Return the start as a new permuted mixed-radix number.
|
| SendRange | tail (int offset) |
| | Return a new SendRange that represents the leftover elements starting at the specified offset.
|
| RuntimeRange< T > | toggleInterleaved (ReactorInstance reactor) |
| | Toggle the interleaved status of the specified reactor, which is assumed to be a parent of the instance of this range.
|
| String | toString () |
Class representing a range of a port that sources data together with a list of destination ranges of other ports that should all receive the same data sent in this range.
All ranges in the destinations list have widths that are an integer multiple N of this range but not necessarily the same start offsets.
This class and subclasses are designed to be immutable. Modifications always return a new RuntimeRange.
- Author
- Edward A. Lee
Return the list of natural identifiers for the runtime instances in this range.
Each returned identifier is an integer representation of the mixed-radix number [d0, ... , dn] with radices [w0, ... , wn], where d0 is the bank or channel index of this RuntimeRange's instance, which has width w0, and dn is the bank index of its topmost parent below the top-level (main) reactor, which has width wn. The depth of this RuntimeRange's instance, therefore, is n - 1. The order of the returned list is the order in which the runtime instances should be iterated.
Return a list containing the instance for this range and all of its parents, not including the top level reactor, in the order in which their banks and multiport channels should be iterated.
For each depth at which the connection is interleaved, that parent will appear before this instance in depth order (shallower to deeper). For each depth at which the connection is not interleaved, that parent will appear after this instance in reverse depth order (deeper to shallower).
| SendRange org.lflang.generator.SendRange.newSendRange |
( |
SendRange | srcRange, |
|
|
int | srcRangeOffset ) |
|
protected |
Assuming that this SendRange is completely contained by one of the destinations of the specified srcRange, return a new SendRange where the send range is the subrange of the specified srcRange that overlaps with this SendRange and the destinations include all the destinations of this SendRange.
If the assumption is not satisfied, throw an IllegalArgumentException.
If any parent of this range is marked interleaved and is also a parent of the specified srcRange, then that parent will be marked interleaved in the result.
- Parameters
-
| srcRange | A new source range. |
| srcRangeOffset | An offset into the source range. |
Return a set of identifiers for runtime instances of a parent of this RuntimeRange's instance n levels above this RuntimeRange's instance.
If n == 1, for example, then this return the identifiers for the parent ReactorInstance.
This returns a list of natural identifiers, as defined below, for the instances within the range.
The resulting list can be used to count the number of distinct runtime instances of this RuntimeRange's instance (using n == 0) or any of its parents that lie within the range and to provide an index into an array of runtime instances.
Each natural identifier is the integer value of a mixed-radix number defined as follows:
- The low-order digit is the index of the runtime instance of i within its container. If the
NamedInstance is a PortInstance, this will be the multiport channel or 0 if it is not a multiport. If the NamedInstance is a ReactorInstance, then it will be the bank index or 0 if the reactor is not a bank. The radix for this digit will be the multiport width or bank width or 1 if the NamedInstance is neither a multiport nor a bank.
- The next digit will be the bank index of the container of the specified
NamedInstance or 0 if it is not a bank.
- The remaining digits will be bank indices of containers up to but not including the top-level reactor (there is no point in including the top-level reactor because it is never a bank).
- Each index that is returned can be used as an index into an array of runtime instances that is assumed to be in a natural order.
- Parameters
-
| n | The number of levels up of the parent. This is required to be less than the depth of this RuntimeRange's instance or an exception will be thrown. |