Is there any possible method to print recieve data frame after rgmii_expect() in RGMII VVC?

Hi, the receive data is not same as expected in my design. I need to print the recieve frames to transcript. Is there any possible method to print recieve data frame after rgmii_expect() in RGMII VVC?

The code is shown below

rgmii_expect(RGMII_VVCT,C_RGMII_VVC_IDX_ETH,RX,expected_data, “error occured”);
await_completon(RGMII_VVCT,C_RGMII_VVC_IDX_ETH,RX,100 us);


You have full verbosity control from the testbench test sequencer. Have you enabled ID_BFM? enable_log_msg(ID_BFM)


Yes, I sure it is enabled.

I found a solution by modifying the rgmii_expect procedure within the rgmii_bfm_pkg. This way, I’m able to print the received data. I’m looking for a feature similar to what I’ve done here within UVVM. Is there another method in UVVM that allows me to achieve this?

I’d like to share the update I made below for your reference

procedure rgmii_expect (
    constant data_exp     : in    t_byte_array;
    constant msg          : in    string             := "";
    signal   rgmii_rx_if  : inout t_rgmii_rx_if;
    constant alert_level  : in    t_alert_level      := ERROR;
    constant scope        : in    string             := C_SCOPE;
    constant msg_id_panel : in    t_msg_id_panel     := shared_msg_id_panel;
    constant config       : in    t_rgmii_bfm_config := C_RGMII_BFM_CONFIG_DEFAULT
  ) is
    constant proc_name : string := "rgmii_expect";
    constant proc_call : string := proc_name & "(" & to_string(data_exp'length) & " bytes)";
    variable v_normalized_data  : t_byte_array(0 to data_exp'length-1) := data_exp;
    variable v_rx_data_array    : t_byte_array(v_normalized_data'range);

    variable v_rx_data_array_slv: std_logic_vector((v_normalized_data'high+1)*8-1 downto 0); 
    variable v_expect_array_slv : std_logic_vector((v_normalized_data'high+1)*8-1 downto 0);

    variable v_rx_data_len      : natural;
    variable v_length_error     : boolean := false;
    variable v_data_error_cnt   : natural := 0;
    variable v_first_wrong_byte : natural;
    variable v_alert_radix      : t_radix;

    check_value(data_exp'ascending, TB_FAILURE, "Sanity check: Check that data_exp is ascending (defined with 'to'), for byte order clarity.", scope, ID_NEVER, msg_id_panel, proc_call);

    -- Read data
    rgmii_read(v_rx_data_array, v_rx_data_len, msg, rgmii_rx_if, scope, msg_id_panel, config, proc_call);

    -- Check the length of the received data
    if v_rx_data_len /= v_normalized_data'length then
      v_length_error := true;
    end if;

    -- Check if each received bit matches the expected.
    -- Report the first wrong byte (iterate from the last to the first)
    for byte in v_rx_data_array'high downto 0 loop
      v_rx_data_array_slv((byte+1)*8-1 downto byte*8) := v_rx_data_array(byte); 
      v_expect_array_slv((byte+1)*8-1 downto byte*8)  := v_normalized_data(byte);
      for i in v_rx_data_array(byte)'range loop
        -- Allow don't care in expected value and use match strictness from config for comparison
        if v_normalized_data(byte)(i) = '-' or check_value(v_rx_data_array(byte)(i), v_normalized_data(byte)(i), config.match_strictness, NO_ALERT, msg, scope, ID_NEVER) then
          -- Check is OK
          -- Received byte doesn't match
          v_data_error_cnt   := v_data_error_cnt + 1;
          v_first_wrong_byte := byte;
        end if;
      end loop;
    end loop;

    -- Done. Report result
    if v_length_error then
      alert(alert_level, proc_call & "=> Failed. Mismatch in received data length. Was " & to_string(v_rx_data_len) &
        ". Expected " & to_string(v_normalized_data'length) & "." & LF & add_msg_delimiter(msg), scope);
    elsif v_data_error_cnt /= 0 then
      -- Use binary representation when mismatch is due to weak signals
      v_alert_radix := BIN when config.match_strictness = MATCH_EXACT and check_value(v_rx_data_array(v_first_wrong_byte), v_normalized_data(v_first_wrong_byte), MATCH_STD, NO_ALERT, msg, scope, HEX_BIN_IF_INVALID, KEEP_LEADING_0, ID_NEVER) else HEX;
      alert(alert_level, proc_call & "=> Failed in "& to_string(v_data_error_cnt) & " data bits. First mismatch in byte# " &
        to_string(v_first_wrong_byte) & ". Was " & to_string(v_rx_data_array(v_first_wrong_byte), v_alert_radix, AS_IS, INCL_RADIX) &
        ". Expected " & to_string(v_normalized_data(v_first_wrong_byte), v_alert_radix, AS_IS, INCL_RADIX) & "." & LF & "Frame: " &
        to_hstring(v_rx_data_array_slv) & LF 
        & "Expect: " &
        to_hstring(v_expect_array_slv) & LF
        & add_msg_delimiter(msg), scope);
      log(config.id_for_bfm, proc_call & "=> OK, received " & to_string(v_rx_data_array'length) & " bytes. " &
        add_msg_delimiter(msg), scope, msg_id_panel);
    end if;
  end procedure;

So this is not really a matter of verbosity control, but rather an extended mismatch report on error; - or in fact a full mismatch report vs the original mismatch report for the first byte mismatch only.
For a large array this could of course be quite a bit of data, but then again maybe that is perfectly OK for an actual error.
I think the change here would be either to just extend this as you have shown, or to make a switch for “extended error info”, but I think the latter is probably not needed.
We will discuss this in the UVVM-group, but I would assume we will extend the code according to your input…
Thanks for your feedback
– Espen