码迷,mamicode.com
首页 > 其他好文 > 详细

R8051_simulation

时间:2020-04-18 18:27:38      阅读:73      评论:0      收藏:0      [点我收藏+]

标签:lse   stopped   div   mes   over   bsp   makefile   代码   UNC   

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

标签:lse   stopped   div   mes   over   bsp   makefile   代码   UNC   

原文地址:https://www.cnblogs.com/xuxian007/p/12727143.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!