加入星计划,您可以享受以下权益:

  • 创作内容快速变现
  • 行业影响力扩散
  • 作品版权保护
  • 300W+ 专业用户
  • 1.5W+ 优质创作者
  • 5000+ 长期合作伙伴
立即加入
  • 正文
    •  
    • 文件说明
    •  
    • 运行仿真
  • 推荐器件
  • 相关推荐
  • 电子产业图谱
申请入驻 产业图谱

基于UVM的UART验证环境

2020/12/14
349
阅读需 5 分钟
加入交流群
扫码加入
获取工程师必备礼包
参与热点资讯讨论

今天偶然在群里看到有人分享了Mentor Graphics提供的一个 UART 的 UVM 验证环境代码,包含了 UVM 的基本使用以及进阶的 UVM 寄存器模型。这里也分享给大家。

 

文件说明

agents/apb_agent - APB agent used in the UVM testbench
agents/uart_agent - UART agent user in the UVM testbench
agents/modem_agent - UART Modem interface agent, used in the UVM testbench
docs
protocol_monitor - contains an example APB protocol monitor
rtl - Contains the UART RTL source code***
sim - Simulation directory for the example, contains the Makefile
uvm_tb/tb - Top level testbench
uvm_tb/tests
uvm_tb/virtual_sequences
uvm_tb/sequences
uvm_tb/register_model
uvm_tb/env - contains the functional coverage monitors described in the cookbook

DUT 是 16550A UART 模块,接口主要包含 apb、uart 以及一些状态信号,agents 下是不同接口的 agent,16550A UART 的详细 spec 建议大家自己搜索下载。

docs 是 uart 模块的简单说明,包含了一些寄存器的说明

protocol_monitor 是一个协议检查模块,通过断言对 apb 协议进行检查

环境集成以及 sequence 等编写在 uvm_tb 下。

 

运行仿真

想要运行可以通过 sim 目录下的 makefile 进行,makefile 调用的是 quesatsim 进行仿真,如果没有的话,需要自己编写 vcs 的 makefile 进行仿真。

如果想要在 window 下通过 makefile 运行仿真,需要以下几个步骤

  • 安装 git_bash,git 的 bash 实际上也就是一个 mingw,是可以支持部分 linux 指令的,但是只有少部分,可以让我们的的终端更加像 linux 下的操作。这个时候还是不支持 makefile,需要我们自行安装,教程可以参考下面的链接

https://www.eemaker.com/git-bash-make.html

  • 安装 questasim

完成以后就能直接通过 make all 运行啦。

默认的 makefile 只进行到仿真这一步,没有生成覆盖率报告,我在 makefile 中加了入了覆盖率相关的命令

先合并覆盖率数据库,然后生成覆盖率报告的 html 文件

rpt_cg:
	vcover merge -out merge_coverage.ucdb *.ucdb
	vcover report -details -html merge_coverage.ucdb
	@echo "html has been created in ./sim/covhtmlreport"

 

详细的内容请查看 README

后台回复uart获得验证环境

推荐器件

更多器件
器件型号 数量 器件厂商 器件描述 数据手册 ECAD模型 风险等级 参考价格 更多信息
SN65HVD233DR 1 Texas Instruments 3.3 V CAN Transceiver with Standby Mode, Loopback 8-SOIC -40 to 125

ECAD模型

下载ECAD模型
$2.73 查看
TJA1051T/3/2Z 1 NXP Semiconductors Interface Circuit
$9.33 查看
VSC8664XIC-03 1 Microsemi Corporation Ethernet Transceiver, PBGA256, BGA-256
$28.66 查看

相关推荐

电子产业图谱