A monitor in UVM watches your design and catches problems before they become bugs
A monitor in UVM (Universal Verification Methodology) is a component that observes signals and transactions in your hardware design without changing them. It sits between your testbench and the design under test, collecting data about what actually happened so you can check whether the design behaved correctly. Monitors are passive — they look and record, but never drive signals or alter the design's behavior.
Think of a monitor like a security camera in a store. The camera watches what happens, records it, and sends the footage somewhere for review. It doesn't stop shoplifters or ring up sales — it just captures the facts. In the same way, a UVM monitor captures the facts about your design's behavior so your testbench can decide whether those facts match what you expected.
Key Takeaways
- A monitor observes signals on your design's interface and converts them into transaction objects that your testbench can understand and check.
- Monitors are passive components that never drive signals or change the design's behavior, only record what they see.
- Each monitor typically watches one interface or protocol (like AXI, APB, or a custom bus), and you can have multiple monitors in one testbench.
- The data a monitor collects gets sent to a scoreboard or analysis port, where your testbench compares it against expected behavior.
- Monitors are reusable across different testbenches and projects if you build them to handle the protocol correctly.
How a monitor collects and converts signal data
A monitor watches the raw signals on your design's interface — clock edges, valid signals, data lines, handshake signals, whatever your protocol uses. It waits for meaningful events (like a valid transaction starting) and then samples the signals at the right moments to capture the complete transaction.
Once the monitor has captured all the pieces of a transaction, it packages them into a transaction object — a structured piece of data that your testbench can work with. If you're monitoring an AXI write, for example, the monitor might capture the address, data, write strobes, and burst type, then bundle them into an axi_write_transaction object. This object is much easier for your testbench to check than trying to track individual signal values.
The monitor runs continuously during simulation, watching for transactions and converting them as they happen. It doesn't care whether the transactions came from your driver (the part of the testbench that sends stimulus) or from some other source — it just records what it sees on the interface.
Why monitors are passive and why that matters
A monitor never drives signals. It only reads them. This is crucial because it means a monitor can't accidentally interfere with your design or with other parts of your testbench. If a monitor had the ability to drive signals, you'd have to worry about conflicts — what if the monitor and the driver both tried to set a signal at the same time?
Being passive also means you can add a monitor to an existing testbench without changing how the testbench works. The monitor sits on the side, watching, while your driver and your design continue exactly as before. This makes monitors safe to reuse and safe to add late in your verification work.
The trade-off is that a monitor can only see what's on the interface. If a bug happens inside the design but doesn't show up on the interface signals, the monitor won't catch it directly. That's why monitors usually work together with other verification components — the monitor reports what happened on the interface, and your testbench or scoreboard decides whether it's correct.
Where monitor data goes and how it gets checked
A monitor sends the transactions it collects to an analysis port, which is a broadcast mechanism in UVM. Any component that cares about those transactions can listen to the analysis port and receive a copy. The most common listener is a scoreboard, which compares what the monitor saw against what the testbench expected.
Here's a typical flow: your driver sends a write request to the design. The monitor on the write interface sees the request and converts it to a transaction object. At the same time, the monitor on the read interface watches for the response. Both monitors send their transactions to the scoreboard. The scoreboard checks that the response matches the request — same address, same data, no corruption. If they don't match, the scoreboard flags a failure.
Some testbenches also send the monitor's transactions to a coverage collector, which tracks which combinations of signals and values you've actually tested. This helps you know whether you've exercised all the important paths through your design.
Building a monitor for your protocol
When you write a monitor, you need to know the protocol you're monitoring — the rules about which signals matter, when they're valid, and what order they appear in. For standard protocols like AXI or APB, you can often find pre-built monitors in verification IP libraries. For custom protocols, you write the monitor yourself.
A basic monitor has a few key parts: a clock input (so it knows when to sample), the interface signals it's watching, and an analysis port to send transactions out. The monitor's main job is a loop that runs every clock cycle, checking whether a transaction is starting, sampling the signals if it is, and sending the completed transaction to the analysis port.
The hardest part is usually getting the sampling timing right. You need to sample signals at the moment they're stable and valid, not in the middle of a transition. For synchronous protocols, this usually means sampling on the rising edge of the clock. For protocols with handshake signals, you might need to wait for a "valid" signal to be high before you trust the data.
Multiple monitors and multiple interfaces
Most real designs have more than one interface. A processor might have separate buses for instruction fetch, data read, and data write. A memory controller might monitor both the client-side interface and the DRAM-side interface. You can have one monitor per interface, and they all run in parallel.
Each monitor is independent — one monitor's job is to watch the instruction bus, another watches the data bus. They don't talk to each other. But they both send their transactions to the same scoreboard, so the scoreboard can correlate them. For example, the scoreboard might check that a write on the data bus eventually shows up as a read on the instruction bus, or that the timing between them is correct.
Having multiple monitors also helps you isolate problems. If a test fails, you can look at what each monitor saw and figure out which interface had the wrong behavior. If the instruction monitor saw the right data but the data monitor saw garbage, you know the problem is on the data path, not the instruction path.
Reusing monitors across projects
Once you've written a monitor for a protocol, you can use it in other designs that use the same protocol. If you build your monitor to be generic — parameterized for data width, address width, and other configurable values — it becomes even more reusable.
Many teams build a library of monitors for the protocols they use regularly. A monitor for AXI 4, for example, can be used in any testbench that has an AXI interface, regardless of what the design does. This saves time and reduces bugs, because you're not rewriting the same protocol-watching logic over and over.
The key to reusability is keeping the monitor focused on one job: watching the protocol and converting signals to transactions. Don't put design-specific logic into the monitor. If you need to check whether a transaction is correct, put that logic in the scoreboard, not the monitor. That way the monitor stays clean and portable.
Frequently Asked Questions
Can a monitor drive signals back to the design?
No. A monitor is passive and only reads signals. If you need to send signals to the design, you use a driver, not a monitor. A driver is the active component that stimulates the design; a monitor is the passive component that observes it.
What happens if my monitor samples a signal at the wrong time?
You'll capture incorrect or unstable data. If you sample in the middle of a transition, you might see a value that's neither the old state nor the new state. Always sample at moments when signals are stable — usually on a clock edge for synchronous designs, or after a handshake signal indicates data is valid.
Do I need a separate monitor for each direction of data flow?
Usually yes. If your interface has both requests going in and responses coming back, you typically need one monitor watching the request side and another watching the response side. Each monitor focuses on one direction and one set of signals, which keeps them simple and reusable.
Can a monitor check whether transactions are correct?
A monitor can collect the data, but checking correctness is usually the scoreboard's job. The monitor reports what it saw; the scoreboard decides whether what it saw was right. This separation keeps the monitor simple and reusable across different testbenches with different expectations.
What if the design has a protocol I've never seen before?
You write a custom monitor for that protocol. Study the protocol specification to understand the signal timing and handshake rules, then write a monitor that samples at the right moments and packages the data into transaction objects. Start simple — get the basic transaction capture working, then add complexity if needed.