Initial commit
Added base code, can run ELF files and simulate RV32I instructions
This commit is contained in:
+27
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user