Add defines.h to project
MODIFY
RISC-V-sim.pro
RISC-V-sim.pro
@@ -7,4 +7,5 @@ SOURCES += src/main.cpp \
src/parser.cpp
HEADERS += \
- src/parser.h
+ src/parser.h \
+ src/defines.h

ADD
src/defines.h
+#ifndef DEFINES_H
+#define DEFINES_H
+
+#include <cstdint>
+
+typedef struct {
+ int type;
+ uint32_t word;
+} Instruction;
+
+enum instrType {
+ LUI = 0b0110111,
+ JAL = 0b1101111,
+ JALR = 0b1100111,
+ BRANCH = 0b1100011,
+ LOAD = 0b0000011,
+ STORE = 0b0100011,
+ OP_IMM = 0b0010011,
+ OP = 0b0110011,
+};
+
+#endif // DEFINES_H

Add defines.h to project