system verilog - Getting the hierarchical scope from where a function was called -
when calling function, possible function hierarchical scope of location called?
let me give example. have following code:
package some_pkg; function void some_function(); $display("%m"); endfunction endpackage module top; import some_pkg::*; initial some_function(); endmodule
when running it, display "some_pkg::some_function". there way can function display "top"? or if have other sub-module called from, display "top.submodule"?
this going tool specific , requires debugger information dynamically track scopes. modelsim/questa has $stacktrace
display scope , filename/linenumber
Comments
Post a Comment