The Sparta Modeling Framework
Loading...
Searching...
No Matches
SchedulingPhases.hpp
Go to the documentation of this file.
1// <SchedulingPhases.hpp> -*- C++ -*-
2
3
10#pragma once
11
12#include <cinttypes>
13#include <iostream>
14
15namespace sparta
16{
17
57 enum class SchedulingPhase
58 {
59#ifndef DO_NOT_DOCUMENT
60 Trigger,
61#endif
62 Update,
64 Flush,
66 Tick,
67 PostTick,
68#ifndef DO_NOT_DOCUMENT
69 __last_scheduling_phase,
70 Invalid = __last_scheduling_phase
71#endif
72 };
73
75 const uint32_t NUM_SCHEDULING_PHASES =
76 static_cast<uint32_t>(SchedulingPhase::__last_scheduling_phase);
77
84 inline std::ostream & operator<<(std::ostream & os, const SchedulingPhase & phase)
85 {
86 switch (phase) {
87 case SchedulingPhase::Trigger:
88 os << "Trigger";
89 break;
91 os << "Update";
92 break;
94 os << "PortUpdate";
95 break;
97 os << "Flush";
98 break;
100 os << "Collection";
101 break;
103 os << "Tick";
104 break;
106 os << "PostTick";
107 break;
108 case SchedulingPhase::__last_scheduling_phase:
109 os << "<UNKNOWN PHASE>";
110 break;
111 // NO DEFAULT! Allows for compiler errors if the enum
112 // class is updated.
113 }
114 return os;
115 }
116
117}
118
Macros for handling exponential backoff.
const uint32_t NUM_SCHEDULING_PHASES
The number of phases.
std::ostream & operator<<(std::ostream &o, const SimulationInfo &info)
ostream insertion operator for SimulationInfo
SchedulingPhase
The SchedulingPhases used for events (Tick, Update, PortUpdate, etc)
@ Update
Resources are updated in this phase.
@ PortUpdate
N-cycle Ports are updated in this phase.
@ Tick
Most operations (combinational logic) occurs in this phase.
@ Flush
Phase where flushing of pipelines, etc can occur.
@ PostTick
Operations such as post-tick pipeline collection occur here.
@ Collection
Pipeline collection occurs here.