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.
•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).