# MyCPU
Implementation of TinyMIPS processor for USTB computer composition principle course design.
## TinyMIPS's ISA
### <center>
| Opcode | Action |
| ------- | ----------- |
| **Arithmetic Logic Unit** |
| ADDU rd,rs,rt | rd=rs+rt |
| ADDIU rt,rs | rt=rs+imm |
| SUBU rd,rs,rt | rd=rs-rt |
| SLT rt,rs,imm | rt=rs<imm |
| SLTU rd,rs,rt | rd=rs<rt |
| SLTI rt,rs,imm | rt=rs<imm |
| SLTIU rt,rs,imm | rt=rs<imm |
| AND | rd=rs&rt |
| ANDI rt, rs, imm | rt=rs&imm |
| NOR rd, rs, rt | rd=~(rs|rt) |
| OR | rd=rs|rt |
| ORI rt, rs, imm | rt=rs|imm |
| XOR | rd=rs^rt |
| XORI rt,rs,imm | rt=rs^imm |
| LUI | rt=imm<<16 |
| **Shifter** |
| SLL rd,rt,sa | rd=rt<<sa |
| SLLV rd,rs,rt | rd=rt<<rs |
| SRA rd,rt,sa | rd=rt>>sa |
| SRAV rd,rs,rt | rd=rt>>rs |
| SRL rd,rt,sa | rd=rt>>sa |
| SRLV rd,rt,sa | rd=rt>>rs |
| **Multiply** |
| MULT rs, rt | HI,LO=rs*rt |
| MULTU rs, rt | HI,LO=rs*rt |
| DIV rs, rt | HI=rs%rt; LO=rs/rt |
| DIVU rs,rt | HI=rs%rt; LO=rs/rt |
| MFHI rd | rd=HI |
| MFLO rd | rd=LO |
| MTHI rs | HI=rs |
| MTLO rs | LO=rs |
| **Branch** |
| BEQ rs,rt,offest | if(rs==rt) pc+=offset*4 |
| BNE rs,rt,offest | if(rs!=rt) pc+=offset*4 |
| JAL target | r31=pc; pc=target<<2 |
| JALR rd,rs | rd=pc; pc=rs |
| BGEZ rs,offset | if(rs>=0) pc+=offset*4 |
| BGTZ rs,offset | if(rs>0) pc+=offset*4 |
| BLEZ rs,offset | if(rs<=0) pc+=offset*4 |
| BLTZ rs,offset | if(rs<0) pc+=offset*4 |
| J target | pc=pc_upper|(target<<2) |
| JR rs | pc=rs |
| **Memory Access** |
| LB rt,offest(rs) | rt=*(char*)(offset+rs) |
| LBU rt,offset(rs) | rt=*(Uchar*)(offset+rs |
| LH rt, offset(rs) | rt=*(short*)(offset+rs) |
| LHU rt,offset(rs) | rt=*(Ushort*)(offset+rs) |
| LW rt,offset(rs) | rt=*(int*)(offset+rs) |
| SB rt,offset(rs) | *(char*)(offset+rs)=rt |
| SH rt,offset(rs) | *(short*)(offset+rs)=rt |
| SW rt,offset(rs) | *(int*)(offset+rs)=rt |
| **Trap** |
| BREAK | SignalException(Breakpoint) |
| SYSCALL | SignalException(SystemCall) |
| **Privilege** |
| ERET | PC<-EPC;Status.EXL<-0;Refresh the pipeline|
| MFC0 | GPR[rt]<-CP0[rd, sel] |
| MTC0 | CP0[rd, sel]<-GPR[rt] |
## Note
If you are using Vivado, after importing source files, you may need to do the following things:
1. Go to "Tools - Settings... - General - Verilog options", add `src\cpu\include` to search paths.
2. Select all include files in "Project Manager", then right click and click "Set Global Include".
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
北京科技大学计组课设(计算机组成原理课程设计) (773个子文件)
1 1KB
__synthesis_is_running__ 0B
__synthesis_is_running__ 0B
libinst.a 782KB
xsim.ini.bak 23KB
elaborate.bat 936B
compile.bat 830B
simulate.bat 792B
runme.bat 229B
runme.bat 229B
main.bin 572KB
xsim_2.c 289KB
convert.c 2KB
inst_ram.coe 1.26MB
inst_ram.coe 1.26MB
inst_ram.coe 1.26MB
inst_ram.coe 1.26MB
inst_ram.coe 1.26MB
inst_ram.coe 1.26MB
inst_ram.coe 1.26MB
inst_ram.coe 1.26MB
inst_ram.coe 1.26MB
inst_ram.coe 1.26MB
inst_ram.coe 1.26MB
inst_ram.coe 187KB
data_ram.coe 110B
convert 13KB
main.data 16B
xsim.dbg 707KB
DivGen.dcp 1.01MB
InternalCrossbar.dcp 220KB
MultGen.dcp 54KB
compile.do 836B
compile.do 836B
compile.do 802B
compile.do 802B
compile.do 752B
compile.do 752B
compile.do 746B
compile.do 738B
compile.do 738B
compile.do 722B
compile.do 681B
compile.do 671B
simulate.do 331B
simulate.do 331B
simulate.do 325B
simulate.do 325B
simulate.do 325B
simulate.do 325B
simulate.do 307B
simulate.do 300B
simulate.do 300B
elaborate.do 203B
elaborate.do 203B
simulate.do 193B
simulate.do 193B
simulate.do 191B
elaborate.do 179B
wave.do 32B
wave.do 32B
wave.do 32B
wave.do 32B
wave.do 32B
wave.do 32B
wave.do 32B
wave.do 32B
wave.do 32B
wave.do 32B
wave.do 32B
wave.do 32B
simulate.do 11B
simulate.do 11B
simulate.do 11B
main.elf 698KB
xsimk.exe 1.25MB
run.f 583B
run.f 583B
run.f 563B
run.f 563B
run.f 535B
run.f 519B
inst_test.h 25KB
asm.h 6KB
cpu_cde.h 5KB
regdef.h 4KB
usage_statistics_ext_xsim.html 3KB
.xsim_webtallk.info 64B
xsim.ini 23KB
xsim.ini 22KB
xsim.ini 22KB
xsim.ini 22KB
xsimSettings.ini 1KB
webtalk.jou 1KB
webtalk_3060.backup.jou 1KB
vivado.jou 1010B
vivado.jou 892B
vivado.jou 885B
ISEWrap.js 7KB
ISEWrap.js 7KB
共 773 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
y0gurt.
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功