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的更多相关文章
随机推荐
- djangoDRF查询
DRF全部查询基础示例 from django.db.models import Q, F, Sum, Avg, Count, Min, Max from rest_framework.respons ...
- VS2010 发布网站总是连同cs文件一起发布了
选择第一个,保存再发布.cs文件 都删除了.
- 在使用IDEA提交git代码时,如何修改提交者的名字
在Terminal终端中输入 git config user.name git config --global user.name "xl"
- (mysql笔记)GROUP_CONCAT() 把多行数据合并
不合并查询: 合并查询: SELECT GROUP_CONCAT(id) FROM orderinfo WHERE enterpriseid = 2265 AND shopid =0 AND orde ...
- CentOS7安裝 Nginx + php7 + php-fpm
原文 : https://ivanagyro.medium.com/於centos7安裝-nginx-php7-php-fpm-laravel5-6-df8631681acf安装nginx 1/ 用y ...
- JAVA图片压缩到指定大小
这是压缩到小于300KB的,循环压缩,一次不行再压一次, 不废话,直接贴代码 <!-- 图片缩略图 --> <dependency> <groupId>net.co ...
- go简单写个ini配置文件读取工具
直接上代码: 1 package main 2 3 import ( 4 "fmt" 5 "io/ioutil" 6 "reflect" 7 ...
- 胖AP组建小型企业WLAN
胖ap组网 无线路由器wrt配置 使用自动连接时,会从无线路由器第一个端口开始连接,但那是接入外网的端口,因此和二层交换机相连的线要手动更改一下,否则和交换机相连的设备无法dhcp获取ip 打开无线路 ...
- VirtualBox上使用qemu和busybear搭建RISCV环境
Step 1:安装一些编译riscv需要的库: sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr ...
- Recycle Queue Sample
public class RecycleQueue<T> { public int len; T[] v; int max; int front; int rear; public Rec ...