diff --git a/docs/guide/connecting.rst b/docs/guide/connecting.rst index 49fdc4f79..119fa850e 100644 --- a/docs/guide/connecting.rst +++ b/docs/guide/connecting.rst @@ -257,7 +257,9 @@ with respect to that top level module, then the scope could be set with #include "svdpi.h" ... - svSetScope(svGetScopeFromName("TOP.dut")); + const svScope scope = svGetScopeFromName("TOP.dut"); + assert(scope); // Check for nullptr if scope not found + svSetScope(scope); (Remember that Verilator adds a "TOP" to the top of the module hierarchy.)