Modelsim Working + Simulating + dumping - Some bugs

This commit is contained in:
felsabbagh3
2019-10-27 03:36:02 -04:00
parent 372c81d90c
commit 715982cca7
24 changed files with 374 additions and 142 deletions

View File

@@ -2,9 +2,13 @@
#define __RAM__
#include "string.h"
// #include "string.h"
#include <stdio.h>
#include <stdint.h>
#include <cstdint>
// #include <cstdint>
// #define NULL 0
class RAM{
public:
uint8_t* mem[1 << 12];
@@ -157,11 +161,12 @@ uint32_t hToI(char *c, uint32_t size) {
void loadHexImpl(std::string path,RAM* mem) {
void loadHexImpl(char * path,RAM* mem) {
mem->clear();
FILE *fp = fopen(&path[0], "r");
if(fp == 0){
std::cout << path << " not found" << std::endl;
printf("Path not found %s\n", path);
// std::cout << path << " not found" << std::endl;
}
//Preload 0x0 <-> 0x80000000 jumps
((uint32_t*)mem->get(0))[1] = 0xf1401073;

View File

@@ -100,7 +100,7 @@ Vortex::~Vortex()
void Vortex::ProcessFile(void)
{
loadHexImpl(this->instruction_file_name, &this->ram);
loadHexImpl("../../kernel/vortex_test.hex", &this->ram);
}
void Vortex::print_stats(bool cycle_test)