[UVM]UVM Phases最詳細的介紹

                               UVM Phases最詳細的介紹

 

  • 目录

一、The UVM Phases are,

1.1、The run phase is implemented as a task and remaining all are function.

1.2、Q&A

二、 Phases can be grouped into 3 categories,

1. Build Phases

2. Run-time Phases

3. Clean up Phases

二、Phases Description:

三、UVM run phase phases


  • UVM Phases are a synchronizing mechanism for the environment
  • Phases are represented by callback methods, A set of predefined phases and corresponding callbacks are provided in uvm_component. The Method can be either a function or task.
  • Any class deriving from uvm_component may implement any or all of these callbacks, which are executed in a particular order

 

一、The UVM Phases are,

  • build
  • connect
  • end of elaboration
  • start of simulation
  • run
  • extract
  • check
  • report

1.1、The run phase is implemented as a task and remaining all are function.

                       

  • Note1:run_phase和main_phase或者說run_phase與右邊的12個phase是並行run的,他們之間並沒有包含關係。
  • Note2:一般地,比較推薦將driver和monitor run在main_phase,而把reference、Scoreboard和Subscriber run在run_phase
  • Note3:右邊的12個phase是串行執行的,開發中沒必要全部都使用。一般地只會細化到reset_phase、configure_phase、main_phase、shutdown_phase這四個。

 

1.2、Q&A

  • Q:为什么要分成小的phase?
  • Q:这12个小的phase与run_phase之间关系如何?
  • A:分成小的phase是为了实现更加精细化的控制。如这12个小phase的名字所示,reset,configure,main,shutdown四个phase是核心,这四个phase通常也是模拟了DUT的正常工作方式,在reset_phase对DUT进行复位,初始化等操作,在configure_ phase则进行DUT的配置,DUT的运行主要在main_phase完成,shutdown_phase则是做一些与DUT断电相关的操作。通过细分,对DUT实现更加精确的控制。如,假设要对DUT在运行过程中进行一次reset操作,在没有这些细分的phase之前,这种操作要在scoreboard,reference model等加入一些额外的代码来保证验证平台不会出错。但是有了这些小的phase之后,分别在scoreboard和reference model及其它部分(如driver,monitor等)的reset_phase写好相关代码,之后如果想做一次复位操作,那么只要通过phase的jump,就会自动的跳转回reset_phase。
  • A:这12个动态运行的phase与run_phase之间有什么关系。从本小节的图中可以看出,这12个动态运行的phase与run_phase之间是并列的关系,这是不是也意味着它们之间的执行也是并列的呢?答案是确定的。对于同一个component来说,如果其同时定义了run_phase和其它12个小的phase,那么其执行大体如下:
fork
  begin
    run_phase();
  end
  
  begin
    pre_reset_phase();
    reset_phase();
    post_reset_phase();
    pre_configure_phase();
    configure_phase();
    post_configure_phase();
    pre_main_phase();
    main_phase();
    post_main_phase();
    pre_shutdown_phase();
    shutdown_phase();
    post_shutdown_phase();
  end

join_none
  • Note:这段代码只是形象的说明这12个小的phase与run_phase之间的关系,但是有一点要指出的是,这12个小的phase之间并不是这样顺序执行,而是每当一个小的phase执行完成的时候要看看其它component的同名的小phase有没有执行完,等所有的都执行完后,才会进入下一个小的phase,也就是说有一个同步的过程。这段代码中并没有体现出这种同步的过程。

 

二、 Phases can be grouped into 3 categories,

1. Build Phases

       build phase, connect phase and end_of_elobaration phase belongs to this category.Phases in this categorize are executed at the start of the UVM testbench simulation, where the testbench components are constructed, configured and testbench components are connected.All the build phase  methods are functions and therefore execute in zero simulation time.

 

2. Run-time Phases

       start of simulation and run phase belongs to run-time phases, the run phase will get executed from the start of simulation to till the end of the simulation.the run phase is time-consuming, where the testcase is running

