![]() |
WarpTwin
Documentation for WarpTwin models and classes.
|
Latency model. More...
#include <LatencyUtil.hpp>
Public Member Functions | |
| LatencyUtil (SimulationExecutive &exc) | |
| int | start (int latency=0, T start_val=T()) |
| Starting the latency model. | |
| int | step (T input_value, T &output_value) |
| Step the latency model. | |
| int | reset () |
| Function for reseting the latency queue. | |
Protected Attributes | |
| std::queue< T > | _latency_queue |
| Buffer to hold latency values. | |
| SimulationExecutive & | _exc |
| Reference to the simulation executive. | |
| clockwerk::Time | _lat_sim_rate |
| Simulation rate in milliseconds. | |
| T | _default_value |
| Default value to fill the queue with. | |
| bool | _first_run = true |
| Tracks the first time the model is stepped. | |
Latency model.
This model implements a latency mechanism that delays the output value by a specified latency.
The model uses a queue to store the input values and outputs them after a specified latency. The latency is specified in milliseconds.
|
inline |
| int warptwin::LatencyUtil< T >::reset | ( | ) |
Function for reseting the latency queue.
| int warptwin::LatencyUtil< T >::start | ( | int | latency = 0, |
| T | start_val = T() ) |
Starting the latency model.
| latency | The latency in milliseconds |
| start_val | The value to start the queue with |
| int warptwin::LatencyUtil< T >::step | ( | T | input_value, |
| T & | output_value ) |
Step the latency model.
| input_value | The input value to write to the queue |
| output_value | The output value to read from the queue |
|
protected |
Default value to fill the queue with.
|
protected |
Reference to the simulation executive.
|
protected |
Tracks the first time the model is stepped.
|
protected |
Simulation rate in milliseconds.
|
protected |
Buffer to hold latency values.