UART UVM验证平台平台搭建总结

          tb_top是整个UVM验证平台的最顶层;tb_top中例化dut,提供时钟和复位信号,定义接口以及设置driver和monitor的virual interface,在intial中调用run_test() UVM入口函数。在基于uvm_test扩展出base_test,根据测试用例再基于base_test扩展出各种各样的test.在扩展后的test中call sequence.

          在base_test中实例化env, env_config, 打印验证平台的拓扑结构uvm_top.print_topology,打印输出注册在factory中类factory.print()。在环境env的build_phase()阶段,实例化agent,reference model,scoreboard,checker,function coverage。在connetion_phase()将各个组件component通过TLM1.0 中的FIFO或analysis port连接起来。在agent中,实例化driver,monitor,sequencer,根据uvm_agent的is_active变量决定是否实例化driver和sequencer。在monitor和driver与DUT的信号层打交道,所以需要例化virtual interface. 除此之外,根据情况例化config,用congfig_db 配置相应的参数。从uvm_item_sequence派生成相应的transactions。

          整个UVM TB的如何函数是run_test()。UVM是基于事物级的验证方法学各个组件之间通过port, export, transport, analysis_port, analysis_export,imp(implement) 等来进行通信。搭建完验证平台后,大部分工作需要编写sequence(seq lib).

          uvm中有两种基本类:uvm_transaction,uvm_component(uvm_component其实也是从uvm_objection扩展而来)。uvm验证平台是基于uvm_component构建的树形结构;uvm_compent包括各种phase: build_phase, connect_phase, end_of_elaboration, start_of_simulation_phase, run_phase, pre_reset_phase, reset_phase, post_reset_phase , pre_congfigure_phase, configure_phase, post_configure_phase, pre_main_phase, main_phase, post_main_phase, pre_shutdown, shutdown_phase, post_shutdown_phase, extract_phase, chect_phase, report_phase, final_pahse等。uvm采用objection机制决定phase执行的时间raising_objection和drop_objection. 将uvm_sequence_item中比较复杂的约束可以放在per_randomize()和post_randomize()中。sequence包含pre_body(), body(), post_body()三个过程。

          验证平台需要自动化完成工作,用perl脚本搭建基本UVM验证平台框架,编写Makefile完成仿真工具和工作设置,以及在Makefile中调用参数化设置;还可使用$test$plusargs和$value$plusargs传入相应的参数。

 

参考文献:

扩展阅读

[1] 关于$test$plusargs和$value$plusargs的小结. http://www.cnblogs.com/nanoty/p/4355245.html

原文地址:https://www.cnblogs.com/dpc525/p/5495659.html