3. Clean up Phases

       extract, check, report and final belong to this category.where the results of the testcase are collected and reported. example: the number of error’s during the simulation is reported.

 

二、Phases Description:

PhaseDescriptionExecution Order
buildUsed to construct the testbenchcomponentstop-down
connectUsed to connect TLM ports of componentsbottom-up
end_of_elaborationUsed to make any final adjustments to the structure, configuration or connectivity of the testbench before simulation startsbottom-up
start_of_simulationused for printing testbench topology or configuration informationbottom-up
runUsed for stimulus generation, driving, monitoring, and checkingparallel
extractUsed to retrieve and process information from scoreboards and functional coverage monitors 
checkUsed to check that the DUT behaved correctly and to identify any errors that may have occurred during the execution of the test bench 
reportUsed to display the results of the simulation or to write the results to file 
finalUsed to complete any other outstanding actions that the test bench has not already completed

 

三、UVM run phase phases

       the run phase has different phases, these are,

runPhaseDescription
pre_resetthe pre_reset phase starts at the same time as the run phase. Its purpose is to take care of any activity that should occur before the reset, such as waiting for a power-good signal to go active
resetThe reset phase is reserved for DUT or interface specific reset behavior. For example, this phase would be used to generate a reset and to put an interface into its default state
post_resetIntended for any activity required immediately the following reset
pre_configurepre_configure phase is intended for anything that is required to prepare for the DUT’s configuration process after reset is completed
configureconfigure phase is used to program the DUT and any memories in the testbench so that it is ready for the start of the test case
post_configurepost_configure phase is used to wait for the effects of configuration to propagate through the DUT, or for it to reach a state where it is ready to start the main test stimulus
pre_mainpre_main phase is used to ensure that all required components are ready to start generating stimulus
mainThis is where the stimulus specified by the test case is generated and applied to the DUT. It completes when either all stimulus is exhausted or a timeout occurs
post_mainThis phase is used to take care of any finalization of the main phase
pre_shutdownThis phase is a buffer for any DUT stimulus that needs to take place before the shutdown phase
shutdownThe shutdown phase is used to ensure that the effects of the stimulus generated during the main phase have propagated through the DUT and that any resultant data has drained away
post_shutdownPerform any final activities before exiting the active simulation phases. At the end of the post_shutdown phase, the UVM testbench The execution process starts the cleanup phases

 

 

 

UVM(Universal Verification Methodology)寄存器模型是一用于验证芯片寄存器功能的标准方法。它提供了一个统一的、可重用的框架,用于建立和管理寄存器模型,以及执行寄存器访问和验证。 UVM寄存器模型的主要组成部分包括寄存器模型、寄存器层次结构、寄存器操作和寄存器验证环境。 1. 寄存器模型:UVM寄存器模型是一个抽象的表示,用于描述芯片内部的寄存器和寄存器字段。它提供了一种结构化的方式来定义寄存器的属性、寄存器字段的位宽和访问权限等。 2. 寄存器层次结构:UVM寄存器模型支持多层级的寄存器结构,可以通过层级关系来描述芯片内部的寄存器模块和子模块。这样可以更好地组织和管理寄存器模型,并提供寄存器之间的相互作用和访问。 3. 寄存器操作:UVM提供了一系列的API,用于执行寄存器读写操作。通过这些API,可以向寄存器模型发送读写请求,并获取响应。同时,还可以对寄存器的访问进行配置和控制,如重置、写入默认值等。 4. 寄存器验证环境:UVM寄存器模型可以与其他验证环境进行集成,以验证寄存器功能的正确性。通过使用事务级建模(TLM)接口,可以将寄存器操作与其他验证组件进行交互,并进行功能验证、覆盖率分析和错误注入等。 总之,UVM寄存器模型提供了一种规范化的方法来描述和验证芯片寄存器功能。它具有可重用性、灵活性和扩展性,并能与其他验证组件进行集成,从而提高验证效率和可靠性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

元直数字电路验证

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值