1 typedef class uxp_parent_seq_item;
2 typedef enum {ON, OFF} t_on_off;
14 `uvm_component_utils_begin(cl_scb_test_uvm_xml_printer)
16 `uvm_component_utils_end
21 function new(string name = "cl_scb_test_uvm_xml_printer", uvm_component parent = null);
22 super.new(name, parent);
28 extern task run_phase(uvm_phase phase);
29 extern function void pre_build();
32 function void cl_scb_test_uvm_xml_printer::pre_build();
35 this.syoscb_cfgs.syoscb_cfg[0].set_enable_no_insert_check(0);
36 this.syoscb_cfgs.syoscb_cfg[0].set_disable_report(1'b1);
37 this.syoscb_cfgs.syoscb_cfg[0].set_end_greediness(pk_syoscb::SYOSCB_COMPARE_NOT_GREEDY);
40 this.syoscb_cfgs.syoscb_cfg[0].set_full_scb_dump(1'b1);
41 this.syoscb_cfgs.syoscb_cfg[0].set_full_scb_dump_type(pk_syoscb::XML);
42 void'(this.syoscb_cfgs.syoscb_cfg[0].set_full_scb_dump_split(1'b0));
44 this.syoscb_cfgs.syoscb_cfg[0].set_full_scb_dump_file_name("xml_printer");
45 endfunction: pre_build
47 task cl_scb_test_uvm_xml_printer::run_phase(uvm_phase phase);
48 uxp_parent_seq_item parent;
55 phase.raise_objection(this);
56 super.run_phase(phase);
58 this.scb_env.syoscb[0].compare_control(1'b0);
60 parent = uxp_parent_seq_item::type_id::create("parent");
61 syoscb_item = cl_syoscb_item::type_id::create("syoscb_item");
63 for(int i=1; i<=2; i++) begin
64 if(!parent.randomize()) begin
65 `uvm_fatal("RAND", "Unable to randomize")
67 parent.str = "Hello, world";
68 parent.q.push_back(1*i);
69 parent.q.push_back(2*i);
70 parent.q.push_back(100*i);
73 parent.aa["one"] = 1*i;
74 parent.aa["two"] = 2*i;
75 parent.aa["hundred"] = 100*i;
77 this.scb_env.syoscb[0].add_item("Q1", "P1", parent);
80 if(!parent.randomize()) begin
81 `uvm_fatal("RAND", "Unable to randomize")
84 this.scb_env.syoscb[0].add_item("Q2", "P1", parent.child);
86 phase.drop_objection(this);
90 class cl_scb_test_uvm_xml_printer_break extends cl_scb_test_uvm_xml_printer;
99 `uvm_component_utils_begin(cl_scb_test_uvm_xml_printer_break)
101 `uvm_component_utils_end
106 function new(string name = "cl_scb_test_uvm_xml_printer_break", uvm_component parent = null);
107 super.new(name, parent);
113 extern task run_phase(uvm_phase phase);
115 endclass: cl_scb_test_uvm_xml_printer_break
117 task cl_scb_test_uvm_xml_printer_break::run_phase(uvm_phase phase);
118 uvm_xml_printer xml_printer;
119 uxp_parent_seq_item item;
122 phase.raise_objection(this);
123 uvm_top = uvm_root::get();
124 uvm_top.set_report_severity_id_override(UVM_WARNING, "XML_PRINT", UVM_INFO);
126 super.run_phase(phase);
129 item = uxp_parent_seq_item::type_id::create("item");
131 if(!item.randomize()) begin
132 `uvm_fatal("RAND", "Unable to randomize seq. item")
134 void'(item.sprint(xml_printer));
136 phase.drop_objection(this);
140 class uxp_small_seq_item extends uvm_sequence_item;
144 `uvm_object_utils_begin(uxp_small_seq_item)
145 `uvm_field_int(i, UVM_DEFAULT)
146 `uvm_field_int(by, UVM_DEFAULT)
147 `uvm_object_utils_end
149 function new(string name = "uxp_small_seq_item");
152 endclass: uxp_small_seq_item
154 class uxp_child_seq_item extends uvm_sequence_item;
156 uxp_small_seq_item children[3];
158 `uvm_object_utils_begin(uxp_child_seq_item)
159 `uvm_field_sarray_int(arr, UVM_DEFAULT)
160 `uvm_field_sarray_object(children, UVM_DEFAULT)
161 `uvm_object_utils_end
163 function new(string name = "uxp_child_seq_item");
166 children[0] = new("child0");
168 children[2] = new("child2");
172 endclass: uxp_child_seq_item
174 class uxp_parent_seq_item extends uvm_sequence_item;
182 uxp_child_seq_item child;
184 uxp_child_seq_item null_object;
186 `uvm_object_utils_begin(uxp_parent_seq_item)
187 `uvm_field_int(a, UVM_DEFAULT)
188 `uvm_field_int(b, UVM_DEFAULT)
189 `uvm_field_enum(t_on_off, t, UVM_DEFAULT)
190 `uvm_field_real(r, UVM_DEFAULT)
191 `uvm_field_string(str, UVM_DEFAULT)
192 `uvm_field_queue_int(q, UVM_DEFAULT)
193 `uvm_field_aa_int_string(aa, UVM_DEFAULT)
194 `uvm_field_object(child, UVM_DEFAULT)
195 `uvm_field_array_int(empt, UVM_DEFAULT)
196 `uvm_field_object(null_object, UVM_DEFAULT)
197 `uvm_object_utils_end
199 function new(string name = "uxp_parent_seq_item");
203 function void pre_randomize();
204 this.child = uxp_child_seq_item::type_id::create("child");
205 endfunction: pre_randomize
206 endclass: uxp_parent_seq_item
The UVM scoreboard item which wraps uvm_sequence_item .
An XML printer for cl_syoscb_items.
A test which can be used to generate an XML printout for verifying the uvm_xml_printer.