mirror of
https://github.com/openhwgroup/cvw
synced 2025-01-23 21:14:37 +00:00
21 lines
365 B
C
21 lines
365 B
C
#include "time.h"
|
|
#include "boot.h"
|
|
#include "riscv.h"
|
|
#include "uart.h"
|
|
|
|
float getTime() {
|
|
set_status_fs();
|
|
float numCycles = (float)read_mcycle();
|
|
float ret = numCycles/SYSTEMCLOCK;
|
|
// clear_status_fs();
|
|
return ret;
|
|
}
|
|
|
|
void print_time() {
|
|
print_uart("[");
|
|
set_status_fs();
|
|
print_uart_float(getTime(),5);
|
|
clear_status_fs();
|
|
print_uart("] ");
|
|
}
|