Sunteți pe pagina 1din 2

Switched - Order Of Things To Happen

1. Definition Of the tranaction.sv - think on a class that will be suited to


transfer all that need to be transfered from/to all blocks. It will hold fields
declarations required to generate the stimulus.

2. Generator class is responsible for:

Generating the stimulus by randomizing the transaction class


Sending the randomized class to the driver using the mailbox gen2driv.
1. Declare the transaction class handle
2. 'Randomize' the transaction class
3. Adding Mailbox and event
4. Adding variable to control the number of packets to be created
5. Adding event to indicate the completion of generation process, event will be
triggered on the completion of Generation process.

3. Create The Interface - Interface will group the signals.

4. Driver Class - responsible for receiving the stimulus generated from generator
and drive to DUT by assigning transaction class values to interface signals.
1. Declare interface and mailbox, Get the interface and mailbox handle through
constructor.
2. Adding reset task, which initializes the Interface signals to default values.
3. Adding drive task to drive the transaction packet to interface signal.
4. Adding local variable to track the number of packets driven, and increment the
variable in drive task.
(This will be useful to end the test-case/Simulation. i.e compare the generated
pkt's and driven pkt's, if both are same then end the simulation)

5. Environment is container class contains Mailbox, Generator and Driver. Creates


the mailbox, generator and driver, shares the mailbox handle across the Generator
and Driver.
1. Declare the handles
2. In Construct Method, Create
3. For better accessibility.
4. Add run task to call the above methods

6. Test.sv - Test is responsible for,

Creating the environment.


Configuring the testbench i.e, setting the type and number of transactions to
be generated.
Initiating the stimulus driving.

1. Declare and Create environment


2. Configure the number of transactions to be generated
3. Initiating the stimulus driving

7. TestBench Top:

This is the top most file, which connects the DUT and TestBench.
TestBench top consists of DUT, Test and Interface instances.
Interface connects the DUT and TestBench.
1.Declare and Generate the clock and reset
2. Create Interface instance
3. Create Design Instance and Connect Interface signals
4. Create test instance and Pass the interface handle
5. Add logic to generate the dump

8. Monitor -

Samples the interface signals and convert the signal level activity to
transaction level.
Send the sampled transaction to Scoreboard via Mailbox.
Below are the steps to write monitor.
1. Writing monitor class.
2. Declare interface and mailbox, Get the interface and mailbox handle through
constructor.
3. Sampling logic and sending the sampled transaction to scoreboard.

9. Scoreboard receive's the sampled packet from monitor and compare with the
expected result, error will be reported if the comparison results mismatch.
1. Declaring the mailbox and variable to keep count of transactions, connecting
handle through constructor
2. logic to compare the received result with the expected result

S-ar putea să vă placă și