# Very Odd build\_phase Problem

**URL:** <https://verificationacademy.com/forums/t/very-odd-build-phase-problem/48731>\
**Category:** UVM\
**Created:** [October 16, 2024, 11:27am UTC](https://verificationacademy.com/forums/t/very-odd-build-phase-problem/48731 "2024-10-16T11:27:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlanier1](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/58f4c7/32.png) [@rlanier1](https://verificationacademy.com/forums/u/rlanier1)\
**Post date:** [October 16, 2024, 11:27am UTC](https://verificationacademy.com/forums/t/very-odd-build-phase-problem/48731/1 "2024-10-16T11:27:41Z")

</div>

This is a general question about Agent and Monitor build\_phase.

While building and connecting a UVM verification environment, I am seeing a very odd problem. In the Agent, if I do not create the monitor _twice_ then I will get an error during the build\_phase:

```auto
# ** Fatal: (SIGSEGV) Bad handle or reference.

```

Without the second create command for the monitor, the build\_phase for the Monitor will not show up in the logs.

Are there any methods I can use to more thoroughly debug this problem?

---

<div class="post-metadata">

**Author:** ![rlanier1](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/58f4c7/32.png) [@rlanier1](https://verificationacademy.com/forums/u/rlanier1)\
**Post date:** [October 16, 2024, 2:19pm UTC](https://verificationacademy.com/forums/t/very-odd-build-phase-problem/48731/2 "2024-10-16T14:19:02Z")

</div>

**Create command for monitor in agent:**

my\_mon = my\_monitor::type\_id::create(“my\_mon”, **this** );

**Log file with one create command for the monitor:**

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1124) @ 0: reporter [PH/TRC/STRT] Phase ‘common’ (id=27) Starting phase_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1381) @ 0: reporter [PH/TRC/DONE] Phase ‘common’ (id=27) Completed phase_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1403) @ 0: reporter [PH/TRC/SCHEDULED] Phase ‘common.build’ (id=45) Scheduled from phase common_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1124) @ 0: reporter [PH/TRC/STRT] Phase ‘common.build’ (id=45) Starting phase_

_UVM\_INFO /home/agent/my\_agent.sv(47) @ 0: uvm\_test\_top.my\_env\_i.my\_agent\_i [DEBUG] MY AGENT Starting my\_agent build\_phase_

_UVM\_INFO /home/agent/my\_agent.sv(71) @ 0: uvm\_test\_top.my\_env\_i.my\_agent\_i [DEBUG] MY AGENT Starting my\_agent build\_phase complete_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1499) @ 0: reporter [PH/TRC/WAIT\_PRED\_OF\_SUCC] Phase ‘common.build’ (id=45) \*\*\* No pred to succ other than myself, so ending phase_\*\*\*

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1356) @ 0: reporter [PH\_END] Phase ‘common.build’ (id=45) ENDING PHASE_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1381) @ 0: reporter [PH/TRC/DONE] Phase ‘common.build’ (id=45) Completed phase_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1403) @ 0: reporter [PH/TRC/SCHEDULED] Phase ‘common.connect’ (id=57) Scheduled from phase common.build_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1124) @ 0: reporter [PH/TRC/STRT] Phase ‘common.connect’ (id=57) Starting phase_

**Log file with two create commands for the monitor:**

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1124) @ 0: reporter [PH/TRC/STRT] Phase ‘common’ (id=27) Starting phase_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1381) @ 0: reporter [PH/TRC/DONE] Phase ‘common’ (id=27) Completed phase_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1403) @ 0: reporter [PH/TRC/SCHEDULED] Phase ‘common.build’ (id=45) Scheduled from phase common_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1124) @ 0: reporter [PH/TRC/STRT] Phase ‘common.build’ (id=45) Starting phase_

_UVM\_INFO /home/agent/my\_agent.sv(47) @ 0: uvm\_test\_top.my\_env\_i.my\_agent\_i [DEBUG] MY AGENT Starting my\_agent build\_phase_

_UVM\_INFO /home/agent/my\_agent.sv(72) @ 0: uvm\_test\_top.my\_env\_i.my\_agent\_i [DEBUG] MY AGENT Starting my\_agent build\_phase complete_

