1 #ifndef LIBNEXUS_RV_TRACE_DECODER_H
2 #define LIBNEXUS_RV_TRACE_DECODER_H
6 #include "return-stack.h"
93 uint8_t exception : 1;
128 NEXUSRV_Trace_Event_None,
129 NEXUSRV_Trace_Event_Direct,
130 NEXUSRV_Trace_Event_DirectSync,
131 NEXUSRV_Trace_Event_Trap,
132 NEXUSRV_Trace_Event_Indirect,
133 NEXUSRV_Trace_Event_IndirectSync,
134 NEXUSRV_Trace_Event_Sync,
135 NEXUSRV_Trace_Event_Stop,
136 NEXUSRV_Trace_Event_Error,
139 static inline const char
140 *str_nexusrv_trace_event(
unsigned event) {
142 case NEXUSRV_Trace_Event_None:
144 case NEXUSRV_Trace_Event_Direct:
146 case NEXUSRV_Trace_Event_DirectSync:
147 return "direct-sync";
148 case NEXUSRV_Trace_Event_Trap:
150 case NEXUSRV_Trace_Event_Indirect:
152 case NEXUSRV_Trace_Event_IndirectSync:
153 return "indirect-sync";
154 case NEXUSRV_Trace_Event_Sync:
156 case NEXUSRV_Trace_Event_Stop:
158 case NEXUSRV_Trace_Event_Error:
226 return decoder->
timestamp & (((uint64_t)1 << ts_bits) - 1);
unsigned ts_bits
Definition: msg-decoder.h:25
NexusRV Message decoder context.
Definition: msg-decoder.h:38
const nexusrv_hw_cfg * hw_cfg
Definition: msg-decoder.h:39
Decoded NexusRV Message.
Definition: msg-types.h:92
Definition: return-stack.h:8
NexusRV Trace decoder context.
Definition: trace-decoder.h:172
uint64_t full_addr
Definition: trace-decoder.h:184
struct nexusrv_hist_array * res_hists
Definition: trace-decoder.h:175
nexusrv_msg msg
Definition: trace-decoder.h:183
uint32_t res_icnt
Definition: trace-decoder.h:177
uint8_t consumed_tnts
Definition: trace-decoder.h:180
nexusrv_return_stack return_stack
Definition: trace-decoder.h:186
uint32_t consumed_icnt
Definition: trace-decoder.h:179
bool msg_present
Definition: trace-decoder.h:182
uint64_t timestamp
Definition: trace-decoder.h:185
uint32_t res_tnts
Definition: trace-decoder.h:178
nexusrv_msg_decoder * msg_decoder
Definition: trace-decoder.h:173
bool synced
Definition: trace-decoder.h:181
NexusRV Trace Error Event.
Definition: trace-decoder.h:112
uint32_t ecode
Definition: trace-decoder.h:113
uint8_t etype
Definition: trace-decoder.h:115
NexusRV Trace Indirect Branch Event.
Definition: trace-decoder.h:87
uint8_t interrupt
Definition: trace-decoder.h:92
uint8_t ownership_priv
Definition: trace-decoder.h:96
uint8_t ownership_v
Definition: trace-decoder.h:97
uint8_t ownership
Definition: trace-decoder.h:93
uint64_t context
Definition: trace-decoder.h:89
uint8_t ownership_fmt
Definition: trace-decoder.h:95
uint64_t target
Definition: trace-decoder.h:88
NexusRV Stop Event.
Definition: trace-decoder.h:121
uint8_t evcode
Definition: trace-decoder.h:122
NexusRV Trace Sync Event.
Definition: trace-decoder.h:103
uint64_t addr
Definition: trace-decoder.h:104
uint8_t sync
Definition: trace-decoder.h:106
int nexusrv_trace_decoder_init(nexusrv_trace_decoder *decoder, nexusrv_msg_decoder *msg_decoder)
Initialize the trace decoder.
int32_t nexusrv_trace_try_retire(nexusrv_trace_decoder *decoder, uint32_t icnt, unsigned *event)
Try to retire icnt from trace.
int nexusrv_trace_next_tnt(nexusrv_trace_decoder *decoder)
Get the next taken-not-taken.
int nexusrv_trace_sync_reset(nexusrv_trace_decoder *decoder, nexusrv_trace_sync *sync)
Synchronize the trace decoder.
struct nexusrv_trace_sync nexusrv_trace_sync
NexusRV Trace Sync Event.
nexusrv_trace_events
NexusRV trace events.
Definition: trace-decoder.h:127
void nexusrv_trace_decoder_fini(nexusrv_trace_decoder *decoder)
Finialize the trace decoder.
struct nexusrv_trace_error nexusrv_trace_error
NexusRV Trace Error Event.
int nexusrv_trace_next_stop(nexusrv_trace_decoder *decoder, nexusrv_trace_stop *stop)
Get the next Stop event.
struct nexusrv_trace_decoder nexusrv_trace_decoder
NexusRV Trace decoder context.
int nexusrv_trace_next_error(nexusrv_trace_decoder *decoder, nexusrv_trace_error *error)
Get the next Error event.
struct nexusrv_trace_stop nexusrv_trace_stop
NexusRV Stop Event.
struct nexusrv_trace_indirect nexusrv_trace_indirect
NexusRV Trace Indirect Branch Event.
int nexusrv_trace_next_indirect(nexusrv_trace_decoder *decoder, nexusrv_trace_indirect *indirect)
Get the next indirect branch.
int nexusrv_trace_next_sync(nexusrv_trace_decoder *decoder, nexusrv_trace_sync *sync)
Get the next Sync event.