Merge branch 'main' of https://github.com/supleed2/AM04_CPU into main

This commit is contained in:
theexecutor13 2020-12-18 10:07:54 +00:00
commit bcc05cd061
8 changed files with 13 additions and 10 deletions

View file

@ -1,5 +1,7 @@
3404fffc 3C04FFFF
3405fffe 3484FFFC
3C05FFFF
34A5FFFE
0085001A 0085001A
00001012 00001012
00000008 00000008

View file

@ -1 +1 @@
-2 4294967294

View file

@ -1,5 +1,6 @@
34040004 34040004
3405fffe 3C05FFFF
34A5FFFE
0085001A 0085001A
00001012 00001012
00000008 00000008

View file

@ -1 +1 @@
2 2

View file

@ -55,7 +55,7 @@ reg file = -2
div - 5 // is it seperating quotients & remainders correctly - when dealing with negatives div - 5 // is it seperating quotients & remainders correctly - when dealing with negatives
ori $4, $0, -4 ori $4, $0, 4
ori $5, $0, 3 ori $5, $0, 3
div $4, $5 div $4, $5
mfhi $4 mfhi $4

View file

@ -25,7 +25,7 @@ then
-s mips_cpu_harvard_tb \ -s mips_cpu_harvard_tb \
-P mips_cpu_harvard_tb.INSTR_INIT_FILE=\"inputs/${DIR}/${TESTCASE}.txt\" \ -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\" \ -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 ${SRC} 2> /dev/null
./exec/mips_cpu_harvard_tb_${TESTCASE} &> ./inputs/${DIR}/${TESTCASE}.log.txt; # log file for debugging (contains $display) ./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 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 \ -s mips_cpu_harvard_tb \
-P mips_cpu_harvard_tb.INSTR_INIT_FILE=\"inputs/${INSTR}/${TESTCASE}.txt\" \ -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\" \ -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 ${SRC} 2> /dev/null
./exec/mips_cpu_harvard_tb_${TESTCASE} &> ./inputs/${INSTR}/${TESTCASE}.log.txt; # log file for debugging (contains $display) ./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 echo "$(tail -1 ./inputs/${INSTR}/${TESTCASE}.log.txt)" > ./inputs/${INSTR}/${TESTCASE}.out.txt; # register v0 output to compare with reference

View file

@ -1,4 +1,4 @@
module mips_cpu_memory( module mips_cpu_harvard_memory(
input logic clk, input logic clk,
//Data Memory //Data Memory

View file

@ -7,7 +7,7 @@ module mips_cpu_harvard_tb;
logic clk, clk_enable, reset, active, data_read, data_write; 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; 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), .clk(clk),
.data_address(data_address), .data_address(data_address),
.data_write(data_write), .data_write(data_write),