The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::Pipeline< DataT, EventT > Class Template Reference

A simple pipeline. More...

#include <Pipeline.hpp>

Classes

class  PipelineIterator
 An iterator class for Pipeline class. More...
 

Public Types

enum class  Precedence { NONE , FORWARD , BACKWARD , NUM_OF_PRECEDENCE }
 
using size_type = uint32_t
 
using value_type = DataT
 
using EventHandle = std::unique_ptr< EventT >
 
using EventHandleList = std::list< EventHandle >
 
using EventList = std::list< EventT * >
 
using EventMatrix = std::array< EventList, NUM_SCHEDULING_PHASES >
 
using iterator = PipelineIterator< false >
 
using const_iterator = PipelineIterator< true >
 

Public Member Functions

iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cend () const
 
 Pipeline (EventSet *es, const std::string &name, const uint32_t num_stages, const Clock *clk)
 Construct a Pipeline object by existed event set.
 
 Pipeline (const std::string &name, const uint32_t num_stages, const Clock *clk)
 Construct a Pipeline object.
 
template<SchedulingPhase sched_phase = SchedulingPhase::Tick>
void registerHandlerAtStage (const uint32_t &id, const SpartaHandler &handler)
 Register event handler for a designated pipeline stage.
 
void setPrecedenceBetweenStage (const uint32_t &pid, const uint32_t &cid)
 Specify precedence between two different stages within the same pipeline instance.
 
template<class DataT2 , class EventT2 >
void setPrecedenceBetweenPipeline (const uint32_t &pid, Pipeline< DataT2, EventT2 > &c_pipeline, const uint32_t &cid)
 Specify precedence between two stages from different pipeline instances.
 
void setDefaultStagePrecedence (const Precedence &default_precedence)
 Specify precedence of pipeline stage-handling events as forward/backward stage order.
 
template<typename EventType >
void setProducerForPipelineUpdate (EventType &ev_handler)
 Specify producer event for the pipeline update event.
 
template<typename EventType >
void setConsumerForPipelineUpdate (EventType &ev_handler)
 Specify consumer event for the pipeline update event.
 
template<typename EventType >
void setProducerForStage (const uint32_t &id, EventType &ev_handler)
 Specify producer event for a designated pipeline stage.
 
template<typename EventType >
void setConsumerForStage (const uint32_t &id, EventType &ev_handler)
 Specify consumer event for a designated pipeline stage.
 
EventList & getEventsAtStage (const uint32_t &id, const SchedulingPhase phase=SchedulingPhase::Tick)
 Get events at a stage for a particular scheduling phase.
 
bool isEventRegisteredAtStage (const uint32_t &id) const
 Check if any event is registered at a designated pipeline stage.
 
void activateEventAtStage (const uint32_t &id)
 Activate event for a designated pipeline stage.
 
void deactivateEventAtStage (const uint32_t &id)
 Deactivate event for a designated pipeline stage.
 
void append (const DataT &item)
 Append data to the beginning of the pipeline.
 
void append (DataT &&item)
 Append data to the beginning of the pipeline.
 
bool isAppended () const
 Is the pipe already appended data?
 
const DataT & readAppendedData () const
 Get the data just appended; it will assert if no data appended.
 
void writeStage (const uint32_t &stage_id, const DataT &item)
 Modify a specific stage of the pipeline.
 
void writeStage (const uint32_t &stage_id, DataT &&item)
 Modify a specific stage of the pipeline.
 
void invalidateStage (const uint32_t &stage_id)
 Invalidate a specific stage of the pipeline.
 
void stall (const uint32_t &stall_stage_id, const uint32_t &stall_cycles, const bool crush_bubbles=false, const bool suppress_events=true)
 Stall the pipeline up to designated stage for a specified number of cycles.
 
bool isStalledOrStalling () const
 Check if the pipeline will be stalled the very next cycle.
 
bool isStalledOrStallingAtStage (const uint32_t &stage_id) const
 Check if the designated pipeline stage will be stalled the very next cycle.
 
