Fix the connect calls of a two-environment bench so packets reach the consumer and every sent packet reaches the ledger.
Hardware context: Two-environment UVM bench linking a packet source agent to a sink agent. Repair the connect calls that keep a source and a sink environment from exchanging packets.
A source environment and a sink environment sit side by side in link_env. The producer, deep in the source agent, puts each packet into a consumer deep in the sink agent. After each put it also publishes the packet on an analysis port, so the ledger in the sink environment can count what was sent.
The bench compiles, but nothing arrives. The run reports connection errors, the producer sends nothing, and even after the errors are gone the ledger would stay empty without a word.
Two connect lines in the wiring classes are wrong. Fix them. The producer, consumer and ledger are correct and are not part of your code.
Full specification
| Path | From | To |
|---|---|---|
| put (blocking) | src.agent.prod.put_port | snk.agent.cons.put_imp, through src_agent, src_env, link_env, snk_env and snk_agent |
| analysis | src.agent.prod.sent_ap | snk.led.analysis_export, through src_agent, src_env, link_env and snk_env |
Every component keeps its name; the bench reads src.agent.prod, snk.agent.cons and snk.led. Each case is a separate link_env with its own packet count. Connection errors are counted per bench and shown as warnings, so a run with a broken chain still ends normally and reports what it saw.
Examples
Example 1
Three packets- Input
bench0: n_packets = 3
- Output
connection_errors = 0, sent = 3, delivered = 3, ledger = 3, all_in_order = yes
With both chains resolved, the producer puts three packets, the consumer stores 1, 2 and 3, and the ledger records the same three IDs.
Example 2
One packet- Input
bench1: n_packets = 1
- Output
connection_errors = 0, sent = 1, delivered = 1, ledger = 1, all_in_order = yes
The smallest run still needs both chains: one delivery and one ledger entry, and no connection error.
Example 3
Five packets- Input
bench2: n_packets = 5
- Output
connection_errors = 0, sent = 5, delivered = 5, ledger = 5, all_in_order = yes
The counts follow n_packets. A ledger count of zero here would mean the analysis chain stops somewhere without an error.
Constraints and contract
- Change only connect calls. Keep every class, member and instance name.
- Each path must reach its target exactly once, so the ledger sees each packet once.
- A result with zero connection errors and all packets in order on both paths passes.
Hints
Hint 1
Start from the connection errors. Which port or export is named nearest the top of the hierarchy?
Hint 2
Ports climb and cross; exports descend. Read each connect call in the receiving environment and ask which object is the requirer and which the provider.
Hint 3
An analysis port may legally reach nobody. Follow sent_ap from the producer outwards, one level at a time, and find the level that never passes it on.
What this judge verifies: Five real link_env instances are built with your wiring and the trusted producer, consumer and ledger. The checks count connection errors per bench, the packets sent, delivered and recorded by the ledger, and their order.
5 checks on UVM · local server. Run the examples first, then check the full regression. The suite is local and inspectable. A passing result establishes the tested cases, not a proof for all possible inputs.
See all 1 problem on this path