See the probe example from my DVCon paper:
https://verificationacademy.com/resources/technical-papers/the-missing-link-the-testbench-to-dut-connection