Package: uart_bfm_pkg

Description

=================================================================================================

Constants

Name Type Value Description
C_SCOPE string "UART BFM"
C_DATA_MAX_LENGTH natural 8
C_EXPECT_RECEIVED_DATA_STRING_SEPARATOR string ";
"
C_BFM_ERROR_INJECTION_INACTIVE t_bfm_error_injection ( parity_bit_error => false,
stop_bit_error => false )
C_UART_BFM_CONFIG_DEFAULT t_uart_bfm_config ( bit_time => -1 ns,
num_data_bits => 8,
idle_state => '1',
num_stop_bits => STOP_BITS_ONE,
parity => PARITY_ODD,
timeout => 0 ns,
-- will default never time out timeout_severity => error,
num_bytes_to_log_before_expected_data => 10,
match_strictness => MATCH_EXACT,
id_for_bfm => ID_BFM,
id_for_bfm_wait => ID_BFM_WAIT,
id_for_bfm_poll => ID_BFM_POLL,
id_for_bfm_poll_summary => ID_BFM_POLL_SUMMARY,
error_injection => C_BFM_ERROR_INJECTION_INACTIVE )

Types

Name Type Description
uart_expect_received_data_array array (natural range<>) of std_logic_vector(C_DATA_MAX_LENGTH-1 downto 0)
t_bfm_error_injection
t_uart_bfm_config

Functions

Description

BFM procedures


uart_transmit

  • This procedure transmits data 'data_value' to the UART DUT
  • The TX configuration can be set in the config parameter

Description

uart_receive

  • This procedure reads data from the UART DUT and returns it in 'data_value'
  • The RX configuration can be set in the config parameter

Description

uart_expect

  • This procedure reads data from the UART DUT and compares it to the data in
    'data_exp'.
  • If the read data is inconsistent with the 'data_exp' data, a new read will
    be performed, and the new read data will be compared with 'data_exp'.
    This process will continue untill one of the following conditions are met:
    a) The read data is equal to the expected data
    b) The number of reads equal 'max_receptions'
    c) The time spent reading is equal to the 'timeout'
  • If 'timeout' is set to 0, it will be interpreted as no timeout
  • If 'max_receptions' is set to 0, it will be interpreted as no limitation on number of reads
  • The RX configuration can be set in the config parameter

Description

odd_parity

  • This function checks if the data parity is odd or even
  • If the number of '1' in the 'data' input is odd, '1' will be returned
  • If the number of '1' in the 'data' input is even, '0' will be returned