com.newisys.dv
Interface InputSignal

All Superinterfaces:
Signal
All Known Subinterfaces:
ClockSignal, InOutSignal
All Known Implementing Classes:
PortSignalWrapper

public interface InputSignal
extends Signal

Represents an input signal (or multiple-bit input signal bus). It provides methods that:


Method Summary
 Event getChangeEvent(BitVector mask, boolean async)
          Returns an event that will be notified each time any of the signal bits corresponding to the given mask changes value.
 Event getEdgeEvent(com.newisys.verilog.EdgeSet edges, int bit, boolean async)
          Returns an event that will be notified each time the given bit of this signal reaches an edge in the given set.
 int getInputDepth()
          Returns the sample buffer depth for this signal, which is the number of samples stored for back-references.
 com.newisys.verilog.EdgeSet getInputEdges()
          Returns the set of clock edges this signal is sampled at.
 int getInputSkew()
          Returns the skew (in simulator ticks) relative to the clock edge at which this signal is sampled.
 BitVector sample()
          Samples the value of this signal, after synchronizing to the sample edge of the clock, as if by a call to syncSample().
 BitVector sampleAsync()
          Samples the value of this signal immediately, without synchronizing to the sample edge of the clock.
 BitVector sampleDepth(int depth)
          Returns the value of this signal the given number of cycles in the past, after synchronizing to the sample edge of the clock, as if by a call to syncSample().
 BitVector sampleDepthAsync(int depth)
          Returns the value of this signal the given number of cycles in the past, without synchronizing to the sample edge of the clock.
 void syncChange()
          Suspends this thread until a) (any bit of) this signal changes value and then b) the clock for this signal reaches its next sample edge.
 void syncChange(BitVector mask)
          Suspends this thread until a) one of the signal bits corresponding to the given mask changes value and then b) the clock for this signal reaches its next sample edge.
 void syncChangeAsync()
          Suspends this thread until (any bit of) this signal changes value.
 void syncChangeAsync(BitVector mask)
          Suspends this thread until one of the signal bits corresponding to the given mask changes value.
 void syncEdge(com.newisys.verilog.EdgeSet edges)
          Suspends this thread until a) (the low bit of) this signal reaches an edge in the given set and then b) the clock for this signal reaches its next sample edge.
 void syncEdge(com.newisys.verilog.EdgeSet edges, int bit)
          Suspends this thread until a) the given bit of this signal reaches an edge in the given set and then b) the clock for this signal reaches its next sample edge.
 void syncEdgeAsync(com.newisys.verilog.EdgeSet edges)
          Suspends this thread until (the low bit of) this signal reaches an edge in the given set.
 void syncEdgeAsync(com.newisys.verilog.EdgeSet edges, int bit)
          Suspends this thread until the given bit of this signal reaches an edge in the given set.
 void syncSample()
          Suspends this thread until the clock for this signal is at the sample edge.
 void syncSampleDelay(int cycles)
          Suspends this thread until the clock for this signal reaches the sample edge the given number of times.
 
Methods inherited from interface com.newisys.dv.Signal
getClock, getName, getSize
 

Method Detail

getInputEdges

com.newisys.verilog.EdgeSet getInputEdges()
Returns the set of clock edges this signal is sampled at.

Returns:
the sample edge set

getInputSkew

int getInputSkew()
Returns the skew (in simulator ticks) relative to the clock edge at which this signal is sampled. The skew can be any non-positive integer, though the use of zero skew is not recommended for input signals. For in/out signals, the skew must be negative. For clock signals, the skew is always 0.

Returns:
the sample skew

getInputDepth

int getInputDepth()
Returns the sample buffer depth for this signal, which is the number of samples stored for back-references. The depth is always at least 1.

Returns:
the sample buffer depth
See Also:
sampleDepth(int)

sample

BitVector sample()
Samples the value of this signal, after synchronizing to the sample edge of the clock, as if by a call to syncSample().

Returns:
the value of this signal
See Also:
syncSample()

sampleDepth

BitVector sampleDepth(int depth)
Returns the value of this signal the given number of cycles in the past, after synchronizing to the sample edge of the clock, as if by a call to syncSample(). The given depth must be >= 0 and less than the sample buffer depth of this signal, as returned by getInputDepth(). Calling this method with depth 0 is equivalent to calling sample().

Parameters:
depth - the number of cycles in the past
Returns:
the value of this signal
See Also:
syncSample(), getInputDepth()

sampleAsync

BitVector sampleAsync()
Samples the value of this signal immediately, without synchronizing to the sample edge of the clock.

Returns:
the value of this signal

sampleDepthAsync

