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