void flushStage (const uint32_t &flush_stage_id)
 Flush a specific stage of the pipeline using stage id.
 
void flushStage (const const_iterator &const_iter)
 Flush a specific stage of the pipeline using const iterator.
 
void flushStage (const iterator &iter)
 Flush a specific stage of the pipeline using non-const iterator.
 
void flushAllStages ()
 Flush all stages of the pipeline.
 
void flushAppend ()
 Flush the data just appended.
 
void setContinuing (const bool value)
 set whether the update event is continuing or not
 
const DataT & operator[] (const uint32_t &stage_id) const
 Access (read-only) a specific stage of the pipeline.
 
DataT & operator[] (const uint32_t &stage_id)
 Access a specific stage of the pipeline.
 
const DataT & at (const uint32_t &stage_id) const
 Access (read-only) a specific stage of the pipeline.
 
DataT & at (const uint32_t &stage_id)
 Access a specific stage of the pipeline.
 
bool isValid (const uint32_t &stage_id) const
 Indicate the validity of a specific pipeline stage.
 
bool isLastValid () const
 Indicate the validity of the last pipeline stage.
 
bool isAnyValid () const
 Indicate the validity of the whole pipeline.
 
uint32_t numValid () const
 Indicate the number of valid pipeline stages.
 
bool empty () const
 Indicate no valid pipeline stages.
 
uint32_t size () const
 Indicate the pipeline size.
 
uint32_t capacity () const
 Indicate the pipeline capacity.
 
void performOwnUpdates ()
 Ask pipeline to perform its own update.
 
void update ()
 Manually update pipeline (i.e. data-movement and event-scheduling)
 
template<SchedulingPhase phase = SchedulingPhase::Collection>
void enableCollection (TreeNode *parent)
 Enable pipeline collection.
 
bool isCollected () const
 Check if pipeline is collecting.
 

Detailed Description

template<typename DataT, typename EventT = PhasedUniqueEvent>
class sparta::Pipeline< DataT, EventT >

A simple pipeline.

The sparta::Pipeline class is intended to provide an efficient and flexible event scheduling framework for modeling generic pipeline concept.

It contains a sparta::Pipe, and couples event-scheduling (i.e. control-flow path), with the data-movement (i.e. data-flow path) provided by sparta::Pipe.

Template parameter DataT specifies the type of data flowing through pipeline stages, and EventT can be specified by 2 Event types: PhasedUniqueEvent (default) and PhasedPayloadEvent<DataT>. The difference between both types is related to what kind of SpartaHandler modelers are going to register at stages. With default PhasedUniqueEvent, you can register a SpartaHandler with no data; or, with PhasedPayloadEvent<DataT>, you can register a SpartaHandler with data of type DataT. Pipeline will prepare payload and pass data of the stage to every handler.

The sparta::Pipeline is able to provide modelers with the following design capability:

  1. Register event handler(s) for designated pipeline stage(s), sparse stage handler registration is supported.
  2. Specify precedence between two pipeline stage(s).
  3. Specify producer-consumer relationship between pipeline stage handling event(s) and other user-defined event(s).
  4. Read and check validity of pipeline data at designated pipeline stage(s).
  5. Append, write/modify, invalidate, or flush data at designated pipeline stage(s).
  6. Perform manual or automatic pipeline update (i.e. forward progression). The registered pipeline stage handlers are called under-the-hood whenever valid pipeline data arrives.

Definition at line 62 of file Pipeline.hpp.

Member Typedef Documentation

◆ const_iterator

template<typename DataT , typename EventT = PhasedUniqueEvent>
using sparta::Pipeline< DataT, EventT >::const_iterator = PipelineIterator<true>

Definition at line 219 of file Pipeline.hpp.

◆ EventHandle

template<typename DataT , typename EventT = PhasedUniqueEvent>
using sparta::Pipeline< DataT, EventT >::EventHandle = std::unique_ptr<EventT>

Definition at line 67 of file Pipeline.hpp.

◆ EventHandleList

