Skip to content

Commit

Permalink
dut: move trap values to common/dut (#169)
Browse files Browse the repository at this point in the history
They are used by both Verilator and VCS.
  • Loading branch information
poemonsense authored Sep 21, 2023
1 parent b42109f commit 067705f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
12 changes: 12 additions & 0 deletions src/test/csrc/common/dut.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ class DUT {
#define simstats_display(s, ...) \
eprintf(ANSI_COLOR_GREEN s ANSI_COLOR_RESET, ##__VA_ARGS__)

enum {
STATE_GOODTRAP = 0,
STATE_BADTRAP = 1,
STATE_ABORT = 2,
STATE_LIMIT_EXCEEDED = 3,
STATE_SIG = 4,
STATE_AMBIGUOUS = 5,
STATE_SIM_EXIT = 6,
STATE_FUZZ_COND = 7,
STATE_RUNNING = -1
};

enum class SimExitCode {
good_trap,
exceed_limit,
Expand Down
1 change: 1 addition & 0 deletions src/test/csrc/difftest/difftest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "difftest.h"
#include "difftrace.h"
#include "dut.h"
#include "goldenmem.h"
#include "ram.h"
#include "flash.h"
Expand Down
12 changes: 0 additions & 12 deletions src/test/csrc/verilator/emu.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,6 @@ struct EmuArgs {
bool image_as_footprints = false;
};

enum {
STATE_GOODTRAP = 0,
STATE_BADTRAP = 1,
STATE_ABORT = 2,
STATE_LIMIT_EXCEEDED = 3,
STATE_SIG = 4,
STATE_AMBIGUOUS = 5,
STATE_SIM_EXIT = 6,
STATE_FUZZ_COND = 7,
STATE_RUNNING = -1
};

class Emulator final : public DUT {
private:
VSimTop *dut_ptr;
Expand Down

0 comments on commit 067705f

Please sign in to comment.