Specman e:序列驱动其BFM,其MAIN未在测试中定义

时间:2017-12-14 09:02:32

标签: uvm specman e

我正在构建UART验证环境。 我有两个序列:

  1. 用于驱动DUT UART配置 - vr_ad_sequence
  2. 用于将帧驱动到DUT UART Rx - uart_sequence
  3. 两个序列,它们的驱动程序和BFM都运行正常。 但是,当我创建一个仅使用配置序列的简单测试时,DUT UART Rx由验证环境驱动(也没有MAIN uart_sequence的扩展名)!测试看起来像这样:

    // The test that drives ALSO uart_sequence
    extend MAIN vr_ad_sequence {  // Configuration sequence
       body()@driver.clock is only {
           // Configuration logic
       };
    };
    

    我成功阻止Rx被驱动的唯一方法是“覆盖”MAIN uart_sequence body()

    // The test that does not drives UART Rx
    extend MAIN uart_sequence { // Rx sequence
        body() @driver.clock is only {
        };
    };
    
    extend MAIN vr_ad_sequence {  // Configuration sequence
       body()@driver.clock is only {
           // Configuration logic
       };
    };
    

    以下是验证环境中如何定义UART Rx序列,驱动程序和BFM:

    sequence uart_sequence using 
       item           = uart_frame_s,
       created_driver = uart_driver_u;
    
    
    extend uart_driver_u {
       event clock is only rise(port_clk$) @sim;
    };
    
    
    extend uart_rx_agent_u {
       driver: uart_driver_u is instance;
    };
    
    
    extend uart_rx_agent_u {
       uart_monitor : uart_rx_monitor_u is instance; // like uvm_monitor
       uart_bfm     : uart_rx_bfm_u is instance; // like uvm_bfm
    };
    
    
    extend uart_rx_bfm_u {
       !cur_frame: uart_frame_s;
    
       run() is also {
          start execute_items();
       };
    
       execute_items() @rx_clk is {
          while (TRUE) do{
             cur_frame = p_agent.driver.get_next_item();
             drive_frame(cur_frame);
          }; 
       }; 
    
       drive_frame(cur_frame : uart_frame_s) @rx_clk is {
           // Drive frame logic
       };
    };  
    

    您是否知道为什么uart_sequence驱动其BFM即使其MAIN未被延长?谢谢你的帮助

1 个答案:

答案 0 :(得分:2)

在Specman文档中有一个例子,解释说明:

  

MAIN序列随机创建任何类型的 count 序列   从当前加载的ATM序列中选择。

My structure: FIREBASE --> Events ---> Party1 name ---> some details ---> Party2 name ---> some details ---> Party3 name---> some details 序列也在其自己的部分中描述:

  

MAIN序列子类型直接在序列下定义   驱动程序,默认启动。它是整体的根源   序列树。

它的代码是:

MAIN

通过扩展并覆盖其extend MAIN sequence_name { count: uint; !sequence: sequence_name; keep soft count > 0; keep soft count <= MAX_RANDOM_COUNT; keep sequence.kind not in [RANDOM, MAIN]; body() @driver.clock is only { for i from 1 to count do { do sequence; }; }; }; ,您将禁用自动生成的启动随机序列的代码。

您还可以通过约束UART序列驱动程序中的body()来禁用MAIN序列。