This is somewhat old but I wish I could find better ways. I need a scoreboard class that takes in 2 types of transaction via uvm_analysis_imp, and currently the only way of doing it is using `*_decl macro. I'm hoping there is a better way since I'm not sure about the impact of using such macro on other classes. If I understand the class reference correctly, using _decl macro essentially creates a different set of uvm base classes, so if I have 2 scoreboards, both using the same _decl macro with same suffix would there be a conflict? for example:
file:scoreboard1.svh
`uvm_analysis_imp_decl(_rd)
class scoreboard1 extends uvm_scoreboard;
uvm_analysis_imp_rd #(T1,scoreboard1) imp1;
uvm_analysis_imp #(T2,scoreboard1) imp2;
function void write_rd(T1 t); //Have to add _rd due to imp_decl macro
endfunction
function void write(T2 t); //Default method
endclass
-end of file-
file:scoreboard2.svh
`uvm_analysis_imp_decl(_rd)
class scoreboard2 extends uvm_scoreboard;
uvm_analysis_imp #(T1,scoreboard1) imp1;
uvm_analysis_imp_rd #(T2,scoreboard1) imp2;
function void write(T1 t); //Method for T1
endfunction
function void write_rd(T2 t); //Method for T2
endclass
-end of file-
Would this create a conflict at compile time? What is best practice for implementing multiple analysis_imp in a single class?