Runtime tests and riscv tests are runnable

This commit is contained in:
MalikBurton
2020-07-28 16:04:27 -04:00
parent e0f729e11e
commit 7fc7bc0cab
7 changed files with 105 additions and 91 deletions

View File

@@ -3,10 +3,11 @@
#include <fstream> #include <fstream>
#include <iomanip> #include <iomanip>
int main(int argc, char **argv) int main(int argc, char *argv[])
{ {
//#define ALL_TESTS //#define ALL_TESTS
#ifdef ALL_TESTS //#ifdef ALL_TESTS
if(argc == 1) {
bool passed = true; bool passed = true;
std::string tests[] = { std::string tests[] = {
@@ -81,13 +82,11 @@ int main(int argc, char **argv)
if (!passed) std::cerr << DEFAULT << "Failed one or more tests\n"; if (!passed) std::cerr << DEFAULT << "Failed one or more tests\n";
return !passed; return !passed;
}
#else //#else
if (argc >= 2) {
char test[] = "../../../runtime/tests/simple/vx_simple.hex"; char* test = argv[2];
//char test[] = "../../../benchmarks/riscv_tests/rv32ui-p-lb.hex";
//char test[] = "../../../benchmarks/riscv_tests/rv32ui-p-lw.hex";
//char test[] = "../../../benchmarks/riscv_tests/rv32ui-p-sw.hex";
std::cerr << test << std::endl; std::cerr << test << std::endl;
@@ -101,6 +100,6 @@ int main(int argc, char **argv)
if (!curr) std::cerr << RED << "Test Failed: " << test << std::endl; if (!curr) std::cerr << RED << "Test Failed: " << test << std::endl;
return !curr; return !curr;
}
#endif //#endif
} }

View File

@@ -27,6 +27,9 @@ $(PROJECT).hex: $(PROJECT).elf
$(PROJECT).elf: $(SRCS) $(PROJECT).elf: $(SRCS)
$(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf $(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf
run: $(PROJECT).hex
(cd ../../../hw/simulate/obj_dir && ./VVortex -f ../../../runtime/tests/dev/$(PROJECT).hex)
.depend: $(SRCS) .depend: $(SRCS)
$(CC) $(CFLAGS) -MM $^ > .depend; $(CC) $(CFLAGS) -MM $^ > .depend;

View File

@@ -27,6 +27,9 @@ $(PROJECT).hex: $(PROJECT).elf
$(PROJECT).elf: $(SRCS) $(PROJECT).elf: $(SRCS)
$(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf $(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf
run: $(PROJECT).hex
(cd ../../../hw/simulate/obj_dir && ./VVortex -f ../../../runtime/tests/hello/$(PROJECT).hex)
.depend: $(SRCS) .depend: $(SRCS)
$(CC) $(CFLAGS) -MM $^ > .depend; $(CC) $(CFLAGS) -MM $^ > .depend;

View File

@@ -27,6 +27,9 @@ $(PROJECT).hex: $(PROJECT).elf
$(PROJECT).elf: $(SRCS) $(PROJECT).elf: $(SRCS)
$(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf $(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf
run: $(PROJECT).hex
(cd ../../../hw/simulate/obj_dir && ./VVortex -f ../../../runtime/tests/nlTest/$(PROJECT).hex)
.depend: $(SRCS) .depend: $(SRCS)
$(CC) $(CFLAGS) -MM $^ > .depend; $(CC) $(CFLAGS) -MM $^ > .depend;

View File

@@ -27,6 +27,9 @@ $(PROJECT).hex: $(PROJECT).elf
$(PROJECT).elf: $(SRCS) $(PROJECT).elf: $(SRCS)
$(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf $(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf
run: $(PROJECT).hex
(cd ../../../hw/simulate/obj_dir && ./VVortex -f ../../../runtime/tests/simple/$(PROJECT).hex)
.depend: $(SRCS) .depend: $(SRCS)
$(CC) $(CFLAGS) -MM $^ > .depend; $(CC) $(CFLAGS) -MM $^ > .depend;

View File

@@ -28,6 +28,9 @@ $(PROJECT).hex: $(PROJECT).elf
$(PROJECT).elf: $(SRCS) $(PROJECT).elf: $(SRCS)
$(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf $(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf
run: $(PROJECT).hex
(cd ../../../hw/simulate/obj_dir && ./VVortex -f ../../../runtime/tests/vecadd/$(PROJECT).hex)
.depend: $(SRCS) .depend: $(SRCS)
$(CC) $(CFLAGS) -MM $^ > .depend; $(CC) $(CFLAGS) -MM $^ > .depend;