_UVM\_INFO /home/agent/my\_monitor.sv(48) @ 0: uvm\_test\_top.my\_env\_i.my\_agent\_i.my\_mon [DEBUG] MY MONITOR my\_monitor build\_phase started_

_UVM\_INFO /home/agent/my\_monitor.sv(64) @ 0: uvm\_test\_top.my\_env\_i.my\_agent\_i.my\_mon [DEBUG] MY MONITOR my\_monitor build\_phase complete_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1499) @ 0: reporter [PH/TRC/WAIT\_PRED\_OF\_SUCC] Phase ‘common.build’ (id=45) \*\*\* No pred to succ other than myself, so ending phase_\*\*\*

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1356) @ 0: reporter [PH\_END] Phase ‘common.build’ (id=45) ENDING PHASE_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1381) @ 0: reporter [PH/TRC/DONE] Phase ‘common.build’ (id=45) Completed phase_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1403) @ 0: reporter [PH/TRC/SCHEDULED] Phase ‘common.connect’ (id=57) Scheduled from phase common.build_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1124) @ 0: reporter [PH/TRC/STRT] Phase ‘common.connect’ (id=57) Starting phase_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1499) @ 0: reporter [PH/TRC/WAIT\_PRED\_OF\_SUCC] Phase ‘common.connect’ (id=57) \*\*\* No pred to succ other than myself, so ending phase_\*\*\*

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1356) @ 0: reporter [PH\_END] Phase ‘common.connect’ (id=57) ENDING PHASE_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1381) @ 0: reporter [PH/TRC/DONE] Phase ‘common.connect’ (id=57) Completed phase_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1403) @ 0: reporter [PH/TRC/SCHEDULED] Phase ‘common.end\_of\_elaboration’ (id=69) Scheduled from phase common.connect_

_UVM\_INFO verilog\_src/uvm-1.1d/src/base/uvm\_phase.svh(1124) @ 0: reporter [PH/TRC/STRT] Phase ‘common.end\_of\_elaboration’ (id=69) Starting phase_

---

<div class="post-metadata">

**Author:** ![cgales](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/c/ccd318/32.png) [@cgales](https://verificationacademy.com/forums/u/cgales)\
**Post date:** [October 16, 2024, 2:33pm UTC](https://verificationacademy.com/forums/t/very-odd-build-phase-problem/48731/3 "2024-10-16T14:33:12Z")

</div>

You will likely need to post code which demonstrates your issues, as it is difficult to debug something without knowing what you are doing.

Do you need to call create() twice in a row? Or is there other code in between calls that may clear your handle? Is there code in your environment which alters the agent behavior?

---

<div class="post-metadata">

**Author:** ![rlanier1](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/58f4c7/32.png) [@rlanier1](https://verificationacademy.com/forums/u/rlanier1)\
**Post date:** [October 16, 2024, 6:43pm UTC](https://verificationacademy.com/forums/t/very-odd-build-phase-problem/48731/4 "2024-10-16T18:43:55Z")

</div>

Yes, I needed to call create() twice. In all of the UVM projects I have worked on, I’ve never had to do this before, and it is limited to the monitor.

Once I get more time, I will post code to this thread. For now, I wanted to reach out to the community and see if anyone has experienced this before.

---

<div class="post-metadata">

**Author:** ![rlanier1](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/58f4c7/32.png) [@rlanier1](https://verificationacademy.com/forums/u/rlanier1)\
**Post date:** [November 4, 2024, 1:57pm UTC](https://verificationacademy.com/forums/t/very-odd-build-phase-problem/48731/5 "2024-11-04T13:57:29Z")

</div>

I was able to resolve the issue the created the odd build\_phase problem. There was a missing “;” in the code on the line preceding the create() command for the monitor. It was only after a routine code inspection that the missing “;” was found.

Another tool used to find the problem was the testbench topology. Without the second create() command, the monitor was not seen in topology report. A good linting tool would also help.

The most disturbing problem is the compiler did not flag this is an error and was the simulation was allowed to proceed forward.

Hopefully this information will be helpful to any community developers who experience the same problem.
