11 class my_custom_filter_trfm#(type IN = int, type OUT = uvm_sequence_item) extends uvm_component;
12 typedef my_custom_filter_trfm#(IN,OUT) this_type;
14 uvm_analysis_imp#(IN, this_type) analysis_export;
15 uvm_analysis_port#(OUT) ap;
17 `uvm_component_param_utils(my_custom_filter_trfm#(IN, OUT))
19 function new(
string name =
"my_custom_filter_trfm", uvm_component parent = null);
20 super.new(name, parent);
21 this.analysis_export =
new(
"my_analysis_imp",
this);
22 this.ap =
new(
"ap",
this);
26 virtual function void transform(IN t, output OUT items[]);
29 endfunction: transform
32 virtual function void write(IN t);
34 this.transform(t, items);
35 foreach(items[i]) begin
36 this.ap.write(items[i]);
39 endclass: my_custom_filter_trfm
47 typedef my_custom_filter_trfm #(FIN, uvm_sequence_item) tp_ft;
49 `uvm_component_param_utils(my_custom_syoscbs#(FIN))
52 function new(
string name=
"my_custom_syoscbs", uvm_component parent=null);
53 super.new(name, parent);
57 virtual function tp_ft get_filter_trfm(
string queue_name,
62 uvm_component ft_orig;
63 ft_orig = this.get_filter_trfm_base(queue_name, producer_name, idx);
64 if(ft_orig == null) begin
67 if(!$cast(ft, ft_orig)) begin
68 `uvm_fatal(
"TYPECAST",
"Unable to typecast from uvm_component to filter transform type")
72 endfunction: get_filter_trfm
75 function
void build_phase(uvm_phase phase);
76 super.build_phase(phase);
77 foreach (this.scbs[i]) begin
79 this.create_filters(i, tmp_cfg);
81 endfunction: build_phase
84 function
void connect_phase(uvm_phase phase);
85 super.connect_phase(phase);
86 foreach (this.fts[i]) begin
88 this.connect_filters(i, tmp_cfg);
90 endfunction: connect_phase
93 protected function
void create_filter(input
string queue_name,
94 input
string producer_name,
95 input
int unsigned idx);
96 string ft_name = $sformatf("ft_%s_%s[%0d]", queue_name, producer_name, idx);
97 this.fts[idx][queue_name][producer_name] = tp_ft::type_id::create(ft_name, this);
98 endfunction: create_filter
101 protected function
void connect_filter_and_subscriber(input
string queue_name,
102 input
string producer_name,
103 input
int unsigned idx);
108 scb_subscriber = this.scbs[idx].get_subscriber(queue_name, producer_name);
109 ft = this.get_filter_trfm(queue_name, producer_name, idx);
111 ft.ap.connect(scb_subscriber.analysis_export);
112 endfunction: connect_filter_and_subscriber
114 endclass: my_custom_syoscbs
121 cl_tb_tlm_monitor#(cl_tb_seq_item),
122 my_custom_filter_trfm#(cl_tb_seq_item, uvm_sequence_item));
136 function new(
string name =
"cl_scbs_test_io_custom_filter_trfm", uvm_component parent = null);
137 super.new(name, parent);
143 extern function void pre_build();
144 extern task main_phase(uvm_phase phase);
150 function void cl_scbs_test_io_custom_filter_trfm::pre_build();
153 cl_syoscbs_base::type_id::set_type_override(my_custom_syoscbs#(cl_tb_seq_item)::get_type());
154 endfunction: pre_build
156 task cl_scbs_test_io_custom_filter_trfm::main_phase(uvm_phase phase);
158 my_custom_filter_trfm#(cl_tb_seq_item, uvm_sequence_item) mcft;
160 phase.raise_objection(
this);
161 super.main_phase(phase);
163 uc = this.scbs_env.syoscbs.get_filter_trfm_base(
"Q1",
"P1", 0);
164 if(!$cast(mcft, uc)) begin
165 `uvm_fatal(
"TYPECAST",
"uvm_component could not be cast to my_custom_filter_trfm")
166 end else if(mcft.analysis_export.get_name() != "my_analysis_imp") begin
167 `uvm_fatal("TYPECAST", "my_custom_filter_trfm did not have the correct analysis_imp name")
169 phase.drop_objection(this);
SCBs test using a filter transform not inherited from pk_uvm_utils::filter_trfm, to show that all typ...
Base class for all SCBs tests.
Base class for a wrapper around multiple SyoSil Scoreboards.
Generic subscriber for the scoreboard.
Configuration class for the SyoSil UVM scoreboard.