Dear Sir/Madam,
I am looking at the example code attached at the end of this page.
In the analysis_imp version of the comparator (comparator_ooo_imps.svh), it has the following code
class comparator_ooo_imps #(type T = int, type IDX = int)
......
protected function void proc_data(T txn_data, input bit is_before);
T txn_existing;
IDX idx;
string rs;
q_of_T tmpq;
bit need_to_compare;
idx = txn_data.index_id();
.......
Since type T is unknown during compilation time and the default value for T is “int”. I wonder why we can directly access the member methods/variable inside txn_data without getting a compilation error? Given that during compilation time, we don’t know if txn_data really has member method index_id() inside it.
Thanks in advance for your help!
Hao