zoukankan      html  css  js  c++  java
  • 基于UVM的UART验证环境

    今天偶然在群里看到有人分享了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获得验证环境

  • 相关阅读:
    代码是什么
    关于程序
    信息系统分析三原则
    设计的一个原则,妥协,不完美
    Algs4-1.4.30一个栈和一个steque实现的双向队列
    Algs4-1.4.31三个栈实现的双向队列
    Algs4-1.4.29两个栈实现的steque
    Algs4-1.4.27两个栈实现队列
    Algs4-1.4.28一个队列实现的栈
    *Algs4-1.4.26-三点共线-(未解决)
  • 原文地址:https://www.cnblogs.com/icparadigm/p/13463617.html
Copyright © 2011-2022 走看看