Initial commit for Parser class
MODIFY
RISC-V-sim.pro
RISC-V-sim.pro
@@ -4,3 +4,7 @@ CONFIG -= app_bundle
CONFIG -= qt
SOURCES += src/main.cpp \
+ src/parser.cpp
+
+HEADERS += \
+ src/parser.h

MODIFY
src/main.cpp
src/main.cpp
#include <iostream>
+#include "parser.h"
+
using namespace std;
-int main()
-{
+int main(/*argv, argc*/) {
+
cout << "Hello World!" << endl;
+
+ Parser myParser(char *fileName);
+ // risc5sim test.bin
+
return 0;
}

ADD
src/parser.cpp
+#include "parser.h"
+
+Parser::Parser(char *fileName) {}
+
+int Parser::decodeInstruction(uint32_t word) {}

ADD
src/parser.h
+#ifndef PARSER_H
+#define PARSER_H
+
+#include <cstdint>
+
+class Parser {
+public:
+ Parser(char *fileName);
+ ~Parser();
+
+ int getInstruction(int byteOffset = 4);
+ uint32_t readWord();
+ int decodeInstruction(uint32_t word);
+
+private:
+ // FILE *filePtr;
+};
+
+#endif // PARSER_H

Initial commit for Parser class