feat(difftest): generate checkpoint on difftest mismatch#878
feat(difftest): generate checkpoint on difftest mismatch#878good-circle wants to merge 1 commit into
Conversation
Add an --auto-checkpoint option that asks the REF to dump a checkpoint when difftest reports a mismatch. Without --enable-fork, generate the checkpoint after the mismatch is detected. With --enable-fork, wake the fork child and generate the checkpoint from the fork snapshot instead. Route the request through RefProxy and pass a checkpoint base path to the REF.
poemonsense
left a comment
There was a problem hiding this comment.
It seems we don't need difftest_auto_cpt and cpt_from_fork
| info->notgood = false; | ||
| info->endCycles = 0; | ||
| info->oldest = 0; | ||
| info->do_cpt = false; |
There was a problem hiding this comment.
There's no need to pass these. The child can decide it on its own.
| #ifndef CONFIG_NO_DIFFTEST | ||
| extern const char *difftest_ref_so; | ||
| extern bool difftest_auto_cpt; | ||
| extern bool cpt_from_fork; |
There was a problem hiding this comment.
Don't know why we need cpt_from_fork
| case 6: args.enable_fork = true; continue; | ||
| case 6: args.enable_fork = true; | ||
| #ifndef CONFIG_NO_DIFFTEST | ||
| cpt_from_fork = true; |
There was a problem hiding this comment.
Don't know why we need this.
|
|
||
| uint8_t *ref_golden_mem = NULL; | ||
| const char *difftest_ref_so = NULL; | ||
| bool difftest_auto_cpt = false; |
There was a problem hiding this comment.
Don't know why we need this. Is it already in the args?
| }; | ||
|
|
||
| extern const char *difftest_ref_so; | ||
| extern bool difftest_auto_cpt; |
| bool need_wakeup = trapCode != STATE_GOODTRAP && trapCode != STATE_LIMIT_EXCEEDED && trapCode != STATE_SIG; | ||
| if (need_wakeup) { | ||
| #ifndef CONFIG_NO_DIFFTEST | ||
| if (difftest_auto_cpt) { |
There was a problem hiding this comment.
No need to set the path here
|
|
||
| // Generate checkpoint from the fork snapshot state if requested | ||
| if (lightsss->get_do_cpt()) { | ||
| const char *base_filepath = lightsss->get_cpt_filepath(); |
There was a problem hiding this comment.
The path should be determined here, the same as waveform.
| if (lightsss->get_do_cpt()) { | ||
| const char *base_filepath = lightsss->get_cpt_filepath(); | ||
| FORK_PRINTF("Generating checkpoint from fork snapshot: %s_memory_.gz\n", base_filepath) | ||
| for (int i = 0; i < NUM_CORES; i++) { |
There was a problem hiding this comment.
It seems we don't support multicore checkpoint here. Maybe we should check NUM_CORES and avoid checkpointing it.
Add an --auto-checkpoint option that asks the REF to dump a checkpoint when difftest reports a mismatch.
Without --enable-fork, generate the checkpoint after the mismatch is detected. With --enable-fork, wake the fork child and generate the checkpoint from the fork snapshot instead.
Route the request through RefProxy and pass a checkpoint base path to the REF.