26 #ifndef ORCASIM_MODELING_INCLUDE_SIGNAL_HPP_ 27 #define ORCASIM_MODELING_INCLUDE_SIGNAL_HPP_ 66 Signal(T* t_ptr, uint32_t addr, std::string name);
73 Signal(uint32_t addr, std::string name);
79 explicit Signal(std::string name);
97 void MapTo(
bool keep_val =
true);
158 #endif // ORCASIM_MODELING_INCLUDE_SIGNAL_HPP_ The Signal class models a generic bus of width equals to the sizeof(T)
void SetAddress(MemoryAddr)
Set an address for this signal.
void MapTo(bool keep_val=true)
Maps current Signal to the internal storage.
std::string _t_name
an optional name to identify this bus during runtime
T Read()
Get the last value writen to the bus.
void Write(T val)
Writes some value to the bus.
volatile T _t_storage
internal storage (necessary when mmio is not used)
volatile T * _t_ptr
pointer to the place where the bus data will be stored
void Inc(T val)
Increments the value of the bus by the given value.
void Dec(T val)
Descrements the value of the bus by the given value.
Signal(T *t_ptr, uint32_t addr, std::string name)
Constructor.
std::string GetName()
Return the name of the Signal.
volatile uint32_t _t_addr
a memory address in case this is mapped using mmio
uint32_t GetAddress()
Return the addres to which this Signal is mapped.