BitVector sampleDepthAsync(int depth)
Returns the value of this signal the given number of cycles in the past, without synchronizing to the sample edge of the clock. The given depth must be >= 0 and less than the sample buffer depth of this signal, as returned by getInputDepth(). Calling this method with depth 0 returns the value of this signal at the last clock edge.

Parameters:
depth - the number of cycles in the past
Returns:
the value of this signal
See Also:
getInputDepth()

syncSample

void syncSample()
Suspends this thread until the clock for this signal is at the sample edge. If the clock is already at the sample edge, this method returns immediately.


syncSampleDelay

void syncSampleDelay(int cycles)
Suspends this thread until the clock for this signal reaches the sample edge the given number of times. If cycles is 1, this method waits for the next sample edge. If cycles is 0 and the clock is already at the sample edge, this method returns immediately. In other words, syncSampleDelay(0) is equivalent to syncSample().

Parameters:
cycles - the number of times the sample edge must be observed

syncEdge

void syncEdge(com.newisys.verilog.EdgeSet edges)
Suspends this thread until a) (the low bit of) this signal reaches an edge in the given set and then b) the clock for this signal reaches its next sample edge. At the time of the call, if the last transition of the signal in the current cycle matches the given edge set, condition a) is considered satisfied and this method simply waits for condition b). This method is intended for use with single bit signals; for multiple bit signals, use syncEdge(EdgeSet, int).

Parameters:
edges - the set of edges to wait for
See Also:
syncEdge(EdgeSet, int)

syncEdge

void syncEdge(com.newisys.verilog.EdgeSet edges,
              int bit)
Suspends this thread until a) the given bit of this signal reaches an edge in the given set and then b) the clock for this signal reaches its next sample edge. At the time of the call, if the last transition of the signal in the current cycle matches the given edge set, condition a) is considered satisfied and this method simply waits for condition b).

Parameters:
edges - the set of edges to wait for
bit - the index of the bit to wait for the edge on

syncEdgeAsync

void syncEdgeAsync(com.newisys.verilog.EdgeSet edges)
Suspends this thread until (the low bit of) this signal reaches an edge in the given set. This method does not synchronize to the sample edge of the clock. This method is intended for use with single bit signals; for multiple bit signals, use syncEdgeAsync(EdgeSet, int).

Parameters:
edges - the set of edges to wait for
See Also:
syncEdgeAsync(EdgeSet, int)

syncEdgeAsync

void syncEdgeAsync(com.newisys.verilog.EdgeSet edges,
                   int bit)
Suspends this thread until the given bit of this signal reaches an edge in the given set. This method does not synchronize to the sample edge of the clock.

Parameters:
edges - the set of edges to wait for
bit - the index of the bit to wait for the edge on

getEdgeEvent

Event getEdgeEvent(com.newisys.verilog.EdgeSet edges,
                   int bit,
                   boolean async)
Returns an event that will be notified each time the given bit of this signal reaches an edge in the given set. Unless the async flag is set, the event is not notified until the next sample edge of the clock.

Parameters:
edges - the set of edges to wait for
bit - the index of the bit to wait for edges on
async - indicates not to wait for the next sample edge
Returns:
an event notified each time the requested edge(s) occurs

syncChange

void syncChange()
Suspends this thread until a) (any bit of) this signal changes value and then b) the clock for this signal reaches its next sample edge. At the time of the call, if the signal has changed value in the current cycle, condition a) is considered satisfied and this method simply waits for condition b).


syncChange

void syncChange(BitVector mask)
Suspends this thread until a) one of the signal bits corresponding to the given mask changes value and then b) the clock for this signal reaches its next sample edge. At the time of the call, if the signal has changed value in the current cycle, condition a) is considered satisfied and this method simply waits for condition b).

Parameters:
mask - a bit vector containing a ONE for each signal bit to watch, or null to watch the entire signal

syncChangeAsync

void syncChangeAsync()
Suspends this thread until (any bit of) this signal changes value. This method does not synchronize to the sample edge of the clock.


syncChangeAsync

void syncChangeAsync(BitVector mask)
Suspends this thread until one of the signal bits corresponding to the given mask changes value. This method does not synchronize to the sample edge of the clock.

Parameters:
mask - a bit vector containing a ONE for each signal bit to watch, or null to watch the entire signal

getChangeEvent

Event getChangeEvent(BitVector mask,
                     boolean async)
Returns an event that will be notified each time any of the signal bits corresponding to the given mask changes value. Unless the async flag is set, the event is not notified until the next sample edge of the clock.

Parameters:
mask - a bit vector containing a ONE for each signal bit to watch, or null to watch the entire signal
async - indicates not to wait for the next sample edge
Returns:
an event notified each time the requested change occurs