How To Set Uvm Verbosity From Command Line

When working with UVM-based verification environments, controlling the amount of log output is essential for efficient debugging and simulation analysis. Too much information can overwhelm you, while too little can hide critical issues. That is why understanding how to set UVM verbosity from command line is an important skill for verification engineers. By adjusting verbosity externally, you can change message visibility without modifying the testbench code, making simulations more flexible and easier to manage.

Understanding UVM Verbosity at a High Level

In UVM, verbosity controls which informational messages are printed during simulation. Every UVM report message has an associated verbosity level, and the simulator compares this level with the current verbosity setting to decide whether the message should be displayed.

Error and fatal messages are always shown, but informational messages depend heavily on verbosity. This mechanism helps engineers focus on relevant output.

Common UVM Verbosity Levels

UVM defines several standard verbosity levels that are used across components and tests. These levels are ordered from least verbose to most verbose.

  • UVM_NONE
  • UVM_LOW
  • UVM_MEDIUM
  • UVM_HIGH
  • UVM_FULL
  • UVM_DEBUG

Each level determines how detailed the simulation output will be.

Why Set UVM Verbosity from Command Line

Setting UVM verbosity from the command line allows you to adjust output without recompiling or editing source files. This is especially useful when running regressions or debugging specific failures.

Different scenarios often require different verbosity levels. A passing test may only need low verbosity, while a failing test might require full or debug-level messages.

Default Verbosity Behavior

If no verbosity is explicitly set, UVM typically defaults to UVM_MEDIUM. This provides a balanced level of output, but it may not always be ideal.

Understanding how to override this default behavior is key to controlling simulation output effectively.

Using the +UVM_VERBOSITY Command Line Option

The most common way to set UVM verbosity from command line is by using the +UVM_VERBOSITY plusarg. This argument is supported by standard UVM simulators.

The general syntax is straightforward and easy to remember.

+UVM_VERBOSITY=UVM_HIGH

This command sets the global verbosity level for the entire simulation.

How the Global Verbosity Setting Works

When you set verbosity globally, all UVM components inherit this verbosity unless they override it locally.

This is useful when you want consistent output across the entire testbench.

Choosing the Right Verbosity Level

Selecting the appropriate verbosity depends on your goal. Lower verbosity is suitable for clean runs, while higher verbosity helps during debugging.

Using UVM_DEBUG can produce a large amount of output, so it should be used carefully.

Setting Verbosity for Specific Components

Sometimes, you only want detailed logs from a specific component rather than the entire environment.

UVM allows component-specific verbosity settings, and some simulators support this through command line options.

Component-Level Control Through Hierarchy

You can target specific components by combining verbosity settings with component paths, depending on simulator capabilities.

This approach helps reduce noise while still providing deep insight where needed.

Using +UVM_SET_VERBOSITY

Another powerful way to control verbosity from the command line is using the +UVM_SET_VERBOSITY argument.

This option allows you to specify component name, verbosity level, and severity.

+UVM_SET_VERBOSITY=uvm_test_top.env.agent,UVM_HIGH,ALL

This sets verbosity for a specific component hierarchy.

Understanding the Parameters

The +UVM_SET_VERBOSITY option usually includes three main elements.

  • Component or hierarchy name
  • Verbosity level
  • Severity or message type

These parameters give you fine-grained control over simulation output.

Differences Between Global and Local Verbosity

Global verbosity affects all components, while local verbosity applies only to selected parts of the testbench.

Local settings typically override global settings for those components.

Using Verbosity in Regression Runs

In regression environments, verbosity is often kept low to reduce log size.

When a test fails, the same test can be rerun with higher verbosity using command line options.

Benefits of Command Line Control in CI Systems

Continuous integration systems benefit greatly from command line verbosity control.

It allows automated scripts to dynamically adjust verbosity based on pass or fail conditions.

Simulator Compatibility Considerations

Most modern simulators support standard UVM plusargs, but there may be slight differences.

Always ensure that your simulator version supports the verbosity options you intend to use.

Common Mistakes When Setting Verbosity

A frequent mistake is misspelling the verbosity level or using an unsupported value.

Another common issue is expecting verbosity changes to affect error or fatal messages.

Understanding What Verbosity Does Not Control

Verbosity does not suppress UVM_ERROR or UVM_FATAL messages.

These messages are always printed to ensure critical issues are visible.

Debugging with High Verbosity

Using UVM_HIGH or UVM_DEBUG can reveal detailed transaction flow, sequence execution, and component interactions.

This level of detail is invaluable when tracking down complex bugs.

Balancing Performance and Output

Higher verbosity levels can slow down simulation and generate very large log files.

It is important to balance the need for information with performance considerations.

Best Practices for Verbosity Management

Start with a moderate verbosity level and increase it only when necessary.

Use component-specific verbosity to limit output to relevant areas.

Documenting Verbosity Usage in Teams

Teams benefit from documenting recommended verbosity settings for common debugging scenarios.

This reduces confusion and speeds up issue resolution.

Combining Verbosity with Other UVM Reporting Controls

Verbosity works alongside severity and report actions.

Together, these features provide a flexible reporting system.

Practical Example Workflow

A typical workflow might involve running tests with UVM_LOW in regressions.

If a failure occurs, the test is rerun with UVM_HIGH or UVM_DEBUG using command line options.

Why Command Line Control Improves Productivity

Being able to change verbosity without code changes saves time and reduces risk.

It allows faster iteration and cleaner testbench design.

Learning how to set UVM verbosity from command line is a valuable skill for anyone working with UVM-based verification environments. It provides flexibility, improves debugging efficiency, and supports scalable regression workflows. By understanding verbosity levels, global and local control options, and best practices, you can tailor simulation output to your exact needs without touching the source code. This approach leads to cleaner logs, faster debugging, and a more productive verification process overall.