Skip to content

Commit cd5746b

Browse files
authored
Merge pull request #93 from sysprog21/wip/instruction-decode
Break instruction decoding and emulation into separate stage
2 parents 36d0f29 + e885b22 commit cd5746b

File tree

14 files changed

+3216
-2180
lines changed

14 files changed

+3216
-2180
lines changed

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ src/mini-gdbstub/Makefile:
7979
GDBSTUB_LIB := $(GDBSTUB_OUT)/libgdbstub.a
8080
$(GDBSTUB_LIB): src/mini-gdbstub/Makefile
8181
$(MAKE) -C $(dir $<) O=$(dir $@)
82-
$(OUT)/emulate.o: $(GDBSTUB_LIB)
82+
# FIXME: track gdbstub dependency properly
83+
$(OUT)/decode.o: $(GDBSTUB_LIB)
8384
OBJS_EXT += gdbstub.o breakpoint.o
8485
CFLAGS += -D'GDBSTUB_COMM="$(GDBSTUB_COMM)"'
8586
LDFLAGS += $(GDBSTUB_LIB)
@@ -96,12 +97,14 @@ all: $(BIN)
9697
OBJS := \
9798
map.o \
9899
utils.o \
99-
emulate.o \
100+
decode.o \
100101
io.o \
101-
elf.o \
102-
main.o \
103102
syscall.o \
104-
$(OBJS_EXT)
103+
emulate.o \
104+
riscv.o \
105+
elf.o \
106+
$(OBJS_EXT) \
107+
main.o
105108

106109
OBJS := $(addprefix $(OUT)/, $(OBJS))
107110
deps := $(OBJS:%.o=%.o.d)

src/breakpoint.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#endif
99

1010
#include "breakpoint.h"
11-
#include <assert.h>
1211

1312
static inline int cmp(const void *arg0, const void *arg1)
1413
{

0 commit comments

Comments
 (0)