SynaptiCAD Tutorials

(TBench) 4.5 Post Random Transaction Types 

(TBench) 4.5 Post Random Transaction Types 

Previous topic Next topic  

(TBench) 4.5 Post Random Transaction Types 

Previous topic Next topic  

Calls to PostRandomTransactionType will randomly generate one of the master transaction types of  the specified BFM and add this transaction to the BFM's transaction manager queue. In converting a directed-test test bench project into a constrained-random testbench (where transactions are randomly applied to the model under test), you will remove most of the apply calls to master transactors and replace them with PostRandomTransactionType calls. The apply calls to slave transactors will probably remain the same.

Scroll down to view the code below the sequencer comment.

post_random_tasaction_code

Notice that the we started and stopped the clock using regular Apply calls. Since the Clock is a slave transaction it is not eligible to be randomized by the Test Generator.

The PostRandomTransactionType call puts one randomly chosen transaction into the Transaction Manager's Queue.

There is a loop around the PostRandomTransactionType call so it will execute and put 5 transactions in the queue.

There is also a wait call that will force the simulation to continue to run until the queue is empty (both the read and the write transaction take 300ns to complete, so 5 of these transactions will complete in 1500ns).