What is a BFM, what does it do in a simulation?
BFMs are SW modules which encapsulate the functionality of a HW component (behavioral model). BFMs are not synthesiseable.

The employment of BFMs allows:


To simulate a behavior of HW component when its RTL description is either not available, or the component replaced by BFM has already been verified.
Simplify the verification process by converting a simple commands into complicated sequences of signals inside BFM.


#1 applies when designing a few modules in parallel - BFM is much easier to write and test than a complete RTL design. You can use BFMs in simulation of other modules until the RTL of the modules replaced with BFMs will be ready.

#1 also applies when the module represented by BFM has already been tested (like 3rd party IP) - you don't want to waste time on simulating its internal implementation, but just need some model which can "mimic" the behavior of this IP while consuming less computational time.

#2 says that BFMs might be employed in order to translate simple commands (like write(pcie_prim, mem_rd32, data, ...)) into a (complicated) sequence of signals' assignments which represent some complex protocol (like PCIe).

You are welcome to read this SNUG paper for much broader discussion.