ibuffer addition

This commit is contained in:
Blaise Tine
2020-08-22 00:22:04 -07:00
parent 6c12391338
commit 0b355f228e
80 changed files with 1811 additions and 1528 deletions

View File

@@ -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;
}