8 #ifndef LIBNEXUS_RV_MSG_DECODER_H
9 #define LIBNEXUS_RV_MSG_DECODER_H
55 #define NEXUS_RV_MSG_MAX_BYTES 38
102 const uint8_t *buffer,
size_t limit,
116 int fd, int16_t src_filter,
119 memset(decoder, 0,
sizeof(*decoder));
124 decoder->
bufsz = bufsz;
133 size_t offset = decoder->
nread;
135 offset += decoder->
pos;
uint8_t * nexusrv_msg_decoder_lastmsg(nexusrv_msg_decoder *decoder)
Get the pointer to the last successfully decoded Message bytes.
ssize_t nexusrv_msg_decode(const nexusrv_hw_cfg *hwcfg, const uint8_t *buffer, size_t limit, nexusrv_msg *msg)
Decode the full NexusRV Message from buffer into msg.
struct nexusrv_hw_cfg nexusrv_hw_cfg
NexusRV Message decoder configuration.
int nexusrv_print_msg(FILE *fp, const nexusrv_msg *msg)
Print the msg in human readable form to fp.
ssize_t nexusrv_sync_forward(const uint8_t *buffer, size_t limit)
Sync forward for the first full Message.
ssize_t nexusrv_msg_decoder_next(nexusrv_msg_decoder *decoder, nexusrv_msg *msg)
Iteratively decode the next Nexus Message from trace file.
void nexusrv_msg_decoder_rewind_last(nexusrv_msg_decoder *decoder)
Rewind the decoder to the beginning of last Message.
ssize_t nexusrv_sync_backward(const uint8_t *buffer, size_t pos)
Sync backward for the last full Message.
struct nexusrv_msg_decoder nexusrv_msg_decoder
NexusRV Message decoder context.
NexusRV Message decoder configuration.
Definition: msg-decoder.h:23
bool ext_sifive
Definition: msg-decoder.h:30
unsigned ts_bits
Definition: msg-decoder.h:25
unsigned src_bits
Definition: msg-decoder.h:24
unsigned retstack_sz
Definition: msg-decoder.h:27
bool HTM
Definition: msg-decoder.h:28
bool VAO
Definition: msg-decoder.h:29
unsigned addr_bits
Definition: msg-decoder.h:26
NexusRV Message decoder context.
Definition: msg-decoder.h:38
const nexusrv_hw_cfg * hw_cfg
Definition: msg-decoder.h:39
size_t bufsz
Definition: msg-decoder.h:44
size_t lastmsg_len
Definition: msg-decoder.h:48
size_t nread
Definition: msg-decoder.h:45
int fd
Definition: msg-decoder.h:41
size_t filled
Definition: msg-decoder.h:46
void * buffer
Definition: msg-decoder.h:43
int16_t src_filter
Definition: msg-decoder.h:42
size_t pos
Definition: msg-decoder.h:47
Decoded NexusRV Message.
Definition: msg-types.h:92