This project verifies the functionality of a D-type Flip-Flop (DFF) using SystemVerilog-based testbench methodology. The testbench includes components such as Generator, Driver, Monitor, Scoreboard, and Transaction-based modeling, simulating a complete test environment.
It ensures that the D Flip-Flop behaves as expected β capturing the D
input on the rising edge of the clock and maintaining the correct output value (Q
).
The following functional behavior is tested:
- On reset (
rst = 1
), outputQ
should be0
. - On rising edge of clock,
Q
should take the value ofD
. - Correct data should be latched and held until the next clock event.
- Multiple randomized test vectors ensure robust validation.
The testbench consists of the following components:
- Interface (
dff_if
) β Connects DUT and TB withclk
,rst
,din
,dout
. - Transaction β Data structure for test inputs/outputs.
- Generator β Produces random stimulus.
- Driver β Drives stimulus to the DUT.
- Monitor β Captures DUT outputs.
- Scoreboard β Compares actual vs expected outputs.
- Environment β Connects all components together.
- Testbench Top β Instantiates DUT, interface, and environment.
You can run this testbench online using EDA Playground: