Skip to main content

Hierarchical Reference

· loading · loading · · ·
HDL Verilog HDL
Axolot Logic
Author
Axolot Logic
Digital Design Engineer
Table of Contents
Verilog HDL Series - This article is part of a series.
Part 17: This Article

🧭 Hierarchical Reference
#

Hierarchical reference allows accessing signals or instances inside submodules. It’s useful in testbenches, force/release operations, or debugging.

✅ Example:
#

top.dut.internal_reg = 8'hA5;  // Accessing signal from testbench
  • top: top-level module
  • dut: instance name of your DUT
  • internal_reg: a signal declared inside dut

force and release — For Simulation Overrides
#

You can override the value of a signal during simulation using force, and restore normal behavior using release.

force top.dut.internal_reg = 8'hFF;  // Override value
#100 release top.dut.internal_reg;   // Return control to simulation

This is useful to:

  • Set internal states in testbenches
  • Simulate fault injection or error recovery
  • Debug hard-to-reach logic

🔧 Use Cases
#

  • Forcing signal values in simulation
  • Observing internal signals not exposed via ports
  • Writing testbenches that interact deeply with module internals

⚠️ Avoid using hierarchical references or force/release in synthesizable code — they break module encapsulation and are not synthesizable.


Verilog HDL Series - This article is part of a series.
Part 17: This Article

Related

Blocking vs Non-Blocking Assignments
· loading · loading
HDL Verilog HDL
Command-Line Input
· loading · loading
HDL Verilog HDL
Namespaces
· loading · loading
HDL Verilog HDL
Task and Function
· loading · loading
HDL Verilog HDL
Verilog Simulation Basics
· loading · loading
HDL Verilog HDL
Compiler Directives & Macros
· loading · loading
HDL Verilog HDL

comments powered by Disqus