refactoring RTL simulator and Makefile

This commit is contained in:
Blaise Tine
2020-03-26 04:14:36 -04:00
parent 8fd742edd8
commit a82dd9387d
6 changed files with 87 additions and 109 deletions

View File

@@ -1,4 +1,4 @@
#include "multi_test_bench.h"
#include "Vortex_SOC.h"
#define NUM_TESTS 46
@@ -65,13 +65,16 @@ int main(int argc, char **argv)
};
for (std::string s : tests) {
Vortex v;
std::cerr << DEFAULT << "\n---------------------------------------\n";
std::cerr << DEFAULT << "\n---------------------------------------\n";
std::cerr << s << std::endl;
bool curr = v.simulate(s);
RAM ram;
loadHexImpl(s.c_str(), &ram);
Vortex_SOC v(&ram);
bool curr = v.simulate();
if ( curr) std::cerr << GREEN << "Test Passed: " << s << std::endl;
if (!curr) std::cerr << RED << "Test Failed: " << s << std::endl;
std::cerr << DEFAULT;
@@ -90,7 +93,7 @@ int main(int argc, char **argv)
char testing[] = "../../runtime/mains/simple/vx_simple_main.hex";
// char testing[] = "../../emulator/riscv_tests/rv32ui-p-lw.hex";
// char testing[] = "../../emulator/riscv_tests/rv32ui-p-sw.hex";
Vortex v;
// const char *testing;
// if (argc >= 2) {
@@ -99,14 +102,18 @@ int main(int argc, char **argv)
// testing = "../../kernel/vortex_test.hex";
// }
std::cerr << testing << std::endl;
std::cerr << testing << std::endl;
RAM ram;
loadHexImpl(testing, &ram);
Vortex_SOC v(&ram);
bool curr = v.simulate();
bool curr = v.simulate(testing);
if ( curr) std::cerr << GREEN << "Test Passed: " << testing << std::endl;
if (!curr) std::cerr << RED << "Test Failed: " << testing << std::endl;
return !curr;
#endif
}
}