Skip to content

Commit

Permalink
hw/intc: Fix time csr rdtime_fn not implement issue which cause time …
Browse files Browse the repository at this point in the history
…illegal instruction issue

Also fix issue in gdb info reg time

time           Could not fetch register "time"; remote failure reply 'E14'

Signed-off-by: Huaqi Fang <[email protected]>
  • Loading branch information
fanghuaqi committed Dec 6, 2023
1 parent d94119c commit ce2a24a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/intc/nuclei_systimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ int hart_numbers = 0;

static uint64_t nuclei_cpu_riscv_read_rtc(void *opaque)
{

uint64_t timebase_freq = *(uint64_t*)opaque;
return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL),
timebase_freq, NANOSECONDS_PER_SECOND);
Expand Down Expand Up @@ -463,6 +462,7 @@ DeviceState *nuclei_systimer_create(hwaddr addr, hwaddr size, uint32_t hartid_ba
if(eclic != NULL)
{
//env->features |= (1ULL << RISCV_FEATURE_ECLIC);
riscv_cpu_set_rdtime_fn(env, nuclei_cpu_riscv_read_rtc, &(s->timebase_freq));
env->mtimer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
&nuclei_mtimecmp_cb, cpu);
env->mtimecmp = 0;
Expand Down

0 comments on commit ce2a24a

Please sign in to comment.