From b8123998443f698dc59897fa8b01df44cfc94e6e Mon Sep 17 00:00:00 2001 From: jl7719 Date: Tue, 15 Dec 2020 15:06:04 +0000 Subject: [PATCH] Fix to allow multiple testcases for each instruction --- .gitignore | 4 +- .../{addiu.ref.txt => addiu/addiu-1.ref.txt} | 0 inputs/{addiu.txt => addiu/addiu-1.txt} | 0 inputs/{addu.ref.txt => addu/addu-1.ref.txt} | 0 inputs/{addu.txt => addu/addu-1.txt} | 0 inputs/{and.ref.txt => and/and-1.ref.txt} | 0 inputs/{and.txt => and/and-1.txt} | 0 inputs/{andi.ref.txt => andi/andi-1.ref.txt} | 0 inputs/{andi.txt => andi/andi-1.txt} | 0 inputs/{beq.ref.txt => beq/beq-1.ref.txt} | 0 inputs/{beq.txt => beq/beq-1.txt} | 0 inputs/{bgez.ref.txt => bgez/bgez-1.ref.txt} | 0 inputs/{bgez.txt => bgez/bgez-1.txt} | 0 .../bgezal-1.ref.txt} | 0 inputs/{bgezal.txt => bgezal/bgezal-1.txt} | 0 inputs/{bgtz.ref.txt => bgtz/bgtz-1.ref.txt} | 0 inputs/{bgtz.txt => bgtz/bgtz-1.txt} | 0 inputs/{blez.ref.txt => blez/blez-1.ref.txt} | 0 inputs/{blez.txt => blez/blez-1.txt} | 0 inputs/{bltz.ref.txt => bltz/bltz-1.ref.txt} | 0 inputs/{bltz.txt => bltz/bltz-1.txt} | 0 .../bltzal-1.ref.txt} | 0 inputs/{bltzal.txt => bltzal/bltzal-1.txt} | 0 inputs/{bne.ref.txt => bne/bne-1.ref.txt} | 0 inputs/{bne.txt => bne/bne-1.txt} | 0 inputs/{div.ref.txt => div/div-1.ref.txt} | 0 inputs/{div.txt => div/div-1.txt} | 0 inputs/{divu.txt => divu/divu-1.txt} | 0 inputs/{j.ref.txt => j/j-1.ref.txt} | 0 inputs/{j.txt => j/j-1.txt} | 0 inputs/{jal.ref.txt => jal/jal-1.ref.txt} | 0 inputs/{jal.txt => jal/jal-1.txt} | 0 inputs/{jalr.ref.txt => jalr/jalr-1.ref.txt} | 0 inputs/{jalr.txt => jalr/jalr-1.txt} | 0 inputs/{jr.ref.txt => jr/jr-1.ref.txt} | 0 inputs/{jr.txt => jr/jr-1.txt} | 0 inputs/{lb.data.txt => lb/lb-1.data.txt} | 0 inputs/{lb.ref.txt => lb/lb-1.ref.txt} | 0 inputs/{lb.txt => lb/lb-1.txt} | 0 inputs/{lbu.data.txt => lbu/lbu-1.data.txt} | 0 inputs/{lbu.ref.txt => lbu/lbu-1.ref.txt} | 0 inputs/{lbu.txt => lbu/lbu-1.txt} | 0 inputs/{lh.data.txt => lh/lh-1.data.txt} | 0 inputs/{lh.ref.txt => lh/lh-1.ref.txt} | 0 inputs/{lh.txt => lh/lh-1.txt} | 0 inputs/{lhu.data.txt => lhu/lhu-1.data.txt} | 0 inputs/{lhu.ref.txt => lhu/lhu-1.ref.txt} | 0 inputs/{lhu.txt => lhu/lhu-1.txt} | 0 inputs/{lui.ref.txt => lui/lui-1.ref.txt} | 0 inputs/{lui.txt => lui/lui-1.txt} | 0 inputs/{lw.data.txt => lw/lw-1.data.txt} | 0 inputs/{lw.ref.txt => lw/lw-1.ref.txt} | 0 inputs/{lw.txt => lw/lw-1.txt} | 0 inputs/{lwl.data.txt => lwl/lwl-1.data.txt} | 0 inputs/{lwl.ref.txt => lwl/lwl-1.ref.txt} | 0 inputs/{lwl.txt => lwl/lwl-1.txt} | 0 inputs/{lwr.data.txt => lwr/lwr-1.data.txt} | 0 inputs/{lwr.ref.txt => lwr/lwr-1.ref.txt} | 0 inputs/{lwr.txt => lwr/lwr-1.txt} | 0 inputs/{mfhi.ref.txt => mfhi/mfhi-1.ref.txt} | 0 inputs/{mfhi.txt => mfhi/mfhi-1.txt} | 0 inputs/{mflo.ref.txt => mflo/mflo-1.ref.txt} | 0 inputs/{mflo.txt => mflo/mflo-1.txt} | 0 inputs/{mthi.ref.txt => mthi/mthi-1.ref.txt} | 0 inputs/{mthi.txt => mthi/mthi-1.txt} | 0 inputs/{mtlo.txt => mtlo/mtlo-1.txt} | 0 inputs/{mult.ref.txt => mult/mult-1.ref.txt} | 0 inputs/{mult.txt => mult/mult-1.txt} | 0 .../multcurrent-1.txt} | 0 .../{multu.ref.txt => multu/multu-1.ref.txt} | 0 inputs/{multu.txt => multu/multu-1.txt} | 0 .../multucurrent-1.txt} | 0 inputs/{or.ref.txt => or/or-1.ref.txt} | 0 inputs/{or.txt => or/or-1.txt} | 0 inputs/{ori.ref.txt => ori/ori-1.ref.txt} | 0 inputs/{ori.txt => ori/ori-1.txt} | 0 inputs/{sb.txt => sb/sb-1.txt} | 0 inputs/{sh.txt => sh/sh-1.txt} | 0 inputs/{sll.ref.txt => sll/sll-1.ref.txt} | 0 inputs/{sll.txt => sll/sll-1.txt} | 0 inputs/{sllv.ref.txt => sllv/sllv-1.ref.txt} | 0 inputs/{sllv.txt => sllv/sllv-1.txt} | 0 inputs/slt.ref.txt | 1 - inputs/{bqtz.ref.txt => slt/slt-1.ref.txt} | 0 inputs/{slt.txt => slt/slt-1.txt} | 0 inputs/{slti.ref.txt => slti/slti-1.ref.txt} | 0 inputs/{slti.txt => slti/slti-1.txt} | 0 .../{sltiu.ref.txt => sltiu/sltiu-1.ref.txt} | 0 inputs/{sltiu.txt => sltiu/sltiu-1.txt} | 0 inputs/{sltu.ref.txt => sltu/sltu-1.ref.txt} | 0 inputs/{sltu.txt => sltu/sltu-1.txt} | 0 inputs/{sra.ref.txt => sra/sra-1.ref.txt} | 0 inputs/{sra.txt => sra/sra-1.txt} | 0 inputs/{srav.ref.txt => srav/srav-1.ref.txt} | 0 inputs/{srav.txt => srav/srav-1.txt} | 0 inputs/{srl.ref.txt => srl/srl-1.ref.txt} | 0 inputs/{srl.txt => srl/srl-1.txt} | 0 inputs/{srlv.ref.txt => srlv/srlv-1.ref.txt} | 0 inputs/{srlv.txt => srlv/srlv-1.txt} | 0 inputs/{subu.ref.txt => subu/subu-1.ref.txt} | 0 inputs/{subu.txt => subu/subu-1.txt} | 0 inputs/{sw.ref.txt => sw/sw-1.ref.txt} | 0 inputs/{sw.txt => sw/sw-1.txt} | 0 inputs/{xor.ref.txt => xor/xor-1.ref.txt} | 0 inputs/{xor.txt => xor/xor-1.txt} | 0 inputs/{xori.ref.txt => xori/xori-1.ref.txt} | 0 inputs/{xori.txt => xori/xori-1.txt} | 0 .../ibrahimreference.txt | 0 {inputs/reference => reference}/reference.txt | 0 test/test_mips_cpu_harvard.sh | 91 +++++++++---------- 110 files changed, 45 insertions(+), 51 deletions(-) rename inputs/{addiu.ref.txt => addiu/addiu-1.ref.txt} (100%) rename inputs/{addiu.txt => addiu/addiu-1.txt} (100%) rename inputs/{addu.ref.txt => addu/addu-1.ref.txt} (100%) rename inputs/{addu.txt => addu/addu-1.txt} (100%) rename inputs/{and.ref.txt => and/and-1.ref.txt} (100%) rename inputs/{and.txt => and/and-1.txt} (100%) rename inputs/{andi.ref.txt => andi/andi-1.ref.txt} (100%) rename inputs/{andi.txt => andi/andi-1.txt} (100%) rename inputs/{beq.ref.txt => beq/beq-1.ref.txt} (100%) rename inputs/{beq.txt => beq/beq-1.txt} (100%) rename inputs/{bgez.ref.txt => bgez/bgez-1.ref.txt} (100%) rename inputs/{bgez.txt => bgez/bgez-1.txt} (100%) rename inputs/{bgezal.ref.txt => bgezal/bgezal-1.ref.txt} (100%) rename inputs/{bgezal.txt => bgezal/bgezal-1.txt} (100%) rename inputs/{bgtz.ref.txt => bgtz/bgtz-1.ref.txt} (100%) rename inputs/{bgtz.txt => bgtz/bgtz-1.txt} (100%) rename inputs/{blez.ref.txt => blez/blez-1.ref.txt} (100%) rename inputs/{blez.txt => blez/blez-1.txt} (100%) rename inputs/{bltz.ref.txt => bltz/bltz-1.ref.txt} (100%) rename inputs/{bltz.txt => bltz/bltz-1.txt} (100%) rename inputs/{bltzal.ref.txt => bltzal/bltzal-1.ref.txt} (100%) rename inputs/{bltzal.txt => bltzal/bltzal-1.txt} (100%) rename inputs/{bne.ref.txt => bne/bne-1.ref.txt} (100%) rename inputs/{bne.txt => bne/bne-1.txt} (100%) rename inputs/{div.ref.txt => div/div-1.ref.txt} (100%) rename inputs/{div.txt => div/div-1.txt} (100%) rename inputs/{divu.txt => divu/divu-1.txt} (100%) rename inputs/{j.ref.txt => j/j-1.ref.txt} (100%) rename inputs/{j.txt => j/j-1.txt} (100%) rename inputs/{jal.ref.txt => jal/jal-1.ref.txt} (100%) rename inputs/{jal.txt => jal/jal-1.txt} (100%) rename inputs/{jalr.ref.txt => jalr/jalr-1.ref.txt} (100%) rename inputs/{jalr.txt => jalr/jalr-1.txt} (100%) rename inputs/{jr.ref.txt => jr/jr-1.ref.txt} (100%) rename inputs/{jr.txt => jr/jr-1.txt} (100%) rename inputs/{lb.data.txt => lb/lb-1.data.txt} (100%) rename inputs/{lb.ref.txt => lb/lb-1.ref.txt} (100%) rename inputs/{lb.txt => lb/lb-1.txt} (100%) rename inputs/{lbu.data.txt => lbu/lbu-1.data.txt} (100%) rename inputs/{lbu.ref.txt => lbu/lbu-1.ref.txt} (100%) rename inputs/{lbu.txt => lbu/lbu-1.txt} (100%) rename inputs/{lh.data.txt => lh/lh-1.data.txt} (100%) rename inputs/{lh.ref.txt => lh/lh-1.ref.txt} (100%) rename inputs/{lh.txt => lh/lh-1.txt} (100%) rename inputs/{lhu.data.txt => lhu/lhu-1.data.txt} (100%) rename inputs/{lhu.ref.txt => lhu/lhu-1.ref.txt} (100%) rename inputs/{lhu.txt => lhu/lhu-1.txt} (100%) rename inputs/{lui.ref.txt => lui/lui-1.ref.txt} (100%) rename inputs/{lui.txt => lui/lui-1.txt} (100%) rename inputs/{lw.data.txt => lw/lw-1.data.txt} (100%) rename inputs/{lw.ref.txt => lw/lw-1.ref.txt} (100%) rename inputs/{lw.txt => lw/lw-1.txt} (100%) rename inputs/{lwl.data.txt => lwl/lwl-1.data.txt} (100%) rename inputs/{lwl.ref.txt => lwl/lwl-1.ref.txt} (100%) rename inputs/{lwl.txt => lwl/lwl-1.txt} (100%) rename inputs/{lwr.data.txt => lwr/lwr-1.data.txt} (100%) rename inputs/{lwr.ref.txt => lwr/lwr-1.ref.txt} (100%) rename inputs/{lwr.txt => lwr/lwr-1.txt} (100%) rename inputs/{mfhi.ref.txt => mfhi/mfhi-1.ref.txt} (100%) rename inputs/{mfhi.txt => mfhi/mfhi-1.txt} (100%) rename inputs/{mflo.ref.txt => mflo/mflo-1.ref.txt} (100%) rename inputs/{mflo.txt => mflo/mflo-1.txt} (100%) rename inputs/{mthi.ref.txt => mthi/mthi-1.ref.txt} (100%) rename inputs/{mthi.txt => mthi/mthi-1.txt} (100%) rename inputs/{mtlo.txt => mtlo/mtlo-1.txt} (100%) rename inputs/{mult.ref.txt => mult/mult-1.ref.txt} (100%) rename inputs/{mult.txt => mult/mult-1.txt} (100%) rename inputs/{multcurrent.txt => multcurrent/multcurrent-1.txt} (100%) rename inputs/{multu.ref.txt => multu/multu-1.ref.txt} (100%) rename inputs/{multu.txt => multu/multu-1.txt} (100%) rename inputs/{multucurrent.txt => multucurrent/multucurrent-1.txt} (100%) rename inputs/{or.ref.txt => or/or-1.ref.txt} (100%) rename inputs/{or.txt => or/or-1.txt} (100%) rename inputs/{ori.ref.txt => ori/ori-1.ref.txt} (100%) rename inputs/{ori.txt => ori/ori-1.txt} (100%) rename inputs/{sb.txt => sb/sb-1.txt} (100%) rename inputs/{sh.txt => sh/sh-1.txt} (100%) rename inputs/{sll.ref.txt => sll/sll-1.ref.txt} (100%) rename inputs/{sll.txt => sll/sll-1.txt} (100%) rename inputs/{sllv.ref.txt => sllv/sllv-1.ref.txt} (100%) rename inputs/{sllv.txt => sllv/sllv-1.txt} (100%) delete mode 100644 inputs/slt.ref.txt rename inputs/{bqtz.ref.txt => slt/slt-1.ref.txt} (100%) rename inputs/{slt.txt => slt/slt-1.txt} (100%) rename inputs/{slti.ref.txt => slti/slti-1.ref.txt} (100%) rename inputs/{slti.txt => slti/slti-1.txt} (100%) rename inputs/{sltiu.ref.txt => sltiu/sltiu-1.ref.txt} (100%) rename inputs/{sltiu.txt => sltiu/sltiu-1.txt} (100%) rename inputs/{sltu.ref.txt => sltu/sltu-1.ref.txt} (100%) rename inputs/{sltu.txt => sltu/sltu-1.txt} (100%) rename inputs/{sra.ref.txt => sra/sra-1.ref.txt} (100%) rename inputs/{sra.txt => sra/sra-1.txt} (100%) rename inputs/{srav.ref.txt => srav/srav-1.ref.txt} (100%) rename inputs/{srav.txt => srav/srav-1.txt} (100%) rename inputs/{srl.ref.txt => srl/srl-1.ref.txt} (100%) rename inputs/{srl.txt => srl/srl-1.txt} (100%) rename inputs/{srlv.ref.txt => srlv/srlv-1.ref.txt} (100%) rename inputs/{srlv.txt => srlv/srlv-1.txt} (100%) rename inputs/{subu.ref.txt => subu/subu-1.ref.txt} (100%) rename inputs/{subu.txt => subu/subu-1.txt} (100%) rename inputs/{sw.ref.txt => sw/sw-1.ref.txt} (100%) rename inputs/{sw.txt => sw/sw-1.txt} (100%) rename inputs/{xor.ref.txt => xor/xor-1.ref.txt} (100%) rename inputs/{xor.txt => xor/xor-1.txt} (100%) rename inputs/{xori.ref.txt => xori/xori-1.ref.txt} (100%) rename inputs/{xori.txt => xori/xori-1.txt} (100%) rename {inputs/reference => reference}/ibrahimreference.txt (100%) rename {inputs/reference => reference}/reference.txt (100%) diff --git a/.gitignore b/.gitignore index 2b0cdb5..b66d3d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ exec/* !exec/executable.txt -inputs/*.log.txt -inputs/*.out.txt +*.log.txt +*.out.txt mips_cpu_harvard.vcd \ No newline at end of file diff --git a/inputs/addiu.ref.txt b/inputs/addiu/addiu-1.ref.txt similarity index 100% rename from inputs/addiu.ref.txt rename to inputs/addiu/addiu-1.ref.txt diff --git a/inputs/addiu.txt b/inputs/addiu/addiu-1.txt similarity index 100% rename from inputs/addiu.txt rename to inputs/addiu/addiu-1.txt diff --git a/inputs/addu.ref.txt b/inputs/addu/addu-1.ref.txt similarity index 100% rename from inputs/addu.ref.txt rename to inputs/addu/addu-1.ref.txt diff --git a/inputs/addu.txt b/inputs/addu/addu-1.txt similarity index 100% rename from inputs/addu.txt rename to inputs/addu/addu-1.txt diff --git a/inputs/and.ref.txt b/inputs/and/and-1.ref.txt similarity index 100% rename from inputs/and.ref.txt rename to inputs/and/and-1.ref.txt diff --git a/inputs/and.txt b/inputs/and/and-1.txt similarity index 100% rename from inputs/and.txt rename to inputs/and/and-1.txt diff --git a/inputs/andi.ref.txt b/inputs/andi/andi-1.ref.txt similarity index 100% rename from inputs/andi.ref.txt rename to inputs/andi/andi-1.ref.txt diff --git a/inputs/andi.txt b/inputs/andi/andi-1.txt similarity index 100% rename from inputs/andi.txt rename to inputs/andi/andi-1.txt diff --git a/inputs/beq.ref.txt b/inputs/beq/beq-1.ref.txt similarity index 100% rename from inputs/beq.ref.txt rename to inputs/beq/beq-1.ref.txt diff --git a/inputs/beq.txt b/inputs/beq/beq-1.txt similarity index 100% rename from inputs/beq.txt rename to inputs/beq/beq-1.txt diff --git a/inputs/bgez.ref.txt b/inputs/bgez/bgez-1.ref.txt similarity index 100% rename from inputs/bgez.ref.txt rename to inputs/bgez/bgez-1.ref.txt diff --git a/inputs/bgez.txt b/inputs/bgez/bgez-1.txt similarity index 100% rename from inputs/bgez.txt rename to inputs/bgez/bgez-1.txt diff --git a/inputs/bgezal.ref.txt b/inputs/bgezal/bgezal-1.ref.txt similarity index 100% rename from inputs/bgezal.ref.txt rename to inputs/bgezal/bgezal-1.ref.txt diff --git a/inputs/bgezal.txt b/inputs/bgezal/bgezal-1.txt similarity index 100% rename from inputs/bgezal.txt rename to inputs/bgezal/bgezal-1.txt diff --git a/inputs/bgtz.ref.txt b/inputs/bgtz/bgtz-1.ref.txt similarity index 100% rename from inputs/bgtz.ref.txt rename to inputs/bgtz/bgtz-1.ref.txt diff --git a/inputs/bgtz.txt b/inputs/bgtz/bgtz-1.txt similarity index 100% rename from inputs/bgtz.txt rename to inputs/bgtz/bgtz-1.txt diff --git a/inputs/blez.ref.txt b/inputs/blez/blez-1.ref.txt similarity index 100% rename from inputs/blez.ref.txt rename to inputs/blez/blez-1.ref.txt diff --git a/inputs/blez.txt b/inputs/blez/blez-1.txt similarity index 100% rename from inputs/blez.txt rename to inputs/blez/blez-1.txt diff --git a/inputs/bltz.ref.txt b/inputs/bltz/bltz-1.ref.txt similarity index 100% rename from inputs/bltz.ref.txt rename to inputs/bltz/bltz-1.ref.txt diff --git a/inputs/bltz.txt b/inputs/bltz/bltz-1.txt similarity index 100% rename from inputs/bltz.txt rename to inputs/bltz/bltz-1.txt diff --git a/inputs/bltzal.ref.txt b/inputs/bltzal/bltzal-1.ref.txt similarity index 100% rename from inputs/bltzal.ref.txt rename to inputs/bltzal/bltzal-1.ref.txt diff --git a/inputs/bltzal.txt b/inputs/bltzal/bltzal-1.txt similarity index 100% rename from inputs/bltzal.txt rename to inputs/bltzal/bltzal-1.txt diff --git a/inputs/bne.ref.txt b/inputs/bne/bne-1.ref.txt similarity index 100% rename from inputs/bne.ref.txt rename to inputs/bne/bne-1.ref.txt diff --git a/inputs/bne.txt b/inputs/bne/bne-1.txt similarity index 100% rename from inputs/bne.txt rename to inputs/bne/bne-1.txt diff --git a/inputs/div.ref.txt b/inputs/div/div-1.ref.txt similarity index 100% rename from inputs/div.ref.txt rename to inputs/div/div-1.ref.txt diff --git a/inputs/div.txt b/inputs/div/div-1.txt similarity index 100% rename from inputs/div.txt rename to inputs/div/div-1.txt diff --git a/inputs/divu.txt b/inputs/divu/divu-1.txt similarity index 100% rename from inputs/divu.txt rename to inputs/divu/divu-1.txt diff --git a/inputs/j.ref.txt b/inputs/j/j-1.ref.txt similarity index 100% rename from inputs/j.ref.txt rename to inputs/j/j-1.ref.txt diff --git a/inputs/j.txt b/inputs/j/j-1.txt similarity index 100% rename from inputs/j.txt rename to inputs/j/j-1.txt diff --git a/inputs/jal.ref.txt b/inputs/jal/jal-1.ref.txt similarity index 100% rename from inputs/jal.ref.txt rename to inputs/jal/jal-1.ref.txt diff --git a/inputs/jal.txt b/inputs/jal/jal-1.txt similarity index 100% rename from inputs/jal.txt rename to inputs/jal/jal-1.txt diff --git a/inputs/jalr.ref.txt b/inputs/jalr/jalr-1.ref.txt similarity index 100% rename from inputs/jalr.ref.txt rename to inputs/jalr/jalr-1.ref.txt diff --git a/inputs/jalr.txt b/inputs/jalr/jalr-1.txt similarity index 100% rename from inputs/jalr.txt rename to inputs/jalr/jalr-1.txt diff --git a/inputs/jr.ref.txt b/inputs/jr/jr-1.ref.txt similarity index 100% rename from inputs/jr.ref.txt rename to inputs/jr/jr-1.ref.txt diff --git a/inputs/jr.txt b/inputs/jr/jr-1.txt similarity index 100% rename from inputs/jr.txt rename to inputs/jr/jr-1.txt diff --git a/inputs/lb.data.txt b/inputs/lb/lb-1.data.txt similarity index 100% rename from inputs/lb.data.txt rename to inputs/lb/lb-1.data.txt diff --git a/inputs/lb.ref.txt b/inputs/lb/lb-1.ref.txt similarity index 100% rename from inputs/lb.ref.txt rename to inputs/lb/lb-1.ref.txt diff --git a/inputs/lb.txt b/inputs/lb/lb-1.txt similarity index 100% rename from inputs/lb.txt rename to inputs/lb/lb-1.txt diff --git a/inputs/lbu.data.txt b/inputs/lbu/lbu-1.data.txt similarity index 100% rename from inputs/lbu.data.txt rename to inputs/lbu/lbu-1.data.txt diff --git a/inputs/lbu.ref.txt b/inputs/lbu/lbu-1.ref.txt similarity index 100% rename from inputs/lbu.ref.txt rename to inputs/lbu/lbu-1.ref.txt diff --git a/inputs/lbu.txt b/inputs/lbu/lbu-1.txt similarity index 100% rename from inputs/lbu.txt rename to inputs/lbu/lbu-1.txt diff --git a/inputs/lh.data.txt b/inputs/lh/lh-1.data.txt similarity index 100% rename from inputs/lh.data.txt rename to inputs/lh/lh-1.data.txt diff --git a/inputs/lh.ref.txt b/inputs/lh/lh-1.ref.txt similarity index 100% rename from inputs/lh.ref.txt rename to inputs/lh/lh-1.ref.txt diff --git a/inputs/lh.txt b/inputs/lh/lh-1.txt similarity index 100% rename from inputs/lh.txt rename to inputs/lh/lh-1.txt diff --git a/inputs/lhu.data.txt b/inputs/lhu/lhu-1.data.txt similarity index 100% rename from inputs/lhu.data.txt rename to inputs/lhu/lhu-1.data.txt diff --git a/inputs/lhu.ref.txt b/inputs/lhu/lhu-1.ref.txt similarity index 100% rename from inputs/lhu.ref.txt rename to inputs/lhu/lhu-1.ref.txt diff --git a/inputs/lhu.txt b/inputs/lhu/lhu-1.txt similarity index 100% rename from inputs/lhu.txt rename to inputs/lhu/lhu-1.txt diff --git a/inputs/lui.ref.txt b/inputs/lui/lui-1.ref.txt similarity index 100% rename from inputs/lui.ref.txt rename to inputs/lui/lui-1.ref.txt diff --git a/inputs/lui.txt b/inputs/lui/lui-1.txt similarity index 100% rename from inputs/lui.txt rename to inputs/lui/lui-1.txt diff --git a/inputs/lw.data.txt b/inputs/lw/lw-1.data.txt similarity index 100% rename from inputs/lw.data.txt rename to inputs/lw/lw-1.data.txt diff --git a/inputs/lw.ref.txt b/inputs/lw/lw-1.ref.txt similarity index 100% rename from inputs/lw.ref.txt rename to inputs/lw/lw-1.ref.txt diff --git a/inputs/lw.txt b/inputs/lw/lw-1.txt similarity index 100% rename from inputs/lw.txt rename to inputs/lw/lw-1.txt diff --git a/inputs/lwl.data.txt b/inputs/lwl/lwl-1.data.txt similarity index 100% rename from inputs/lwl.data.txt rename to inputs/lwl/lwl-1.data.txt diff --git a/inputs/lwl.ref.txt b/inputs/lwl/lwl-1.ref.txt similarity index 100% rename from inputs/lwl.ref.txt rename to inputs/lwl/lwl-1.ref.txt diff --git a/inputs/lwl.txt b/inputs/lwl/lwl-1.txt similarity index 100% rename from inputs/lwl.txt rename to inputs/lwl/lwl-1.txt diff --git a/inputs/lwr.data.txt b/inputs/lwr/lwr-1.data.txt similarity index 100% rename from inputs/lwr.data.txt rename to inputs/lwr/lwr-1.data.txt diff --git a/inputs/lwr.ref.txt b/inputs/lwr/lwr-1.ref.txt similarity index 100% rename from inputs/lwr.ref.txt rename to inputs/lwr/lwr-1.ref.txt diff --git a/inputs/lwr.txt b/inputs/lwr/lwr-1.txt similarity index 100% rename from inputs/lwr.txt rename to inputs/lwr/lwr-1.txt diff --git a/inputs/mfhi.ref.txt b/inputs/mfhi/mfhi-1.ref.txt similarity index 100% rename from inputs/mfhi.ref.txt rename to inputs/mfhi/mfhi-1.ref.txt diff --git a/inputs/mfhi.txt b/inputs/mfhi/mfhi-1.txt similarity index 100% rename from inputs/mfhi.txt rename to inputs/mfhi/mfhi-1.txt diff --git a/inputs/mflo.ref.txt b/inputs/mflo/mflo-1.ref.txt similarity index 100% rename from inputs/mflo.ref.txt rename to inputs/mflo/mflo-1.ref.txt diff --git a/inputs/mflo.txt b/inputs/mflo/mflo-1.txt similarity index 100% rename from inputs/mflo.txt rename to inputs/mflo/mflo-1.txt diff --git a/inputs/mthi.ref.txt b/inputs/mthi/mthi-1.ref.txt similarity index 100% rename from inputs/mthi.ref.txt rename to inputs/mthi/mthi-1.ref.txt diff --git a/inputs/mthi.txt b/inputs/mthi/mthi-1.txt similarity index 100% rename from inputs/mthi.txt rename to inputs/mthi/mthi-1.txt diff --git a/inputs/mtlo.txt b/inputs/mtlo/mtlo-1.txt similarity index 100% rename from inputs/mtlo.txt rename to inputs/mtlo/mtlo-1.txt diff --git a/inputs/mult.ref.txt b/inputs/mult/mult-1.ref.txt similarity index 100% rename from inputs/mult.ref.txt rename to inputs/mult/mult-1.ref.txt diff --git a/inputs/mult.txt b/inputs/mult/mult-1.txt similarity index 100% rename from inputs/mult.txt rename to inputs/mult/mult-1.txt diff --git a/inputs/multcurrent.txt b/inputs/multcurrent/multcurrent-1.txt similarity index 100% rename from inputs/multcurrent.txt rename to inputs/multcurrent/multcurrent-1.txt diff --git a/inputs/multu.ref.txt b/inputs/multu/multu-1.ref.txt similarity index 100% rename from inputs/multu.ref.txt rename to inputs/multu/multu-1.ref.txt diff --git a/inputs/multu.txt b/inputs/multu/multu-1.txt similarity index 100% rename from inputs/multu.txt rename to inputs/multu/multu-1.txt diff --git a/inputs/multucurrent.txt b/inputs/multucurrent/multucurrent-1.txt similarity index 100% rename from inputs/multucurrent.txt rename to inputs/multucurrent/multucurrent-1.txt diff --git a/inputs/or.ref.txt b/inputs/or/or-1.ref.txt similarity index 100% rename from inputs/or.ref.txt rename to inputs/or/or-1.ref.txt diff --git a/inputs/or.txt b/inputs/or/or-1.txt similarity index 100% rename from inputs/or.txt rename to inputs/or/or-1.txt diff --git a/inputs/ori.ref.txt b/inputs/ori/ori-1.ref.txt similarity index 100% rename from inputs/ori.ref.txt rename to inputs/ori/ori-1.ref.txt diff --git a/inputs/ori.txt b/inputs/ori/ori-1.txt similarity index 100% rename from inputs/ori.txt rename to inputs/ori/ori-1.txt diff --git a/inputs/sb.txt b/inputs/sb/sb-1.txt similarity index 100% rename from inputs/sb.txt rename to inputs/sb/sb-1.txt diff --git a/inputs/sh.txt b/inputs/sh/sh-1.txt similarity index 100% rename from inputs/sh.txt rename to inputs/sh/sh-1.txt diff --git a/inputs/sll.ref.txt b/inputs/sll/sll-1.ref.txt similarity index 100% rename from inputs/sll.ref.txt rename to inputs/sll/sll-1.ref.txt diff --git a/inputs/sll.txt b/inputs/sll/sll-1.txt similarity index 100% rename from inputs/sll.txt rename to inputs/sll/sll-1.txt diff --git a/inputs/sllv.ref.txt b/inputs/sllv/sllv-1.ref.txt similarity index 100% rename from inputs/sllv.ref.txt rename to inputs/sllv/sllv-1.ref.txt diff --git a/inputs/sllv.txt b/inputs/sllv/sllv-1.txt similarity index 100% rename from inputs/sllv.txt rename to inputs/sllv/sllv-1.txt diff --git a/inputs/slt.ref.txt b/inputs/slt.ref.txt deleted file mode 100644 index 56a6051..0000000 --- a/inputs/slt.ref.txt +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/inputs/bqtz.ref.txt b/inputs/slt/slt-1.ref.txt similarity index 100% rename from inputs/bqtz.ref.txt rename to inputs/slt/slt-1.ref.txt diff --git a/inputs/slt.txt b/inputs/slt/slt-1.txt similarity index 100% rename from inputs/slt.txt rename to inputs/slt/slt-1.txt diff --git a/inputs/slti.ref.txt b/inputs/slti/slti-1.ref.txt similarity index 100% rename from inputs/slti.ref.txt rename to inputs/slti/slti-1.ref.txt diff --git a/inputs/slti.txt b/inputs/slti/slti-1.txt similarity index 100% rename from inputs/slti.txt rename to inputs/slti/slti-1.txt diff --git a/inputs/sltiu.ref.txt b/inputs/sltiu/sltiu-1.ref.txt similarity index 100% rename from inputs/sltiu.ref.txt rename to inputs/sltiu/sltiu-1.ref.txt diff --git a/inputs/sltiu.txt b/inputs/sltiu/sltiu-1.txt similarity index 100% rename from inputs/sltiu.txt rename to inputs/sltiu/sltiu-1.txt diff --git a/inputs/sltu.ref.txt b/inputs/sltu/sltu-1.ref.txt similarity index 100% rename from inputs/sltu.ref.txt rename to inputs/sltu/sltu-1.ref.txt diff --git a/inputs/sltu.txt b/inputs/sltu/sltu-1.txt similarity index 100% rename from inputs/sltu.txt rename to inputs/sltu/sltu-1.txt diff --git a/inputs/sra.ref.txt b/inputs/sra/sra-1.ref.txt similarity index 100% rename from inputs/sra.ref.txt rename to inputs/sra/sra-1.ref.txt diff --git a/inputs/sra.txt b/inputs/sra/sra-1.txt similarity index 100% rename from inputs/sra.txt rename to inputs/sra/sra-1.txt diff --git a/inputs/srav.ref.txt b/inputs/srav/srav-1.ref.txt similarity index 100% rename from inputs/srav.ref.txt rename to inputs/srav/srav-1.ref.txt diff --git a/inputs/srav.txt b/inputs/srav/srav-1.txt similarity index 100% rename from inputs/srav.txt rename to inputs/srav/srav-1.txt diff --git a/inputs/srl.ref.txt b/inputs/srl/srl-1.ref.txt similarity index 100% rename from inputs/srl.ref.txt rename to inputs/srl/srl-1.ref.txt diff --git a/inputs/srl.txt b/inputs/srl/srl-1.txt similarity index 100% rename from inputs/srl.txt rename to inputs/srl/srl-1.txt diff --git a/inputs/srlv.ref.txt b/inputs/srlv/srlv-1.ref.txt similarity index 100% rename from inputs/srlv.ref.txt rename to inputs/srlv/srlv-1.ref.txt diff --git a/inputs/srlv.txt b/inputs/srlv/srlv-1.txt similarity index 100% rename from inputs/srlv.txt rename to inputs/srlv/srlv-1.txt diff --git a/inputs/subu.ref.txt b/inputs/subu/subu-1.ref.txt similarity index 100% rename from inputs/subu.ref.txt rename to inputs/subu/subu-1.ref.txt diff --git a/inputs/subu.txt b/inputs/subu/subu-1.txt similarity index 100% rename from inputs/subu.txt rename to inputs/subu/subu-1.txt diff --git a/inputs/sw.ref.txt b/inputs/sw/sw-1.ref.txt similarity index 100% rename from inputs/sw.ref.txt rename to inputs/sw/sw-1.ref.txt diff --git a/inputs/sw.txt b/inputs/sw/sw-1.txt similarity index 100% rename from inputs/sw.txt rename to inputs/sw/sw-1.txt diff --git a/inputs/xor.ref.txt b/inputs/xor/xor-1.ref.txt similarity index 100% rename from inputs/xor.ref.txt rename to inputs/xor/xor-1.ref.txt diff --git a/inputs/xor.txt b/inputs/xor/xor-1.txt similarity index 100% rename from inputs/xor.txt rename to inputs/xor/xor-1.txt diff --git a/inputs/xori.ref.txt b/inputs/xori/xori-1.ref.txt similarity index 100% rename from inputs/xori.ref.txt rename to inputs/xori/xori-1.ref.txt diff --git a/inputs/xori.txt b/inputs/xori/xori-1.txt similarity index 100% rename from inputs/xori.txt rename to inputs/xori/xori-1.txt diff --git a/inputs/reference/ibrahimreference.txt b/reference/ibrahimreference.txt similarity index 100% rename from inputs/reference/ibrahimreference.txt rename to reference/ibrahimreference.txt diff --git a/inputs/reference/reference.txt b/reference/reference.txt similarity index 100% rename from inputs/reference/reference.txt rename to reference/reference.txt diff --git a/test/test_mips_cpu_harvard.sh b/test/test_mips_cpu_harvard.sh index 0b094b4..cddad0a 100755 --- a/test/test_mips_cpu_harvard.sh +++ b/test/test_mips_cpu_harvard.sh @@ -1,7 +1,6 @@ #!/bin/bash -# 1. Source File & Source Directory Parsing -SRC_DIR=${1?Error: no source directory given in argument}; # e.g. rtl +SRC_DIR=${1?Error: no source directory given in argument}; SRC=$(ls ${SRC_DIR} | grep -E "harvard|memory|alu|regfile|pc|control"); SRC_TEMP=""; for src in ${SRC} @@ -11,55 +10,51 @@ done SRC=${SRC_TEMP} -# 2. Instruction Argument -INSTR=${2:-"No instruction specified: running all testcases"}; # e.g. addiu +INSTR=${2:-"No instruction specified: running all testcases"}; - -# 3. Start Testing -# 3-1. Running ALL testcases when instruction not specified. if [[ ${INSTR} == "No instruction specified: running all testcases" ]]; then - TESTCASES=$(find ./inputs ! -name '*ref*' ! -name '*log*' ! -name '*out*' ! -name '*inputs*' ! -name '*data*' | sed 's#.*/##'); - #echo ${TESTCASES} - for TESTCASE in ${TESTCASES} + for DIR in inputs/*/ do - # Run Each Testcase File - #echo ${TESTCASE}; - TESTCASE="${TESTCASE%%.*}"; - -iverilog -Wall -g2012 \ - -s mips_cpu_harvard_tb \ - -P mips_cpu_harvard_tb.INSTR_INIT_FILE=\"inputs/${TESTCASE}.txt\" \ - -P mips_cpu_harvard_tb.DATA_INIT_FILE=\"inputs/${TESTCASE}.data.txt\" \ - -o exec/mips_cpu_harvard_tb_${TESTCASE} testbench/mips_cpu_harvard_tb.v \ - ${SRC} 2> /dev/null -./exec/mips_cpu_harvard_tb_${TESTCASE} &> ./inputs/${TESTCASE}.log.txt; # log file for debugging (contains $display) -echo "$(tail -1 ./inputs/${TESTCASE}.log.txt)" > ./inputs/${TESTCASE}.out.txt; # register v0 output to compare with reference -if diff -w ./inputs/${TESTCASE}.out.txt ./inputs/${TESTCASE}.ref.txt &> /dev/null # compare -then - echo ${TESTCASE} ${TESTCASE} "Pass"; -else - printf '%s %s %s%d %s%d%s\n' "${TESTCASE}" "${TESTCASE}" "Fail Output=" "$(tail -1 ./inputs/${TESTCASE}.out.txt)" "Ref=" "$(tail -1 ./inputs/${TESTCASE}.ref.txt)" 2> /dev/null; -fi + DIR=$(basename ${DIR}); + LOOP=$(find inputs/${DIR}/* ! -name '*ref*' ! -name '*log*' ! -name '*data*' ! -name '*out*'); + for TESTCASE in ${LOOP} + do + TESTCASE=$([[ ${TESTCASE} =~ /([^./]+)\. ]] && echo "${BASH_REMATCH[1]}"); + iverilog -Wall -g2012 \ + -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 \ + ${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 + if diff -w ./inputs/${DIR}/${TESTCASE}.out.txt ./inputs/${DIR}/${TESTCASE}.ref.txt &> /dev/null # compare + then + echo ${TESTCASE} ${DIR} "Pass"; + else + printf '%s %s %s%d %s%d%s\n' "${TESTCASE}" "${DIR}" "Fail Output=" "$(tail -1 ./inputs/${DIR}/${TESTCASE}.out.txt)" "Ref=" "$(tail -1 ./inputs/${DIR}/${TESTCASE}.ref.txt)" 2> /dev/null; + fi + done done - -# 3-2 Running SINGLE testcase of specified instruction else - -iverilog -Wall -g2012 \ - -s mips_cpu_harvard_tb \ - -P mips_cpu_harvard_tb.INSTR_INIT_FILE=\"inputs/${INSTR}.txt\" \ - -P mips_cpu_harvard_tb.DATA_INIT_FILE=\"inputs/${INSTR}.data.txt\" \ - -o exec/mips_cpu_harvard_tb_${INSTR} testbench/mips_cpu_harvard_tb.v \ - ${SRC} 2> /dev/null - -./exec/mips_cpu_harvard_tb_${INSTR} &> ./inputs/${INSTR}.log.txt; # log file for debugging (contains $display) -echo "$(tail -1 ./inputs/${INSTR}.log.txt)" > ./inputs/${INSTR}.out.txt; # register v0 output to compare with reference -if diff -w ./inputs/${INSTR}.out.txt ./inputs/${INSTR}.ref.txt &> /dev/null # compare -then - echo ${INSTR} ${INSTR} "Pass"; -else - printf '%s %s %s%d %s%d%s\n' "${INSTR}" "${INSTR}" "Fail Output=" "$(tail -1 ./inputs/${INSTR}.out.txt)" "Ref=" "$(tail -1 ./inputs/${INSTR}.ref.txt)" 2> /dev/null; -fi - -fi + LOOP=$(find inputs/${INSTR}/* ! -name '*ref*' ! -name '*log*' ! -name '*data*' ! -name '*out*'); + for TESTCASE in ${LOOP} + do + TESTCASE=$([[ ${TESTCASE} =~ /([^./]+)\. ]] && echo "${BASH_REMATCH[1]}"); + iverilog -Wall -g2012 \ + -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 \ + ${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 + if diff -w ./inputs/${INSTR}/${TESTCASE}.out.txt ./inputs/${INSTR}/${TESTCASE}.ref.txt &> /dev/null # compare + then + echo ${TESTCASE} ${INSTR} "Pass"; + else + printf '%s %s %s%d %s%d%s\n' "${TESTCASE}" "${INSTR}" "Fail Output=" "$(tail -1 ./inputs/${INSTR}/${TESTCASE}.out.txt)" "Ref=" "$(tail -1 ./inputs/${INSTR}/${TESTCASE}.ref.txt)" 2> /dev/null; + fi + done +fi \ No newline at end of file