R8051_simulation

Posted xuxian007

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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的主要内容,如果未能解决你的问题,请参考以下文章

被称为 8051 的 RTOS 的基本要求

ApplePay `paymentAuthorizationViewController:didAuthorizePayment:handler:` 未在 Xcode Simulator 10.3 中

r R有用的代码片段

r R有用的代码片段

[OpenAirInterface实战-9] :OAI代码的运行与常规测试(pingIperf)之RF Simulator

R语言基于模拟退火(Simulated Annealing)进行特征筛选(feature selection)