Howto use `ifdef to check if OVM or UVM is being compiled?

I sometimes deal with models that are in OVM, UVM, or XVM… is there a way to use `ifdef statements to selectively compile certain functions?

I.e.


`ifdef USING_OVM
   //do OVM function calls
`elsif USING_UVM
    // do UVM functions calls
`else
    // try using DPI/VPI methods instead, or other custom SV code
`endif

I know I could probably use VPI to grab the command-line arguments and search if the -ovm flag was used… but VPI calls are run-time, not compile-time.

In reply to ntmccork:
You can ifdef any UVM macro, like uvm_info. Or use any `define like UVM_NAME or even UVM_MACROS_SVH.

This assumes you’ve `include’d the macro package in the first place.