Initial commit

Added base code, can run ELF files and simulate RV32I instructions
This commit is contained in:
2023-10-04 21:28:18 +02:00
commit 981c35584c
17 changed files with 1280 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
#include "vriscv.h"
#include "memory/memory.h"
#include "bootloader/bootloader.h"
#include "cpu/rv32cpu.h"
char* CURRENT_NAME;
int main(int argc, char** argv)
{
CURRENT_NAME = argc ? argv[0] : NAME;
parse_options(argc, argv);
// Initialize the memory
mem_init();
// Bootload the file passed as argument
uint32_t entry_point = bootload(file_path);
// Initialize the CPU
cpu_init();
cpu0->pc = entry_point;
// CPU simulation
cpu_loop(cpu0);
return 0;
}