I have a vendor-supplied BFM module instantiated deep in my hierarchy; let's call the path top.dut.u1.u2.bfm1. The BFM's API is a little archaic and messy for our needs. I would like to write an "object" (class? interface? something else?) that will provide tasks with a simpler calling interface, and can call the tasks of the specific BFM that it has been "linked" with. It's this "linking" that I can't figure out.
I have a simple version defined as a module, that uses a `define to specify the path to the BFM, something along the lines of:
`define BFM top.dut.u1.u2.bfm1
module bfm_wrapper;
...
task read_burst(...);
...
`BFM.read_burst(...);
endtask;
...
endmodule
Obviously this isn't very reusable. How do I replace `BFM with something more portable or abstracted to the next higher level?
I'm a relative newbie with SystemVerilog, and I'm not even using UVM yet, but I'll take the plunge if there's something there that will help. Any help is appreciated.
[Update] A couple of restrictions that I didn't mention:
- I can't change or replace the vendor-supplied BFM. I'd prefer to not even wrap it (i.e., instantiate it in my wrapper).
- For reasons that I don't want to go into here, the BFM needs to be instantiated inside the DUT. Changing that would require more effort than I can invest right now.
bindin this situation. Are you saying to bindbfm_wrapperinto the scope where the BFM is instantiated? If so, what do I put in place of`BFMin the above (pseudo)code? - Jabberwockbindtou2's module or path. In the wrapper, have its own read_burst task that uses "Upwards name referencing" IEEE1800-2012 ยง23.8. The wrapper itself can contain the code to link your auxiliary code to classes, virtual interfaces, uvm_config_db, etc. - Gregbindit tou2, I'm still not sure how to reference the BFM. For the wrapper to be reusable, I can't assume it's calledbfm1. In fact, I don't want to assume that there's only one BFM (e.g., ifu2contains two independent buses). Or did you mean "bind tobfm1"? I'll read up on referencing and see if that would work. - Jabberwock