The Sparta Modeling Framework
|
Macros | |
#define | HEX(val, width) |
#define | HEX16(val) HEX(val, 16) |
#define | HEX8(val) HEX(val, 8) |
These macros are meant to be used within a Logger ouput macro to print hex values and then return the logger to the default state.
Example usage:
class Fetch : public sparta::Unit { void FetchSomeInsts() const { const int addr = 0xdeadbeef; DLOG("Got instruction at " << HEX8(addr));" } }
Example debug logger output:
{0000000000 00000000 top.fetch debug} FetchSomeInsts: Got instruction at 0xdeadbeef
#define HEX | ( | val, | |
width | |||
) |
Macro to simplify printing of hex values
val | The value to print |
width | The number of digits to print |
Definition at line 149 of file LogUtils.hpp.
#define HEX16 | ( | val | ) | HEX(val, 16) |
Macro to simplify printing of 16 digit hex value
val | The value to print |
Definition at line 158 of file LogUtils.hpp.
#define HEX8 | ( | val | ) | HEX(val, 8) |
Macro to simplify printing of 8 digit hex values
val | The value to print |
Definition at line 165 of file LogUtils.hpp.