R8051_simulation
生活随笔
收集整理的這篇文章主要介紹了
R8051_simulation
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1 下載
git clone https://github.com/risclite/R8051.git
2 編輯文件
mkdir work && mv sim tb
flist
../rtl/r8051.v
../tb/tb.v
makefile:
com:
irun -f flist -incdir ../rtl -timescale 1ns/1ns
3 仿真
make com
LCALL_FUNC
RET_FUNC
RETI_FUNC
AJMP_FUNC
SJMP_FUNC
JMP_FUNC
JZ_FUNC
JNZ_FUNC
CJNE_A_DI_REL
CJNE_A_DA_REL
CJNE_RN_DA_REL
CJNE_RI_DA_REL
DJNZ_RN_REL
DJNZ_DI_REL
Test success!
Test finished!
Test over, simulation is OK!
Simulation stopped via $stop(1) at time 1525335 NS + 0
../tb/tb.v:101 $stop(1);
4 說明
代碼中將stdio.h里的printf重構,printf其實是往SFR_99這個地址寫字符串,然后通過tb監測sfr_99的寫入值,并$write出來。
109 always @ ( posedge clk )
110 if ( ram_wr_en_sfr & ( ram_wr_addr[7:0]==8'h99 ) )
111 $write("%s",ram_wr_byte);
112 else;
總結
以上是生活随笔為你收集整理的R8051_simulation的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Hive文件与记录格式
- 下一篇: 2347. 最好的扑克手牌 (Easy)