Specman e:一个序列驱动它的 BFM,它的 MAIN 也没有在测试中定义

Specman e: A sequence drives its BFM also its MAIN was not defined in a test

正在搭建串口验证环境。 我有 2 个序列:

  1. 用于驱动 DUT UART 配置 - vr_ad_sequence
  2. 用于将帧驱动到 DUT UART Rx - uart_sequence

两个序列、它们的驱动程序和 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 被驱动的唯一方法是 "overwriting" 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 没有扩展吗?感谢您的帮助

在 Specman 文档中有一个示例和解释说明:

The MAIN sequence creates count sequences of any kind, randomly selected from the currently loaded ATM sequences.

MAIN 序列也在其自己的部分中进行了描述:

The MAIN sequence subtype is defined directly under the sequence driver, and is started by default. It is the root for the whole sequence tree.

它的代码是:

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;
        };
    };
};

通过扩展它并覆盖它 body() 您将禁用启动随机序列的自动生成代码。

您还可以通过在 UART 序列驱动程序中限制 gen_and_start_main 来禁用 MAIN 序列。