42 #ifndef __CPU_TRAFFIC_GEN_TRAFFIC_GEN_HH__ 43 #define __CPU_TRAFFIC_GEN_TRAFFIC_GEN_HH__ 45 #include <unordered_map> 49 struct TrafficGenParams;
120 std::unordered_map<uint32_t, std::shared_ptr<BaseGen>>
states;
131 void init()
override;
139 #endif //__CPU_TRAFFIC_GEN_TRAFFIC_GEN_HH__
std::shared_ptr< BaseGen > nextGenerator() override
TrafficGen(const TrafficGenParams *p)
Struct to represent a probabilistic transition during parsing.
uint32_t currState
Index of the current state.
const std::string configFile
The config file to parse.
std::vector< std::vector< double > > transitionMatrix
State transition matrix.
void parseConfig()
Parse the config file and build the state map and transition matrix.
The traffic generator is a master module that generates stimuli for the memory system, based on a collection of simple behaviours that are either probabilistic or based on traces.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void serialize(CheckpointOut &cp) const override
Serialize an object.
std::unordered_map< uint32_t, std::shared_ptr< BaseGen > > states
Map of generator states.
virtual const std::string name() const
std::string resolveFile(const std::string &name)
Resolve a file path in the configuration file.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
std::ostream CheckpointOut
The traffic generator is a master module that generates stimuli for the memory system, based on a collection of simple generator behaviours that are either probabilistic or based on traces.
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
size_t nextState()
Use the transition matrix to find the next state index.