How vivek-dave/uvm_testbench_for_up_down_counter works
Project type and purpose
• This is a UVM-based verification testbench for an up/down counter.
• Its sole purpose is to generate stimulus, drive the device-under-test (DUT), monitor responses, check assertions, and collect coverage.
File structure
Top-level files:
• design.sv – Up/Down Counter RTL (DUT)
• interface.sv – UVM interface connecting DUT and testbench
• tb_pkg.sv – Common definitions (transactions, config, utility)
• testbench.sv – Top-level module that instantiates DUT, interface, and UVM test harness
UVM agent files:
• counter_env.sv
• counter_agent.sv
• counter_sequencer.sv
• counter_sequence.sv, counter_sequence_item.sv
• counter_driver.sv, counter_monitor.sv
Test and coverage:
• counter_test.sv – UVM test class extends base test
• counter_monitor.sv – collects signals and drives scoreboarding/assertions
• LOG_FILE.log – simulation output
• Assertions (embedded in RTL or monitor)
Key insights from README
• “Complete UVM TB Architecture”
• Includes assertions for up and down counter
• Standard UVM layering: sequences → sequencer → driver → DUT → monitor → scoreboard
Main components
a) DUT (Up/Down Counter)
b) UVM Testbench Top (testbench.sv)
c) UVM Package (tb_pkg)
d) Environment (counter_env)
– Agent
• Sequencer (counter_sequencer)
• Sequence & Sequence Item (counter_sequence, counter_sequence_item)
• Driver (counter_driver)
• Monitor (counter_monitor)
– Scoreboard/Assertions
e) Interface block (interface.sv)
f) Test (counter_test)
• Sequence → sequencer: stimulus generation
• Sequencer → driver: transaction pushing
• Driver → interface → DUT: pin-level stimulus
• DUT → interface → monitor: response capture
• Monitor → scoreboard/assertion checker: check correctness
• Test → env: config and start sequences
• env → agent: phasing and connect
• tb_pkg: common types accessed by all UVM components
Architectural patterns and principles
• UVM layered architecture (Phasing, Factory, TLM interfaces)
• Agent isolation (each agent drives one interface instance)
• Reuse: put common definitions in tb_pkg
• Virtual interfaces for decoupling RTL from testbench
Relevant technologies and libraries
• SystemVerilog / UVM 1.2+
• TLM ports and exports (sequence item transport)
• Assertions (SVAs) embedded in either RTL or monitor
Summary of elements
• Clear component labels (e.g., “counter_driver”, “counter_monitor”)