UVM on Verilator: Mapping the Minefield (The Technical Deep Dive)

While our previous posts focused on the strategic "Why," this post addresses the "How." Porting 50+ production-grade UVCs wasn't a matter of simple recompilation. It was an exercise in uncovering the delta between commercial simulator "permissiveness" and the strict reality of the SystemVerilog LRM and the Verilator execution model.

Here are the some of the primary technical roadblocks we mapped and cleared. 

You can learn lot more at our upcoming event on Thursday, get your tickets today: https://buytickets.at/asfigo/2091884 


1. Strict LRM & Parsing Enforcement

Commercial tools have historically been "lazy" with LRM enforcement. Verilator is not. Code that has run for years in proprietary silos often fails immediately here due to:

  • SVA: Basic temporals do work, not complex ones. We have ported AHB, APB and AXI4-Lite SVA IPs to Verilator, so though this sounds very limiting, in reality, it is not that bad!
  • Range Syntax: Not so un-common, but non-compliant packed ranges like [63_0] are flagged.
  • Parameter Strictness: Missing parameter defaults and invalid interface port declarations are no longer "guessed" by the compiler; they require explicit LRM compliance.

2. UVM Versioning & Encapsulation

Verilator is built for the modern era, supporting UVM 1.2 and IEEE 1800-2017. While the bulk of VIPs are being updated, we found that approximately 30% of the codebases we encountered still rely on legacy constructs or "loose" scoping:

  • Legacy/deprecated Constructs: Macros like the uvm_do_on family, and deprecated objects like uvm_test_done or legacy uvm_top shortcuts, do not resolve natively.
  • Access Violations: Illegal direct access to local or protected UVM members is strictly blocked.
  • Phase Management: Implicit behaviors, such as starting_phase being auto-provided (UVM 1.1d), are not supported, leading to local access violations during phase_done.
  • The Migration Path: While AsFigo has developed a temporary compatibility mode (a shim layer) to bridge these gaps, we strongly encourage users to migrate to full IEEE-compliant 1.2+ syntax for long-term stability.

3. Template & Type Resolution

The elaboration engine in Verilator demands absolute type clarity. We encountered several bottlenecks where the resolution of complex types broke down:

  • Recursive Templates: Deeply nested or recursive parameterized classes can lead to resolution failures during elaboration.
  • Typedef Requirements: Missing explicit typedefs often lead to "unknown type" errors, as Verilator requires a clear type map.
  • Virtual Enforcement: A pure virtual method in a class that isn't explicitly declared as a virtual class will trigger a failure—a common relaxed syntax in some tools.

4. The "Final Boss": Scheduling & Phasing

The most difficult issues to root cause weren't syntax-based—they were execution-based.

  • The #0 Support: Relying on #0 to resolve race conditions is a high-risk strategy in Verilator’s optimized execution model.
  • The OBJTN_CLEAR Error: This dreaded UVM phasing/objection error was the most significant hurdle. It required a massive, coordinated effort from the worldwide Verilator R&D team to fix, ensuring that UVM objection clearing and phase transitions synchronize correctly in a compiled model.

The Codified Solution

We didn't just document these errors; we embedded them into the UVMLint and SVALint engines. These tools now serve as the deterministic backbone for our agentic AI flow, ensuring that any code—whether human or AI-generated—is validated against these production-proven constraints.

Coming up next: How we scale this across AWS infrastructure without hitting the "RAM Wall."

You can learn lot more at our upcoming event on Thursday, get your tickets today: https://buytickets.at/asfigo/2091884 


Comments

Popular posts from this blog

Join Us in Cambridge - Advancing Chip Verification with UVMLint & SVALint

SVALint Technical Meetup – Reading, UK

Call for Collaboration: Seeking Public UVM Environments for Verilator 5.0+ Porting