From 47a452cd6d4a76f961a7afa2600a3dbd26551d0a Mon Sep 17 00:00:00 2001 From: jl7719 Date: Fri, 18 Dec 2020 09:20:00 +0000 Subject: [PATCH 1/3] Fix div input testcases 3,4,5 --- inputs/div/div-3.txt | 6 ++++-- inputs/div/div-4.ref.txt | 2 +- inputs/div/div-4.txt | 3 ++- inputs/div/div-5.ref.txt | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/inputs/div/div-3.txt b/inputs/div/div-3.txt index cb43025..8edfebf 100644 --- a/inputs/div/div-3.txt +++ b/inputs/div/div-3.txt @@ -1,5 +1,7 @@ -3404fffc -3405fffe +3C04FFFF +3484FFFC +3C05FFFF +34A5FFFE 0085001A 00001012 00000008 \ No newline at end of file diff --git a/inputs/div/div-4.ref.txt b/inputs/div/div-4.ref.txt index 0605667..000b489 100644 --- a/inputs/div/div-4.ref.txt +++ b/inputs/div/div-4.ref.txt @@ -1 +1 @@ --2 \ No newline at end of file +4294967294 \ No newline at end of file diff --git a/inputs/div/div-4.txt b/inputs/div/div-4.txt index 4383ca2..9a2ed8e 100644 --- a/inputs/div/div-4.txt +++ b/inputs/div/div-4.txt @@ -1,5 +1,6 @@ 34040004 -3405fffe +3C05FFFF +34A5FFFE 0085001A 00001012 00000008 \ No newline at end of file diff --git a/inputs/div/div-5.ref.txt b/inputs/div/div-5.ref.txt index c227083..e440e5c 100644 --- a/inputs/div/div-5.ref.txt +++ b/inputs/div/div-5.ref.txt @@ -1 +1 @@ -0 \ No newline at end of file +3 \ No newline at end of file From f3779e1cc30b32afc9fdacf8ad8b340e4ae4a3f3 Mon Sep 17 00:00:00 2001 From: jl7719 Date: Fri, 18 Dec 2020 09:24:58 +0000 Subject: [PATCH 2/3] Fix div-5 testcase minor error --- inputs/div/div-5.ref.txt | 2 +- reference/divedgecaseref.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inputs/div/div-5.ref.txt b/inputs/div/div-5.ref.txt index 00750ed..0cfbf08 100644 --- a/inputs/div/div-5.ref.txt +++ b/inputs/div/div-5.ref.txt @@ -1 +1 @@ -3 +2 diff --git a/reference/divedgecaseref.txt b/reference/divedgecaseref.txt index cfee281..e37af75 100644 --- a/reference/divedgecaseref.txt +++ b/reference/divedgecaseref.txt @@ -55,7 +55,7 @@ reg file = -2 div - 5 // is it seperating quotients & remainders correctly - when dealing with negatives -ori $4, $0, -4 +ori $4, $0, 4 ori $5, $0, 3 div $4, $5 mfhi $4 From 4f97fb41d83b94b3098cf95b80ab548dc07f8ff1 Mon Sep 17 00:00:00 2001 From: jl7719 Date: Fri, 18 Dec 2020 09:55:41 +0000 Subject: [PATCH 3/3] Rename mips_cpu_memory.v to mips_cpu_harvard_memory.v --- test/test_mips_cpu_harvard.sh | 4 ++-- testbench/{mips_cpu_memory.v => mips_cpu_harvard_memory.v} | 2 +- testbench/mips_cpu_harvard_tb.v | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename testbench/{mips_cpu_memory.v => mips_cpu_harvard_memory.v} (98%) diff --git a/test/test_mips_cpu_harvard.sh b/test/test_mips_cpu_harvard.sh index e5cd348..1d1ffd2 100755 --- a/test/test_mips_cpu_harvard.sh +++ b/test/test_mips_cpu_harvard.sh @@ -25,7 +25,7 @@ then -s mips_cpu_harvard_tb \ -P mips_cpu_harvard_tb.INSTR_INIT_FILE=\"inputs/${DIR}/${TESTCASE}.txt\" \ -P mips_cpu_harvard_tb.DATA_INIT_FILE=\"inputs/${DIR}/${TESTCASE}.data.txt\" \ - -o exec/mips_cpu_harvard_tb_${TESTCASE} testbench/mips_cpu_harvard_tb.v testbench/mips_cpu_memory.v\ + -o exec/mips_cpu_harvard_tb_${TESTCASE} testbench/mips_cpu_harvard_tb.v testbench/mips_cpu_harvard_memory.v\ ${SRC} 2> /dev/null ./exec/mips_cpu_harvard_tb_${TESTCASE} &> ./inputs/${DIR}/${TESTCASE}.log.txt; # log file for debugging (contains $display) echo "$(tail -1 ./inputs/${DIR}/${TESTCASE}.log.txt)" > ./inputs/${DIR}/${TESTCASE}.out.txt; # register v0 output to compare with reference @@ -46,7 +46,7 @@ else -s mips_cpu_harvard_tb \ -P mips_cpu_harvard_tb.INSTR_INIT_FILE=\"inputs/${INSTR}/${TESTCASE}.txt\" \ -P mips_cpu_harvard_tb.DATA_INIT_FILE=\"inputs/${INSTR}/${TESTCASE}.data.txt\" \ - -o exec/mips_cpu_harvard_tb_${TESTCASE} testbench/mips_cpu_harvard_tb.v testbench/mips_cpu_memory.v\ + -o exec/mips_cpu_harvard_tb_${TESTCASE} testbench/mips_cpu_harvard_tb.v testbench/mips_cpu_harvard_memory.v\ ${SRC} 2> /dev/null ./exec/mips_cpu_harvard_tb_${TESTCASE} &> ./inputs/${INSTR}/${TESTCASE}.log.txt; # log file for debugging (contains $display) echo "$(tail -1 ./inputs/${INSTR}/${TESTCASE}.log.txt)" > ./inputs/${INSTR}/${TESTCASE}.out.txt; # register v0 output to compare with reference diff --git a/testbench/mips_cpu_memory.v b/testbench/mips_cpu_harvard_memory.v similarity index 98% rename from testbench/mips_cpu_memory.v rename to testbench/mips_cpu_harvard_memory.v index bfd8e56..bc20901 100644 --- a/testbench/mips_cpu_memory.v +++ b/testbench/mips_cpu_harvard_memory.v @@ -1,4 +1,4 @@ -module mips_cpu_memory( +module mips_cpu_harvard_memory( input logic clk, //Data Memory diff --git a/testbench/mips_cpu_harvard_tb.v b/testbench/mips_cpu_harvard_tb.v index 85ca66e..fba3cf7 100644 --- a/testbench/mips_cpu_harvard_tb.v +++ b/testbench/mips_cpu_harvard_tb.v @@ -7,7 +7,7 @@ module mips_cpu_harvard_tb; logic clk, clk_enable, reset, active, data_read, data_write; logic[31:0] register_v0, instr_address, instr_readdata, data_readdata, data_writedata, data_address; - mips_cpu_memory #(INSTR_INIT_FILE, DATA_INIT_FILE) ramInst( + mips_cpu_harvard_memory #(INSTR_INIT_FILE, DATA_INIT_FILE) ramInst( .clk(clk), .data_address(data_address), .data_write(data_write),