├── MIPS_Vol2_指令集_.pdf ├── Mars.jar ├── Preparation ├── 32mux1.circ ├── 7位显示器.circ ├── juzhen ├── juzhen.asm ├── mod5.circ ├── paixu.circ ├── runnian.asm ├── swap.circ ├── test.circ ├── verilog │ └── code.v ├── 哈密顿回路.asm ├── 快速幂.circ └── 斐波拉子数列.circ ├── README.md ├── logisim-win-2.7.1.exe ├── p0 ├── 课下1CRC.circ ├── 课下2alu.circ ├── 课下3GRF.circ └── 课下4fsm.circ ├── p1 ├── p1_2.v ├── p1_3.v ├── p1_4.v └── p1_5.v ├── p2 ├── p2_1.asm ├── p2_2.asm ├── p2_5.asm ├── p2_6.asm ├── p5_3.asm └── p5_4.asm ├── p3 ├── P3_test datas │ ├── mips1.asm │ ├── test.asm │ ├── test.txt │ ├── test1.asm │ ├── test1.txt │ ├── test2.txt │ ├── test3.txt │ ├── test4.txt │ ├── test_addu.txt │ ├── test_beq.asm │ ├── test_beq.txt │ ├── test_lui.txt │ ├── test_lw.txt │ ├── test_lw.txt.txt │ ├── test_ori.txt │ ├── test_subu.txt │ ├── test_sw.txt │ ├── text.txt │ ├── ts.txt │ ├── tx.txt │ ├── 对拍.circ │ └── 新建 Microsoft Word 文档.docx ├── asset-v1_BUAA+B3I062410+2017_T1+type@asset+block@计算机组成原理实验报告撰写排版规则.docx ├── cpu_0.1.circ ├── cpu_0.2.circ ├── cpu_test.circ ├── p3课下cpu设计文档.docx ├── p3课下cpu设计文档.pdf └── 测试1.txt ├── p4 ├── P4_code │ ├── ALU.v │ ├── CMP.v │ ├── Controller.v │ ├── DM.v │ ├── EXT.v │ ├── GRF.v │ ├── IM.v │ ├── Mips.v │ ├── Mux.v │ ├── PC.v │ ├── cjbdefine.v │ └── test_cpu.v ├── mips1.asm ├── p4测试数据 │ ├── beq.txt │ ├── jal.txt │ ├── jr.txt │ ├── sw.txt │ ├── temp.txt │ ├── test.txt │ ├── test1.txt │ ├── test_addu.txt │ ├── test_lui.txt │ ├── test_lw.txt │ ├── test_ori.txt │ ├── test_subu.txt │ ├── test_sw.txt │ └── 最终版测试程序..txt ├── p4课下设计文档.docx ├── p4课下设计文档.pdf └── test.txt ├── p5 ├── P5_code │ ├── ALU.v │ ├── CMP.v │ ├── DM.v │ ├── D_E_Register.v │ ├── EXT.v │ ├── E_M_Register.v │ ├── F_D_Register.v │ ├── GRF.v │ ├── IM.v │ ├── MUX.v │ ├── M_W_Register.v │ ├── NPC.v │ ├── PC.v │ ├── conflict.v │ ├── controller.v │ ├── define.v │ ├── instr_decoder.v │ ├── mips.v │ └── test.v ├── P5_test datas from CJB │ ├── 1.txt │ ├── E_D转发.asm │ ├── E_D转发.txt │ ├── M_D转发.asm │ ├── M_D转发.txt │ ├── W-D转发.asm │ ├── W_D转发.txt │ ├── W_M转发.txt │ ├── begzal │ ├── begzal.txt │ ├── begzal1.txt │ ├── beq.asm │ ├── beq.txt │ ├── bgezal.txt │ ├── feibonaqie.txt │ ├── j.asm │ ├── j.txt │ ├── jal.asm │ ├── jal.txt │ ├── jr.txt │ ├── jr_new.asm │ ├── jr_new.txt │ ├── lui.asm │ ├── lui.txt │ ├── lw.txt │ ├── lw_sw.txt │ ├── mips1.asm │ ├── mips2.asm │ ├── mips5.asm │ ├── movez.asm │ ├── movz.asm │ ├── movz.txt │ ├── movz_R.asm │ ├── movz_r.txt │ ├── next.txt │ ├── nop.asm │ ├── or.asm │ ├── or.txt │ ├── p5_zyy │ │ ├── P5design.rar │ │ └── P5design │ │ │ ├── 16231246P5DesignDoc.docx │ │ │ ├── 5.wcfg │ │ │ ├── CPU Design.xlsx │ │ │ ├── MagicMARSResult │ │ │ ├── 【magic】Forward_rs.txt │ │ │ ├── 【magic】bgezal.txt │ │ │ ├── 【magic】bgezal2.txt │ │ │ ├── 【magic】movz.txt │ │ │ ├── 【magic】超强测bgezal1018.txt │ │ │ └── 【magic】超强测movz1036.txt │ │ │ ├── P4-SingleCycleCPU.zip │ │ │ ├── P5-PipelineCPU-FinalwithoutMOVZ.zip │ │ │ ├── P5-PipelineCPU-withMOVZ.zip │ │ │ ├── TestASM │ │ │ ├── 16LZHtest.zip │ │ │ ├── 16LZHtest │ │ │ │ ├── test1.asm │ │ │ │ ├── test10.asm │ │ │ │ ├── test11.asm │ │ │ │ ├── test12.asm │ │ │ │ ├── test13.asm │ │ │ │ ├── test14.asm │ │ │ │ ├── test15.asm │ │ │ │ ├── test16.asm │ │ │ │ ├── test2.asm │ │ │ │ ├── test3.asm │ │ │ │ ├── test4.asm │ │ │ │ ├── test5.asm │ │ │ │ ├── test6.asm │ │ │ │ ├── test7.asm │ │ │ │ ├── test8.asm │ │ │ │ └── test9.asm │ │ │ ├── Forward_rs.asm │ │ │ ├── Stall │ │ │ │ ├── rs 0,E1.asm │ │ │ │ ├── rs 0,E2.asm │ │ │ │ ├── rs 0,M1.asm │ │ │ │ ├── rs 1,E2.asm │ │ │ │ ├── rt 0,E1,E2,M1.asm │ │ │ │ └── rt 1,E2.asm │ │ │ ├── bgezal.txt │ │ │ ├── bgezal2.txt │ │ │ ├── movz.txt │ │ │ ├── swl&swr&lwl&lwr.asm │ │ │ ├── 超强测bgezal1018.asm │ │ │ └── 超强测movz1036.asm │ │ │ ├── pipeline.jpg │ │ │ ├── power.zip │ │ │ └── 比较输出 │ │ │ ├── Mars.txt │ │ │ ├── Verilog.txt │ │ │ ├── cmp.c │ │ │ └── 比较Mars与Verilog输出.exe │ ├── p5测试 │ │ ├── 2 │ │ ├── 3 │ │ ├── 4 │ │ ├── 1.txt │ │ ├── 2.txt │ │ ├── 3.txt │ │ ├── 4.txt │ │ ├── 5.txt │ │ ├── mips1.asm │ │ ├── mips2.asm │ │ ├── mips3.asm │ │ ├── mips4.asm │ │ ├── mips5.asm │ │ ├── mips6.asm │ │ └── 新建文本文档.txt │ ├── sw_lw.asm │ ├── t.txt │ ├── temp.txt │ ├── temp1.txt │ ├── temp2.txt │ ├── tt.txt │ ├── 到E级的转发.asm │ ├── 到E级转发.txt │ ├── 到M级转发.asm │ ├── 弱侧.asm │ ├── 弱侧2.asm │ ├── 强测.asm │ ├── 强测.txt │ ├── 强测答案.txt │ ├── 斐波那契额.asm │ ├── 暂停.txt │ ├── 暂停1.asm │ ├── 暂停1.txt │ ├── 暂停2.asm │ ├── 暂停2.txt │ ├── 暂停3.asm │ ├── 暂停3.txt │ ├── 暂停4.asm │ ├── 暂停4.txt │ ├── 暂停5.asm │ ├── 暂停5.txt │ ├── 超强测bgezal1018.asm │ ├── 跳转1.txt │ ├── 转发.asm │ ├── 转发.txt │ ├── 转发E_D │ ├── 转发_cjb.txt │ ├── 重点.txt │ ├── 重点测试.asm │ └── 高危.txt ├── p5_test datas from MouYu │ ├── addu.asm │ ├── addu.txt │ ├── huluanchude.asm │ ├── huluanchude.txt │ ├── jal.asm │ ├── jal.txt │ ├── jiandanruoce.asm │ ├── jiandanruoce.txt │ ├── luiori.asm │ ├── luiori.txt │ ├── lwsw.asm │ ├── lwsw.txt │ ├── mips1.asm │ ├── mips1.txt │ ├── subu.asm │ ├── subu.txt │ ├── testForHighPC.asm │ ├── testForHighPC.txt │ ├── xjbtest.asm │ ├── xjbtest.txt │ ├── xjbtest2.asm │ └── xjbtest2.txt └── 测试集 │ └── TestASM │ ├── 16LZHtest │ ├── test1.asm │ ├── test10.asm │ ├── test11.asm │ ├── test12.asm │ ├── test13.asm │ ├── test14.asm │ ├── test15.asm │ ├── test16.asm │ ├── test2.asm │ ├── test3.asm │ ├── test4.asm │ ├── test5.asm │ ├── test6.asm │ ├── test7.asm │ ├── test8.asm │ └── test9.asm │ ├── Forward_rs.asm │ ├── Stall │ ├── rs 0,E1.asm │ ├── rs 0,E2.asm │ ├── rs 0,M1.asm │ ├── rs 1,E2.asm │ ├── rt 0,E1,E2,M1.asm │ └── rt 1,E2.asm │ ├── bgezal.txt │ ├── bgezal2.txt │ ├── bgezal2答案.txt │ ├── bgezal_2jinzhi.txt │ ├── movz.txt │ ├── swl&swr&lwl&lwr.asm │ ├── 说明.txt │ ├── 超强侧movz2jinzhi.txt │ ├── 超强测movz1036.asm │ └── 超强测movz答案.txt ├── p6 supports 50 MIPS instructions ├── P6 offical documents │ └── 文档.zip ├── P6_code │ ├── ALU.v │ ├── CMP.v │ ├── DM.v │ ├── DMEXT.v │ ├── D_E_Register.v │ ├── EXT.v │ ├── E_M_Register.v │ ├── F_D_Register.v │ ├── GRF.v │ ├── IM.v │ ├── MULT_DIV.v │ ├── MUX.v │ ├── M_W_Register.v │ ├── NPC.v │ ├── PC.v │ ├── conflict.v │ ├── controller.v │ ├── define.v │ ├── instr_decoder.v │ └── mips.v ├── auto_judge_script │ └── testsuit │ │ ├── P7_L0_weak (1).asm │ │ ├── __mips_tb.v │ │ ├── bin │ │ ├── diff.exe │ │ ├── grep.exe │ │ ├── libiconv2.dll │ │ ├── libintl3.dll │ │ ├── pcre3.dll │ │ ├── regex2.dll │ │ └── sed.exe │ │ ├── export.bat │ │ ├── ins.asm │ │ ├── jar │ │ └── Mars.jar │ │ ├── judge.bat │ │ ├── myjudge.bat │ │ ├── p60 │ │ ├── ALU.v │ │ ├── CMP.v │ │ ├── DM.v │ │ ├── DMEXT.v │ │ ├── D_E_Register.v │ │ ├── EXT.v │ │ ├── E_M_Register.v │ │ ├── F_D_Register.v │ │ ├── GRF.v │ │ ├── IM.v │ │ ├── MULT_DIV.v │ │ ├── MUX.v │ │ ├── M_W_Register.v │ │ ├── NPC.v │ │ ├── PC.v │ │ ├── conflict.v │ │ ├── controller.v │ │ ├── define.v │ │ ├── instr_decoder.v │ │ ├── mips.v │ │ └── test.v │ │ ├── rand_ins.py │ │ └── tmp │ │ ├── __mips_tb_beh.cmd │ │ ├── __mips_tb_beh.files │ │ ├── __mips_tb_beh.prj │ │ ├── ans-pre.txt │ │ ├── ans.txt │ │ ├── code.txt │ │ ├── fuse-compile.out │ │ ├── fuse-compile.tmp │ │ ├── fuse.log │ │ ├── fuse.xmsgs │ │ ├── fuseRelaunch.cmd │ │ ├── isim.wdb │ │ ├── isim │ │ ├── isim_usage_statistics.html │ │ ├── mips_tb_beh.exe.sim │ │ │ ├── ISimEngine-DesignHierarchy.dbg │ │ │ ├── isimcrash.log │ │ │ ├── isimkernel.log │ │ │ ├── mips_tb_beh.exe │ │ │ ├── netId.dat │ │ │ ├── tmp_save │ │ │ │ └── _1 │ │ │ └── work │ │ │ │ ├── m_00000000000090147144_3355812389.c │ │ │ │ ├── m_00000000000090147144_3355812389.didat │ │ │ │ ├── m_00000000000090147144_3355812389.nt64.obj │ │ │ │ ├── m_00000000000195303324_1323274903.c │ │ │ │ ├── m_00000000000195303324_1323274903.didat │ │ │ │ ├── m_00000000000195303324_1323274903.nt64.obj │ │ │ │ ├── m_00000000000211310069_3877310806.c │ │ │ │ ├── m_00000000000211310069_3877310806.didat │ │ │ │ ├── m_00000000000211310069_3877310806.nt64.obj │ │ │ │ ├── m_00000000000318747285_1579609468.c │ │ │ │ ├── m_00000000000318747285_1579609468.didat │ │ │ │ ├── m_00000000000318747285_1579609468.nt64.obj │ │ │ │ ├── m_00000000000421124009_1621229167.c │ │ │ │ ├── m_00000000000421124009_1621229167.didat │ │ │ │ ├── m_00000000000421124009_1621229167.nt64.obj │ │ │ │ ├── m_00000000000585739166_1733832700.c │ │ │ │ ├── m_00000000000585739166_1733832700.didat │ │ │ │ ├── m_00000000000585739166_1733832700.nt64.obj │ │ │ │ ├── m_00000000001093560553_1691942019.c │ │ │ │ ├── m_00000000001093560553_1691942019.didat │ │ │ │ ├── m_00000000001093560553_1691942019.nt64.obj │ │ │ │ ├── m_00000000001170474820_3058754606.c │ │ │ │ ├── m_00000000001170474820_3058754606.didat │ │ │ │ ├── m_00000000001170474820_3058754606.nt64.obj │ │ │ │ ├── m_00000000001246071590_3805778912.c │ │ │ │ ├── m_00000000001246071590_3805778912.didat │ │ │ │ ├── m_00000000001246071590_3805778912.nt64.obj │ │ │ │ ├── m_00000000001399026245_4223490419.c │ │ │ │ ├── m_00000000001399026245_4223490419.didat │ │ │ │ ├── m_00000000001399026245_4223490419.nt64.obj │ │ │ │ ├── m_00000000001754221512_3037376393.c │ │ │ │ ├── m_00000000001754221512_3037376393.didat │ │ │ │ ├── m_00000000001754221512_3037376393.nt64.obj │ │ │ │ ├── m_00000000001769676328_2725311412.c │ │ │ │ ├── m_00000000001769676328_2725311412.didat │ │ │ │ ├── m_00000000001769676328_2725311412.nt64.obj │ │ │ │ ├── m_00000000001869374716_3058754606.c │ │ │ │ ├── m_00000000001869374716_3058754606.didat │ │ │ │ ├── m_00000000001869374716_3058754606.nt64.obj │ │ │ │ ├── m_00000000001977544364_3146453351.c │ │ │ │ ├── m_00000000001977544364_3146453351.didat │ │ │ │ ├── m_00000000001977544364_3146453351.nt64.obj │ │ │ │ ├── m_00000000002047498008_1199804567.c │ │ │ │ ├── m_00000000002047498008_1199804567.didat │ │ │ │ ├── m_00000000002047498008_1199804567.nt64.obj │ │ │ │ ├── m_00000000002144323932_2924402094.c │ │ │ │ ├── m_00000000002144323932_2924402094.didat │ │ │ │ ├── m_00000000002144323932_2924402094.nt64.obj │ │ │ │ ├── m_00000000002195517645_1433407185.c │ │ │ │ ├── m_00000000002195517645_1433407185.didat │ │ │ │ ├── m_00000000002195517645_1433407185.nt64.obj │ │ │ │ ├── m_00000000002203459408_2364370701.c │ │ │ │ ├── m_00000000002203459408_2364370701.didat │ │ │ │ ├── m_00000000002203459408_2364370701.nt64.obj │ │ │ │ ├── m_00000000002236284143_3092946469.c │ │ │ │ ├── m_00000000002236284143_3092946469.didat │ │ │ │ ├── m_00000000002236284143_3092946469.nt64.obj │ │ │ │ ├── m_00000000002374559451_3877310806.c │ │ │ │ ├── m_00000000002374559451_3877310806.didat │ │ │ │ ├── m_00000000002374559451_3877310806.nt64.obj │ │ │ │ ├── m_00000000002376088841_0467708899.c │ │ │ │ ├── m_00000000002376088841_0467708899.didat │ │ │ │ ├── m_00000000002376088841_0467708899.nt64.obj │ │ │ │ ├── m_00000000002491177041_3964289794.c │ │ │ │ ├── m_00000000002491177041_3964289794.didat │ │ │ │ ├── m_00000000002491177041_3964289794.nt64.obj │ │ │ │ ├── m_00000000002643005108_2725559894.c │ │ │ │ ├── m_00000000002643005108_2725559894.didat │ │ │ │ ├── m_00000000002643005108_2725559894.nt64.obj │ │ │ │ ├── m_00000000002685825956_1579609468.c │ │ │ │ ├── m_00000000002685825956_1579609468.didat │ │ │ │ ├── m_00000000002685825956_1579609468.nt64.obj │ │ │ │ ├── m_00000000002701586397_3092946469.c │ │ │ │ ├── m_00000000002701586397_3092946469.didat │ │ │ │ ├── m_00000000002701586397_3092946469.nt64.obj │ │ │ │ ├── m_00000000002879138848_4127636709.c │ │ │ │ ├── m_00000000002879138848_4127636709.didat │ │ │ │ ├── m_00000000002879138848_4127636709.nt64.obj │ │ │ │ ├── m_00000000002946577253_3363942390.c │ │ │ │ ├── m_00000000002946577253_3363942390.didat │ │ │ │ ├── m_00000000002946577253_3363942390.nt64.obj │ │ │ │ ├── m_00000000002947729920_3092946469.c │ │ │ │ ├── m_00000000002947729920_3092946469.didat │ │ │ │ ├── m_00000000002947729920_3092946469.nt64.obj │ │ │ │ ├── m_00000000003054197689_1933308015.c │ │ │ │ ├── m_00000000003054197689_1933308015.didat │ │ │ │ ├── m_00000000003054197689_1933308015.nt64.obj │ │ │ │ ├── m_00000000003059442206_1166922973.c │ │ │ │ ├── m_00000000003059442206_1166922973.didat │ │ │ │ ├── m_00000000003059442206_1166922973.nt64.obj │ │ │ │ ├── m_00000000003330003175_0010801604.c │ │ │ │ ├── m_00000000003330003175_0010801604.didat │ │ │ │ ├── m_00000000003330003175_0010801604.nt64.obj │ │ │ │ ├── m_00000000003364596035_3422312324.c │ │ │ │ ├── m_00000000003364596035_3422312324.didat │ │ │ │ ├── m_00000000003364596035_3422312324.nt64.obj │ │ │ │ ├── m_00000000003425170594_4223490419.c │ │ │ │ ├── m_00000000003425170594_4223490419.didat │ │ │ │ ├── m_00000000003425170594_4223490419.nt64.obj │ │ │ │ ├── m_00000000003570122381_1785967555.c │ │ │ │ ├── m_00000000003570122381_1785967555.didat │ │ │ │ ├── m_00000000003570122381_1785967555.nt64.obj │ │ │ │ ├── m_00000000003677317490_3631796253.c │ │ │ │ ├── m_00000000003677317490_3631796253.didat │ │ │ │ ├── m_00000000003677317490_3631796253.nt64.obj │ │ │ │ ├── m_00000000003712463227_0757879789.c │ │ │ │ ├── m_00000000003712463227_0757879789.didat │ │ │ │ ├── m_00000000003712463227_0757879789.nt64.obj │ │ │ │ ├── m_00000000003714568665_4286680365.c │ │ │ │ ├── m_00000000003714568665_4286680365.didat │ │ │ │ ├── m_00000000003714568665_4286680365.nt64.obj │ │ │ │ ├── m_00000000003769080448_1963867328.c │ │ │ │ ├── m_00000000003769080448_1963867328.didat │ │ │ │ ├── m_00000000003769080448_1963867328.nt64.obj │ │ │ │ ├── m_00000000003773469154_3877310806.c │ │ │ │ ├── m_00000000003773469154_3877310806.didat │ │ │ │ ├── m_00000000003773469154_3877310806.nt64.obj │ │ │ │ ├── m_00000000003811684883_2913210254.c │ │ │ │ ├── m_00000000003811684883_2913210254.didat │ │ │ │ ├── m_00000000003811684883_2913210254.nt64.obj │ │ │ │ ├── m_00000000003834018060_1133402911.c │ │ │ │ ├── m_00000000003834018060_1133402911.didat │ │ │ │ ├── m_00000000003834018060_1133402911.nt64.obj │ │ │ │ ├── m_00000000003849004589_4241813833.c │ │ │ │ ├── m_00000000003849004589_4241813833.didat │ │ │ │ ├── m_00000000003849004589_4241813833.nt64.obj │ │ │ │ ├── m_00000000003866914869_3383896982.c │ │ │ │ ├── m_00000000003866914869_3383896982.didat │ │ │ │ ├── m_00000000003866914869_3383896982.nt64.obj │ │ │ │ ├── m_00000000003976976986_0757879789.c │ │ │ │ ├── m_00000000003976976986_0757879789.didat │ │ │ │ ├── m_00000000003976976986_0757879789.nt64.obj │ │ │ │ ├── m_00000000004033357547_0886308060.c │ │ │ │ ├── m_00000000004033357547_0886308060.didat │ │ │ │ ├── m_00000000004033357547_0886308060.nt64.obj │ │ │ │ ├── m_00000000004040520136_2534161108.c │ │ │ │ ├── m_00000000004040520136_2534161108.didat │ │ │ │ ├── m_00000000004040520136_2534161108.nt64.obj │ │ │ │ ├── mips_tb_beh.exe_main.c │ │ │ │ └── mips_tb_beh.exe_main.nt64.obj │ │ └── work │ │ │ ├── @a@l@u.sdb │ │ │ ├── @b@e_@e@x@t.sdb │ │ │ ├── @c@m@p.sdb │ │ │ ├── @d@ereg.sdb │ │ │ ├── @d@m.sdb │ │ │ ├── @d@m@e@x@t.sdb │ │ │ ├── @d@m@o@u@t_@e@x@t.sdb │ │ │ ├── @d_@e_@register.sdb │ │ │ ├── @e@mreg.sdb │ │ │ ├── @e@x@t.sdb │ │ │ ├── @e_@m_@register.sdb │ │ │ ├── @f@dreg.sdb │ │ │ ├── @f_@d_@register.sdb │ │ │ ├── @g@r@f.sdb │ │ │ ├── @i@m.sdb │ │ │ ├── @m@u@l@t_@d@i@v.sdb │ │ │ ├── @m@u@x.sdb │ │ │ ├── @m@wreg.sdb │ │ │ ├── @m_@w_@register.sdb │ │ │ ├── @n@p@c.sdb │ │ │ ├── @p@c.sdb │ │ │ ├── __mips_tb.sdb │ │ │ ├── alu.sdb │ │ │ ├── chengchuqi.sdb │ │ │ ├── cmp.sdb │ │ │ ├── conflict.sdb │ │ │ ├── controller.sdb │ │ │ ├── dm.sdb │ │ │ ├── ext.sdb │ │ │ ├── frdmux.sdb │ │ │ ├── grf.sdb │ │ │ ├── hazard.sdb │ │ │ ├── im.sdb │ │ │ ├── instr_decoder.sdb │ │ │ ├── mips.sdb │ │ │ ├── mux.sdb │ │ │ ├── npc.sdb │ │ │ ├── pc.sdb │ │ │ └── test.sdb │ │ ├── mips_tb_beh.exe │ │ ├── out-pre.lines │ │ ├── out-pre.txt │ │ └── out.txt └── 一些建议.txt └── p7 abnormal interruption and external abort ├── P7_Instruction ├── COCO定时器设计规范-1.0.0.4.pdf ├── L15-支持IO.pdf ├── P7_standard_timer_2019.v ├── 中断异常.pdf └── 学长攻略.docx ├── P7_code ├── ALU.v ├── CMP.v ├── CP0.v ├── DM.v ├── DMEXT.v ├── D_E_Register.v ├── EXT.v ├── E_M_Register.v ├── F_D_Register.v ├── GRF.v ├── IM.v ├── LEGAL.v ├── MULT_DIV.v ├── MUX.v ├── M_W_Register.v ├── NPC.v ├── P7_standard_timer_2019.v ├── PC.v ├── beifen.v ├── bridge.v ├── conflict.v ├── controller.v ├── cpu.v ├── define.v ├── instr_decoder.v ├── mips.v └── tb.v ├── Test_file ├── P7_CjbFound_Class │ ├── realresult │ │ └── result │ │ │ ├── 1.txt │ │ │ ├── 11.txt │ │ │ ├── 13.txt │ │ │ ├── 15.txt │ │ │ ├── 17.txt │ │ │ ├── 19.txt │ │ │ ├── 3.txt │ │ │ ├── 5.txt │ │ │ ├── 7.txt │ │ │ └── 9.txt │ ├── testcase1 │ │ ├── code.txt │ │ ├── code_handler.txt │ │ ├── handle.asm │ │ └── main.asm │ ├── testcase10 │ │ ├── code.txt │ │ ├── code_handler.txt │ │ ├── handle.asm │ │ └── main.asm │ ├── testcase2 │ │ ├── code.txt │ │ ├── code_handler.txt │ │ ├── handle.asm │ │ └── main.asm │ ├── testcase3 │ │ ├── code.txt │ │ ├── code_handler.txt │ │ ├── handle.asm │ │ └── main.asm │ ├── testcase4 │ │ ├── code.txt │ │ ├── code_handler.txt │ │ ├── handle.asm │ │ └── main.asm │ ├── testcase5 │ │ ├── code.txt │ │ ├── code_handler.txt │ │ ├── handle.asm │ │ └── main.asm │ ├── testcase6 │ │ ├── code.txt │ │ ├── code_handler.txt │ │ ├── handle.asm │ │ └── main.asm │ ├── testcase7 │ │ ├── handle.asm │ │ └── main.asm │ ├── testcase8 │ │ ├── code.txt │ │ ├── code_handler.txt │ │ ├── handle.asm │ │ ├── handler.asm │ │ └── main.asm │ └── testcase9 │ │ ├── code.txt │ │ ├── code_handler.txt │ │ ├── handle.asm │ │ └── main.asm ├── P7_L0_delay │ ├── P7_L0_weak_delay.asm │ └── tb.v ├── P7_L0_exception │ ├── P7_L0_weak_exception.asm │ └── tb.v ├── P7_L0_interrupt │ ├── Mars.jar │ ├── P7_L0_weak_delay.asm │ ├── P7_L0_weak_interrupt.asm │ ├── code.txt │ ├── code_handler.txt │ ├── gen_code.bat │ ├── mips1.asm │ └── tb.v ├── eretWithInterruptionOnBubble │ ├── code.txt │ ├── code_handler.txt │ ├── eretWithInterruptionOnBubble.asm │ └── tb_mips.v ├── my-test │ └── my-test │ │ ├── bd1 │ │ ├── ans.txt │ │ ├── bd1.asm │ │ ├── code.txt │ │ └── tb.v │ │ ├── bd2 │ │ ├── ans.txt │ │ ├── bd2.asm │ │ ├── code.txt │ │ ├── eretandint.asm │ │ └── tb.v │ │ ├── code.txt │ │ ├── code_handler.txt │ │ ├── eretandint │ │ ├── ans.txt │ │ ├── code.txt │ │ ├── eretandint.asm │ │ └── tb.v │ │ ├── handler.asm │ │ ├── intbeforemul │ │ ├── ans.txt │ │ ├── code.txt │ │ ├── intbeforemul.asm │ │ └── tb.v │ │ ├── intinbubble │ │ ├── ans.txt │ │ ├── bubble.asm │ │ ├── code.txt │ │ └── tb.v │ │ ├── muleret │ │ ├── ans.txt │ │ ├── code.txt │ │ ├── code_handler.txt │ │ ├── handler.asm │ │ ├── muleret.asm │ │ └── tb.v │ │ └── 数据介绍.txt ├── 一个测中断+异常的比较强的程序.asm └── 使用说明.txt ├── 两个上课过强侧的同学的代码 └── p7_yzqk.zip ├── 可能出现的中断.txt └── 说明文档 ├── P7计时器.pdf └── p7文档_1.pdf /MIPS_Vol2_指令集_.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/MIPS_Vol2_指令集_.pdf -------------------------------------------------------------------------------- /Mars.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/Mars.jar -------------------------------------------------------------------------------- /Preparation/juzhen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/Preparation/juzhen -------------------------------------------------------------------------------- /Preparation/juzhen.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/Preparation/juzhen.asm -------------------------------------------------------------------------------- /Preparation/runnian.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/Preparation/runnian.asm -------------------------------------------------------------------------------- /Preparation/哈密顿回路.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/Preparation/哈密顿回路.asm -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BUAA-Computer Organization-2019 2 | 3 | **introduction** 4 | 5 | This is course project for Computer Organization 2019. I designed a five-stage pipeline CPU that supports 50 MIPS instructions using Verilog HDL. The five-stage pipeline CPU can solve abnormal interruption and external abort. 6 | 7 | **P7 folder is the final code** 8 | 9 | 10 | 11 | 12 | **中文版** 13 | 14 | BUAA 2019年 CO相关代码 15 | 笔者比较弱,最终只到达P7,即mips指令集下50条指令5级流水线+异常中断的cpu 16 | 当年测的时候p7强测也ak了,但不保证完全无bug 17 | 仅供参考。 18 | 19 | 原谅笔者当时还没有整理的习惯,不过其中的测试数据还是有可借鉴性 20 | 21 | **2021/11 update:** 22 | **致学弟:好好看看p5-p7数据部分,有惊喜。** 23 | -------------------------------------------------------------------------------- /logisim-win-2.7.1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/logisim-win-2.7.1.exe -------------------------------------------------------------------------------- /p1/p1_2.v: -------------------------------------------------------------------------------- 1 | module alu( 2 | input [31:0] A, 3 | input [31:0] B, 4 | input [2:0] ALUOp, 5 | output reg [31:0] C 6 | ); 7 | initial begin 8 | C<=0; 9 | end 10 | always@(*) begin 11 | if(ALUOp==0)begin 12 | C <= A+B; 13 | end 14 | else if(ALUOp==1)begin 15 | C<=A-B; 16 | end 17 | else if(ALUOp==2)begin 18 | C<=A&B; 19 | end 20 | else if(ALUOp==3)begin 21 | C<=A|B; 22 | end 23 | else if(ALUOp==4)begin 24 | C<=A>>B; 25 | end 26 | else if(ALUOp==5)begin 27 | C<=$signed(A)>>>B; 28 | end 29 | end 30 | endmodule -------------------------------------------------------------------------------- /p1/p1_3.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 19:57:11 10/17/2019 7 | // Design Name: 8 | // Module Name: p2_3 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module ext( 22 | input [15:0] imm, 23 | input [1:0] EOp, 24 | output [31:0] ext 25 | ); 26 | assign ext = (EOp==0)?{{16{imm[15]}},imm[15:0]}: 27 | (EOp==1)?{{16{0}},imm}: 28 | (EOp==2)?{imm,{16{0}}}: 29 | (EOp==3)?{{14{imm[15]}},imm[15:0],{2{0}}}: 30 | 0; 31 | 32 | 33 | 34 | endmodule 35 | -------------------------------------------------------------------------------- /p2/p2_1.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p2/p2_1.asm -------------------------------------------------------------------------------- /p2/p2_2.asm: -------------------------------------------------------------------------------- 1 | .data 2 | A: .space 1000 3 | .text 4 | li $v0, 5 5 | syscall 6 | move $s0, $v0 #v0 = n 7 | li $t0, 0 8 | for_read: 9 | beq $t0, $s0, for_read_end 10 | li $v0,12 11 | syscall 12 | sb $v0, A($t0) 13 | addi $t0,$t0,1 14 | j for_read 15 | for_read_end: 16 | 17 | li $t0,0 #t0 = i 18 | addi $t1 ,$s0,-1 #t1 = n -1 19 | for: 20 | slt $t2,$t0,$t1 21 | beq $t2,$0,for_end 22 | lb $s1, A($t0) 23 | lb $s2, A($t1) 24 | bne $s1,$s2,no 25 | addi $t0,$t0,1 26 | addi $t1,$t1,-1 27 | j for 28 | for_end: 29 | li $a0,1 30 | li $v0,1 31 | syscall 32 | li $v0,10 33 | syscall 34 | no: 35 | li $a0,0 36 | li $v0,1 37 | syscall 38 | li $v0,10 39 | syscall 40 | -------------------------------------------------------------------------------- /p2/p2_5.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p2/p2_5.asm -------------------------------------------------------------------------------- /p2/p2_6.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p2/p2_6.asm -------------------------------------------------------------------------------- /p2/p5_4.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p2/p5_4.asm -------------------------------------------------------------------------------- /p3/P3_test datas/mips1.asm: -------------------------------------------------------------------------------- 1 | .text 2 | ori $0,100 3 | ori $1,101 4 | ori $2,102 5 | ori $3,103 6 | ori $4,104 7 | ori $5,105 8 | ori $6,106 9 | ori $7,107 10 | ori $8,108 11 | ori $9,109 12 | subu $10,$0,$1 13 | subu $11,$2,$3 14 | subu $12,$3,$4 15 | subu $13,$4,$5 16 | subu $14,$5,$6 17 | subu $15,$6,$7 18 | subu $16,$7,$8 19 | subu $17,$8,$9 20 | subu $18,$9,$0 21 | subu $19,$0,$0 -------------------------------------------------------------------------------- /p3/P3_test datas/test.asm: -------------------------------------------------------------------------------- 1 | .data 2 | arr:.space 40 3 | .text 4 | ori $t0,0 5 | ori $s0,10 6 | loop: 7 | beq $t0,$s0,loop_out 8 | subu $t1,$t1,$t1 9 | subu $t4,$t4,$t4 10 | lj: 11 | beq $t1,$s0,ljout 12 | lw $t3,arr($t4) 13 | addu $t4,$t4,4 14 | addu $t3,$t3,$t1 15 | sw $t3,arr($t4) 16 | addu $t1,$t1,1 17 | j lj 18 | ljout: 19 | addu $t0,$t0,1 20 | j loop 21 | loop_out: 22 | beq $t2,$t2,loop_out -------------------------------------------------------------------------------- /p3/P3_test datas/test.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 3c080064 3 | 350900ea 4 | 01285021 5 | 014a5821 6 | 01686023 7 | 3c040064 8 | 3c050064 9 | 3c020190 10 | 10440008 11 | ac020004 12 | ac020008 13 | ac05000c 14 | 8c030004 15 | 8c150008 16 | 00000000 17 | 10850001 18 | 8c900004 19 | 3c0200c8 20 | -------------------------------------------------------------------------------- /p3/P3_test datas/test1.asm: -------------------------------------------------------------------------------- 1 | .text 2 | ori $0,100 3 | ori $1,101 4 | ori $2,102 5 | ori $3,103 6 | ori $4,104 7 | ori $5,105 8 | ori $6,106 9 | ori $7,107 10 | ori $8,108 11 | ori $9,109 12 | ori $0,110 13 | ori $10,120 14 | sw $0, 0($0) 15 | sw $1, 4($0) 16 | sw $2, 8($0) 17 | sw $3, 12($0) 18 | sw $4, 16($0) 19 | sw $5, 20($0) 20 | sw $7, 24($0) 21 | sw $8, 28($0) 22 | sw $9, 32($0) 23 | sw $10, 36($0) 24 | lw $0, 0($0) 25 | lw $21, 4($0) 26 | lw $22, 8($0) 27 | lw $23, 12($0) 28 | lw $24, 16($0) 29 | lw $25, 20($0) 30 | lw $26, 24($0) 31 | lw $27, 28($0) 32 | 33 | -------------------------------------------------------------------------------- /p3/P3_test datas/test1.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 340407cf 3 | 3485006f 4 | 3c063039 5 | 3c07ffff 6 | 34e7ffff 7 | 00858021 8 | 00e78821 9 | 00f09021 10 | 00928023 11 | 00e78823 12 | 00e49023 13 | 02519823 14 | 34080000 15 | ad040000 16 | 00000000 17 | ad050004 18 | ad100008 19 | ad11000c 20 | ad120010 21 | 8d0f0000 22 | 8d0e0014 23 | ad0e0018 24 | 8d0d000c 25 | 35080001 26 | 35290001 27 | 354a0002 28 | 110affef 29 | 11090001 30 | 3c0b0457 31 | 010f4021 32 | -------------------------------------------------------------------------------- /p3/P3_test datas/test2.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 3408006f 3 | 340a007b 4 | 34e7ffff 5 | 3c050064 6 | 34050457 7 | 00000000 8 | 116a0008 9 | 358c0001 10 | 3c160064 11 | 016c5821 12 | 01405821 13 | 8d300004 14 | 01495021 15 | 01405823 16 | 116afff7 17 | 3c022b67 18 | -------------------------------------------------------------------------------- /p3/P3_test datas/test3.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 3c080013 3 | 00000000 4 | 01094821 5 | 01085021 6 | 01495023 7 | ac000004 8 | 8c000004 9 | 11490000 10 | 356d03e8 11 | -------------------------------------------------------------------------------- /p3/P3_test datas/test4.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 3c080009 3 | ad280004 4 | 8d2a0004 5 | 11480001 6 | 354c0001 7 | 354b0064 8 | -------------------------------------------------------------------------------- /p3/P3_test datas/test_addu.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 34000064 3 | 34210065 4 | 34420066 5 | 34630067 6 | 34840068 7 | 34a50069 8 | 34c6006a 9 | 34e7006b 10 | 3508006c 11 | 3529006d 12 | 00015021 13 | 00425821 14 | 00636021 15 | 00846821 16 | 00a57021 17 | 00c67821 18 | 00e78021 19 | 01088821 20 | 01299021 21 | 00009821 22 | -------------------------------------------------------------------------------- /p3/P3_test datas/test_beq.asm: -------------------------------------------------------------------------------- 1 | .text 2 | lui $2, 1 3 | lui $3,1 4 | lui $5, 10 5 | for: 6 | beq $2,$5,end 7 | addu $4,$4,$2 8 | addu $2,$2,$3 9 | beq $0,$0,for 10 | end : -------------------------------------------------------------------------------- /p3/P3_test datas/test_beq.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 3c020001 3 | 3c030001 4 | 3c05000a 5 | 10450003 6 | 00822021 7 | 00431021 8 | 1000fffc 9 | -------------------------------------------------------------------------------- /p3/P3_test datas/test_lui.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 3c080064 3 | 3c09007b 4 | 3c0a0141 5 | 3c0b00ea 6 | 3c0c0156 7 | 3c0d0214 8 | 3c0e01c6 9 | 3c0f01c5 10 | 3c18028e 11 | 3c1900ea 12 | 3c1000d3 13 | 3c110017 14 | 3c12000a 15 | 3c13008c 16 | 3c14007b 17 | 3c15008f 18 | 3c16000c 19 | 3c170096 20 | -------------------------------------------------------------------------------- /p3/P3_test datas/test_lw.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 34000064 3 | 34210065 4 | 34420066 5 | 34630067 6 | 34840068 7 | 34a50069 8 | 34c6006a 9 | 34e7006b 10 | 3508006c 11 | 3529006d 12 | 3400006e 13 | 354a0078 14 | ac000000 15 | ac010004 16 | ac020008 17 | ac03000c 18 | ac040010 19 | ac050014 20 | ac070018 21 | ac08001c 22 | ac090020 23 | ac0a0024 24 | 8c000000 25 | 8c150004 26 | 8c160008 27 | 8c17000c 28 | 8c180010 29 | 8c190014 30 | 8c1a0018 31 | 8c1b001c 32 | -------------------------------------------------------------------------------- /p3/P3_test datas/test_lw.txt.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 34000064 3 | 34210065 4 | 34420066 5 | 34630067 6 | 34840068 7 | 34a50069 8 | 34c6006a 9 | 34e7006b 10 | 3508006c 11 | 3529006d 12 | 3400006e 13 | 354a0078 14 | ac000000 15 | ac010004 16 | ac020008 17 | ac03000c 18 | ac040010 19 | ac050014 20 | ac070018 21 | ac08001c 22 | ac090020 23 | ac0a0024 24 | 8c000000 25 | 8c010004 26 | 8c020008 27 | 8c03000c 28 | 8c040010 29 | 8c050014 30 | 8c060018 31 | 8c07001c 32 | -------------------------------------------------------------------------------- /p3/P3_test datas/test_ori.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 35080064 3 | 3529007b 4 | 354a0141 5 | 356b00ea 6 | 358c0156 7 | 35ad0214 8 | 35ce01c6 9 | 35ef01c5 10 | 3718028e 11 | 373900ea 12 | 361000d3 13 | 36310017 14 | 3652000a 15 | 3673008c 16 | 3694007b 17 | 36b5008f 18 | 36d6000c 19 | 34840096 20 | 344201b0 21 | 34630159 22 | 37bd00ea 23 | 37de01c8 24 | 37ff01b0 25 | -------------------------------------------------------------------------------- /p3/P3_test datas/test_subu.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 34000064 3 | 34210065 4 | 34420066 5 | 34630067 6 | 34840068 7 | 34a50069 8 | 34c6006a 9 | 34e7006b 10 | 3508006c 11 | 3529006d 12 | 00015023 13 | 00435823 14 | 00646023 15 | 00856823 16 | 00a67023 17 | 00c77823 18 | 00e88023 19 | 01098823 20 | 01209023 21 | 00009823 22 | -------------------------------------------------------------------------------- /p3/P3_test datas/test_sw.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 34000064 3 | 34210065 4 | 34420066 5 | 34630067 6 | 34840068 7 | 34a50069 8 | 34c6006a 9 | 34e7006b 10 | 3508006c 11 | 3529006d 12 | 3400006e 13 | 354a0078 14 | 356b0082 15 | 356b008c 16 | 358c0096 17 | 35ad00a0 18 | 35ce00aa 19 | 37ff03de 20 | ac000000 21 | ac010004 22 | ac020008 23 | ac03000c 24 | ac040010 25 | ac050014 26 | ac070018 27 | ac08001c 28 | ac090020 29 | ac0a0024 30 | -------------------------------------------------------------------------------- /p3/P3_test datas/text.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 35080000 3 | 3610000a 4 | 11100011 5 | 01294823 6 | 018c6023 7 | 1130000a 8 | 8d8b0000 9 | 3c010000 10 | 34210004 11 | 01816021 12 | 01695821 13 | ad8b0000 14 | 3c010000 15 | 34210001 16 | 01214821 17 | 08000c05 18 | 3c010000 19 | 34210001 20 | 01014021 21 | 08000c02 22 | 114affff 23 | 00000000 24 | 00000000 25 | 00000000 26 | 00000000 27 | 00000000 28 | 00000000 29 | 00000000 30 | 00000000 31 | 00000000 32 | 00000000 33 | 00000000 34 | 35 | -------------------------------------------------------------------------------- /p3/P3_test datas/ts.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 3c03000a 3 | 0c000000 4 | -------------------------------------------------------------------------------- /p3/P3_test datas/tx.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 3c03000a 3 | 3c04000a 4 | 18a00000 -------------------------------------------------------------------------------- /p3/P3_test datas/新建 Microsoft Word 文档.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p3/P3_test datas/新建 Microsoft Word 文档.docx -------------------------------------------------------------------------------- /p3/asset-v1_BUAA+B3I062410+2017_T1+type@asset+block@计算机组成原理实验报告撰写排版规则.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p3/asset-v1_BUAA+B3I062410+2017_T1+type@asset+block@计算机组成原理实验报告撰写排版规则.docx -------------------------------------------------------------------------------- /p3/p3课下cpu设计文档.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p3/p3课下cpu设计文档.docx -------------------------------------------------------------------------------- /p3/p3课下cpu设计文档.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p3/p3课下cpu设计文档.pdf -------------------------------------------------------------------------------- /p3/测试1.txt: -------------------------------------------------------------------------------- 1 | v2.0 raw 2 | 341c0000 3 | 341d0000 4 | 340080f8 5 | 36ee0367 6 | 3593769c 7 | 34dda539 8 | 3465c5dc 9 | 34be0ff1 10 | 3472af1d 11 | 35566602 12 | 35fe72a7 13 | 3437ff23 14 | 37b9649e 15 | 3690bf9b 16 | 37fe4e0c 17 | 3711f49d 18 | 3c113bfe 19 | 3c057433 20 | 3c03c451 21 | 3c04c431 22 | 3c1c24d9 23 | 3c1bf0da 24 | 3c0ccc68 25 | 3c0a118d 26 | 3c1021ea 27 | 3c0004d3 28 | 3c16115b 29 | 3c184f06 30 | 3c1215de 31 | 1000ffff -------------------------------------------------------------------------------- /p4/P4_code/CMP.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 00:40:43 11/20/2019 7 | // Design Name: 8 | // Module Name: CMP 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module CMP( 22 | input [31:0] A, 23 | input [31:0] B, 24 | output zero 25 | ); 26 | 27 | assign zero = (A==B)?1:0; 28 | endmodule 29 | -------------------------------------------------------------------------------- /p4/P4_code/EXT.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 15:53:04 11/09/2019 7 | // Design Name: 8 | // Module Name: EXT 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module EXT( 22 | input [15:0] in, 23 | output reg [31:0] out, 24 | input ExtOp 25 | ); 26 | always @(*)begin 27 | case(ExtOp) 28 | 0: out <= {{16{in[15]}},in}; 29 | 1: out <= {{16{1'b0}},in}; 30 | endcase 31 | end 32 | endmodule 33 | -------------------------------------------------------------------------------- /p4/P4_code/IM.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 00:33:37 11/09/2019 7 | // Design Name: 8 | // Module Name: IM 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module IM( 22 | input [31:0] PC, 23 | output [31:0] Instruction 24 | ); 25 | 26 | reg [31:0]im [0:1024]; 27 | initial begin 28 | $readmemh("code.txt",im); 29 | end 30 | assign Instruction = im[PC[11:2]]; 31 | 32 | endmodule 33 | -------------------------------------------------------------------------------- /p4/P4_code/Mips.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p4/P4_code/Mips.v -------------------------------------------------------------------------------- /p4/P4_code/PC.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 13:55:34 11/09/2019 7 | // Design Name: 8 | // Module Name: PC 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module PC( 22 | input clk, 23 | input reset, 24 | input [31:0] next_pc, 25 | output reg [31:0] PC 26 | ); 27 | always @(posedge clk)begin 28 | if(reset==1) begin 29 | PC <= 32'h00003000; 30 | end 31 | else begin 32 | PC <= next_pc; 33 | end 34 | end 35 | 36 | endmodule 37 | -------------------------------------------------------------------------------- /p4/P4_code/cjbdefine.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 10:25:16 11/15/2019 7 | // Design Name: 8 | // Module Name: define 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | //RegDst 22 | `define Rt 3'b000 23 | `define Rd 3'b001 24 | `define jal 3'b010 25 | //ALUSrc 26 | `define RD2 0 27 | `define imm 1 28 | //MemtoReg 29 | `define alu 3'b000 30 | `define dm 3'b001 31 | `define lui 3'b010 32 | `define pc4 3'b011 33 | 34 | //ALUCtrl 35 | `define add 3'b000 36 | `define sub 3'b001 37 | `define or 3'b0010 38 | //branch 39 | `define pc 3'b000 40 | `define beq 3'b001 41 | //`define jal 3'b010 42 | `define jr 3'b011 -------------------------------------------------------------------------------- /p4/P4_code/test_cpu.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | 3 | //////////////////////////////////////////////////////////////////////////////// 4 | // Company: 5 | // Engineer: 6 | // 7 | // Create Date: 20:19:27 11/15/2019 8 | // Design Name: mips 9 | // Module Name: D:/p4/p4_0/test_cpu.v 10 | // Project Name: p4_0 11 | // Target Device: 12 | // Tool versions: 13 | // Description: 14 | // 15 | // Verilog Test Fixture created by ISE for module: mips 16 | // 17 | // Dependencies: 18 | // 19 | // Revision: 20 | // Revision 0.01 - File Created 21 | // Additional Comments: 22 | // 23 | //////////////////////////////////////////////////////////////////////////////// 24 | 25 | module test_cpu; 26 | 27 | // Inputs 28 | reg clk; 29 | reg reset; 30 | 31 | // Instantiate the Unit Under Test (UUT) 32 | mips uut ( 33 | .clk(clk), 34 | .reset(reset) 35 | ); 36 | always #10 clk = ~clk; 37 | initial begin 38 | // Initialize Inputs 39 | clk = 0; 40 | reset = 1; 41 | 42 | // Wait 100 ns for global reset to finish 43 | #98; 44 | reset = 0; 45 | // Add stimulus here 46 | 47 | end 48 | 49 | endmodule 50 | 51 | -------------------------------------------------------------------------------- /p4/mips1.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p4/mips1.asm -------------------------------------------------------------------------------- /p4/p4测试数据/beq.txt: -------------------------------------------------------------------------------- 1 | 34630064 2 | 34840064 3 | 34a500c8 4 | 10650001 5 | 10640001 6 | 3c06000a 7 | 3c07000a 8 | -------------------------------------------------------------------------------- /p4/p4测试数据/jal.txt: -------------------------------------------------------------------------------- 1 | 3463000a 2 | 0c000c03 3 | 3484000a 4 | 34a5000a 5 | -------------------------------------------------------------------------------- /p4/p4测试数据/jr.txt: -------------------------------------------------------------------------------- 1 | 3463000a 2 | 0c000c03 3 | 3484000a 4 | 03e00008 5 | -------------------------------------------------------------------------------- /p4/p4测试数据/sw.txt: -------------------------------------------------------------------------------- 1 | 3c04000a 2 | ac030000 3 | ac030004 4 | -------------------------------------------------------------------------------- /p4/p4测试数据/temp.txt: -------------------------------------------------------------------------------- 1 | 340407cf 2 | 3485006f 3 | 3c063039 4 | 3c07ffff 5 | 00000000 6 | 34e7ffff 7 | 00858021 8 | 00e78821 9 | 00f09021 10 | 12530002 11 | 00928023 12 | 00e78823 13 | 00e49023 14 | 02519823 15 | 34080000 16 | ad040000 17 | 00000000 18 | ad050004 19 | ad100008 20 | ad11000c 21 | ad120010 22 | ad150014 23 | 8d090014 24 | 8d0f0000 25 | 8d0e0014 26 | ad0e0018 27 | 8d0d000c 28 | 0c000c21 29 | 35080001 30 | 35290001 31 | 354a0002 32 | 110affec 33 | 3c0b0457 34 | 010f4021 35 | -------------------------------------------------------------------------------- /p4/p4测试数据/test.txt: -------------------------------------------------------------------------------- 1 | 340407cf 2 | 3485006f 3 | 3c063039 4 | 3c07ffff 5 | 00000000 6 | 34e7ffff 7 | 00858021 8 | 00e78821 9 | 00f09021 10 | 12530002 11 | 00928023 12 | 00e78823 13 | 00e49023 14 | 02519823 15 | 34080000 16 | ad040000 17 | 00000000 18 | ad050004 19 | -------------------------------------------------------------------------------- /p4/p4测试数据/test1.txt: -------------------------------------------------------------------------------- 1 | 3484000a 2 | 3442000c 3 | 34630017 4 | ac020000 5 | ac030004 6 | ac040008 7 | 8c050000 8 | 8c060000 9 | 8c070000 10 | -------------------------------------------------------------------------------- /p4/p4测试数据/test_addu.txt: -------------------------------------------------------------------------------- 1 | 34000064 2 | 34210065 3 | 34420066 4 | 34630067 5 | 34840068 6 | 34a50069 7 | 34c6006a 8 | 34e7006b 9 | 3508006c 10 | 3529006d 11 | 00015021 12 | 00425821 13 | 00636021 14 | 00846821 15 | 00a57021 16 | 00c67821 17 | 00e78021 18 | 01088821 19 | 01299021 20 | 00009821 21 | -------------------------------------------------------------------------------- /p4/p4测试数据/test_lui.txt: -------------------------------------------------------------------------------- 1 | 3c080064 2 | 3c09007b 3 | 3c0a0141 4 | 3c0b00ea 5 | 3c0c0156 6 | 3c0d0214 7 | 3c0e01c6 8 | 3c0f01c5 9 | 3c18028e 10 | 3c1900ea 11 | 3c1000d3 12 | 3c110017 13 | 3c12000a 14 | 3c13008c 15 | 3c14007b 16 | 3c15008f 17 | 3c16000c 18 | 3c170096 19 | -------------------------------------------------------------------------------- /p4/p4测试数据/test_lw.txt: -------------------------------------------------------------------------------- 1 | 34000064 2 | 34210065 3 | 34420066 4 | 34630067 5 | 34840068 6 | 34a50069 7 | 34c6006a 8 | 34e7006b 9 | 3508006c 10 | 3529006d 11 | 3400006e 12 | 354a0078 13 | ac000000 14 | ac010004 15 | ac020008 16 | ac03000c 17 | ac040010 18 | ac050014 19 | ac070018 20 | ac08001c 21 | ac090020 22 | ac0a0024 23 | 8c000000 24 | 8c150004 25 | 8c160008 26 | 8c17000c 27 | 8c180010 28 | 8c190014 29 | 8c1a0018 30 | 8c1b001c 31 | -------------------------------------------------------------------------------- /p4/p4测试数据/test_ori.txt: -------------------------------------------------------------------------------- 1 | 35080064 2 | 3529007b 3 | 354a0141 4 | 356b00ea 5 | 358c0156 6 | 35ad0214 7 | 35ce01c6 8 | 35ef01c5 9 | 3718028e 10 | 373900ea 11 | 361000d3 12 | 36310017 13 | 3652000a 14 | 3673008c 15 | 3694007b 16 | 36b5008f 17 | 36d6000c 18 | 34840096 19 | 344201b0 20 | 34630159 21 | 37bd00ea 22 | 37de01c8 23 | 37ff01b0 24 | -------------------------------------------------------------------------------- /p4/p4测试数据/test_subu.txt: -------------------------------------------------------------------------------- 1 | 34000064 2 | 34210065 3 | 34420066 4 | 34630067 5 | 34840068 6 | 34a50069 7 | 34c6006a 8 | 34e7006b 9 | 3508006c 10 | 3529006d 11 | 00015023 12 | 00435823 13 | 00646023 14 | 00856823 15 | 00a67023 16 | 00c77823 17 | 00e88023 18 | 01098823 19 | 01209023 20 | 00009823 21 | -------------------------------------------------------------------------------- /p4/p4测试数据/test_sw.txt: -------------------------------------------------------------------------------- 1 | 34000064 2 | 34210065 3 | 34420066 4 | 34630067 5 | 34840068 6 | 34a50069 7 | 34c6006a 8 | 34e7006b 9 | 3508006c 10 | 3529006d 11 | 3400006e 12 | 354a0078 13 | 356b0082 14 | 356b008c 15 | 358c0096 16 | 35ad00a0 17 | 35ce00aa 18 | 37ff03de 19 | ac000000 20 | ac010004 21 | ac020008 22 | ac03000c 23 | ac040010 24 | ac050014 25 | ac070018 26 | ac08001c 27 | ac090020 28 | ac0a0024 29 | -------------------------------------------------------------------------------- /p4/p4测试数据/最终版测试程序..txt: -------------------------------------------------------------------------------- 1 | 3421000b 2 | 34420016 3 | 34630021 4 | 3c04000c 5 | 3c050017 6 | 3c060018 7 | 3c070019 8 | 3c080022 9 | 3c09000c 10 | 01295021 11 | 00435821 12 | 00a66021 13 | 00656823 14 | 00a47023 15 | 00467823 16 | 00000000 17 | 3c10000c 18 | 1130000b 19 | 00000000 20 | 3c010001 21 | 3c020001 22 | 3c030001 23 | 3c040001 24 | 3c050001 25 | 3c060001 26 | 3c070001 27 | 3c080001 28 | 3c090001 29 | 3c0a0001 30 | 1022fff9 31 | ac010000 32 | ac020004 33 | ac030008 34 | ac04000c 35 | ac050010 36 | ac060014 37 | ac070018 38 | 8c110000 39 | 8c120004 40 | 0c000c2a 41 | 8c130008 42 | 0c000c2c 43 | 8c000000 44 | 03e00008 45 | 00601823 46 | 001ff823 47 | -------------------------------------------------------------------------------- /p4/p4课下设计文档.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p4/p4课下设计文档.docx -------------------------------------------------------------------------------- /p4/p4课下设计文档.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p4/p4课下设计文档.pdf -------------------------------------------------------------------------------- /p4/test.txt: -------------------------------------------------------------------------------- 1 | 3c0504d2 2 | ac850000 3 | 8c830000 4 | -------------------------------------------------------------------------------- /p5/P5_code/CMP.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 19:09:50 11/19/2019 7 | // Design Name: 8 | // Module Name: CMP 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module CMP( 22 | input [31:0] Data1, 23 | input [31:0] Data2, 24 | output Equal 25 | ); 26 | 27 | assign Equal = (Data1==Data2)?1:0; 28 | endmodule 29 | -------------------------------------------------------------------------------- /p5/P5_code/EXT.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 15:53:04 11/09/2019 7 | // Design Name: 8 | // Module Name: EXT 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module EXT( 22 | input [15:0] in, 23 | input [2:0]ExtOp, 24 | output reg [31:0] out 25 | ); 26 | always @(*) begin 27 | case(ExtOp) 28 | 0: out <= {{16{in[15]}},in}; 29 | 1: out <= {{16{1'b0}},in}; 30 | 2: out <= {in,{16{1'b0}}}; 31 | default: out <= 0; 32 | endcase 33 | end 34 | endmodule 35 | -------------------------------------------------------------------------------- /p5/P5_code/IM.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 00:33:37 11/09/2019 7 | // Design Name: 8 | // Module Name: IM 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module IM( 22 | input [31:0] PC, 23 | output [31:0] Instruction 24 | ); 25 | 26 | reg [31:0]im [0:1024]; 27 | initial begin 28 | $readmemh("code.txt",im); 29 | end 30 | assign Instruction = im[PC[11:2]]; 31 | 32 | endmodule 33 | -------------------------------------------------------------------------------- /p5/P5_code/NPC.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 21:33:16 11/22/2019 7 | // Design Name: 8 | // Module Name: NPC 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module NPC( 22 | input Equal, 23 | input [2:0] PC_sel, 24 | input [31:0] PC, 25 | input [31:0] PC4, 26 | input [31:0] PC_beq, 27 | input [31:0] PC_j, 28 | input [31:0] PC_jr, 29 | output [31:0] next_pc 30 | ); 31 | assign next_pc = (PC_sel == 0) ? PC4: 32 | (PC_sel == 1 & Equal) ? PC_beq: 33 | (PC_sel == 1 & ~Equal)? PC4: 34 | (PC_sel == 2) ? PC_jr: 35 | (PC_sel == 3) ? PC_j: 36 | PC4; 37 | 38 | endmodule 39 | -------------------------------------------------------------------------------- /p5/P5_code/PC.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 13:55:34 11/09/2019 7 | // Design Name: 8 | // Module Name: PC 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module PC( 22 | input clk, 23 | input reset, 24 | input PC_En, 25 | input [31:0] next_pc, 26 | output reg [31:0] PC 27 | ); 28 | always @(posedge clk)begin 29 | if(reset==1) begin 30 | PC <= 32'h00003000; 31 | end 32 | else if(PC_En)begin 33 | PC <= next_pc; 34 | end 35 | end 36 | 37 | endmodule 38 | -------------------------------------------------------------------------------- /p5/P5_code/conflict.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_code/conflict.v -------------------------------------------------------------------------------- /p5/P5_code/controller.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_code/controller.v -------------------------------------------------------------------------------- /p5/P5_code/define.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | 3 | `define R 6'b000000 4 | `define lw 6'b100011 5 | `define sw 6'b101011 6 | `define lui 6'b001111 7 | `define ori 6'b001101 8 | `define beq 6'b000100 9 | `define jal 6'b000011 10 | `define addu 6'b100001 11 | `define subu 6'b100011 12 | `define jr 6'b001000 13 | `define jalr 6'b001001 14 | `define j 6'b000010 15 | 16 | `define op 31:26 17 | `define rs 25:21 18 | `define rt 20:16 19 | `define rd 15:11 20 | `define shamt 10:6 21 | `define func 5:0 22 | `define imm16 15:0 -------------------------------------------------------------------------------- /p5/P5_code/instr_decoder.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_code/instr_decoder.v -------------------------------------------------------------------------------- /p5/P5_code/mips.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_code/mips.v -------------------------------------------------------------------------------- /p5/P5_code/test.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | 3 | //////////////////////////////////////////////////////////////////////////////// 4 | // Company: 5 | // Engineer: 6 | // 7 | // Create Date: 23:36:04 11/22/2019 8 | // Design Name: mips 9 | // Module Name: D:/p5/p5_0.1/test.v 10 | // Project Name: p5_0.1 11 | // Target Device: 12 | // Tool versions: 13 | // Description: 14 | // 15 | // Verilog Test Fixture created by ISE for module: mips 16 | // 17 | // Dependencies: 18 | // 19 | // Revision: 20 | // Revision 0.01 - File Created 21 | // Additional Comments: 22 | // 23 | //////////////////////////////////////////////////////////////////////////////// 24 | 25 | module test; 26 | 27 | // Inputs 28 | reg clk; 29 | reg reset; 30 | 31 | // Instantiate the Unit Under Test (UUT) 32 | mips uut ( 33 | .clk(clk), 34 | .reset(reset) 35 | ); 36 | always #10 clk = ~clk; 37 | initial begin 38 | // Initialize Inputs 39 | clk = 0; 40 | reset = 1; 41 | 42 | // Wait 100 ns for global reset to finish 43 | #97; 44 | reset = 0; 45 | // Add stimulus here 46 | 47 | end 48 | 49 | endmodule 50 | 51 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/E_D转发.asm: -------------------------------------------------------------------------------- 1 | lui $3, 203 2 | lui $4, 203 3 | beq $3,$4 next 4 | ori $5,123 5 | ori $6,123 6 | 7 | next: 8 | jal end 9 | ori $8,$31,0 10 | ori $9,$31,0 11 | end: 12 | ori $10,$31,0 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/E_D转发.txt: -------------------------------------------------------------------------------- 1 | 3c0300cb 2 | 3c0400cb 3 | 10640002 4 | 34a5007b 5 | 34c6007b 6 | 0c000c08 7 | 37e80000 8 | 37e90000 9 | 37ea0000 10 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/M_D转发.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/M_D转发.asm -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/M_D转发.txt: -------------------------------------------------------------------------------- 1 | 340300cb 2 | 3c010000 3 | 342100cb 4 | 00012021 5 | 10640002 6 | 34a5007b 7 | 34c6007b 8 | 0c000c0a 9 | 37e80000 10 | 37e90000 11 | 37ea0000 12 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/W-D转发.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/W-D转发.asm -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/W_D转发.txt: -------------------------------------------------------------------------------- 1 | 340c0141 2 | 340d0141 3 | 34030004 4 | ac6c0000 5 | ac6d0004 6 | 8c640004 7 | 8c650000 8 | 10850002 9 | 3408007b 10 | 3409007b 11 | 341f0000 12 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/W_M转发.txt: -------------------------------------------------------------------------------- 1 | 3403000c 2 | 3404007b 3 | ac640000 4 | 00802821 5 | ac650004 6 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/begzal1.txt: -------------------------------------------------------------------------------- 1 | 3c02ffff 2 | 04510002 3 | 00000000 4 | 34630017 5 | 34840017 6 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/beq.asm: -------------------------------------------------------------------------------- 1 | ori $3,$0,123 2 | ori $5, $0, 234 3 | ori $4,$0,123 4 | beq $4,$3,next 5 | addu $30,$30,$5 6 | addu $31,$31,$5 7 | next: 8 | addu $t6,$6,$5 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/beq.txt: -------------------------------------------------------------------------------- 1 | 3403007b 2 | 340500ea 3 | 3404007b 4 | 10830002 5 | 03c5f021 6 | 03e5f821 7 | 00c57021 8 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/bgezal.txt: -------------------------------------------------------------------------------- 1 | 3c020000 2 | 04510004 3 | 00000000 4 | 04710004 5 | 00000000 6 | 34630017 7 | 03e00008 8 | 00000000 9 | 03e00008 10 | 00000000 11 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/feibonaqie.txt: -------------------------------------------------------------------------------- 1 | 34100000 2 | 34110001 3 | 34120002 4 | 34130004 5 | 34140000 6 | 34040007 7 | 0c000c0b 8 | 0002c821 9 | 34082333 10 | 34092333 11 | 1109001d 12 | ae9f0000 13 | 0293a021 14 | 10900016 15 | 10910015 16 | ae840000 17 | 0293a021 18 | 00912023 19 | 0c000c0b 20 | 0293a023 21 | 8e840000 22 | 00024021 23 | ae880000 24 | 0293a021 25 | ae840000 26 | 0293a021 27 | 00922023 28 | 0c000c0b 29 | 0293a023 30 | 8e840000 31 | 0293a023 32 | 8e880000 33 | 01021021 34 | 0293a023 35 | 8e9f0000 36 | 03e00008 37 | 34020001 38 | 0293a023 39 | 8e9f0000 40 | 03e00008 41 | 00000000 42 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/j.asm: -------------------------------------------------------------------------------- 1 | ori $28,$0,123 2 | begin: 3 | ori $21,$0,324 4 | ori $22,$0,643 5 | ori $23,$0,235 6 | j begin 7 | ori $29,$0,134 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/j.txt: -------------------------------------------------------------------------------- 1 | 341c007b 2 | 34150144 3 | 34160283 4 | 341700eb 5 | 08000c01 6 | 341d0086 7 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/jal.asm: -------------------------------------------------------------------------------- 1 | ori $3,$0,123 2 | ori $4,$0,123 3 | beq $4,$3,nn 4 | addu $9,$3,$3 5 | addu $10,$5,$5 6 | nn: 7 | jal next 8 | ori $5, $0,345 9 | ori $6,$0,789 10 | next: 11 | ori $4,$0,1234567 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/jal.txt: -------------------------------------------------------------------------------- 1 | 3403007b 2 | 3404007b 3 | 10830002 4 | 00634821 5 | 00a55021 6 | 0c000c08 7 | 34050159 8 | 34060315 9 | 3c010012 10 | 3421d687 11 | 00012025 12 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/jr.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/jr.txt -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/jr_new.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/jr_new.asm -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/jr_new.txt: -------------------------------------------------------------------------------- 1 | 34633000 2 | 34843004 3 | 34a50004 4 | 34c60008 5 | 00651821 6 | 1083fffa 7 | 00000000 8 | 00661821 9 | 00661821 10 | 00661821 11 | 00661821 12 | 00661821 13 | 00661821 14 | 00600008 15 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/lui.asm: -------------------------------------------------------------------------------- 1 | lui $5, 233 2 | lui $6, 233 3 | lui $5, 122 4 | addu $6,$5,$5 5 | subu $6,$5,$5 6 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/lui.txt: -------------------------------------------------------------------------------- 1 | 3c0500e9 2 | 3c0600e9 3 | 3c05007a 4 | 00a53020 5 | 00a53023 6 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/lw.txt: -------------------------------------------------------------------------------- 1 | 3c0500e9 2 | 3c0600e9 3 | 3c05007a 4 | 00a53021 5 | 00a53023 6 | 34c6007b 7 | ac050000 8 | ac060004 9 | 8c070000 10 | 8c080004 11 | 01284821 12 | 01285021 13 | ac0a002c 14 | 8c0b002c 15 | 016b6020 16 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/lw_sw.txt: -------------------------------------------------------------------------------- 1 | 3c0500e9 2 | 3c0600e9 3 | 3c05007a 4 | 00a53021 5 | 00a53023 6 | 34c6007b 7 | ac050000 8 | ac060004 9 | 8c070000 10 | 8c080004 11 | 01284821 12 | 01285021 13 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/mips1.asm: -------------------------------------------------------------------------------- 1 | ori $t1,$0,0x00003004 2 | movz $t0,$t1,$t1 3 | nop 4 | jr $t0 5 | nop 6 | nop -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/mips5.asm: -------------------------------------------------------------------------------- 1 | lui $2,0 2 | bgezal $2 ,next 3 | nop 4 | bgezal $3, next_2 5 | nop 6 | ori $3,23 7 | next: 8 | jr $31 9 | nop 10 | next_2: 11 | jr $31 12 | nop 13 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/movez.asm: -------------------------------------------------------------------------------- 1 | lui $3,123 2 | movz $t1,$3,$0 3 | addu $t4,$t1,$t1 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/movz_R.asm: -------------------------------------------------------------------------------- 1 | ori $t1,$0,0x00003004 2 | movz $t0,$t1,$t1 3 | nop 4 | jr $t0 5 | nop 6 | nop -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/movz_r.txt: -------------------------------------------------------------------------------- 1 | 3c03000c 2 | 00632021 3 | 0064280a 4 | 3447007b 5 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/next.txt: -------------------------------------------------------------------------------- 1 | 3408000c 2 | ad080000 3 | 8d090000 4 | 00000000 5 | 11280002 6 | 00000000 7 | 3402007b 8 | 3404007b 9 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/nop.asm: -------------------------------------------------------------------------------- 1 | ori $t0,$0,12 2 | sw $t0, 0($t0) 3 | lw $t1,0($t0) 4 | nop 5 | beq $t1,$t0, next 6 | nop 7 | ori $2,$0,123 8 | next: 9 | ori $4,$0,123 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/or.asm: -------------------------------------------------------------------------------- 1 | ori $t2,$t3,123 2 | or $t4,$t2,$t2 3 | addu $t5,$t4,$t4 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/or.txt: -------------------------------------------------------------------------------- 1 | 356a007b 2 | 014a6025 3 | 018c6821 4 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/p5_zyy/P5design.rar -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/16231246P5DesignDoc.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/p5_zyy/P5design/16231246P5DesignDoc.docx -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/CPU Design.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/p5_zyy/P5design/CPU Design.xlsx -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/MagicMARSResult/【magic】Forward_rs.txt: -------------------------------------------------------------------------------- 1 | $ 8 <= f65b0000 2 | $ 9 <= 0000abfe 3 | $12 <= af780000 4 | $10 <= 00003018 5 | $13 <= 0000abfe 6 | $11 <= 49bf0000 7 | $12 <= 49bfabfe 8 | $10 <= 00003018 9 | $13 <= 49bfabfe 10 | $11 <= 49bf0000 11 | $13 <= 00007be6 12 | $11 <= 00003044 13 | $12 <= 49bfdc16 14 | $13 <= 0000734d 15 | $31 <= 00003044 16 | $13 <= 0000605c 17 | $12 <= 49c00c2e 18 | $12 <= 49c00c2e 19 | $13 <= 49c00c2e 20 | $12 <= 49bfdbea 21 | $11 <= 49bfffeb 22 | $ 1 <= 00000030 23 | $31 <= 00003074 24 | $ 2 <= 41ba0000 25 | $ 1 <= 49bfffeb 26 | $ 1 <= 49bfffeb 27 | $12 <= 49bf2fec 28 | $16 <= 00000018 29 | $31 <= 0000308c 30 | $12 <= 49c0b82c 31 | $10 <= 0000b841 32 | $ 1 <= 00000004 33 | $31 <= 0000309c 34 | $31 <= 000030a0 35 | $12 <= 49c0b82c 36 | $17 <= ffffcf60 37 | $31 <= 000030ac 38 | $ 8 <= fffff3bd 39 | $12 <= 49c0b82c -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/P4-SingleCycleCPU.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/p5_zyy/P5design/P4-SingleCycleCPU.zip -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/P5-PipelineCPU-FinalwithoutMOVZ.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/p5_zyy/P5design/P5-PipelineCPU-FinalwithoutMOVZ.zip -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/P5-PipelineCPU-withMOVZ.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/p5_zyy/P5design/P5-PipelineCPU-withMOVZ.zip -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest.zip -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test1.asm: -------------------------------------------------------------------------------- 1 | ori $t0, $t0, 10 2 | lui $t1, 6 3 | addu $t2, $t0, $t1 4 | nop 5 | subu $t3, $t1, $t2 6 | subu $t3, $t1, $t0 7 | 8 | 9 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test10.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums: .space 4096 3 | .text 4 | ori $s3, 0x3000 5 | ori $t3, $0, 16 6 | ori $t2, $0, 12 7 | ori $t1, $0, 8 8 | ori $t0, $0, 4 9 | jal loop 10 | sw $ra, nums($t0) 11 | ori $t0, $0, 1 12 | loop: 13 | jal loop2 14 | nop 15 | loop2: 16 | sw $ra, nums($t1) 17 | jal loop3 18 | nop 19 | loop3: 20 | nop 21 | sw $ra, nums($t2) 22 | jal loop4 23 | nop 24 | loop4: 25 | nop 26 | nop 27 | sw $ra, nums($t3) 28 | jal loop5 29 | subu $t0, $ra, $s3 30 | loop5: 31 | sw $t3, nums($t0) 32 | jal loop6 33 | subu $t0, $ra, $s3 34 | loop6: 35 | nop 36 | sw $t3, nums($t0) 37 | jal loop7 38 | subu $t0, $ra, $s3 39 | loop7: 40 | nop 41 | nop 42 | sw $t3, nums($t0) 43 | 44 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test11.asm: -------------------------------------------------------------------------------- 1 | jal loop 2 | ori $t0, $ra, 0 3 | loop: 4 | beq $t0, $ra, loop2 5 | nop 6 | loop2: 7 | jal loop3 8 | ori $t1, $ra, 0 9 | loop3: 10 | beq $ra, $t1, loop4 11 | nop 12 | loop4: 13 | jal loop5 14 | ori $t2, $ra, 0 15 | loop5: 16 | nop 17 | beq $ra, $t2, loop6 18 | nop 19 | loop6: 20 | jal loop7 21 | ori $t3, $ra, 0 22 | loop7: 23 | nop 24 | beq $t3, $ra, loop8 25 | nop 26 | loop8: 27 | jal loop9 28 | ori $t4, $ra, 0 29 | loop9: 30 | nop 31 | beq $ra, $t4, loop10 32 | nop 33 | loop10: 34 | jal loop11 35 | ori $t5, $ra, 0 36 | loop11: 37 | nop 38 | beq $t5, $ra, loop12 39 | nop 40 | loop12: 41 | jal loop13 42 | ori $t6, $ra, 0 43 | loop13: 44 | nop 45 | nop 46 | beq $t6, $ra, loop14 47 | nop 48 | loop14: 49 | jal loop15 50 | ori $t7, $ra, 0 51 | loop15: 52 | nop 53 | nop 54 | beq $ra, $t7, loop16 55 | nop 56 | loop16: 57 | ori $t0, $0, 12 58 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test12.asm: -------------------------------------------------------------------------------- 1 | ori $t0, $0, 0x00003010 2 | jr $t0 3 | nop 4 | ori $t0, $0, 1 5 | ori $t0, $0, 2 6 | ori $t0, $0, 0x00003028 7 | nop 8 | jr $t0 9 | nop 10 | ori $t0, $0, 1 11 | ori $t0, $0, 3 12 | ori $t0, $0, 0x00003044 13 | nop 14 | nop 15 | jr $t0 16 | nop 17 | ori $t0, $0, 1 18 | ori $t0, $0, 4 19 | ori $t0, $0, 0x00003064 20 | nop 21 | nop 22 | nop 23 | jr $t0 24 | nop 25 | ori $0, $0, 1 26 | ori $t0, $0, 5 27 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test13.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums: .space 4096 3 | 4 | .text 5 | ori $t0, $0, 0x3094 6 | ori $t1, $0, 0x30a4 7 | ori $t2, $0, 0x30b4 8 | ori $t3, $0, 0x30c4 9 | ori $t4, $0, 4 10 | ori $t5, $0, 8 11 | ori $t6, $0, 0xc 12 | sw $t0, nums 13 | sw $t1, nums+4 14 | sw $t2, nums+8 15 | sw $t3, nums+12 16 | sw $t3, nums+16 17 | sw $t4, nums+20 18 | 19 | lw $s0, nums 20 | jr $s0 21 | nop 22 | tag: 23 | lw $s1, nums($t4) 24 | nop 25 | jr $s1 26 | nop 27 | tag2: 28 | lw $s2, nums($t5) 29 | nop 30 | nop 31 | jr $s2 32 | nop 33 | tag3: 34 | lw $s3, nums($t6) 35 | nop 36 | nop 37 | nop 38 | jr $s3 39 | nop 40 | 41 | ori $t9, $0, 1 42 | ori $t9, $0, 2 43 | j tag 44 | nop 45 | ori $t9, $0, 1 46 | ori $t9, $0, 3 47 | j tag2 48 | nop 49 | ori $t9, $0, 1 50 | ori $t9, $0, 4 51 | j tag3 52 | nop 53 | ori $t9, $0, 1 54 | ori $t9, $0, 5 55 | end: 56 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test14.asm: -------------------------------------------------------------------------------- 1 | jal loop 2 | nop 3 | jal loop2 4 | nop 5 | jal loop3 6 | nop 7 | jal loop4 8 | nop 9 | ori $t0, $0, 100 10 | loop: 11 | jr $ra 12 | nop 13 | loop2: 14 | nop 15 | jr $ra 16 | nop 17 | loop3: 18 | nop 19 | nop 20 | jr $ra 21 | nop 22 | loop4: 23 | nop 24 | nop 25 | nop 26 | jr $ra 27 | nop 28 | 29 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test15.asm: -------------------------------------------------------------------------------- 1 | ori $t0, $0, -1234 2 | bltz $t0, loop 3 | nop 4 | ori $s0, $0, 1 5 | loop: 6 | ori $s0, $0, 2 7 | ori $t1, $0, -6 8 | nop 9 | bltz $t1, loop2 10 | nop 11 | ori $s0, $0, 1 12 | loop2: 13 | ori $s0, $0, 3 14 | ori $t2, $0, -7 15 | nop 16 | nop 17 | bltz $t2, loop3 18 | nop 19 | ori $s0, $0, 1 20 | loop3: 21 | ori $s0, $0, 4 22 | ori $t3, $0, -8 23 | nop 24 | nop 25 | nop 26 | bltz $t3, loop4 27 | nop 28 | ori $s0, $0, 1 29 | loop4: 30 | ori $t3, $0, 5 31 | 32 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test16.asm: -------------------------------------------------------------------------------- 1 | ori $t0, $0, 12 2 | ori $t1, $0, 12 3 | bne $t0, $t1, loop 4 | nop 5 | ori $s0, $0, 1 6 | loop: 7 | ori $s0, $0, 2 8 | ori $t2, $0, 11 9 | ori $t3, $0, 11 10 | bne $t3, $t2, loop2 11 | nop 12 | ori $s0, $0, 1 13 | loop2: 14 | ori $s0,$0, 2 15 | ori $t4, $0, 22 16 | ori $t5, $0, 22 17 | nop 18 | bne $t4, $t5, loop3 19 | nop 20 | ori $s0, $0, 1 21 | loop3: 22 | ori $s0, $0, 3 23 | ori $t6, $0, 12 24 | ori $t7, $0, 12 25 | nop 26 | bne $t7, $t6, loop4 27 | nop 28 | ori $s0, $0, 1 29 | loop4: 30 | ori $s0, $0, 4 31 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test2.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums: .space 4096 3 | .text 4 | ori $t0, $t0, 100 5 | sw $t0, nums($t0) 6 | ori $t1, $t1, 12 7 | ori $t3, $t3, 16 8 | sw $t1, nums($t1) 9 | nop 10 | sw $t3, nums($t3) 11 | ori $t4, $t4, 20 12 | nop 13 | nop 14 | sw $t3, nums($t4) 15 | sw $t4, nums($t4) 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test3.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums:.space 4096 3 | .text 4 | ori $s0, $s0, 4 5 | ori $s5, 19 6 | sw $s5, nums($s0) 7 | ori $s2, $s2, 8 8 | ori $s5, 17 9 | sw $s5, nums($s2) 10 | ori $s3, $s3, 4092 11 | lui $s5, 13 12 | sw $s5,nums($s3) 13 | ori $s4, $s4, 20 14 | sw $s4,nums($s4) 15 | ori $t0, $t0, 4 16 | lw $t5, nums($t0) 17 | ori $t2, $t2, 8 18 | nop 19 | lw $t6, nums($t2) 20 | ori $t3, $t3, 4092 21 | nop 22 | nop 23 | lw $t7, nums($t3) 24 | ori $t4, $t4, 20 25 | nop 26 | nop 27 | nop 28 | lw $t8, nums($t4) 29 | ori $t6, $0, 24 30 | lw $t9, nums($t6) 31 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test5.asm: -------------------------------------------------------------------------------- 1 | ori $s0, 4 2 | jal tag 3 | addu $t0, $ra, $ra 4 | ori $t0, $0, 1 5 | tag: 6 | addu $t1, $ra, $s0 7 | addu $t2, $ra, $s0 8 | addu $t3, $ra, $s0 9 | jal tag2 10 | addu $t4, $s0, $ra 11 | ori $t0, $0, 1 12 | tag2: 13 | addu $t4, $s0, $ra 14 | addu $t5, $s0, $ra 15 | addu $t6, $s0, $ra 16 | addu $t7, $s0, $ra 17 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test6.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums:.space 4096 3 | 4 | .text 5 | ori $t0, $0, 4 6 | lui $t1, 15 7 | sw $t1, nums($t0) 8 | lw $t2, nums($t0) 9 | lw $t3, nums($t0) 10 | lw $t4, nums($t0) 11 | lw $t5, nums($t0) 12 | 13 | ori $t0, $0, 4 14 | ori $t1, $0, 8 15 | ori $t2, $0, 12 16 | ori $t3, $0, 16 17 | lui $s1, 17 18 | lui $s2, 18 19 | lui $s3, 19 20 | lui $s4, 20 21 | lui $s5, 21 22 | 23 | sw $s1, nums 24 | lw $s2, nums 25 | sw $s2, nums($t0) 26 | sw $s2, nums($t1) 27 | sw $s2, nums($t2) 28 | sw $s2, nums($t3) 29 | 30 | sw $t0, nums 31 | lw $t1, nums 32 | sw $s1, nums($t1) 33 | 34 | sw $t2, nums 35 | lw $t1, nums 36 | nop 37 | sw $s2, nums($t1) 38 | 39 | sw $t2, nums 40 | lw $t1, nums 41 | nop 42 | nop 43 | sw $s2, nums($t1) 44 | 45 | sw $t3, nums 46 | lw $t1, nums 47 | nop 48 | nop 49 | nop 50 | sw $s2, nums($t1) 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test7.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums: .space 4096 3 | 4 | .text 5 | ori $t2, $0 15 6 | sw $t2, nums 7 | lw $t1, nums 8 | beq $t2, $t1, tag 9 | nop 10 | ori $t0, $0, 1 11 | tag: 12 | ori $t0, $0, 17 13 | 14 | ori $t5, $0, 19 15 | sw $t5, nums 16 | lw $t6, nums 17 | beq $t6, $t5, tag2 18 | nop 19 | ori $t0, $0, 1 20 | tag2: 21 | ori $t0, $0, 18 22 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/16LZHtest/test8.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums: .space 4096 3 | .text 4 | ori $s1, $s1, 0x3000 5 | ori $s0, $0, 15 6 | sw $s0, nums+0x30 7 | ori $s0, $0, 16 8 | sw $s0, nums+0x40 9 | ori $s0, $0, 17 10 | sw $s0, nums+0x54 11 | jal loop 12 | subu $t1, $ra, $s1 13 | ori $t0, $0, 1 14 | loop: 15 | lw $s3, nums($t1) 16 | jal loop2 17 | subu $t1, $ra, $s1 18 | ori $t0, $0, 1 19 | loop2: 20 | nop 21 | lw $s4, nums($t1) 22 | jal loop3 23 | subu $t1, $ra, $s1 24 | ori $t0, $0, 1 25 | loop3: 26 | nop 27 | nop 28 | lw $s5, nums($t1) 29 | 30 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/Forward_rs.asm: -------------------------------------------------------------------------------- 1 | lui $t0 0xf65b 2 | ori $t1 $0 0xabfe 3 | lui $t4 0xaf78 4 | tiao: 5 | ori $t2 $0 0x3018 6 | addu $t5 $t1 $t3 7 | beq $t4 $t5 end 8 | lui $t3 0x49bf 9 | j tiao 10 | addu $t4 $t1 $t3 11 | addu $t4 $t4 $t3 12 | end: 13 | subu $t5 $t1 $t2 14 | #addu $t4 $t4 $t3 15 | ori $t3 $0 0x3044 16 | func: 17 | beq $t3 $31 ha #jal + delay + beq 18 | addu $t4 $t4 $t2 19 | ori $t5 $t3 0x6349 20 | jal func 21 | addu $t5 $t2 $t3 22 | subu $t1 $t2 $t5 23 | ha: 24 | subu $t4 $t4 $0 25 | addu $t5 $0 $t4 26 | beq $t4 $t5 end6 #cal + x + beq 27 | subu $t4 $t5 $t3 28 | addu $t6 $t2 $t3 29 | j ha 30 | end6: 31 | ori $t3 $t4 0x26cb 32 | ori $1 $0 48 33 | addu $ra $ra, $1 34 | lui $2 0x41ba 35 | jr $ra #cal + x + jr 36 | addu $1 $0 $t3 37 | subu $t4 $t4 $t1 38 | ori $s0 $0 24 39 | addu $ra $ra $s0 40 | stein:jr $ra 41 | addu $t4 $t5 $t1 42 | subu $t2 $t4 $t3 43 | ori $1 $0 4 44 | jal stein #jal + change$ra + jr 45 | addu $ra $ra $1 46 | lui $s1 0x6249 47 | subu $s1 $s1 $31 48 | jal stein 49 | subu $t0 $t3 $t5 50 | 51 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/Stall/rs 0,E1.asm: -------------------------------------------------------------------------------- 1 | lui $t0 0xf65b 2 | ori $t1 $0 0xabfe 3 | ori $t2 $0 0x3000 4 | lui $t3 0x49bf 5 | addu $t5 $t1 $t3 6 | #rs Tuse=0, Tnew_E=`ALU 7 | addu $t4 $t1 $t3 8 | beq $t4 $t5 end #cal-beq 9 | subu $t6 $t2 $t3 10 | func: 11 | ori $1 $0 4 12 | subu $31 $31 $1 13 | jr $31 #cal-jr 14 | sw $t4 0($0) 15 | jr $31 16 | end: subu $t6 $t3 $t1 17 | jal func 18 | lui $s0 0x462b 19 | ori $s1 $0 0x336c 20 | subu $s2 $s0 $s1 21 | nop -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/Stall/rs 0,E2.asm: -------------------------------------------------------------------------------- 1 | lui $t0 0xf65b 2 | ori $t1 $0 0xabfe 3 | ori $t2 $0 0x3000 4 | lui $t3 0x49bf 5 | addu $t5 $t1 $t3 6 | sw $t5 0($0) 7 | #rs Tuse=0, Tnew_E=`DM 8 | lw $t4 0($0) #sw-lw 9 | beq $t4 $t5 end #lw-beq 10 | func: 11 | sw $31 4($0) 12 | subu $31 $31 4 13 | beq $t4 $t5 end 14 | lui $t4 0x83ba 15 | nop 16 | lw $31 4($0) #lw-jr 17 | jr $31 18 | addu $t4 $t0 $t2 19 | end:subu $t4 $t3 $t1 20 | jal func 21 | addu $t6 $t4 $t5 22 | ori $s0 $0 0xfa6b 23 | addu $s1 $t4 $s0 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/Stall/rs 0,M1.asm: -------------------------------------------------------------------------------- 1 | lui $t0 0xf65b 2 | ori $t1 $0 0xabfe 3 | ori $t2 $0 0x3000 4 | lui $t3 0x49bf 5 | addu $t5 $t1 $t3 6 | sw $t5 0($0) 7 | lw $t4 0($0) 8 | addu $t1 $t1 $t3 9 | beq $t4 $t5 end #lw-cal-beq 10 | func: 11 | sw $31 4($0) 12 | subu $31 $31 4 13 | beq $t4 $t5 end 14 | lui $t4 0x83ba 15 | nop 16 | lw $31 4($0) 17 | addu $t1 $t1 $t2 18 | jr $31 #lw-cal-jr 19 | addu $t4 $t0 $t2 20 | end:subu $t4 $t3 $t1 21 | jal func 22 | addu $t6 $t4 $t5 23 | ori $s0 $0 0xfa6b 24 | addu $s1 $t4 $s0 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/Stall/rs 1,E2.asm: -------------------------------------------------------------------------------- 1 | ori $t2 $0 0x3000 2 | lui $t3 0x49bf 3 | addu $t5 $t1 $t3 4 | sw $t5 0($0) 5 | ori $t1 $0 0xabfe 6 | lw $t4 0($0) 7 | addu $t1 $t1 $t4 #lw-cal 8 | ori $t0 $0 0x0008 9 | sw $t0 4($t0) 10 | lw $t0 4($t0) #lw sw 11 | sw $t1 8($t0) 12 | 13 | 14 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/Stall/rt 0,E1,E2,M1.asm: -------------------------------------------------------------------------------- 1 | lui $t0 0xf65b 2 | ori $t1 $0 0xabfe 3 | ori $t2 $0 0x3000 4 | lui $t3 0x49bf 5 | addu $t5 $t1 $t3 6 | addu $t4 $t1 $t3 7 | beq $t5 $t4 end #cal-beq 8 | subu $t6 $t2 $t3 9 | ori $1 $0 4 10 | subu $31 $31 $1 11 | end: subu $t6 $t3 $t1 12 | sw $t6 0($0) 13 | lw $s0 0($0) 14 | end1:lw $s1 0($0) 15 | beq $s0 $s1 end1 16 | ori $s0 $s1 0x619f 17 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/Stall/rt 1,E2.asm: -------------------------------------------------------------------------------- 1 | ori $t2 $0 0x3000 2 | lui $t3 0x49bf 3 | addu $t5 $t1 $t3 4 | sw $t5 0($0) 5 | ori $t1 $0 0xabfe 6 | lw $t4 0($0) 7 | addu $t1 $t4 $t1 #lw-cal 8 | ori $t0 $0 0x0008 9 | 10 | 11 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/TestASM/swl&swr&lwl&lwr.asm: -------------------------------------------------------------------------------- 1 | li $a0, 999997671 2 | sw $a0, 0($0) 3 | addu $t0 $0 0xffffffff 4 | move $t1 $t0 5 | move $t2 $t0 6 | sw $1 4($0) 7 | sw $1 8($0) 8 | sw $1 12($0) 9 | sw $1 16($0) 10 | lwl $t0 0($0) 11 | lwl $t1 1($0) 12 | lwl $t2 2($0) 13 | lwl $t3 3($0) 14 | swl $t3 4($0) 15 | swl $t3 9($0) 16 | swl $t3 14($0) 17 | swl $t3 19($0) 18 | lwr $t4 0($0) 19 | lwr $t5 1($0) 20 | lwr $t6 2($0) 21 | lwr $t7 3($0) 22 | swr $t3 20($0) 23 | swr $t3 25($0) 24 | swr $t3 30($0) 25 | swr $t3 35($0) 26 | nop -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/pipeline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/p5_zyy/P5design/pipeline.jpg -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/power.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/p5_zyy/P5design/power.zip -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/比较输出/cmp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/p5_zyy/P5design/比较输出/cmp.c -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5_zyy/P5design/比较输出/比较Mars与Verilog输出.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/p5_zyy/P5design/比较输出/比较Mars与Verilog输出.exe -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/1.txt: -------------------------------------------------------------------------------- 1 | 00002021 2 | 34090001 3 | 340a0002 4 | 340b0003 5 | 012a6021 6 | 012a6823 7 | 0c000c08 8 | 01805821 9 | 3404000b 10 | 10850003 11 | 3c06006f 12 | 03e00008 13 | 3405000b 14 | 00000000 15 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/2: -------------------------------------------------------------------------------- 1 | 00002021 2 | 34090001 3 | 340a0002 4 | 340b0003 5 | 012a6021 6 | 012a6823 7 | 0c000c08 8 | 01805821 9 | 3404000b 10 | 10850003 11 | 3c06006f 12 | 03e00008 13 | 3405000b 14 | 00000000 15 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/2.txt: -------------------------------------------------------------------------------- 1 | 3404006f 2 | 0c000c07 3 | 00000000 4 | 00000000 5 | 00000000 6 | 08000c09 7 | 00000000 8 | 03e00008 9 | 00000000 10 | 3405000a 11 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/3: -------------------------------------------------------------------------------- 1 | 3405006f 2 | 34060070 3 | 10a60003 4 | 34a5006f 5 | 10a50002 6 | 00000000 7 | 00000000 8 | 00852021 9 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/3.txt: -------------------------------------------------------------------------------- 1 | 340407cf 2 | 3485006f 3 | 3c063039 4 | 3c07ffff 5 | 3c08ffff 6 | 10e80009 7 | 0004b821 8 | 00000000 9 | 34e7ffff 10 | 00858021 11 | 00e78821 12 | 00f09021 13 | 12530002 14 | 00928023 15 | 00e78823 16 | 00e49023 17 | 02519823 18 | 34080000 19 | ad040000 20 | 00000000 21 | ad050004 22 | ad100008 23 | ad11000c 24 | ad120010 25 | ad150014 26 | 8d090014 27 | 8d0f0000 28 | 8d0e0014 29 | ad0e0018 30 | 8d0d000c 31 | 0c000c25 32 | 35080001 33 | 35290001 34 | 354a0002 35 | 110affec 36 | 3c0b0457 37 | 0c000c27 38 | 010f4021 39 | 03e00008 40 | 010b4021 41 | 350a0000 42 | 110a0001 43 | 3c02000a 44 | 3c02000b 45 | 08000c2e 46 | 00000000 47 | 3c1f0064 48 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/4: -------------------------------------------------------------------------------- 1 | 3405006f 2 | 34860070 3 | 00a60021 4 | 00a03023 5 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/4.txt: -------------------------------------------------------------------------------- 1 | 3405006f 2 | 34060070 3 | 10a60003 4 | 34a5006f 5 | 10a50002 6 | 00000000 7 | 00000000 8 | 00852021 9 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/5.txt: -------------------------------------------------------------------------------- 1 | 3484006e 2 | 3485006f 3 | 34860070 4 | 3c07ffff 5 | 3c080001 6 | 00853021 7 | 00a43023 8 | 0c000c0b 9 | 02045021 10 | 08000c0d 11 | 014a5023 12 | 008a2023 13 | 03e00008 14 | 3c04006f 15 | 00862023 16 | 00c43021 17 | 34040001 18 | 34850002 19 | 34a60003 20 | 10c5fff9 21 | 00842021 22 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/mips1.asm: -------------------------------------------------------------------------------- 1 | addu $a0,$0,$0 2 | ori $t1,$0,1 3 | ori $t2,$0,2 4 | ori $t3,$0,3 5 | addu $t4,$t1,$t2 6 | subu $t5,$t1,$t2 7 | jal out 8 | addu $t3,$t4,$0 9 | 10 | out: 11 | ori $a0,$0,11 12 | beq $a0,$a1,end 13 | lui $a2,111 14 | jr $ra 15 | ori $a1,$0,11 16 | end: 17 | nop -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/mips2.asm: -------------------------------------------------------------------------------- 1 | ori $a0,$0,111 2 | jal end 3 | nop 4 | nop 5 | nop 6 | j out 7 | nop 8 | end: 9 | jr $ra 10 | nop 11 | out: 12 | ori $a1,$0,10 13 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/mips3.asm: -------------------------------------------------------------------------------- 1 | ori $a0,$0,1999 2 | ori $a1,$a0,111 3 | lui $a2,12345 4 | lui $a3,0xffff 5 | lui $t0,0xffff 6 | beq $a3,$t0,eee 7 | addu $s7,$0,$a0 8 | nop 9 | ori $a3,$a3,0xffff 10 | addu $s0,$a0,$a1 11 | addu $s1,$a3,$a3 12 | addu $s2,$a3,$s0 13 | beq $s2,$s3,eee 14 | subu $s0,$a0,$s2 15 | subu $s1,$a3,$a3 16 | eee: 17 | subu $s2,$a3,$a0 18 | subu $s3,$s2,$s1 19 | ori $t0,$0,0x0000 20 | sw $a0,0($t0) 21 | nop 22 | sw $a1,4($t0) 23 | sw $s0,8($t0) 24 | sw $s1,12($t0) 25 | sw $s2,16($t0) 26 | sw $s5,20($t0) 27 | lw $t1,20($t0) 28 | lw $t7,0($t0) 29 | lw $t6,20($t0) 30 | sw $t6,24($t0) 31 | lw $t5,12($t0) 32 | jal end 33 | ori $t0,$t0,1 34 | ori $t1,$t1,1 35 | ori $t2,$t2,2 36 | beq $t0,$t2,eee 37 | lui $t3,1111 38 | jal out 39 | end: 40 | addu $t0,$t0,$t7 41 | jr $ra 42 | out: 43 | addu $t0,$t0,$t3 44 | ori $t2,$t0,0 45 | beq $t0,$t2,qqq 46 | lui $v0,10 47 | qqq: 48 | lui $v0,11 49 | j www 50 | nop 51 | www: 52 | lui $ra,100 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/mips4.asm: -------------------------------------------------------------------------------- 1 | ori $a1,$0,111 2 | ori $a2,$0,112 3 | beq $a1,$a2,end 4 | ori $a1,$a1,111 5 | beq $a1,$a1,out 6 | nop 7 | end: 8 | nop 9 | out: 10 | addu $a0,$a0,$a1 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/mips5.asm: -------------------------------------------------------------------------------- 1 | ori $a0,$a0,110 2 | ori $a1,$a0,111 3 | ori $a2,$a0,112 4 | lui $a3,0xffff 5 | lui $t0,1 6 | addu $a2,$a0,$a1 7 | subu $a2,$a1,$a0 8 | jal loop 9 | addu $t2,$s0,$a0 10 | j end 11 | subu $t2,$t2,$t2 12 | loop: 13 | subu $a0,$a0,$t2 14 | jr $ra 15 | end: 16 | lui $a0,111 17 | subu $a0,$a0,$a2 18 | addu $a2,$a2,$a0 19 | ori $a0,$0,1 20 | ori $a1,$a0,2 21 | ori $a2,$a1,3 22 | beq $a2,$a1,end 23 | addu $a0,$a0,$a0 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/p5测试/mips6.asm: -------------------------------------------------------------------------------- 1 | ori $a1,$0,111 2 | ori $a2,$a0,112 3 | addu $0,$a1,$a2 4 | subu $a2,$a1,$0 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/sw_lw.asm: -------------------------------------------------------------------------------- 1 | lui $5, 233 2 | lui $6, 233 3 | lui $5, 122 4 | addu $6,$5,$5 5 | subu $6,$5,$5 6 | ori $6,123 7 | sw $5, 0($0) 8 | sw $6, 4($0) 9 | lw $7, 0($0) 10 | lw $8, 4($0) 11 | addu $9,$9,$8 12 | addu $10,$9,$8 13 | sw $10, 44($0) 14 | lw $11, 44($0) 15 | add $12,$11,$11 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/t.txt: -------------------------------------------------------------------------------- 1 | 3508000b 2 | 01484821 3 | 00000000 4 | 35280001 5 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/temp.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/temp.txt -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/temp1.txt: -------------------------------------------------------------------------------- 1 | 3508000b 2 | 0c000c03 3 | 03e04021 4 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/temp2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/temp2.txt -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/tt.txt: -------------------------------------------------------------------------------- 1 | 3c0118dd 2 | 342118dd 3 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/到E级的转发.asm: -------------------------------------------------------------------------------- 1 | ori $3,$0,123 2 | ori $4,$3,0 3 | addu $5,$4,$3 4 | addu $6,$5,$4 5 | addu $7,$5,$6 6 | subu $8,$7,$6 7 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/到E级转发.txt: -------------------------------------------------------------------------------- 1 | 3403007b 2 | 34640000 3 | 00832821 4 | 00a43021 5 | 00a63821 6 | 00e64023 7 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/到M级转发.asm: -------------------------------------------------------------------------------- 1 | ori $3, $0,12 2 | ori $4,$0,123 3 | sw $4,0($3) 4 | addu $5,$4,$0 5 | sw $5,4($3) -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/强测.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/强测.asm -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/强测.txt: -------------------------------------------------------------------------------- 1 | 34633000 2 | 34843004 3 | 34a50004 4 | 34c60008 5 | 00651821 6 | 1083fffa 7 | 00000000 8 | 00661821 9 | 00661821 10 | 00661821 11 | 00661821 12 | 00661821 13 | 00661821 14 | 00600008 15 | 00000000 16 | 0c000c34 17 | 00000000 18 | 34e70010 19 | 00e73823 20 | 00e73823 21 | 34e70010 22 | acc70000 23 | 8cc80000 24 | 00000000 25 | 00000000 26 | 01084021 27 | 8ce80000 28 | 00000000 29 | ad080004 30 | 00000000 31 | 3c080000 32 | 35080010 33 | 8d070000 34 | 10e3ffde 35 | 00000000 36 | 00e73821 37 | 10e3ffdb 38 | 00000000 39 | 8d070000 40 | 34e70020 41 | 00e73821 42 | 8d070000 43 | aca70000 44 | aca70000 45 | aca70000 46 | 00000000 47 | 8d070000 48 | ace70000 49 | 3c040001 50 | 3c050001 51 | 10850003 52 | 00000000 53 | 03e00008 54 | 00000000 55 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/斐波那契额.asm: -------------------------------------------------------------------------------- 1 | .data 2 | .macro push(%d) 3 | sw %d,0($s4) 4 | addu $s4,$s4,$s3 5 | .end_macro 6 | 7 | .macro pop(%d) 8 | subu $s4, $s4, $s3 9 | lw %d, 0($s4) 10 | .end_macro 11 | 12 | .text 13 | ori $s0, $0, 0 14 | ori $s1, $0, 1 15 | ori $s2, $0, 2 16 | ori $s3, $0, 4 17 | ori $s4, $0, 0 18 | ori $a0, $0, 7 19 | jal fib 20 | addu $t9, $0, $v0 21 | ori $t0, $0, 0x2333 22 | ori $t1, $0, 0x2333 23 | beq $t0, $t1, end 24 | 25 | fib: 26 | push($ra) 27 | beq $a0, $s0, return 28 | beq $a0, $s1, return 29 | push($a0) 30 | subu $a0, $a0, $s1 31 | jal fib 32 | pop($a0) 33 | addu $t0, $0, $v0 34 | push($t0) 35 | push($a0) 36 | subu $a0, $a0,$s2 37 | jal fib 38 | pop($a0) 39 | pop($t0) 40 | addu $v0, $t0,$v0 41 | pop($ra) 42 | jr $ra 43 | return: 44 | ori $v0, $0, 1 45 | pop($ra) 46 | jr $ra 47 | end: 48 | nop -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/暂停.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/暂停.txt -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/暂停1.asm: -------------------------------------------------------------------------------- 1 | ori $3,$0,123 2 | addu $4,$0,$3 3 | beq $4,$3,next1 4 | nop 5 | ori $9,$0,99 6 | next1: 7 | addu $5,$4,$0 8 | ori $6,$0,123 9 | beq $6,$5,next2 10 | nop 11 | ori $9,$0,88 12 | next2: 13 | sw $6,0($0) 14 | lw $7,0($0) 15 | lw $8,0($0) 16 | beq $7,$8,next3 17 | nop 18 | ori $9,$0,77 19 | next3: 20 | ori $9,$0,100 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/暂停1.txt: -------------------------------------------------------------------------------- 1 | 3403007b 2 | 00032021 3 | 10830002 4 | 00000000 5 | 34090063 6 | 00802821 7 | 3406007b 8 | 10c50002 9 | 00000000 10 | 34090058 11 | ac060000 12 | 8c070000 13 | 8c080000 14 | 10e80002 15 | 00000000 16 | 3409004d 17 | 34090064 18 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/暂停2.asm: -------------------------------------------------------------------------------- 1 | ori $8,$0,123 2 | sw $8,0($0) 3 | lw $9,0($0) 4 | addu $10,$9,$9 5 | lw $10,0($0) 6 | ori $11,$10,0 7 | sw $11,1024($0) -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/暂停2.txt: -------------------------------------------------------------------------------- 1 | 3408007b 2 | ac080000 3 | 8c090000 4 | 01295021 5 | 8c0a0000 6 | 354b0000 7 | ac0b0400 8 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/暂停3.asm: -------------------------------------------------------------------------------- 1 | ori $3,$0,12 2 | sw $3,0($0) 3 | lw $4,0($0) 4 | sw $3,0($4) 5 | lw $5,0($0) 6 | lw $6,0($4) -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/暂停3.txt: -------------------------------------------------------------------------------- 1 | 3403000c 2 | ac030000 3 | 8c040000 4 | ac830000 5 | 8c050000 6 | 8c860000 7 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/暂停4.asm: -------------------------------------------------------------------------------- 1 | ori $3,$0,16 2 | sw $3,0($0) 3 | lw $4,0($0) 4 | sw $4,4($0) 5 | lw $6,4($0) 6 | sw $6,8($0) 7 | lw $7,8($0) 8 | sw $7,12($0) 9 | lw $8,12($0) 10 | sw $8,0($8) 11 | lw $9,0($8) 12 | sw $9,4($9) 13 | lw $10,4($9) 14 | addu $11,$10,$10 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/暂停4.txt: -------------------------------------------------------------------------------- 1 | 34030010 2 | ac030000 3 | 8c040000 4 | ac040004 5 | 8c060004 6 | ac060008 7 | 8c070008 8 | ac07000c 9 | 8c08000c 10 | ad080000 11 | 8d090000 12 | ad290004 13 | 8d2a0004 14 | 014a5821 15 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/暂停5.asm: -------------------------------------------------------------------------------- 1 | ori $3,$0,0x00003010 #16 2 | jr $3 #4 3 | nop#8 4 | ori $4,$0,123 #12 5 | ori $5,$0,0x00003010 #16 6 | ori $6,$0,24#24 7 | addu $7,$5,$6 #24 8 | jr $7 #28 9 | nop 10 | ori $1,$0,123 11 | addu $9,$7,$7 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/暂停5.txt: -------------------------------------------------------------------------------- 1 | 34033010 2 | 00600008 3 | 00000000 4 | 3404007b 5 | 34053010 6 | 34060018 7 | 00a63821 8 | 00e00008 9 | 00000000 10 | 3401007b 11 | 00e74820 12 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/跳转1.txt: -------------------------------------------------------------------------------- 1 | 3c0800ea 2 | 3c0900ea 3 | 11090002 4 | 3404039b 5 | 340501b0 6 | 3525007b 7 | 3c0a00ea 8 | 01455821 9 | 8c0a0000 10 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/转发.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/转发.asm -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/转发.txt: -------------------------------------------------------------------------------- 1 | 3c0800ea 2 | 3c0900ea 3 | 11090002 4 | 3404039b 5 | 340501b0 6 | 3525007b 7 | 3c0a00ea 8 | 01455821 9 | ac0a0000 10 | 340f3000 11 | ac0f0000 12 | 8c0d0000 13 | 01a00008 14 | 022d8821 15 | -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/转发E_D: -------------------------------------------------------------------------------- 1 | ori $t0,11 2 | addu $t1,$t2,$t0 3 | nop 4 | addu $t2,$t1,$t0 -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/转发_cjb.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/P5_test datas from CJB/转发_cjb.txt -------------------------------------------------------------------------------- /p5/P5_test datas from CJB/高危.txt: -------------------------------------------------------------------------------- 1 | 340f007b 2 | 341800ea 3 | 341e04d2 4 | ac1e0010 5 | 01f8f023 6 | 03cff821 7 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/addu.asm: -------------------------------------------------------------------------------- 1 | ori $2, 10 2 | ori $3, 10 3 | addu $1, $2, $3 4 | subu $4, $1, $2 5 | addu $1, $2, $3 6 | ori $4, 1 7 | addu $1, $2, $3 8 | lui $1, 10 9 | addu $1, $2, $3 10 | ori $2, 10 11 | sw $1, 0($0) 12 | addu $1, $2, $3 13 | sw $1, 4($0) 14 | addu $1, $2, $3 15 | addu $4, $2, $3 16 | beq $1, $4 QAQ 17 | ori $t0, 10 18 | ori $t1, 10 19 | QAQ: 20 | ori $t2, 10 21 | addu $1, $2, $3 22 | 23 | ori $2, 10 24 | ori $0, 10 25 | addu $1, $0, $2 26 | addu $0, $2, $1 27 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/addu.txt: -------------------------------------------------------------------------------- 1 | 3442000a 2 | 3463000a 3 | 00430821 4 | 00222023 5 | 00430821 6 | 34840001 7 | 00430821 8 | 3c01000a 9 | 00430821 10 | 3442000a 11 | ac010000 12 | 00430821 13 | ac010004 14 | 00430821 15 | 00432021 16 | 10240002 17 | 3508000a 18 | 3529000a 19 | 354a000a 20 | 00430821 21 | 3442000a 22 | 3400000a 23 | 00020821 24 | 00410021 25 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/huluanchude.asm: -------------------------------------------------------------------------------- 1 | ori $2, 10 2 | ori $3, 10 3 | addu $1, $2, $3 4 | subu $4, $1, $2 5 | addu $1, $2, $3 6 | ori $4, 1 7 | addu $1, $2, $3 8 | lui $1, 10 9 | addu $1, $2, $3 10 | ori $2, 10 11 | sw $1, 0($0) 12 | addu $1, $2, $3 13 | sw $1, 4($0) 14 | addu $1, $2, $3 15 | addu $4, $2, $3 16 | beq $1, $4 QAQ 17 | ori $t0, 10 18 | ori $t1, 10 19 | QAQ: 20 | ori $t2, 10 21 | addu $1, $2, $3 22 | 23 | ori $2, 10 24 | ori $0, 10 25 | addu $1, $0, $2 26 | addu $0, $2, $1 27 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/huluanchude.txt: -------------------------------------------------------------------------------- 1 | 0c000c03 2 | 001ff823 3 | 34420001 4 | 34210001 5 | 0c000c06 6 | 37ff000a 7 | 0c000c08 8 | 3c1f000a 9 | 354a0004 10 | 0c000c0b 11 | ad5f0000 12 | 8d480000 13 | 0c000c0e 14 | 8d480000 15 | 35290000 16 | 0c000c13 17 | 03ff0021 18 | 08000c14 19 | 00000000 20 | 03e00008 21 | 00000000 22 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/jal.asm: -------------------------------------------------------------------------------- 1 | jal QAQ 2 | subu $31, $0, $31 3 | ori $2, 1 4 | QAQ: 5 | ori $1, 1 6 | 7 | jal QAQ2 8 | ori $31, 10 9 | QAQ2: 10 | 11 | jal QAQ3 12 | lui $31, 10 13 | QAQ3: 14 | ori $10, 4 15 | jal QAQ4 16 | sw $31, 0($10) 17 | QAQ4: 18 | lw $t0, 0($10) 19 | 20 | jal QAQ5 21 | lw $t0, 0($10) 22 | QAQ5: 23 | ori $t1, 0 24 | 25 | jal QAQ6 26 | addu $0, $31, $31 27 | j end 28 | QAQ6: 29 | jr $ra 30 | end: 31 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/jal.txt: -------------------------------------------------------------------------------- 1 | 0c000c03 2 | 001ff823 3 | 34420001 4 | 34210001 5 | 0c000c06 6 | 37ff000a 7 | 0c000c08 8 | 3c1f000a 9 | 354a0004 10 | 0c000c0b 11 | ad5f0000 12 | 8d480000 13 | 0c000c0e 14 | 8d480000 15 | 35290000 16 | 0c000c12 17 | 03ff0021 18 | 08000c13 19 | 03e00008 20 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/jiandanruoce.asm: -------------------------------------------------------------------------------- 1 | .data 2 | arr: .space 32 3 | .text 4 | ori $s0,10 5 | ori $s7,$s0,10 6 | loop: 7 | beq $t0,$s0,loopout 8 | lw $s1,arr($t1) 9 | addu $t1,$t1,4 10 | lw $s2,arr($t1) 11 | addu $s3,$s1,$s7 12 | addu $s2,$s2,$s3 13 | sw $s2,arr($t1) 14 | addu $t0,$t0,1 15 | jal loop 16 | nop 17 | loopout: 18 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/jiandanruoce.txt: -------------------------------------------------------------------------------- 1 | 3610000a 2 | 3617000a 3 | 1110000d 4 | 8d310000 5 | 3c010000 6 | 34210004 7 | 01214821 8 | 8d320000 9 | 02379821 10 | 02539021 11 | ad320000 12 | 3c010000 13 | 34210001 14 | 01014021 15 | 0c000c02 16 | 00000000 17 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/luiori.asm: -------------------------------------------------------------------------------- 1 | lui $3, 3 2 | ori $2, 10 3 | addu $1, $2, $3 4 | lui $3, 3 5 | ori $2, 10 6 | subu $1, $3, $2 7 | ori $4, 10 8 | ori $5, 10 9 | beq $4, $5 QAQ 10 | ori $6, 10 11 | ori $7, 100 12 | QAQ: 13 | ori $7, 40 14 | sw $7, 0($7) 15 | lw $7, 0($7) 16 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/luiori.txt: -------------------------------------------------------------------------------- 1 | 3c030003 2 | 3442000a 3 | 00430821 4 | 3c030003 5 | 3442000a 6 | 00620823 7 | 3484000a 8 | 34a5000a 9 | 10850002 10 | 34c6000a 11 | 34e70064 12 | 34e70028 13 | ace70000 14 | 8ce70000 15 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/lwsw.asm: -------------------------------------------------------------------------------- 1 | ori $1, 10 2 | ori $4, 2 3 | addu $0, $1, $2 4 | sw $1, 0($0) 5 | lw $1, 0($0) 6 | 7 | ori $3, 12 8 | sw $3, 0($3) 9 | lw $3, 0($3) 10 | addu $3, $4, $1 11 | lw $3, 0($3) 12 | addu $0, $1, $2 13 | sw $0, 0($0) 14 | lw $5, 0($0) 15 | lw $0, 0($0) 16 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/lwsw.txt: -------------------------------------------------------------------------------- 1 | 3421000a 2 | 34840002 3 | 00220021 4 | ac010000 5 | 8c010000 6 | 3463000c 7 | ac630000 8 | 8c630000 9 | 00811821 10 | 8c630000 11 | 00220021 12 | ac000000 13 | 8c050000 14 | 8c000000 15 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/mips1.asm: -------------------------------------------------------------------------------- 1 | ori $t1,$t1,1 2 | ori $t2,$t2,2 3 | addu $t0,$t1,$t2 4 | nop 5 | sw $t0,0($0) -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/mips1.txt: -------------------------------------------------------------------------------- 1 | 34420002 2 | 34630001 3 | 00430823 4 | 00222021 5 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/subu.asm: -------------------------------------------------------------------------------- 1 | ori $2, 10 2 | ori $3, 5 3 | subu $1, $3, $2 4 | addu $4, $1, $2 5 | subu $4, $3, $2 6 | ori $4, 1 7 | subu $1, $2, $3 8 | lui $1, 10 9 | subu $1, $2, $3 10 | ori $2, 10 11 | sw $1, 0($0) 12 | subu $1, $2, $3 13 | sw $1, 4($0) 14 | subu $1, $2, $3 15 | subu $4, $2, $3 16 | beq $1, $4 QAQ 17 | ori $t0, 10 18 | ori $t1, 10 19 | QAQ: 20 | ori $t2, 10 21 | subu $1, $2, $3 22 | 23 | ori $2, 10 24 | ori $0, 10 25 | subu $1, $0, $2 26 | subu $0, $2, $1 27 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/subu.txt: -------------------------------------------------------------------------------- 1 | 3442000a 2 | 34630005 3 | 00620823 4 | 00222021 5 | 00622023 6 | 34840001 7 | 00430823 8 | 3c01000a 9 | 00430823 10 | 3442000a 11 | ac010000 12 | 00430823 13 | ac010004 14 | 00430823 15 | 00432023 16 | 10240002 17 | 3508000a 18 | 3529000a 19 | 354a000a 20 | 00430823 21 | 3442000a 22 | 3400000a 23 | 00020823 24 | 00410023 25 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/testForHighPC.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/p5_test datas from MouYu/testForHighPC.asm -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/xjbtest.asm: -------------------------------------------------------------------------------- 1 | ori $t1,$t1,4 2 | ori $t2,$t2,8 3 | sw $t2,0($t1) 4 | 5 | lw $t2,0($t1) 6 | addu $t1,$t1,$t2 7 | 8 | lw $t2,0($t1) 9 | addu $t1,$t3,$t2 10 | 11 | addu $t3,$t4,$t5 12 | sw $t3,0($t1) 13 | 14 | ori $t3,$t3,12 15 | sw $t3,0($t2) 16 | lw $t4,0($t2) 17 | 18 | subu $1,$1,$1 19 | ori $12,$12,5 20 | ori $1,$1,16 21 | addu $16,$12,$1 22 | addu $18,$16,$1 23 | sw $18,16($1) 24 | 25 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/xjbtest.txt: -------------------------------------------------------------------------------- 1 | 35290004 2 | 354a0008 3 | ad2a0000 4 | 8d2a0000 5 | 012a4821 6 | 8d2a0000 7 | 016a4821 8 | 018d5821 9 | ad2b0000 10 | 356b000c 11 | ad4b0000 12 | 8d4c0000 13 | 00210823 14 | 358c0005 15 | 34210010 16 | 01818021 17 | 02019021 18 | ac320010 19 | -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/xjbtest2.asm: -------------------------------------------------------------------------------- 1 | ori $1,$1,4 2 | ori $2,$2,10 3 | addu $3,$2,$3 4 | beq $2,$3,next 5 | ori $2,$0,0x3024 6 | jal next 7 | next: 8 | sw $2,0($0) 9 | lw $3,0($0) 10 | jr $2 11 | subu $2,$2,$1 12 | subu $3,$2,$1 -------------------------------------------------------------------------------- /p5/p5_test datas from MouYu/xjbtest2.txt: -------------------------------------------------------------------------------- 1 | 34210004 2 | 3442000a 3 | 00431821 4 | 10430002 5 | 34023024 6 | 0c000c06 7 | ac020000 8 | 8c030000 9 | 00400008 10 | 00411023 11 | 00411823 12 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test1.asm: -------------------------------------------------------------------------------- 1 | ori $t0, $t0, 10 2 | lui $t1, 6 3 | addu $t2, $t0, $t1 4 | nop 5 | subu $t3, $t1, $t2 6 | subu $t3, $t1, $t0 7 | 8 | 9 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test10.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums: .space 4096 3 | .text 4 | ori $s3, 0x3000 5 | ori $t3, $0, 16 6 | ori $t2, $0, 12 7 | ori $t1, $0, 8 8 | ori $t0, $0, 4 9 | jal loop 10 | sw $ra, nums($t0) 11 | ori $t0, $0, 1 12 | loop: 13 | jal loop2 14 | nop 15 | loop2: 16 | sw $ra, nums($t1) 17 | jal loop3 18 | nop 19 | loop3: 20 | nop 21 | sw $ra, nums($t2) 22 | jal loop4 23 | nop 24 | loop4: 25 | nop 26 | nop 27 | sw $ra, nums($t3) 28 | jal loop5 29 | subu $t0, $ra, $s3 30 | loop5: 31 | sw $t3, nums($t0) 32 | jal loop6 33 | subu $t0, $ra, $s3 34 | loop6: 35 | nop 36 | sw $t3, nums($t0) 37 | jal loop7 38 | subu $t0, $ra, $s3 39 | loop7: 40 | nop 41 | nop 42 | sw $t3, nums($t0) 43 | 44 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test11.asm: -------------------------------------------------------------------------------- 1 | jal loop 2 | ori $t0, $ra, 0 3 | loop: 4 | beq $t0, $ra, loop2 5 | nop 6 | loop2: 7 | jal loop3 8 | ori $t1, $ra, 0 9 | loop3: 10 | beq $ra, $t1, loop4 11 | nop 12 | loop4: 13 | jal loop5 14 | ori $t2, $ra, 0 15 | loop5: 16 | nop 17 | beq $ra, $t2, loop6 18 | nop 19 | loop6: 20 | jal loop7 21 | ori $t3, $ra, 0 22 | loop7: 23 | nop 24 | beq $t3, $ra, loop8 25 | nop 26 | loop8: 27 | jal loop9 28 | ori $t4, $ra, 0 29 | loop9: 30 | nop 31 | beq $ra, $t4, loop10 32 | nop 33 | loop10: 34 | jal loop11 35 | ori $t5, $ra, 0 36 | loop11: 37 | nop 38 | beq $t5, $ra, loop12 39 | nop 40 | loop12: 41 | jal loop13 42 | ori $t6, $ra, 0 43 | loop13: 44 | nop 45 | nop 46 | beq $t6, $ra, loop14 47 | nop 48 | loop14: 49 | jal loop15 50 | ori $t7, $ra, 0 51 | loop15: 52 | nop 53 | nop 54 | beq $ra, $t7, loop16 55 | nop 56 | loop16: 57 | ori $t0, $0, 12 58 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test12.asm: -------------------------------------------------------------------------------- 1 | ori $t0, $0, 0x00003010 2 | jr $t0 3 | nop 4 | ori $t0, $0, 1 5 | ori $t0, $0, 2 6 | ori $t0, $0, 0x00003028 7 | nop 8 | jr $t0 9 | nop 10 | ori $t0, $0, 1 11 | ori $t0, $0, 3 12 | ori $t0, $0, 0x00003044 13 | nop 14 | nop 15 | jr $t0 16 | nop 17 | ori $t0, $0, 1 18 | ori $t0, $0, 4 19 | ori $t0, $0, 0x00003064 20 | nop 21 | nop 22 | nop 23 | jr $t0 24 | nop 25 | ori $0, $0, 1 26 | ori $t0, $0, 5 27 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test13.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums: .space 4096 3 | 4 | .text 5 | ori $t0, $0, 0x3094 6 | ori $t1, $0, 0x30a4 7 | ori $t2, $0, 0x30b4 8 | ori $t3, $0, 0x30c4 9 | ori $t4, $0, 4 10 | ori $t5, $0, 8 11 | ori $t6, $0, 0xc 12 | sw $t0, nums 13 | sw $t1, nums+4 14 | sw $t2, nums+8 15 | sw $t3, nums+12 16 | sw $t3, nums+16 17 | sw $t4, nums+20 18 | 19 | lw $s0, nums 20 | jr $s0 21 | nop 22 | tag: 23 | lw $s1, nums($t4) 24 | nop 25 | jr $s1 26 | nop 27 | tag2: 28 | lw $s2, nums($t5) 29 | nop 30 | nop 31 | jr $s2 32 | nop 33 | tag3: 34 | lw $s3, nums($t6) 35 | nop 36 | nop 37 | nop 38 | jr $s3 39 | nop 40 | 41 | ori $t9, $0, 1 42 | ori $t9, $0, 2 43 | j tag 44 | nop 45 | ori $t9, $0, 1 46 | ori $t9, $0, 3 47 | j tag2 48 | nop 49 | ori $t9, $0, 1 50 | ori $t9, $0, 4 51 | j tag3 52 | nop 53 | ori $t9, $0, 1 54 | ori $t9, $0, 5 55 | end: 56 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test14.asm: -------------------------------------------------------------------------------- 1 | jal loop 2 | nop 3 | jal loop2 4 | nop 5 | jal loop3 6 | nop 7 | jal loop4 8 | nop 9 | ori $t0, $0, 100 10 | loop: 11 | jr $ra 12 | nop 13 | loop2: 14 | nop 15 | jr $ra 16 | nop 17 | loop3: 18 | nop 19 | nop 20 | jr $ra 21 | nop 22 | loop4: 23 | nop 24 | nop 25 | nop 26 | jr $ra 27 | nop 28 | 29 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test15.asm: -------------------------------------------------------------------------------- 1 | ori $t0, $0, -1234 2 | bltz $t0, loop 3 | nop 4 | ori $s0, $0, 1 5 | loop: 6 | ori $s0, $0, 2 7 | ori $t1, $0, -6 8 | nop 9 | bltz $t1, loop2 10 | nop 11 | ori $s0, $0, 1 12 | loop2: 13 | ori $s0, $0, 3 14 | ori $t2, $0, -7 15 | nop 16 | nop 17 | bltz $t2, loop3 18 | nop 19 | ori $s0, $0, 1 20 | loop3: 21 | ori $s0, $0, 4 22 | ori $t3, $0, -8 23 | nop 24 | nop 25 | nop 26 | bltz $t3, loop4 27 | nop 28 | ori $s0, $0, 1 29 | loop4: 30 | ori $t3, $0, 5 31 | 32 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test16.asm: -------------------------------------------------------------------------------- 1 | ori $t0, $0, 12 2 | ori $t1, $0, 12 3 | bne $t0, $t1, loop 4 | nop 5 | ori $s0, $0, 1 6 | loop: 7 | ori $s0, $0, 2 8 | ori $t2, $0, 11 9 | ori $t3, $0, 11 10 | bne $t3, $t2, loop2 11 | nop 12 | ori $s0, $0, 1 13 | loop2: 14 | ori $s0,$0, 2 15 | ori $t4, $0, 22 16 | ori $t5, $0, 22 17 | nop 18 | bne $t4, $t5, loop3 19 | nop 20 | ori $s0, $0, 1 21 | loop3: 22 | ori $s0, $0, 3 23 | ori $t6, $0, 12 24 | ori $t7, $0, 12 25 | nop 26 | bne $t7, $t6, loop4 27 | nop 28 | ori $s0, $0, 1 29 | loop4: 30 | ori $s0, $0, 4 31 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test2.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums: .space 4096 3 | .text 4 | ori $t0, $t0, 100 5 | sw $t0, nums($t0) 6 | ori $t1, $t1, 12 7 | ori $t3, $t3, 16 8 | sw $t1, nums($t1) 9 | nop 10 | sw $t3, nums($t3) 11 | ori $t4, $t4, 20 12 | nop 13 | nop 14 | sw $t3, nums($t4) 15 | sw $t4, nums($t4) 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test3.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums:.space 4096 3 | .text 4 | ori $s0, $s0, 4 5 | ori $s5, 19 6 | sw $s5, nums($s0) 7 | ori $s2, $s2, 8 8 | ori $s5, 17 9 | sw $s5, nums($s2) 10 | ori $s3, $s3, 4092 11 | lui $s5, 13 12 | sw $s5,nums($s3) 13 | ori $s4, $s4, 20 14 | sw $s4,nums($s4) 15 | ori $t0, $t0, 4 16 | lw $t5, nums($t0) 17 | ori $t2, $t2, 8 18 | nop 19 | lw $t6, nums($t2) 20 | ori $t3, $t3, 4092 21 | nop 22 | nop 23 | lw $t7, nums($t3) 24 | ori $t4, $t4, 20 25 | nop 26 | nop 27 | nop 28 | lw $t8, nums($t4) 29 | ori $t6, $0, 24 30 | lw $t9, nums($t6) 31 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test4.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums: .space 4096 3 | 4 | .text 5 | ori $t3, $0, 1234 6 | beq $t3, $t3, loop 7 | nop 8 | ori $t0, $0, 1 9 | loop: 10 | ori $t0, $0, 5 11 | ori $t2, $t2, 0123 12 | ori $t4, $t4, 0123 13 | beq $t2, $t4, loop2 14 | nop 15 | ori $t0, $0, 1 16 | loop2: 17 | ori $t0, $0, 6 18 | ori $t1, $t1, 0123 19 | ori $t5, $t5, 0123 20 | beq $t5, $t1, loop3 21 | nop 22 | ori $t0, $0, 1 23 | loop3: 24 | ori $t0, $0, 7 25 | ori $t6, 2333 26 | ori $t7, 2333 27 | nop 28 | beq $t6, $t7, loop4 29 | nop 30 | ori $t0, $0, 1 31 | loop4: 32 | ori $t0, $0, 8 33 | ori $t1, 244 34 | ori $t2, 244 35 | nop 36 | beq $t2, $t1, loop5 37 | nop 38 | ori $t0, $0, 1 39 | loop5: 40 | ori $t0, $0, 9 41 | ori $t3, $0, 255 42 | ori $t4, $0, 255 43 | nop 44 | nop 45 | beq $t3, $t4, loop6 46 | nop 47 | ori $t0, $0, 1 48 | loop6: 49 | ori $t0, $0, 10 50 | ori $t5, $0, 255 51 | ori $t6, $0, 255 52 | nop 53 | nop 54 | beq $t6, $t5, loop7 55 | nop 56 | ori $t0, $0, 1 57 | loop7: 58 | ori $t1, 1000 59 | nop 60 | nop 61 | nop 62 | beq $t1, $t1, end 63 | nop 64 | ori $t0, $0, 1 65 | end: 66 | ori $t0, 11 67 | 68 | 69 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test5.asm: -------------------------------------------------------------------------------- 1 | ori $s0, 4 2 | jal tag 3 | addu $t0, $ra, $ra 4 | ori $t0, $0, 1 5 | tag: 6 | addu $t1, $ra, $s0 7 | addu $t2, $ra, $s0 8 | addu $t3, $ra, $s0 9 | jal tag2 10 | addu $t4, $s0, $ra 11 | ori $t0, $0, 1 12 | tag2: 13 | addu $t4, $s0, $ra 14 | addu $t5, $s0, $ra 15 | addu $t6, $s0, $ra 16 | addu $t7, $s0, $ra 17 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test6.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums:.space 4096 3 | 4 | .text 5 | ori $t0, $0, 4 6 | lui $t1, 15 7 | sw $t1, nums($t0) 8 | lw $t2, nums($t0) 9 | lw $t3, nums($t0) 10 | lw $t4, nums($t0) 11 | lw $t5, nums($t0) 12 | 13 | ori $t0, $0, 4 14 | ori $t1, $0, 8 15 | ori $t2, $0, 12 16 | ori $t3, $0, 16 17 | lui $s1, 17 18 | lui $s2, 18 19 | lui $s3, 19 20 | lui $s4, 20 21 | lui $s5, 21 22 | 23 | sw $s1, nums 24 | lw $s2, nums 25 | sw $s2, nums($t0) 26 | sw $s2, nums($t1) 27 | sw $s2, nums($t2) 28 | sw $s2, nums($t3) 29 | 30 | sw $t0, nums 31 | lw $t1, nums 32 | sw $s1, nums($t1) 33 | 34 | sw $t2, nums 35 | lw $t1, nums 36 | nop 37 | sw $s2, nums($t1) 38 | 39 | sw $t2, nums 40 | lw $t1, nums 41 | nop 42 | nop 43 | sw $s2, nums($t1) 44 | 45 | sw $t3, nums 46 | lw $t1, nums 47 | nop 48 | nop 49 | nop 50 | sw $s2, nums($t1) 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test7.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums: .space 4096 3 | 4 | .text 5 | ori $t2, $0 15 6 | sw $t2, nums 7 | lw $t1, nums 8 | beq $t2, $t1, tag 9 | nop 10 | ori $t0, $0, 1 11 | tag: 12 | ori $t0, $0, 17 13 | 14 | ori $t5, $0, 19 15 | sw $t5, nums 16 | lw $t6, nums 17 | beq $t6, $t5, tag2 18 | nop 19 | ori $t0, $0, 1 20 | tag2: 21 | ori $t0, $0, 18 22 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test8.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums: .space 4096 3 | .text 4 | ori $s1, $s1, 0x3000 5 | ori $s0, $0, 15 6 | sw $s0, nums+0x30 7 | ori $s0, $0, 16 8 | sw $s0, nums+0x40 9 | ori $s0, $0, 17 10 | sw $s0, nums+0x54 11 | jal loop 12 | subu $t1, $ra, $s1 13 | ori $t0, $0, 1 14 | loop: 15 | lw $s3, nums($t1) 16 | jal loop2 17 | subu $t1, $ra, $s1 18 | ori $t0, $0, 1 19 | loop2: 20 | nop 21 | lw $s4, nums($t1) 22 | jal loop3 23 | subu $t1, $ra, $s1 24 | ori $t0, $0, 1 25 | loop3: 26 | nop 27 | nop 28 | lw $s5, nums($t1) 29 | 30 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/16LZHtest/test9.asm: -------------------------------------------------------------------------------- 1 | .data 2 | nums: .space 4096 3 | .text 4 | ori $t0, $0, 12 5 | ori $t1, $0, 15 6 | sw $t1, nums($t0) 7 | lw $t2, nums($t0) 8 | beq $t1, $t2, tag 9 | nop 10 | ori $t0, 1 11 | tag: 12 | ori $t0, $0, 16 13 | ori $t1, $0, 19 14 | sw $t1, nums($t0) 15 | lw $t2, nums($t0) 16 | beq $t2, $t1, tag2 17 | nop 18 | ori $t0, 1 19 | tag2: 20 | ori $t0, $0, 20 21 | ori $t1, $0, 21 22 | sw $t1, nums($t0) 23 | lw $t2, nums($t0) 24 | nop 25 | beq $t2, $t1, tag3 26 | nop 27 | ori $t0, 1 28 | tag3: 29 | ori $t0, $0, 24 30 | ori $t1, $0, 22 31 | sw $t1, nums($t0) 32 | lw $t2, nums($t0) 33 | nop 34 | beq $t1, $t2, tag4 35 | nop 36 | ori $t0, 1 37 | tag4: 38 | ori $t0, $0, 28 39 | ori $t1, $0, 23 40 | sw $t1, nums($t0) 41 | lw $t2, nums($t0) 42 | nop 43 | nop 44 | beq $t1, $t2, tag5 45 | nop 46 | ori $t0, 1 47 | tag5: 48 | ori $t0, $0, 28 49 | ori $t1, $0, 23 50 | sw $t1, nums($t0) 51 | lw $t2, nums($t0) 52 | nop 53 | nop 54 | beq $t2, $t1, tag6 55 | nop 56 | ori $t0, 1 57 | tag6: 58 | ori $t0, $0, 28 59 | ori $t1, $0, 23 60 | sw $t1, nums($t0) 61 | lw $t2, nums($t0) 62 | nop 63 | nop 64 | beq $t0, $t0, tag7 65 | nop 66 | ori $t0, 1 67 | tag7: 68 | ori $t0, $0, 2 -------------------------------------------------------------------------------- /p5/测试集/TestASM/Forward_rs.asm: -------------------------------------------------------------------------------- 1 | lui $t0 0xf65b 2 | ori $t1 $0 0xabfe 3 | lui $t4 0xaf78 4 | tiao: 5 | ori $t2 $0 0x3018 6 | addu $t5 $t1 $t3 7 | beq $t4 $t5 end 8 | lui $t3 0x49bf 9 | j tiao 10 | addu $t4 $t1 $t3 11 | addu $t4 $t4 $t3 12 | end: 13 | subu $t5 $t1 $t2 14 | #addu $t4 $t4 $t3 15 | ori $t3 $0 0x3044 16 | func: 17 | beq $t3 $31 ha #jal + delay + beq 18 | addu $t4 $t4 $t2 19 | ori $t5 $t3 0x6349 20 | jal func 21 | addu $t5 $t2 $t3 22 | subu $t1 $t2 $t5 23 | ha: 24 | subu $t4 $t4 $0 25 | addu $t5 $0 $t4 26 | beq $t4 $t5 end6 #cal + x + beq 27 | subu $t4 $t5 $t3 28 | addu $t6 $t2 $t3 29 | j ha 30 | end6: 31 | ori $t3 $t4 0x26cb 32 | ori $1 $0 48 33 | addu $ra $ra, $1 34 | lui $2 0x41ba 35 | jr $ra #cal + x + jr 36 | addu $1 $0 $t3 37 | subu $t4 $t4 $t1 38 | ori $s0 $0 24 39 | addu $ra $ra $s0 40 | stein:jr $ra 41 | addu $t4 $t5 $t1 42 | subu $t2 $t4 $t3 43 | ori $1 $0 4 44 | jal stein #jal + change$ra + jr 45 | addu $ra $ra $1 46 | lui $s1 0x6249 47 | subu $s1 $s1 $31 48 | jal stein 49 | subu $t0 $t3 $t5 50 | 51 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/Stall/rs 0,E1.asm: -------------------------------------------------------------------------------- 1 | lui $t0 0xf65b 2 | ori $t1 $0 0xabfe 3 | ori $t2 $0 0x3000 4 | lui $t3 0x49bf 5 | addu $t5 $t1 $t3 6 | #rs Tuse=0, Tnew_E=`ALU 7 | addu $t4 $t1 $t3 8 | beq $t4 $t5 end #cal-beq 9 | subu $t6 $t2 $t3 10 | func: 11 | ori $1 $0 4 12 | subu $31 $31 $1 13 | jr $31 #cal-jr 14 | sw $t4 0($0) 15 | jr $31 16 | end: subu $t6 $t3 $t1 17 | jal func 18 | lui $s0 0x462b 19 | ori $s1 $0 0x336c 20 | subu $s2 $s0 $s1 21 | nop -------------------------------------------------------------------------------- /p5/测试集/TestASM/Stall/rs 0,E2.asm: -------------------------------------------------------------------------------- 1 | lui $t0 0xf65b 2 | ori $t1 $0 0xabfe 3 | ori $t2 $0 0x3000 4 | lui $t3 0x49bf 5 | addu $t5 $t1 $t3 6 | sw $t5 0($0) 7 | #rs Tuse=0, Tnew_E=`DM 8 | lw $t4 0($0) #sw-lw 9 | beq $t4 $t5 end #lw-beq 10 | func: 11 | sw $31 4($0) 12 | subu $31 $31 4 13 | beq $t4 $t5 end 14 | lui $t4 0x83ba 15 | nop 16 | lw $31 4($0) #lw-jr 17 | jr $31 18 | addu $t4 $t0 $t2 19 | end:subu $t4 $t3 $t1 20 | jal func 21 | addu $t6 $t4 $t5 22 | ori $s0 $0 0xfa6b 23 | addu $s1 $t4 $s0 -------------------------------------------------------------------------------- /p5/测试集/TestASM/Stall/rs 0,M1.asm: -------------------------------------------------------------------------------- 1 | lui $t0 0xf65b 2 | ori $t1 $0 0xabfe 3 | ori $t2 $0 0x3000 4 | lui $t3 0x49bf 5 | addu $t5 $t1 $t3 6 | sw $t5 0($0) 7 | lw $t4 0($0) 8 | addu $t1 $t1 $t3 9 | beq $t4 $t5 end #lw-cal-beq 10 | func: 11 | sw $31 4($0) 12 | subu $31 $31 4 13 | beq $t4 $t5 end 14 | lui $t4 0x83ba 15 | nop 16 | lw $31 4($0) 17 | addu $t1 $t1 $t2 18 | jr $31 #lw-cal-jr 19 | addu $t4 $t0 $t2 20 | end:subu $t4 $t3 $t1 21 | jal func 22 | addu $t6 $t4 $t5 23 | ori $s0 $0 0xfa6b 24 | addu $s1 $t4 $s0 -------------------------------------------------------------------------------- /p5/测试集/TestASM/Stall/rs 1,E2.asm: -------------------------------------------------------------------------------- 1 | ori $t2 $0 0x3000 2 | lui $t3 0x49bf 3 | addu $t5 $t1 $t3 4 | sw $t5 0($0) 5 | ori $t1 $0 0xabfe 6 | lw $t4 0($0) 7 | addu $t1 $t1 $t4 #lw-cal 8 | ori $t0 $0 0x0008 9 | sw $t0 4($t0) 10 | lw $t0 4($t0) #lw sw 11 | sw $t1 8($t0) 12 | 13 | 14 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/Stall/rt 0,E1,E2,M1.asm: -------------------------------------------------------------------------------- 1 | lui $t0 0xf65b 2 | ori $t1 $0 0xabfe 3 | ori $t2 $0 0x3000 4 | lui $t3 0x49bf 5 | addu $t5 $t1 $t3 6 | addu $t4 $t1 $t3 7 | beq $t5 $t4 end #cal-beq 8 | subu $t6 $t2 $t3 9 | ori $1 $0 4 10 | subu $31 $31 $1 11 | end: subu $t6 $t3 $t1 12 | sw $t6 0($0) 13 | lw $s0 0($0) 14 | end1:lw $s1 0($0) 15 | beq $s0 $s1 end1 16 | ori $s0 $s1 0x619f 17 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/Stall/rt 1,E2.asm: -------------------------------------------------------------------------------- 1 | ori $t2 $0 0x3000 2 | lui $t3 0x49bf 3 | addu $t5 $t1 $t3 4 | sw $t5 0($0) 5 | ori $t1 $0 0xabfe 6 | lw $t4 0($0) 7 | addu $t1 $t4 $t1 #lw-cal 8 | ori $t0 $0 0x0008 9 | 10 | 11 | -------------------------------------------------------------------------------- /p5/测试集/TestASM/swl&swr&lwl&lwr.asm: -------------------------------------------------------------------------------- 1 | li $a0, 999997671 2 | sw $a0, 0($0) 3 | addu $t0 $0 0xffffffff 4 | move $t1 $t0 5 | move $t2 $t0 6 | sw $1 4($0) 7 | sw $1 8($0) 8 | sw $1 12($0) 9 | sw $1 16($0) 10 | lwl $t0 0($0) 11 | lwl $t1 1($0) 12 | lwl $t2 2($0) 13 | lwl $t3 3($0) 14 | swl $t3 4($0) 15 | swl $t3 9($0) 16 | swl $t3 14($0) 17 | swl $t3 19($0) 18 | lwr $t4 0($0) 19 | lwr $t5 1($0) 20 | lwr $t6 2($0) 21 | lwr $t7 3($0) 22 | swr $t3 20($0) 23 | swr $t3 25($0) 24 | swr $t3 30($0) 25 | swr $t3 35($0) 26 | nop -------------------------------------------------------------------------------- /p5/测试集/TestASM/说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p5/测试集/TestASM/说明.txt -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/P6 offical documents/文档.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/P6 offical documents/文档.zip -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/P6_code/CMP.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 19:09:50 11/19/2019 7 | // Design Name: 8 | // Module Name: CMP 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module CMP( 22 | input [31:0] Data1, 23 | input [31:0] Data2, 24 | output Equal, 25 | output blez, 26 | output bgez, 27 | output bgtz, 28 | output bltz 29 | ); 30 | 31 | assign Equal = (Data1==Data2)?1:0; 32 | assign blez = (Data1[31]==1||Data1==0)?1:0; 33 | assign bgez = (Data1[31]==0)?1:0; 34 | assign bgtz = (Data1[31]==0&&Data1!=0)?1:0; 35 | assign bltz = (Data1[31]==1)?1:0; 36 | 37 | endmodule 38 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/P6_code/DM.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/P6_code/DM.v -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/P6_code/DMEXT.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/P6_code/DMEXT.v -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/P6_code/EXT.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 15:53:04 11/09/2019 7 | // Design Name: 8 | // Module Name: EXT 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module EXT( 22 | input [15:0] in, 23 | input [4:0]ExtOp, 24 | output reg [31:0] out 25 | ); 26 | always @(*) begin 27 | case(ExtOp) 28 | 0: out <= {{16{in[15]}},in}; 29 | 1: out <= {{16{1'b0}},in}; 30 | 2: out <= {in,{16{1'b0}}}; 31 | default: out <= 0; 32 | endcase 33 | end 34 | endmodule 35 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/P6_code/IM.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 00:33:37 11/09/2019 7 | // Design Name: 8 | // Module Name: IM 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module IM( 22 | input [31:0] PC, 23 | output [31:0] Instruction 24 | ); 25 | wire [31:0] pc; 26 | reg [31:0]im [0:4095]; 27 | initial begin 28 | $readmemh("code.txt",im); 29 | end 30 | assign pc = PC - 32'h00003000; 31 | assign Instruction = im[pc[13:2]]; 32 | 33 | endmodule 34 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/P6_code/PC.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 13:55:34 11/09/2019 7 | // Design Name: 8 | // Module Name: PC 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module PC( 22 | input clk, 23 | input reset, 24 | input PC_En, 25 | input [31:0] next_pc, 26 | output reg [31:0] PC 27 | ); 28 | always @(posedge clk)begin 29 | if(reset==1) begin 30 | PC <= 32'h00003000; 31 | end 32 | else if(PC_En)begin 33 | PC <= next_pc; 34 | end 35 | end 36 | 37 | endmodule 38 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/P6_code/conflict.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/P6_code/conflict.v -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/P6_code/controller.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/P6_code/controller.v -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/P6_code/instr_decoder.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/P6_code/instr_decoder.v -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/P6_code/mips.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/P6_code/mips.v -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/__mips_tb.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | 3 | module __mips_tb; 4 | reg clk; 5 | reg reset; 6 | 7 | mips uut( 8 | .clk(clk), 9 | .reset(reset) 10 | ); 11 | 12 | initial begin 13 | clk = 0; 14 | reset = 1; 15 | #10; 16 | reset = 0; 17 | #50000; 18 | $stop; 19 | end 20 | 21 | always #5 clk = ~clk; 22 | 23 | endmodule 24 | 25 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/diff.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/diff.exe -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/grep.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/grep.exe -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/libiconv2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/libiconv2.dll -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/libintl3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/libintl3.dll -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/pcre3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/pcre3.dll -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/regex2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/regex2.dll -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/sed.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/bin/sed.exe -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/export.bat: -------------------------------------------------------------------------------- 1 | :: max number of instructions for MARS 2 | set MAXINS=100000 3 | 4 | :: Xilinx installation directory 5 | set XILINX=D:\ide\ISE\14.7\ISE_DS\ISE 6 | :: max simulate time for mips 7 | set MAXSIMTIME=30us 8 | 9 | :: Delayed branch, comment it to disable delayed branch 10 | set DBFLAG=db 11 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/jar/Mars.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/jar/Mars.jar -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/myjudge.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set /a nowtime = 0 4 | set /a limit = 1000 5 | echo Will run for %limit% times. 6 | echo. 7 | :loop 8 | TIMEOUT /T 0 9 | set /a nowtime = %nowtime% + 1 10 | echo nowtime: %nowtime% 11 | 12 | python rand_ins.py > ins.asm 13 | call judge.bat p60 ins.asm 14 | echo errorlevel:%errorlevel% 15 | if "%errorlevel%" == "0" ( 16 | goto loop 17 | ) 18 | 19 | if %nowtime% == %limit% ( 20 | goto end 21 | ) 22 | :error: 23 | echo Error! at %nowtime% 24 | endlocal 25 | :end 26 | pause 27 | exit /b -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/CMP.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 19:09:50 11/19/2019 7 | // Design Name: 8 | // Module Name: CMP 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module CMP( 22 | input [31:0] Data1, 23 | input [31:0] Data2, 24 | output Equal, 25 | output blez, 26 | output bgez, 27 | output bgtz, 28 | output bltz 29 | ); 30 | 31 | assign Equal = (Data1==Data2)?1:0; 32 | assign blez = (Data1[31]==1||Data1==0)?1:0; 33 | assign bgez = (Data1[31]==0)?1:0; 34 | assign bgtz = (Data1[31]==0&&Data1!=0)?1:0; 35 | assign bltz = (Data1[31]==1)?1:0; 36 | 37 | endmodule 38 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/DM.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/DM.v -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/DMEXT.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/DMEXT.v -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/EXT.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 15:53:04 11/09/2019 7 | // Design Name: 8 | // Module Name: EXT 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module EXT( 22 | input [15:0] in, 23 | input [4:0]ExtOp, 24 | output reg [31:0] out 25 | ); 26 | always @(*) begin 27 | case(ExtOp) 28 | 0: out <= {{16{in[15]}},in}; 29 | 1: out <= {{16{1'b0}},in}; 30 | 2: out <= {in,{16{1'b0}}}; 31 | default: out <= 0; 32 | endcase 33 | end 34 | endmodule 35 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/IM.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 00:33:37 11/09/2019 7 | // Design Name: 8 | // Module Name: IM 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module IM( 22 | input [31:0] PC, 23 | output [31:0] Instruction 24 | ); 25 | wire [31:0] pc; 26 | reg [31:0]im [0:4095]; 27 | initial begin 28 | $readmemh("code.txt",im); 29 | end 30 | assign pc = PC - 32'h00003000; 31 | assign Instruction = im[pc[13:2]]; 32 | 33 | endmodule 34 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/PC.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // Company: 4 | // Engineer: 5 | // 6 | // Create Date: 13:55:34 11/09/2019 7 | // Design Name: 8 | // Module Name: PC 9 | // Project Name: 10 | // Target Devices: 11 | // Tool versions: 12 | // Description: 13 | // 14 | // Dependencies: 15 | // 16 | // Revision: 17 | // Revision 0.01 - File Created 18 | // Additional Comments: 19 | // 20 | ////////////////////////////////////////////////////////////////////////////////// 21 | module PC( 22 | input clk, 23 | input reset, 24 | input PC_En, 25 | input [31:0] next_pc, 26 | output reg [31:0] PC 27 | ); 28 | always @(posedge clk)begin 29 | if(reset==1) begin 30 | PC <= 32'h00003000; 31 | end 32 | else if(PC_En)begin 33 | PC <= next_pc; 34 | end 35 | end 36 | 37 | endmodule 38 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/conflict.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/conflict.v -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/controller.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/controller.v -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/instr_decoder.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/instr_decoder.v -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/mips.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/p60/mips.v -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/tmp/__mips_tb_beh.cmd: -------------------------------------------------------------------------------- 1 | run 30us; 2 | exit; 3 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/tmp/__mips_tb_beh.files: -------------------------------------------------------------------------------- 1 | "D:\p6\testsuit\\__mips_tb.v" 2 | D:\p6\testsuit\p60\ALU.v 3 | D:\p6\testsuit\p60\CMP.v 4 | D:\p6\testsuit\p60\conflict.v 5 | D:\p6\testsuit\p60\controller.v 6 | D:\p6\testsuit\p60\define.v 7 | D:\p6\testsuit\p60\DM.v 8 | D:\p6\testsuit\p60\DMEXT.v 9 | D:\p6\testsuit\p60\D_E_Register.v 10 | D:\p6\testsuit\p60\EXT.v 11 | D:\p6\testsuit\p60\E_M_Register.v 12 | D:\p6\testsuit\p60\F_D_Register.v 13 | D:\p6\testsuit\p60\GRF.v 14 | D:\p6\testsuit\p60\IM.v 15 | D:\p6\testsuit\p60\instr_decoder.v 16 | D:\p6\testsuit\p60\mips.v 17 | D:\p6\testsuit\p60\MULT_DIV.v 18 | D:\p6\testsuit\p60\MUX.v 19 | D:\p6\testsuit\p60\M_W_Register.v 20 | D:\p6\testsuit\p60\NPC.v 21 | D:\p6\testsuit\p60\PC.v 22 | D:\p6\testsuit\p60\test.v 23 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/tmp/__mips_tb_beh.prj: -------------------------------------------------------------------------------- 1 | verilog work "D:\p6\testsuit\\__mips_tb.v" 2 | verilog work D:\p6\testsuit\p60\ALU.v 3 | verilog work D:\p6\testsuit\p60\CMP.v 4 | verilog work D:\p6\testsuit\p60\conflict.v 5 | verilog work D:\p6\testsuit\p60\controller.v 6 | verilog work D:\p6\testsuit\p60\define.v 7 | verilog work D:\p6\testsuit\p60\DM.v 8 | verilog work D:\p6\testsuit\p60\DMEXT.v 9 | verilog work D:\p6\testsuit\p60\D_E_Register.v 10 | verilog work D:\p6\testsuit\p60\EXT.v 11 | verilog work D:\p6\testsuit\p60\E_M_Register.v 12 | verilog work D:\p6\testsuit\p60\F_D_Register.v 13 | verilog work D:\p6\testsuit\p60\GRF.v 14 | verilog work D:\p6\testsuit\p60\IM.v 15 | verilog work D:\p6\testsuit\p60\instr_decoder.v 16 | verilog work D:\p6\testsuit\p60\mips.v 17 | verilog work D:\p6\testsuit\p60\MULT_DIV.v 18 | verilog work D:\p6\testsuit\p60\MUX.v 19 | verilog work D:\p6\testsuit\p60\M_W_Register.v 20 | verilog work D:\p6\testsuit\p60\NPC.v 21 | verilog work D:\p6\testsuit\p60\PC.v 22 | verilog work D:\p6\testsuit\p60\test.v 23 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/tmp/fuse-compile.tmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/tmp/fuse-compile.tmp -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/tmp/fuse.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/tmp/fuse.log -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/tmp/fuseRelaunch.cmd: -------------------------------------------------------------------------------- 1 | --nodebug -i "p60" --prj "D:\p6\testsuit\\tmp\__mips_tb_beh.prj" -o "D:\p6\testsuit\\tmp\mips_tb_beh.exe" "__mips_tb" 2 | -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/tmp/isim.wdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbbb/BUAA-CO-2019/3708933ca4dc881a7d2d1fa4200ffdf59c768712/p6 supports 50 MIPS instructions/auto_judge_script/testsuit/tmp/isim.wdb -------------------------------------------------------------------------------- /p6 supports 50 MIPS instructions/auto_judge_script/testsuit/tmp/isim/isim_usage_statistics.html: -------------------------------------------------------------------------------- 1 |
ISim Statistics |