From 252f630162e16bde6b0880e0b529c404eead3a7b Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Wed, 16 Dec 2020 15:40:21 +0000 Subject: [PATCH] Cleanup --- .gitignore | 5 +- inputs/.DS_Store | Bin 12292 -> 0 bytes inputs/divquotient.txt | 5 - inputs/divremainder.txt | 5 - inputs/divuquotient | 5 - inputs/divuremainder.txt | 5 - inputs/j.ref.txt | 1 - inputs/jal.ref.txt | 1 - inputs/jalr.ref.txt | 1 - inputs/jr.ref.txt | 1 - inputs/lb.data.txt | 4 - inputs/lb.ref.txt | 1 - inputs/lb.txt | 3 - inputs/lbu.data.txt | 4 - inputs/lbu.ref.txt | 1 - inputs/lbu.txt | 3 - inputs/lh.data.txt | 4 - inputs/lh.ref.txt | 1 - inputs/lh.txt | 3 - inputs/lhu.data.txt | 4 - inputs/lhu.ref.txt | 1 - inputs/lhu.txt | 3 - inputs/lui.ref.txt | 1 - inputs/lui.txt | 3 - inputs/lw.data.txt | 4 - inputs/lw.ref.txt | 1 - inputs/lw.txt | 3 - inputs/lwl.data.txt | 4 - inputs/lwl.ref.txt | 1 - inputs/lwl.txt | 4 - inputs/lwr.data.txt | 4 - inputs/lwr.ref.txt | 1 - inputs/lwr.txt | 4 - inputs/slt/.DS_Store | Bin 6148 -> 0 bytes reference/reference.txt | 564 +++++++++++++++++++++++++++++++++++++++ 35 files changed, 568 insertions(+), 87 deletions(-) delete mode 100644 inputs/.DS_Store delete mode 100644 inputs/divquotient.txt delete mode 100644 inputs/divremainder.txt delete mode 100644 inputs/divuquotient delete mode 100644 inputs/divuremainder.txt delete mode 100644 inputs/j.ref.txt delete mode 100644 inputs/jal.ref.txt delete mode 100644 inputs/jalr.ref.txt delete mode 100644 inputs/jr.ref.txt delete mode 100644 inputs/lb.data.txt delete mode 100644 inputs/lb.ref.txt delete mode 100644 inputs/lb.txt delete mode 100644 inputs/lbu.data.txt delete mode 100644 inputs/lbu.ref.txt delete mode 100644 inputs/lbu.txt delete mode 100644 inputs/lh.data.txt delete mode 100644 inputs/lh.ref.txt delete mode 100644 inputs/lh.txt delete mode 100644 inputs/lhu.data.txt delete mode 100644 inputs/lhu.ref.txt delete mode 100644 inputs/lhu.txt delete mode 100644 inputs/lui.ref.txt delete mode 100644 inputs/lui.txt delete mode 100644 inputs/lw.data.txt delete mode 100644 inputs/lw.ref.txt delete mode 100644 inputs/lw.txt delete mode 100644 inputs/lwl.data.txt delete mode 100644 inputs/lwl.ref.txt delete mode 100644 inputs/lwl.txt delete mode 100644 inputs/lwr.data.txt delete mode 100644 inputs/lwr.ref.txt delete mode 100644 inputs/lwr.txt delete mode 100644 inputs/slt/.DS_Store create mode 100644 reference/reference.txt diff --git a/.gitignore b/.gitignore index b66d3d3..8f52a2e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ exec/* !exec/executable.txt *.log.txt *.out.txt -mips_cpu_harvard.vcd \ No newline at end of file +mips_cpu_harvard.vcd +.DS_Store +.DS_Store +inputs/.DS_Store diff --git a/inputs/.DS_Store b/inputs/.DS_Store deleted file mode 100644 index 2fef42f62f02268eeda45b1f2c43c79252ee41a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12292 zcmeI2&x;&Y5XWEd%u2w3K@fu)XxIcqP?Cd6L}6Uk_yaV^21F2a*WK)7Ge6eJ%&Z2H z(HIdg-o@Pg0fB%w1$Eh66%i34_y_pK#{D42bmS@BrR8KcoTO@MRqXoK#{!9pG|nA#ss>s(7GAUalIvw(Gkw z^b~#O?uH0ilgx|PnJM&0we*x*!lA>ldv2&QdzaKC_nE!#R^!2Q!B$3V=_!|1d$gUv znHwwa1A$AL61D}5UN#5a6BWr{|AG0z zPDYxmsShO_6vig;+*FN`LsFB>ovX}bTS>KagX{g(Bh#-T=+Rg*cmHB$u#?1Gt>>w1 z`v}HaAI5yMCOtWQ$N4xjk)OEQ#eQt*hBxz+b>L<*!~q}+RkFW4#O$O+q}weFeifU( z7Q+0qCfQFv!fc^OvZWhbJbNRzV)V73Nak0^naOG-=BmL%UxAnP?)yWWq)FxU0=DvOtzKh(b5erq^{YT42TRo0pGv{029o`E_?s`uaZ&zLkJ^EznhDU6x{AmGm;MP=@@ER&8 zGDH26ePK0vlB+d-056*-{JKWIr1QjM4>J>EAX_<4Sh~S&!Cb%YUQ==UJ62L;oC_zI z8SEr6R}EepcpE@GtBBY;S(D5IQ)UW1X4ldU?kyD;a-~;sj5g6F|FcWXS8bvXb!`kk zd<^3(e*6`QHOXJR%zU9owx!o_dpF2CX_7nmIpGF9axJ}s>#Fm zr}Vv_zY8Np@@{)n@PZnn%vFQeruVg`*@Uo#lT)06v;XEK66-&tXwsCZO_Yo<#`c^tV!nekC-X+ zNUd~wKW`pGf_MM$`9H)^_x>L>YCf6_G#U7RW}s*gjPj{7(;DLR}}6GhdP^9Dq!rBvUB;ll=eeMSy1g-@^RE)~x?G H@%sNSfe9EL diff --git a/inputs/divquotient.txt b/inputs/divquotient.txt deleted file mode 100644 index e8a53e9..0000000 --- a/inputs/divquotient.txt +++ /dev/null @@ -1,5 +0,0 @@ -34040004 -34050003 -0085001A -00001012 -00000008 \ No newline at end of file diff --git a/inputs/divremainder.txt b/inputs/divremainder.txt deleted file mode 100644 index 66e5dba..0000000 --- a/inputs/divremainder.txt +++ /dev/null @@ -1,5 +0,0 @@ -34040004 -34050003 -0085001A -00001010 -00000008 \ No newline at end of file diff --git a/inputs/divuquotient b/inputs/divuquotient deleted file mode 100644 index e19a2cf..0000000 --- a/inputs/divuquotient +++ /dev/null @@ -1,5 +0,0 @@ -34040004 -34050003 -0085001B -00001012 -00000008 \ No newline at end of file diff --git a/inputs/divuremainder.txt b/inputs/divuremainder.txt deleted file mode 100644 index 5384638..0000000 --- a/inputs/divuremainder.txt +++ /dev/null @@ -1,5 +0,0 @@ -34040004 -34050003 -0085001B -00001010 -00000008 \ No newline at end of file diff --git a/inputs/j.ref.txt b/inputs/j.ref.txt deleted file mode 100644 index 56a6051..0000000 --- a/inputs/j.ref.txt +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/inputs/jal.ref.txt b/inputs/jal.ref.txt deleted file mode 100644 index d8263ee..0000000 --- a/inputs/jal.ref.txt +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/inputs/jalr.ref.txt b/inputs/jalr.ref.txt deleted file mode 100644 index d8263ee..0000000 --- a/inputs/jalr.ref.txt +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/inputs/jr.ref.txt b/inputs/jr.ref.txt deleted file mode 100644 index 56a6051..0000000 --- a/inputs/jr.ref.txt +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/inputs/lb.data.txt b/inputs/lb.data.txt deleted file mode 100644 index 47c26d6..0000000 --- a/inputs/lb.data.txt +++ /dev/null @@ -1,4 +0,0 @@ -00000000 -008A0000 -00000000 -00000000 \ No newline at end of file diff --git a/inputs/lb.ref.txt b/inputs/lb.ref.txt deleted file mode 100644 index f8ff60d..0000000 --- a/inputs/lb.ref.txt +++ /dev/null @@ -1 +0,0 @@ -4294967178 \ No newline at end of file diff --git a/inputs/lb.txt b/inputs/lb.txt deleted file mode 100644 index 83898a5..0000000 --- a/inputs/lb.txt +++ /dev/null @@ -1,3 +0,0 @@ -34041003 -80820003 -00000008 \ No newline at end of file diff --git a/inputs/lbu.data.txt b/inputs/lbu.data.txt deleted file mode 100644 index 47c26d6..0000000 --- a/inputs/lbu.data.txt +++ /dev/null @@ -1,4 +0,0 @@ -00000000 -008A0000 -00000000 -00000000 \ No newline at end of file diff --git a/inputs/lbu.ref.txt b/inputs/lbu.ref.txt deleted file mode 100644 index eafdfb0..0000000 --- a/inputs/lbu.ref.txt +++ /dev/null @@ -1 +0,0 @@ -138 \ No newline at end of file diff --git a/inputs/lbu.txt b/inputs/lbu.txt deleted file mode 100644 index 06c0f06..0000000 --- a/inputs/lbu.txt +++ /dev/null @@ -1,3 +0,0 @@ -34041003 -90820003 -00000008 \ No newline at end of file diff --git a/inputs/lh.data.txt b/inputs/lh.data.txt deleted file mode 100644 index f3b4cfd..0000000 --- a/inputs/lh.data.txt +++ /dev/null @@ -1,4 +0,0 @@ -00000000 -00008123 -00000000 -00000000 \ No newline at end of file diff --git a/inputs/lh.ref.txt b/inputs/lh.ref.txt deleted file mode 100644 index 9e489ac..0000000 --- a/inputs/lh.ref.txt +++ /dev/null @@ -1 +0,0 @@ -4294934819 \ No newline at end of file diff --git a/inputs/lh.txt b/inputs/lh.txt deleted file mode 100644 index 3a583e1..0000000 --- a/inputs/lh.txt +++ /dev/null @@ -1,3 +0,0 @@ -34041003 -84820004 -00000008 \ No newline at end of file diff --git a/inputs/lhu.data.txt b/inputs/lhu.data.txt deleted file mode 100644 index f3b4cfd..0000000 --- a/inputs/lhu.data.txt +++ /dev/null @@ -1,4 +0,0 @@ -00000000 -00008123 -00000000 -00000000 \ No newline at end of file diff --git a/inputs/lhu.ref.txt b/inputs/lhu.ref.txt deleted file mode 100644 index db277c1..0000000 --- a/inputs/lhu.ref.txt +++ /dev/null @@ -1 +0,0 @@ -33059 \ No newline at end of file diff --git a/inputs/lhu.txt b/inputs/lhu.txt deleted file mode 100644 index 54a3692..0000000 --- a/inputs/lhu.txt +++ /dev/null @@ -1,3 +0,0 @@ -34041003 -94820004 -00000008 \ No newline at end of file diff --git a/inputs/lui.ref.txt b/inputs/lui.ref.txt deleted file mode 100644 index 7751570..0000000 --- a/inputs/lui.ref.txt +++ /dev/null @@ -1 +0,0 @@ -305419896 \ No newline at end of file diff --git a/inputs/lui.txt b/inputs/lui.txt deleted file mode 100644 index 6c9915e..0000000 --- a/inputs/lui.txt +++ /dev/null @@ -1,3 +0,0 @@ -34045678 -3C021234 -00000008 \ No newline at end of file diff --git a/inputs/lw.data.txt b/inputs/lw.data.txt deleted file mode 100644 index 50de8d2..0000000 --- a/inputs/lw.data.txt +++ /dev/null @@ -1,4 +0,0 @@ -00000000 -12345678 -00000000 -00000000 \ No newline at end of file diff --git a/inputs/lw.ref.txt b/inputs/lw.ref.txt deleted file mode 100644 index 7751570..0000000 --- a/inputs/lw.ref.txt +++ /dev/null @@ -1 +0,0 @@ -305419896 \ No newline at end of file diff --git a/inputs/lw.txt b/inputs/lw.txt deleted file mode 100644 index 7c6a2ee..0000000 --- a/inputs/lw.txt +++ /dev/null @@ -1,3 +0,0 @@ -34041002 -8C820002 -00000008 \ No newline at end of file diff --git a/inputs/lwl.data.txt b/inputs/lwl.data.txt deleted file mode 100644 index 325d898..0000000 --- a/inputs/lwl.data.txt +++ /dev/null @@ -1,4 +0,0 @@ -00000000 -AAAA1234 -00000000 -00000000 \ No newline at end of file diff --git a/inputs/lwl.ref.txt b/inputs/lwl.ref.txt deleted file mode 100644 index 7751570..0000000 --- a/inputs/lwl.ref.txt +++ /dev/null @@ -1 +0,0 @@ -305419896 \ No newline at end of file diff --git a/inputs/lwl.txt b/inputs/lwl.txt deleted file mode 100644 index a62ec0b..0000000 --- a/inputs/lwl.txt +++ /dev/null @@ -1,4 +0,0 @@ -34041003 -34025678 -88820003 -00000008 \ No newline at end of file diff --git a/inputs/lwr.data.txt b/inputs/lwr.data.txt deleted file mode 100644 index ca679b8..0000000 --- a/inputs/lwr.data.txt +++ /dev/null @@ -1,4 +0,0 @@ -00000000 -5678AAAA -00000000 -00000000 \ No newline at end of file diff --git a/inputs/lwr.ref.txt b/inputs/lwr.ref.txt deleted file mode 100644 index 7751570..0000000 --- a/inputs/lwr.ref.txt +++ /dev/null @@ -1 +0,0 @@ -305419896 \ No newline at end of file diff --git a/inputs/lwr.txt b/inputs/lwr.txt deleted file mode 100644 index 22f33f9..0000000 --- a/inputs/lwr.txt +++ /dev/null @@ -1,4 +0,0 @@ -34041003 -3C021234 -98820002 -00000008 \ No newline at end of file diff --git a/inputs/slt/.DS_Store b/inputs/slt/.DS_Store deleted file mode 100644 index a6c4cc6f92295ade9b56455a8c59adcac3f19c76..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKIZgvX5Ud6VMhM9v;d}r~{=s0`fnz>knIl@s5?&<2&HNlc5vmU?FAEY80dz~< zHAmOXZUxgb0A&91Fast4#&kvOH4IJX)dzMKBZ^{c%rM0>9`Qu{nJM=QJ2YrawHRAbxT62uby8rV5lBvwmZj*r9-M?##A5`=qqsU-HF!!CH=0) and link== + +ORI $4,$0,3 +BGEZAL $4,4 +NOP +ADDIU $2,$2,1 +JR $0 +NOP +ORI $2,$0,1 +JR $31 + +34040003 +04910004 +00000000 +24420001 +00000008 +00000000 +34020001 +03E00008 + +register_v0 = 2 + +==BGTZ Branch on greater than zero== + +ORI $4,$0,3 +BGTZ $4,3 +NOP +JR $0 +NOP +ORI $2,$0,1 +JR $0 + +34040003 +1C800003 +00000000 +00000008 +00000000 +34020001 +00000008 + +register_v0 = 1 + +==BLEZ Branch on less than or equal to zero== + +LUI $4,0xFFFF +BLEZ $4,3 +NOP +JR $0 +NOP +ORI $2,$0,1 +JR $0 + +3C05FFFF +18800003 +00000000 +00000008 +00000000 +34020001 +00000008 + +register_v0 = 1 + +==BLTZ Branch on less than zero== + +LUI $4,0xFFFF +BLTZ $4,3 +NOP +JR $0 +NOP +ORI $2,$0,1 +JR $0 + +3C05FFFF +04800003 +00000000 +00000008 +00000000 +34020001 +00000008 + +register_v0 = 1 + +==BLTZAL Branch on less than zero and link== + +LUI $4,0xFFFF +BLTZAL $4,4 +NOP +ADDIU $2,$2,1 +JR $0 +NOP +ORI $2,$0,1 +JR $31 + +3C05FFFF +04900004 +00000000 +24420001 +00000008 +00000000 +34020001 +03E00008 + +register_v0 = 2 + +==BNE Branch on not equal== + +ORI $4,$0,3 +ORI $5,$0,5 +BNE $4,$5,3 +NOP +JR $0 +NOP +ORI $2,$0,1 +JR $0 + +34040003 +34040005 +14850003 +00000000 +00000008 +00000000 +34020001 +00000008 + +register_v0 = 1 + +==DIV Divide== //May need other testcases for -ve/+ve, -ve/-ve + +ORI $4,$0,3 +ORI $5,$0,9 +DIV $5,$4 +MFHI $4 +MFLO $5 +ADDU $2,$4,$5 +JR $0 + +34040003 +34050009 +00A4001A +00002010 +00002812 +00851021 +00000008 + +register_v0 = 3 + +==DIVU Divide unsigned== //May need other testcases for -ve/+ve, -ve/-ve + +LUI $4,0x8000 +ORI $5,$0,2 +DIVU $4,$5 +MFHI $4 +MFLO $5 +ADDU $2,$4,$5 +JR $0 + +34048000 +34050002 +0085001B +00002010 +00002812 +00851021 +00000008 + +register_v0 = 0x40000000 + +==J Jump== + +J 4 +NOP +JR $0 +NOP +ORI $2,$0,1 +JR $0 + +08000004 +00000000 +00000008 +00000000 +34020001 +00000008 + +register_v0 = 1 + +==JALR Jump and link register== + +ORI $5,$0,0x001C +LUI $5,0xBFC0 +JALR $4,$5 +NOP +ADDIU $2,$2,1 +JR $0 +NOP +ORI $2,$0,1 +JR $4 + +3405001C +3C05BCF0 +00A02009 +00000000 +24420001 +00000008 +00000000 +34020001 +00800008 + +register_v0 = 2 + +==JAL Jump and link== + +JAL 5 +NOP +ADDIU $2,$2,1 +JR $0 +NOP +ORI $2,$0,1 +JR $31 + +0C000005 +00000000 +24420001 +00000008 +00000000 +34020001 +03E00008 + +register_v0 = 2 + +==JR Jump register== + +ORI $5,$0,0x0014 +LUI $5,0xBFC0 +JR $5 +NOP +JR $0 +NOP +ORI $2,$0,1 +JR $0 + +34050014 +3C05BCF0 +00A00008 +00000000 +00000008 +34020001 +00000008 + +register_v0 = 1 + +==LB Load byte== + +ORI $4,$0,0x1003 +LB $2,3($4) +JR $0 + +-Instruction Hex + +34041003 +80820003 +00000008 + +-Memory Hex + +00000000 +008A0000 +00000000 +00000000 + +register_v0 = 0xFFFFFF8A + +==LBU Load byte unsigned== + +ORI $4,$0,0x1003 +LBU $2,3($4) +JR $0 + +-Instruction Hex + +34041003 +90820003 +00000008 + +-Memory Hex + +00000000 +008A0000 +00000000 +00000000 + +register_v0 = 0x0000008A + +==LH Load half-word== + +ORI $4,$0,0x1003 +LH $2,4($4) +JR $0 + +-Instruction Hex + +34041003 +84820004 +00000008 + +-Memory Hex + +00000000 +00008123 +00000000 +00000000 + +register_v0 = 0xFFFF8123 + +==LHU Load half-word unsigned== + +ORI $4,$0,0x1003 +LHU $2,4($4) +JR $0 + +-Instruction Hex + +34041003 +94820004 +00000008 + +-Memory Hex + +00000000 +00008123 +00000000 +00000000 + +register_v0 = 0x00008123 + +==LUI Load upper immediate== + +ORI $2,$0,0x5678 +LUI $2,0x1234 +JR $0 + +34045678 +3C021234 +00000008 + +register_v0 = 0x12345678 + +==LW Load word== + +ORI $4,$0,0x1002 +LW $2, 2($4) +JR $0 + +-Instruction Hex + +34041002 +8C820002 +00000008 + +-Memory Hex + +00000000 +12345678 +00000000 +00000000 + +register_v0 = 0x12345678 + +==LWL Load word left== + +ORI $4,$0,0x1003 +ORI $2,$0,0x5678 +LWL $2,3($4) +JR $0 + +-Instruction Hex + +34041003 +34025678 +88820003 +00000008 + +-Memory Hex + +00000000 +AAAA1234 +00000000 +00000000 + +register_v0 = 0x12345678 + +==LWR Load word right== + +ORI $4,$0,0x1003 +LUI $2,0x1234 +LWR $2,2($4) +JR $0 + +-Instruction Hex + +34041003 +3C021234 +98820002 +00000008 + +-Memory Hex + +00000000 +5678AAAA +00000000 +00000000 + +register_v0 = 0x12345678 + +// DIVU Divide unsigned + +// DIV Divide + +//MFHI Move from Hi + +//MFLO Move from lo + +//MTHI Move to HI + +//MTLO Move to LO + +//MULT Multiply** + +//MULTU Multiply unsigned** + +//OR Bitwise or + +//ORI Bitwise or immediate + +//SB Store byte + +//SH Store half-word** + +//SLL Shift left logical + +//SLLV Shift left logical variable + +//SLT Set on less than (signed) + +//SLTI Set on less than immediate (signed) + +//SLTIU Set on less than immediate unsigned + +//SLTU Set on less than unsigned + +//SRA Shift right arithmetic + +//SRAV Shift right arithmetic + +//SRL Shift right logical + +//SRLV Shift right logical variable + +//SUBU Subtract unsigned + +//SW Store word + +//XOR Bitwise exclusive or + +//XORI Bitwise exclusive or immediate