In this repository, I made a UVM environment from scratch for a Dual-Port Router. The purpose is to create a scalable environment that implements Virtual Sequencers, RAL, Scoreboards, Coverage, and DPI-C.
To view the on-going current Coverage Report, CLICK HERE
High Level Overview
^Coverage Diagram is still a WIP (minor errors that I'll fix this week)
-
4-Agent Architecture: Includes two active input agents (Port A/B), an active Register/Control agent, and a passive output monitor.
-
Virtual Sequencing: Implemented a
router_virtual_sequencerto coordinate complex traffic scenarios, including port collisions and priority arbitration. -
Register Abstraction Layer (RAL): Integrated a full register model supporting Frontdoor/Backdoor access for DUT configuration and status tracking.
-
Scalable Scoreboard: Utilized
uvm_analysis_imp_declto create independent implementation ports -
For simulation, I used Synopsys VCS with a Makefile script.
- Virtual Sequencer & Multi-Agent Connectivity
- RAL Model & Adapter Implementation
- Configuration Objects
- DPI-C Golden Reference Model (branch:
feature/dpi-c) - Functional Coverage (branch:
feature/coverage)
I have already made rough drafts for a DPI-C Golden Model, and a Coverage class, which are both on new branches named feature/dpi-c and feature/coverage
Router_UVM
βββ Makefile
βββ README.md
βββ agent
β βββ output_agent
β β βββ output_agent.svh
β β βββ output_config.svh
β β βββ output_item.svh
β β βββ output_monitor.svh
β βββ port_a_agent
β β βββ port_a_agent.svh
β β βββ port_a_config.svh
β β βββ port_a_driver.svh
β β βββ port_a_item.svh
β β βββ port_a_monitor.svh
β β βββ port_a_sequencer.svh
β βββ port_b_agent
β β βββ port_b_agent.svh
β β βββ port_b_config.svh
β β βββ port_b_driver.svh
β β βββ port_b_item.svh
β β βββ port_b_monitor.svh
β β βββ port_b_sequencer.svh
β βββ reg_agent
β βββ reg_agent.svh
β βββ reg_config.svh
β βββ reg_driver.svh
β βββ reg_item.svh
β βββ reg_monitor.svh
β βββ reg_sequencer.svh
βββ docs
β βββ diagrams/...
β βββ test_plans/...
βββ env
β βββ router_env.svh
β βββ router_env_config.svh
β βββ router_scoreboard.svh
β βββ router_virtual_sequencer.svh
βββ ral
β βββ collision_cnt_reg.svh
β βββ ctrl_reg.svh
β βββ router_reg_adapter.svh
β βββ router_reg_block.svh
βββ seq
β βββ back_to_back_vseq.svh
β βββ backdoor_test_vseq.svh
β βββ collision_vseq.svh
β βββ disable_vseq.svh
β βββ port_a_base_sequence.svh
β βββ port_b_base_sequence.svh
β βββ priority_vseq.svh
β βββ ral_sanity_vseq.svh
β βββ reg_base_sequence.svh
β βββ router_base_vseq.svh
βββ src
β βββ dual_port_router.sv
β βββ dual_port_router_if.sv
βββ tb
β βββ tb_top.sv
βββ tests
βββ back_to_back_test.svh
βββ backdoor_test.svh
βββ config_test.svh
βββ disable_test.svh
βββ priority_test.svh
βββ ral_sanity_test.svh
βββ router_base_test.svh
βββ router_pkg.svh
Below are some good debugging patterns that I am trying to memorize.
Quick reference for filtering UVM simulation logs.
| Flag | Meaning | Example |
|---|---|---|
-E |
Extended regex (allows | for OR) |
grep -E "ERROR|FATAL" |
-i |
Case insensitive | grep -i "error" |
-c |
Count matches (don't show lines) | grep -c "UVM_ERROR" |
-n |
Show line numbers | grep -n "MISMATCH" |
-B5 |
Show 5 lines Before match | grep -B5 "ERROR" |
-A3 |
Show 3 lines After match | grep -A3 "ERROR" |
-C2 |
Show 2 lines Context (before+after) | grep -C2 "ERROR" |
-v |
Invert match (lines NOT matching) | grep -v "UVM_INFO" |
-l |
List filenames only | grep -l "ERROR" *.log |
-r |
Recursive search in directories | grep -r "TODO" src/ |
-w |
Match whole word only | grep -w "data" |
| Syntax | Meaning | Example |
|---|---|---|
> |
Redirect stdout to file (overwrite) | ./simv > sim.log |
>> |
Redirect stdout to file (append) | ./simv >> sim.log |
2> |
Redirect stderr to file | ./simv 2> errors.log |
2>&1 |
Redirect stderr to same place as stdout | ./simv > sim.log 2>&1 |
&> |
Redirect both stdout and stderr to file | ./simv &> sim.log |
| |
Pipe stdout to another command | ./simv | grep ERROR |
| tee |
Pipe to screen AND file | ./simv | tee sim.log |
2>&1 | tee |
Both streams to screen and file | ./simv 2>&1 | tee sim.log |
# Save all output to file (won't see on screen)
./simv > sim.log 2>&1
# See output AND save to file
./simv 2>&1 | tee sim.log
# Separate stdout and stderr
./simv > output.log 2> errors.log
# Discard output entirely
./simv > /dev/null 2>&1grep "UVM_ERROR" sim.log # All errors
grep "UVM_FATAL" sim.log # All fatals
grep "UVM_WARNING" sim.log # All warnings
grep -E "UVM_ERROR|UVM_FATAL" sim.log # Errors and fatals
grep -c "UVM_ERROR" sim.log # Count errorsgrep "\[SB\]" sim.log # Scoreboard messages
grep "\[PORT_A_DRV\]" sim.log # Port A driver
grep "\[PORT_B_MON\]" sim.log # Port B monitor
grep "\[router_scoreboard\]" sim.log # Scoreboard summarygrep "@ 0:" sim.log # Events at time 0
grep "@ 145000" sim.log # Events at specific time
grep -E "@ [0-9]+00:" sim.log # Events at round numbersgrep -E "sent|received" sim.log # Track transactions
grep -E "MATCH|MISMATCH" sim.log # Scoreboard comparisons
grep "Driving" sim.log # Driver activity
grep "Observed" sim.log # Monitor activitygrep "uvm_test_top.m_env" sim.log # All env messages
grep "m_port_a_agent" sim.log # Port A agent messages
grep "m_scoreboard" sim.log # Scoreboard messagesgrep "phase" sim.log # Phase transitions
grep "raise_objection\|drop_objection" sim.log # Objections
grep "TEST_DONE" sim.log # Test completion# Errors with context (3 lines before/after)
grep -B3 -A3 "UVM_ERROR" sim.log
# Scoreboard activity in time order
grep -E "\[SB\].*@" sim.log | sort -t@ -k2 -n
# Find mismatches and their context
grep -B5 "MISMATCH" sim.log
# All activity at end of simulation
tail -50 sim.log | grep -E "UVM_ERROR|UVM_INFO.*scoreboard"Run with different verbosity to see more/less detail:
./simv +UVM_VERBOSITY=UVM_NONE # Errors/fatals only
./simv +UVM_VERBOSITY=UVM_LOW # + low priority info
./simv +UVM_VERBOSITY=UVM_MEDIUM # + medium priority info (recommended for debug)
./simv +UVM_VERBOSITY=UVM_HIGH # + high priority info
./simv +UVM_VERBOSITY=UVM_FULL # EverythingUVM_INFO file.svh(42) @ 1000: uvm_test_top.m_env.agent [MSG_ID] Message text
^^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^
| | | |
File:Line Time Component hierarchy Message tag