Package: spi_bfm_pkg

Description

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

Constants

Name Type Value Description
C_SCOPE string "SPI BFM"
C_SPI_BFM_CONFIG_DEFAULT t_spi_bfm_config ( CPOL => '0',
CPHA => '0',
spi_bit_time => -1 ns,
-- Make sure we notice if we forget to set bit time. ss_n_to_sclk => 20 ns,
sclk_to_ss_n => 20 ns,
inter_word_delay => 0 ns,
match_strictness => MATCH_EXACT,
id_for_bfm => ID_BFM,
id_for_bfm_wait => ID_BFM_WAIT,
id_for_bfm_poll => ID_BFM_POLL )

Types

Name Type Description
t_spi_if
t_spi_bfm_config Configuration record to be assigned in the test harness.

Functions

Description

BFM procedures


init_spi_if_signals

  • This function returns an SPI interface with initialized signals.
  • master_mode = true:
    • ss_n initialized to 'H'
    • if config.CPOL = '1', sclk initialized to 'H',
      otherwise sclk initialized to 'L'
    • miso and mosi initialized to 'Z'
  • master_mode = false:
    • all signals initialized to 'Z'

Description

spi_master_transmit_and_receive

This procedure transmits data 'tx_data' to the SPI slave DUT
and receives 'rx_data' from the SPI slave DUT.

Description

spi_master_transmit_and_receive

This procedure transmits data 'tx_data' to the SPI slave DUT
and receives 'rx_data' from the SPI slave DUT.
The SPI interface in this procedure is given as a t_spi_if signal record

Description
Multi-word

Description

spi_master_transmit_and_check

This procedure …
The SPI interface in this procedure is given as a t_spi_if signal record

Description
Multi-word

Description

spi_master_transmit

This procedure transmits data 'tx_data' to the SPI DUT
The SPI interface in this procedure is given as a t_spi_if signal record

Description
Multi-word

Description

spi_master_receive

This procedure receives data 'rx_data' from the SPI DUT
The SPI interface in this procedure is given as a t_spi_if signal record

Description
Multi-word

Description

spi_master_check

This procedure receives an SPI transaction, and compares the read data
to the expected data in 'data_exp'.
If the read data is inconsistent with the expected data, an alert with
severity 'alert_level' is triggered.
The SPI interface in this procedure is given as a t_spi_if signal record

Description
Multi-word

Description

spi_slave_transmit_and_receive

This procedure transmits data 'tx_data' to the SPI master DUT
and receives 'rx_data' from the SPI master DUT.

Description

spi_slave_transmit_and_receive

This procedure transmits data 'tx_data' to the SPI master DUT
and receives 'rx_data' from the SPI master DUT.
The SPI interface in this procedure is given as a t_spi_if signal record

Description
Multi-word

Description

spi_slave_transmit_and_check

This procedure …
The SPI interface in this procedure is given as a t_spi_if signal record

Description
Multi-word

Description

spi_slave_transmit

This procedure transmits data 'tx_data' to the SPI DUT
The SPI interface in this procedure is given as a t_spi_if signal record

Description
Multi-word

Description

spi_slave_receive

This procedure receives data 'rx_data' from the SPI DUT
The SPI interface in this procedure is given as a t_spi_if signal record

Description
Multi-word

Description

spi_slave_check

This procedure receives an SPI transaction, and compares the read data
to the expected data in 'data_exp'.
If the read data is inconsistent with the expected data, an alert with
severity 'alert_level' is triggered.
The SPI interface in this procedure is given as a t_spi_if signal record

Description
Multi-word