ibuffer addition
This commit is contained in:
@@ -89,4 +89,26 @@ extern int vx_upload_kernel_file(vx_device_h device, const char* filename) {
|
||||
delete[] content;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
extern int vx_get_perf(vx_device_h device, uint64_t* cycles, uint64_t* instrs) {
|
||||
int ret = 0;
|
||||
|
||||
unsigned value;
|
||||
|
||||
if (cycles) {
|
||||
ret |= vx_csr_get(device, 0, CSR_CYCLE_H, &value);
|
||||
*cycles = value;
|
||||
ret |= vx_csr_get(device, 0, CSR_CYCLE, &value);
|
||||
*cycles = (*cycles << 32) | value;
|
||||
}
|
||||
|
||||
if (instrs) {
|
||||
ret |= vx_csr_get(device, 0, CSR_INSTRET_H, &value);
|
||||
*instrs = value;
|
||||
ret |= vx_csr_get(device, 0, CSR_INSTRET, &value);
|
||||
*instrs = (*instrs << 32) | value;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user