template<typename DataT , typename EventT = PhasedUniqueEvent>
using sparta::Pipeline< DataT, EventT >::EventHandleList = std::list<EventHandle>

Definition at line 68 of file Pipeline.hpp.

◆ EventList

template<typename DataT , typename EventT = PhasedUniqueEvent>
using sparta::Pipeline< DataT, EventT >::EventList = std::list<EventT*>

Definition at line 69 of file Pipeline.hpp.

◆ EventMatrix

template<typename DataT , typename EventT = PhasedUniqueEvent>
using sparta::Pipeline< DataT, EventT >::EventMatrix = std::array<EventList, NUM_SCHEDULING_PHASES>

Definition at line 70 of file Pipeline.hpp.

◆ iterator

template<typename DataT , typename EventT = PhasedUniqueEvent>
using sparta::Pipeline< DataT, EventT >::iterator = PipelineIterator<false>

Definition at line 218 of file Pipeline.hpp.

◆ size_type

template<typename DataT , typename EventT = PhasedUniqueEvent>
using sparta::Pipeline< DataT, EventT >::size_type = uint32_t

Definition at line 65 of file Pipeline.hpp.

◆ value_type

template<typename DataT , typename EventT = PhasedUniqueEvent>
using sparta::Pipeline< DataT, EventT >::value_type = DataT

Definition at line 66 of file Pipeline.hpp.

Member Enumeration Documentation

◆ Precedence

template<typename DataT , typename EventT = PhasedUniqueEvent>
enum class sparta::Pipeline::Precedence
strong

Definition at line 76 of file Pipeline.hpp.

Constructor & Destructor Documentation

