TestBencher Pro and Reactive Test Bench Help

7.4 VHDL: TM fill with Post calls

7.4 VHDL: TM fill with Post calls

Previous topic Next topic  

7.4 VHDL: TM fill with Post calls

Previous topic Next topic  

One Method of filling the Transaction Manager Queue is to post diagram calls to the queue. This is  similar to using a normal diagram apply calls, but the transaction is scheduled for execution in the future (when it gets popped from the queue), instead of at the present time.

Post diagram calls require an extra parameter called queuePath which specifies the path to the transaction manager where the transaction will be scheduled for execution. Typically, queuePath will be set to tb_LocalTLMPath, which is a generic defined by each TLM that sequencers and transactor-level code can access to reference their containing TLM. Non-hierarchical TLMs will always use tb_LocalBfmPath.

TestBencher will only create the Post transaction calls after the Transaction Manager has been enabled and built as shown in section Section 7.3: Transaction Manager Overview. Procedures for posting transactions individually to the transaction manager (defined in tb_projectName_tasks.vhd).

Using a dialog to generate the Post calls:

To open the Insert Diagram Subroutine Calls dialog, put the cursor in the template file on the line to insert, and then right click and choose Insert Diagram Calls from the context menu.

post_calls_dlg

Select one of the Post radio buttons and select a transaction to highlight it, then press the Insert button.

Master Transaction Manager Post Calls:

Post_diagramName ( signal tb_Control : inout tb_Control_Type;

                 queuePath : in string;

                 transactorBfmPath : in string;

                 <parameters> );

Post_diagramName_nowait ( signal tb_Control : inout tb_Control_Type;

                 queuePath : in string;

                 transactorBfmPath : in string;

                 <parameters> );

Post_Abort_diagramName ( signal tb_Control : inout tb_Control_Type;

                 queuePath : in string;

                 transactorBfmPath : in string );

Slave Transaction Manager Post Calls:

Post_diagramName_looping ( signal tb_Control : inout tb_Control_Type;

                 queuePath : in string;

                 transactorBfmPath : in string;

                 <parameters> );

Post_diagramName_looping_nowait ( signal tb_Control : inout tb_Control_Type;

                 queuePath : in string;

                 transactorBfmPath : in string;

                 <parameters> );

Post_Abort_diagramName ( signal tb_Control : inout tb_Control_Type;

                 queuePath : in string;

                 transactorBfmPath : in string );

Example Post calls

Below are some examples of posting transactions to transaction queues. To post a transaction, you must specify the TLM containing the queue (transactionManagerPath) and the TLM containing the transactor that will perform the transaction (transactorInstancePath). If the transactor is not defined in the local TLM that is making the Post call, you will need to specify the package containing the transactor's Post procedure (e.g. work.tb_master_tasks in the example below).

If you have designed a hierarchical test bench project, two situations will commonly arise where you will need to a use different value for queuePath:

If you need to post a call to a sub-TLM of the TLM containing the Post call,  you should use a relative path to the sub TLM:

        queuePath := tb_LocalBfmPath & ".sub0"

If you need to call a TLM that is not a sub-TLM of the TLM containing the Post call, then you will have to use the full VHDL hierarchical name to post to that TLM's queue:

        queuePath := "top.master0"

tb_tm_posting_syntax

Example 1) Post a transaction defined in this local TLM (i.e. local project) to the local transaction queue:

      Post_write( tb_Control, tb_LocalBfmPath

                              tb_LocalBfmPath, x”AB”, x”EF”); 

 

Example 2) Post transaction defined in this local TLM to the queue of a sub-TLM ("master0"):

       Post_write( tb_Control, tb_LocalBfmPath & ".master0",

                               tb_LocalBfmPath, x”AB”, x”EF”);

Example 3) Same as example 2, except using a full hierarchical name ("Top.master0"):

       Post_write( tb_Control, "Top.master0",

                               tb_LocalBfmPath, x”AB”, x”EF”);

 

Example 4) Post a transaction defined in a sub-TLM (sub-TLM is called "master1") to the local TLM's queue by specifying master1's path relative to the local TLM:

work.tb_master_tasks.Post_write( tb_Control, tb_LocalBfmPath,

                      tb_LocalBfmPath & ".master1", x”AB”, x”EF”);

Example 5) Same as example 4, except using a full hierarchical path name to the transactor's  TLM (in this example, the TLM Top contains the master1 TLM)

work.tb_master_tasks.Post_write( tb_Control, tb_LocalBfmPath,

                    "Top.master1", x”AB”, x”EF”);