Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

What is a BFM in Qsys and why should we need one

As far as I understand it, the BFM is used for simulation purpose and it is an acronym for Bus Functional Model. What I do not understand is that, why should we need one of these. Can't we just do simulation with the synthesized circuit or using the behavioral model as represented by the HDL code?

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    As far as I understand it, the BFM is used for simulation purpose and it is an acronym for Bus Functional Model. What I do not understand is that, why should we need one of these. Can't we just do simulation with the synthesized circuit or using the behavioral model as represented by the HDL code?

    --- Quote End ---

    A BFM is often used where the stimulus to your device-under-test is 'external', so there is no way to do the simulation with the synthesized circuit.

    BFMs are also used when developing components. For example, lets say I have an Avalon-MM slave component that can implement the full suite of Avalon-MM transactions, i.e., single-read, single-write, burst-read, burst-write, etc. How can I generate traffic to that slave that exercises every transaction type? How can I insert arbitrary delays between transactions? How can I stack transactions back-to-back? These traffic patterns are hard to generate in software, eg., how would you do it with a NIOS processor, how about a DMA controller, perhaps a custom traffic generator?

    BFMs are also useful for code coverage, i.e., you can generate traffic patterns that cause every line of your code to be exercised. You can also setup your build system to run a suite of tests on every component in a simulator. This ensures that components that "used to work" still work when you make changes to common code.

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    So how should I describe a BFM if I have to give its definition in this context?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    So how should I describe a BFM if I have to give its definition in this context?

    --- Quote End ---

    I'm not sure what you mean by describe.

    A BFM is a simulation only component. When you want to use one, you instantiate it, and use it to generate stimulus on your source HDL or post-place-and-route RTL files.

    You either obtain the BFM, eg., use Altera's Verification IP suite, or you code one up yourself.

    The definition is in the name; its a functional model (simulation-only) of a bus, where a bus such as the Avalon-MM bus has an architecture specification defining the types of transactions over that bus. The BFM is a simulation implementation of the transactions in that bus specification; both Master BFM and Slave BFMs are available.

    Cheers,

    Dave