This project is a SystemVerilog-based verification environment for a 32-bit Timer Peripheral. The goal is to verify the design against the Requirements Traceability Matrix (RTM) R1-R6, ensuring protocol compliance, functional correctness, and corner-case handling.
The environment uses a layered testbench architecture (Generator -> Driver -> Monitor -> Scoreboard/Coverage).
The verification strategy and requirements mapping for this project are defined in the
Verification Plan (plan/verification_plan.pdf).
All planned verification artifacts (assertions, directed tests, random regression, scoreboard
checks, and functional coverage) were fully implemented and executed.
Evidence of successful execution and verification closure is provided in:
logs/sim.log– simulation transcript showing test execution and PASS resultscoverage/coverage.txt– functional coverage report demonstrating 100% coverage closure
timer_periph.sv: The synthesizable RTL logic for the 32-bit timer.
timer_top.sv: The top-level module connecting the Testbench and DUT.design_params_pkg.sv: Defines constants used throughout the project (e.g., P_ADDR_WIDTH).timer_pkg.sv: Package for type definitions. Exportsdesign_params_pkgcontents.timer_pkt.sv: Defines thebus_transclass (transaction definition).timer_if.sv: Interface definition including SVA Assertions (R1 Protocol checks).timer_generator.sv: Stimulus Generation. Contains directed tests and constrained-random regression tasks.timer_driver.sv: Drives pin-level transactions to the DUT based on generator requests.timer_monitor.sv: Observes bus activity and broadcasts transactions to the Scoreboard and Coverage.timer_scoreboard.sv: Checking Logic. Implements the reference model and validates flag behavior (R4, R5).timer_coverage.sv: Functional Coverage. Implements "Shadow Memory" logic to cross-cover Load Values with Reload Modes.
The timer_generator.sv file contains the following test scenarios, directly traceable to the Test Plan:
| Test Name | Type | Purpose | Req ID |
|---|---|---|---|
timer_sanity_test |
Directed | Smoke Test. basic read/write and short countdown to ensure DUT is alive. | R1, R2 |
timer_load_0_test |
Directed | Corner Case. Writes 0 to LOAD to verify it translates to 1 cycle. |
R3 |
timer_reload_test |
Directed | Mode Verification. Verifies Auto-Reload functionality without software intervention. | R6 |
timer_status_test |
Directed | Flag Verification. Checks "Sticky" behavior, Clear-on-Read, and Clear-on-Write. | R5 |
timer_random_regression |
Random | Coverage Closure. Uses weighted distribution to target Corner Cases (Max/Min Load) and Cross Coverage. | All |
- Shadow Memory (in
timer_coverage.sv): Solves the temporal separation problem between Mode configuration and Load operations. A local copy of theRELOAD_ENbit is maintained to allow accurate cross-coverage sampling. - Weighted Randomization: Uses
distconstraints to force corner cases (0x0000, 0xFFFF) to occur at higher probability, significantly optimizing coverage closure time.
(Using QuestaSim)
-
Compile the Design and Verification files:
vlib work vlog +acc timer_pkg.sv timer_if.sv timer_periph.sv timer_top.sv
-
Run the Simulation:
vsim -c timer_top -do "run -all" -
View Coverage Report:
coverage report -detail -cvg