◆ Pipeline() [1/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
sparta::Pipeline< DataT, EventT >::Pipeline ( EventSet es,
const std::string &  name,
const uint32_t  num_stages,
const Clock clk 
)
inline

Construct a Pipeline object by existed event set.

Parameters
esThe pointer to existed event set
nameThe name of Pipeline object
num_stagesThe number of pipeline stages
clkThe clock this pipeline synchronized to

Definition at line 237 of file Pipeline.hpp.

Here is the call graph for this function:

◆ Pipeline() [2/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
sparta::Pipeline< DataT, EventT >::Pipeline ( const std::string &  name,
const uint32_t  num_stages,
const Clock clk 
)
inline

Construct a Pipeline object.

Parameters
nameThe name of Pipeline object
num_stagesThe number of pipeline stages
clkThe clock this pipeline synchronized to

Definition at line 275 of file Pipeline.hpp.

Member Function Documentation

◆ activateEventAtStage()

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::activateEventAtStage ( const uint32_t &  id)
inline

Activate event for a designated pipeline stage.

Parameters
idThe stage number
Note
This function can ONLY be called when there is already a registered event handler for the designated pipeline stage.

Definition at line 589 of file Pipeline.hpp.

Here is the call graph for this function:

◆ append() [1/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::append ( const DataT &  item)
inline

Append data to the beginning of the pipeline.

Parameters
itemThe data to be appended to the front of pipeline

Definition at line 622 of file Pipeline.hpp.

◆ append() [2/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::append ( DataT &&  item)
inline

Append data to the beginning of the pipeline.

Parameters
itemThe data to be appended to the front of pipeline

Definition at line 632 of file Pipeline.hpp.

◆ at() [1/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
DataT & sparta::Pipeline< DataT, EventT >::at ( const uint32_t &  stage_id)
inline

Access a specific stage of the pipeline.

Parameters
stage_idThe stage number

Definition at line 829 of file Pipeline.hpp.

◆ at() [2/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
const DataT & sparta::Pipeline< DataT, EventT >::at ( const uint32_t &  stage_id) const
inline

Access (read-only) a specific stage of the pipeline.

Parameters
stage_idThe stage number

Definition at line 822 of file Pipeline.hpp.

◆ begin() [1/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
iterator sparta::Pipeline< DataT, EventT >::begin ( )
inline

Definition at line 221 of file Pipeline.hpp.

◆ begin() [2/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
const_iterator sparta::Pipeline< DataT, EventT >::begin ( ) const
inline

Definition at line 222 of file Pipeline.hpp.

◆ capacity()

template<typename DataT , typename EventT = PhasedUniqueEvent>
uint32_t sparta::Pipeline< DataT, EventT >::capacity ( ) const
inline

Indicate the pipeline capacity.

Definition at line 854 of file Pipeline.hpp.

◆ cbegin()

template<typename DataT , typename EventT = PhasedUniqueEvent>
const_iterator sparta::Pipeline< DataT, EventT >::cbegin ( ) const
inline

Definition at line 223 of file Pipeline.hpp.

◆ cend()

template<typename DataT , typename EventT = PhasedUniqueEvent>
const_iterator sparta::Pipeline< DataT, EventT >::cend ( ) const
inline

Definition at line 227 of file Pipeline.hpp.

◆ deactivateEventAtStage()

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::deactivateEventAtStage ( const uint32_t &  id)
inline

Deactivate event for a designated pipeline stage.

Parameters
idThe stage number
Note
This function can ONLY be called when there is already a registered event handler for the designated pipeline stage.

Definition at line 607 of file Pipeline.hpp.

Here is the call graph for this function:

◆ empty()

template<typename DataT , typename EventT = PhasedUniqueEvent>
bool sparta::Pipeline< DataT, EventT >::empty ( ) const
inline

Indicate no valid pipeline stages.

Definition at line 848 of file Pipeline.hpp.

Here is the call graph for this function:

◆ enableCollection()

template<typename DataT , typename EventT = PhasedUniqueEvent>
template<SchedulingPhase phase = SchedulingPhase::Collection>
void sparta::Pipeline< DataT, EventT >::enableCollection ( TreeNode parent)
inline

Enable pipeline collection.

Parameters
parentA pointer to the parent treenode for which to add Collectable objects under.
Note
This only sets the Pipeline up for collection. Collection must be started with an instatiation of the PipelineCollector.

Definition at line 903 of file Pipeline.hpp.

◆ end() [1/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
iterator sparta::Pipeline< DataT, EventT >::end ( )
inline

Definition at line 225 of file Pipeline.hpp.

◆ end() [2/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
const_iterator sparta::Pipeline< DataT, EventT >::end ( ) const
inline

Definition at line 226 of file Pipeline.hpp.

◆ flushAllStages()

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::flushAllStages ( )
inline

Flush all stages of the pipeline.

Definition at line 777 of file Pipeline.hpp.

Here is the call graph for this function:

◆ flushAppend()

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::flushAppend ( )
inline

Flush the data just appended.

Definition at line 786 of file Pipeline.hpp.

◆ flushStage() [1/3]

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::flushStage ( const const_iterator const_iter)
inline

Flush a specific stage of the pipeline using const iterator.

Parameters
const_iterA const iterator pointing to a specific pipeline stage

Definition at line 761 of file Pipeline.hpp.

Here is the call graph for this function:

◆ flushStage() [2/3]

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::flushStage ( const iterator iter)
inline

Flush a specific stage of the pipeline using non-const iterator.

Parameters
iterA non-const iterator pointing to a specific pipeline stage

Definition at line 770 of file Pipeline.hpp.

Here is the call graph for this function:

◆ flushStage() [3/3]

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::flushStage ( const uint32_t &  flush_stage_id)
inline

Flush a specific stage of the pipeline using stage id.

Parameters
stage_idThe stage number
Note
All the pipeline stage handling events (after SchedulingPhase::Flush) will be cancelled. If the pipeline stage is stalled or about to stall, and the flushing stage happens to be the stall-causing stage, then the pipeline stall will be cancelled also.

Definition at line 743 of file Pipeline.hpp.

Here is the call graph for this function:

◆ getEventsAtStage()

template<typename DataT , typename EventT = PhasedUniqueEvent>
EventList & sparta::Pipeline< DataT, EventT >::getEventsAtStage ( const uint32_t &  id,
const SchedulingPhase  phase = SchedulingPhase::Tick 
)
inline

Get events at a stage for a particular scheduling phase.

Parameters
idThe stage number
Note
This function can ONLY be called when there is already a registered event handler for the designated pipeline stage.

Definition at line 550 of file Pipeline.hpp.

◆ invalidateStage()

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::invalidateStage ( const uint32_t &  stage_id)
inline

Invalidate a specific stage of the pipeline.

Parameters
stage_idThe stage number

Definition at line 681 of file Pipeline.hpp.

Here is the call graph for this function:

◆ isAnyValid()

template<typename DataT , typename EventT = PhasedUniqueEvent>
bool sparta::Pipeline< DataT, EventT >::isAnyValid ( ) const
inline

Indicate the validity of the whole pipeline.

Definition at line 842 of file Pipeline.hpp.

◆ isAppended()

template<typename DataT , typename EventT = PhasedUniqueEvent>
bool sparta::Pipeline< DataT, EventT >::isAppended ( ) const
inline

Is the pipe already appended data?

Definition at line 640 of file Pipeline.hpp.

◆ isCollected()

template<typename DataT , typename EventT = PhasedUniqueEvent>
bool sparta::Pipeline< DataT, EventT >::isCollected ( ) const
inline

Check if pipeline is collecting.

Definition at line 908 of file Pipeline.hpp.

◆ isEventRegisteredAtStage()

template<typename DataT , typename EventT = PhasedUniqueEvent>
bool sparta::Pipeline< DataT, EventT >::isEventRegisteredAtStage ( const uint32_t &  id) const
inline

Check if any event is registered at a designated pipeline stage.

Parameters
idThe stage number
Note
The function needs to be called before activating/deactivating event for a designated stage if the user is not sure whether this stage has been registered with any event.

Definition at line 573 of file Pipeline.hpp.

Here is the call graph for this function:

◆ isLastValid()

template<typename DataT , typename EventT = PhasedUniqueEvent>
bool sparta::Pipeline< DataT, EventT >::isLastValid ( ) const
inline

Indicate the validity of the last pipeline stage.

Definition at line 839 of file Pipeline.hpp.

◆ isStalledOrStalling()

template<typename DataT , typename EventT = PhasedUniqueEvent>
bool sparta::Pipeline< DataT, EventT >::isStalledOrStalling ( ) const
inline

Check if the pipeline will be stalled the very next cycle.

Note
This implies either of the following two cases:
  • The pipeline is already stalled, and needs to stall (at least 1) more cycle(s).
  • The pipeline not stalled, but is about to stall next cycle.

Definition at line 722 of file Pipeline.hpp.

◆ isStalledOrStallingAtStage()

template<typename DataT , typename EventT = PhasedUniqueEvent>
bool sparta::Pipeline< DataT, EventT >::isStalledOrStallingAtStage ( const uint32_t &  stage_id) const
inline

Check if the designated pipeline stage will be stalled the very next cycle.

Note
This implies either of the following two cases:
  • The pipeline stage is already stalled, and needs to stall (at least 1) more cycle(s).
  • The pipeline stage is not stalled, but is about to stall next cycle.

Definition at line 732 of file Pipeline.hpp.

Here is the call graph for this function:

◆ isValid()

template<typename DataT , typename EventT = PhasedUniqueEvent>
bool sparta::Pipeline< DataT, EventT >::isValid ( const uint32_t &  stage_id) const
inline

Indicate the validity of a specific pipeline stage.

Parameters
stage_idThe stage number

Definition at line 836 of file Pipeline.hpp.

◆ numValid()

template<typename DataT , typename EventT = PhasedUniqueEvent>
uint32_t sparta::Pipeline< DataT, EventT >::numValid ( ) const
inline

Indicate the number of valid pipeline stages.

Definition at line 845 of file Pipeline.hpp.

◆ operator[]() [1/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
DataT & sparta::Pipeline< DataT, EventT >::operator[] ( const uint32_t &  stage_id)
inline

Access a specific stage of the pipeline.

Parameters
stage_idThe stage number

Definition at line 815 of file Pipeline.hpp.

◆ operator[]() [2/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
const DataT & sparta::Pipeline< DataT, EventT >::operator[] ( const uint32_t &  stage_id) const
inline

Access (read-only) a specific stage of the pipeline.

Parameters
stage_idThe stage number

Definition at line 808 of file Pipeline.hpp.

◆ performOwnUpdates()

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::performOwnUpdates ( )
inline

Ask pipeline to perform its own update.

Note
The pipeline always performs its own update at SchedulingPhase::Update. This function has to be called at the beginning of the simulation ONLY IF the user doesn't want to manually perform the pipeline update.
See also
update()

Definition at line 865 of file Pipeline.hpp.

Here is the call graph for this function:

◆ readAppendedData()

template<typename DataT , typename EventT = PhasedUniqueEvent>
const DataT & sparta::Pipeline< DataT, EventT >::readAppendedData ( ) const
inline

Get the data just appended; it will assert if no data appended.

Definition at line 649 of file Pipeline.hpp.

◆ registerHandlerAtStage()

template<typename DataT , typename EventT = PhasedUniqueEvent>
template<SchedulingPhase sched_phase = SchedulingPhase::Tick>
void sparta::Pipeline< DataT, EventT >::registerHandlerAtStage ( const uint32_t &  id,
const SpartaHandler &  handler 
)
inline

Register event handler for a designated pipeline stage.

Parameters
idThe stage number for registration
handlerThe SpartaHandler to be registered for the designated pipeline stage
Note
If user registers a pipeline stage handler whose scheduling phase is less than or equal to Flush (i.e. Update, PortUpdate, or Flush), the user should be aware that when flush event occurs at Flush phase, this handling event is already scheduled, and WILL NOT be cancelled.

Definition at line 293 of file Pipeline.hpp.

Here is the call graph for this function:

◆ setConsumerForPipelineUpdate()

template<typename DataT , typename EventT = PhasedUniqueEvent>
template<typename EventType >
void sparta::Pipeline< DataT, EventT >::setConsumerForPipelineUpdate ( EventType &  ev_handler)
inline

Specify consumer event for the pipeline update event.

Parameters
ev_handlerThe consumer event handler
Note
Since pipeline update event happens on the Update phase, ev_handler is also expected to be on the same phase

Definition at line 487 of file Pipeline.hpp.

Here is the call graph for this function:

◆ setConsumerForStage()

template<typename DataT , typename EventT = PhasedUniqueEvent>
template<typename EventType >
void sparta::Pipeline< DataT, EventT >::setConsumerForStage ( const uint32_t &  id,
EventType &  ev_handler 
)
inline

Specify consumer event for a designated pipeline stage.

Parameters
idThe stage number
ev_handlerThe consumer event handler

Definition at line 526 of file Pipeline.hpp.

◆ setContinuing()

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::setContinuing ( const bool  value)
inline

set whether the update event is continuing or not

Parameters
valuetrue for continuing, false for non-continuing

This will change the continuing property of ev_pipeline_update_. The purpose of this is to determine whether data moving through this pipeline should prevent simulation from ending or not. If this event is continuing, then the Pipeline will keep calling this event as long as there are items in the Pipeline. These events will block the simulator from exiting.

Definition at line 799 of file Pipeline.hpp.

Here is the call graph for this function:

◆ setDefaultStagePrecedence()

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::setDefaultStagePrecedence ( const Precedence default_precedence)
inline

Specify precedence of pipeline stage-handling events as forward/backward stage order.

Parameters
default_precedencedefault precedence (can be either forward or backward) between pipeline stages
Note
This only set the precedence for stages that already have handler registered

Definition at line 425 of file Pipeline.hpp.

Here is the call graph for this function:

◆ setPrecedenceBetweenPipeline()

template<typename DataT , typename EventT = PhasedUniqueEvent>
template<class DataT2 , class EventT2 >
void sparta::Pipeline< DataT, EventT >::setPrecedenceBetweenPipeline ( const uint32_t &  pid,
Pipeline< DataT2, EventT2 > &  c_pipeline,
const uint32_t &  cid 
)
inline

Specify precedence between two stages from different pipeline instances.

Parameters
pidThe stage number of producer stage-handling event
c_pipelineThe consumer pipeline
cidThe stage number of the consumer pipeline stage-handling event

Definition at line 392 of file Pipeline.hpp.

◆ setPrecedenceBetweenStage()

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::setPrecedenceBetweenStage ( const uint32_t &  pid,
const uint32_t &  cid 
)
inline

Specify precedence between two different stages within the same pipeline instance.

Parameters
pidThe stage number of producer stage-handling event
cidThe stage number of consumer stage-handling event
Note
This function can only be called when 'default_precedence_' is not specified

Definition at line 354 of file Pipeline.hpp.

◆ setProducerForPipelineUpdate()

template<typename DataT , typename EventT = PhasedUniqueEvent>
template<typename EventType >
void sparta::Pipeline< DataT, EventT >::setProducerForPipelineUpdate ( EventType &  ev_handler)
inline

Specify producer event for the pipeline update event.

Parameters
ev_handlerThe producer event handler
Note
Since pipeline update event happens on the Update phase, ev_handler is also expected to be on the same phase

Definition at line 471 of file Pipeline.hpp.

Here is the call graph for this function:

◆ setProducerForStage()

template<typename DataT , typename EventT = PhasedUniqueEvent>
template<typename EventType >
void sparta::Pipeline< DataT, EventT >::setProducerForStage ( const uint32_t &  id,
EventType &  ev_handler 
)
inline

Specify producer event for a designated pipeline stage.

Parameters
idThe stage number
ev_handlerThe producer event handler

Definition at line 502 of file Pipeline.hpp.

◆ size()

template<typename DataT , typename EventT = PhasedUniqueEvent>
uint32_t sparta::Pipeline< DataT, EventT >::size ( ) const
inline

Indicate the pipeline size.

Definition at line 851 of file Pipeline.hpp.

◆ stall()

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::stall ( const uint32_t &  stall_stage_id,
const uint32_t &  stall_cycles,
const bool  crush_bubbles = false,
const bool  suppress_events = true 
)
inline

Stall the pipeline up to designated stage for a specified number of cycles.

Parameters
stall_stage_idThe stage that causes the pipeline stall
stall_cyclesThe total number of stall cycles
crush_bubblesAllow stages before the stall point to move forward into empty slots
suppress_eventSuppress events of stages before the stall point

Definition at line 699 of file Pipeline.hpp.

Here is the call graph for this function:

◆ update()

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::update ( )
inline

Manually update pipeline (i.e. data-movement and event-scheduling)

Note
The user is able to manually update pipeline in ANY SchedulingPhase. However, it is the user's responsibility to make sure that the SchedulingPhase of ALL the registered pipeline stage events are greater than or equal to the SchedulingPhase when this manual update function is called.
See also
performOwnUpdates()

Definition at line 886 of file Pipeline.hpp.

◆ writeStage() [1/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::writeStage ( const uint32_t &  stage_id,
const DataT &  item 
)
inline

Modify a specific stage of the pipeline.

Parameters
stage_idThe stage number
itemThe modified data for this designated stage

Definition at line 660 of file Pipeline.hpp.

◆ writeStage() [2/2]

template<typename DataT , typename EventT = PhasedUniqueEvent>
void sparta::Pipeline< DataT, EventT >::writeStage ( const uint32_t &  stage_id,
DataT &&  item 
)
inline

Modify a specific stage of the pipeline.

Parameters
stage_idThe stage number
itemThe modified data for this designated stage

Definition at line 671 of file Pipeline.hpp.

Friends And Related Symbol Documentation

◆ Pipeline

template<typename DataT , typename EventT = PhasedUniqueEvent>
template<typename DataT2 , typename EventT2 >
friend class Pipeline
friend

Definition at line 84 of file Pipeline.hpp.


The documentation for this class was generated from the following file: