🧪 UVM Commands – Base Classes
| Topic | Question | Answer |
|---|---|---|
| UVM | Include UVM | `include "uvm_macros.svh" |
| UVM | Import UVM | import uvm_pkg::*; |
| UVM | UVM object | class name extends uvm_object; |
| UVM | UVM component | class name extends uvm_component; |
| UVM | UVM test | class name extends uvm_test; |
| UVM | UVM env | class name extends uvm_env; |
| UVM | UVM agent | class name extends uvm_agent; |
| UVM | UVM driver | class name extends uvm_driver#(trans_type); |
| UVM | UVM monitor | class name extends uvm_monitor; |
| UVM | UVM sequencer | class name extends uvm_sequencer#(trans_type); |
| UVM | UVM sequence | class name extends uvm_sequence#(trans_type); |
| UVM | UVM sequence item | class name extends uvm_sequence_item; |
| UVM | UVM scoreboard | class name extends uvm_scoreboard; |
| UVM | UVM subscriber | class name extends uvm_subscriber#(trans_type); |
🧪 UVM Commands – Factory & Macros
| Topic | Question | Answer |
|---|---|---|
| UVM | Register component | `uvm_component_utils(class_name) |
| UVM | Register object | `uvm_object_utils(class_name) |
| UVM | Utils begin | `uvm_component_utils_begin(name) |
| UVM | Utils end | `uvm_component_utils_end |
| UVM | Field int | `uvm_field_int(field_name, UVM_ALL_ON) |
| UVM | Field object | `uvm_field_object(field_name, UVM_ALL_ON) |
| UVM | Field string | `uvm_field_string(field_name, UVM_ALL_ON) |
| UVM | Field enum | `uvm_field_enum(type, field_name, UVM_ALL_ON) |
| UVM | Field array int | `uvm_field_array_int(field_name, UVM_ALL_ON) |
| UVM | Field sarray int | `uvm_field_sarray_int(field_name, UVM_ALL_ON) |
| UVM | Field queue int | `uvm_field_queue_int(field_name, UVM_ALL_ON) |
| UVM | Field aa int string | `uvm_field_aa_int_string(field_name, UVM_ALL_ON) |
| UVM | Component param utils | `uvm_component_param_utils(class_name#(T)) |
| UVM | Object param utils | `uvm_object_param_utils(class_name#(T)) |
🧪 UVM Commands – Constructor & Phases
| Topic | Question | Answer |
|---|---|---|
| UVM | Component constructor | function new(string name, uvm_component parent); super.new(name, parent); endfunction |
| UVM | Object constructor | function new(string name=""); super.new(name); endfunction |
| UVM | Build phase | function void build_phase(uvm_phase phase); super.build_phase(phase); endfunction |
| UVM | Connect phase | function void connect_phase(uvm_phase phase); super.connect_phase(phase); endfunction |
| UVM | End of elaboration | function void end_of_elaboration_phase(uvm_phase phase); |
| UVM | Start of simulation | function void start_of_simulation_phase(uvm_phase phase); |
| UVM | Run phase | task run_phase(uvm_phase phase); endtask |
| UVM | Pre-reset phase | task pre_reset_phase(uvm_phase phase); endtask |
| UVM | Reset phase | task reset_phase(uvm_phase phase); endtask |
| UVM | Post-reset phase | task post_reset_phase(uvm_phase phase); endtask |
| UVM | Pre-configure phase | task pre_configure_phase(uvm_phase phase); endtask |
| UVM | Configure phase | task configure_phase(uvm_phase phase); endtask |
| UVM | Post-configure phase | task post_configure_phase(uvm_phase phase); endtask |
| UVM | Pre-main phase | task pre_main_phase(uvm_phase phase); endtask |
| UVM | Main phase | task main_phase(uvm_phase phase); endtask |
| UVM | Post-main phase | task post_main_phase(uvm_phase phase); endtask |
| UVM | Pre-shutdown phase | task pre_shutdown_phase(uvm_phase phase); endtask |
| UVM | Shutdown phase | task shutdown_phase(uvm_phase phase); endtask |
| UVM | Post-shutdown phase | task post_shutdown_phase(uvm_phase phase); endtask |
| UVM | Extract phase | function void extract_phase(uvm_phase phase); |
| UVM | Check phase | function void check_phase(uvm_phase phase); |
| UVM | Report phase | function void report_phase(uvm_phase phase); |
| UVM | Final phase | function void final_phase(uvm_phase phase); |
🧪 UVM Commands – Factory & Creation
| Topic | Question | Answer |
|---|---|---|
| UVM | Create object | obj = class_name::type_id::create("obj_name"); |
| UVM | Create component | comp = class_name::type_id::create("name", this); |
| UVM | Set type override | class_name::type_id::set_type_override(override_type::get_type()); |
| UVM | Set inst override | set_inst_override_by_type("inst_name", orig_type::get_type(), override_type::get_type()); |
| UVM | Set override by name | set_type_override_by_name("original", "override"); |
| UVM | Factory print | factory.print(); |
🧪 UVM Commands – Configuration & Resources
| Topic | Question | Answer |
|---|---|---|
| UVM | Config DB set | uvm_config_db#(int)::set(this, "*", "field", value); |
| UVM | Config DB get | if (!uvm_config_db#(int)::get(this, "", "field", value)) |
| UVM | Config DB set object | uvm_config_db#(obj_type)::set(this, "path", "field", obj); |
| UVM | Config DB virtual if | uvm_config_db#(virtual interface_type)::set(null, "*", "vif", vif); |
| UVM | Resource DB set | uvm_resource_db#(int)::set("scope", "name", value); |
| UVM | Resource DB get | uvm_resource_db#(int)::read_by_name("scope", "name", value); |
| UVM | Set config int | set_config_int("*", "field", value); |
| UVM | Set config object | set_config_object("*", "field", obj); |
🧪 UVM Commands – Sequences & Sequencer
| Topic | Question | Answer |
|---|---|---|
| UVM | Body task | task body(); endtask |
| UVM | Start sequence | seq.start(sequencer); |
| UVM | Start on sequencer | seq_name.start(m_sequencer); |
| UVM | Create sequence item | req = trans_type::type_id::create("req"); |
| UVM | Start item | start_item(req); |
| UVM | Finish item | finish_item(req); |
| UVM | Wait for grant | wait_for_grant(); |
| UVM | Send request | send_request(req); |
| UVM | Wait for item done | wait_for_item_done(); |
| UVM | Get response | get_response(rsp); |
| UVM | Get next item | seq_item_port.get_next_item(req); |
| UVM | Item done | seq_item_port.item_done(); |
| UVM | Item done with response | seq_item_port.item_done(rsp); |
| UVM | Put response | seq_item_port.put_response(rsp); |
| UVM | Peek request | seq_item_port.peek(req); |
| UVM | Grab sequencer | grab(); |
| UVM | Ungrab sequencer | ungrab(); |
| UVM | Is grabbed | if (is_grabbed()) |
| UVM | Lock sequencer | lock(sequencer); |
| UVM | Unlock sequencer | unlock(sequencer); |
🧪 UVM Commands – Objections & Phasing
| Topic | Question | Answer |
|---|---|---|
| UVM | Raise objection | phase.raise_objection(this); |
| UVM | Drop objection | phase.drop_objection(this); |
| UVM | Raise with count | phase.raise_objection(this, "description", count); |
| UVM | Drop with count | phase.drop_objection(this, "description", count); |
| UVM | Set drain time | phase.phase_done.set_drain_time(this, 100ns); |
| UVM | Get objection | uvm_objection obj = phase.get_objection(); |
| UVM | All dropped | obj.all_dropped(...); |
🧪 UVM Commands – TLM Ports & Exports
| Topic | Question | Answer |
|---|---|---|
| UVM | Analysis port | uvm_analysis_port#(trans_type) ap; |
| UVM | Analysis export | uvm_analysis_export#(trans_type) ae; |
| UVM | Analysis imp | uvm_analysis_imp#(trans_type, class_type) ai; |
| UVM | Write implementation | function void write(trans_type t); endfunction |
| UVM | Blocking put port | uvm_blocking_put_port#(trans_type) put_port; |
| UVM | Blocking get port | uvm_blocking_get_port#(trans_type) get_port; |
| UVM | Nonblocking put port | uvm_nonblocking_put_port#(trans_type) put_port; |
| UVM | Nonblocking get port | uvm_nonblocking_get_port#(trans_type) get_port; |
| UVM | Put export | uvm_put_export#(trans_type) put_export; |
| UVM | Get export | uvm_get_export#(trans_type) get_export; |
| UVM | TLM FIFO | uvm_tlm_fifo#(trans_type) fifo; |
| UVM | Port connect | port.connect(export); |
| UVM | Analysis write | ap.write(transaction); |
| UVM | Blocking put | put_port.put(item); |
| UVM | Blocking get | get_port.get(item); |
| UVM | Try put | if (put_port.try_put(item)) |
| UVM | Try get | if (get_port.try_get(item)) |
| UVM | Can put | if (put_port.can_put()) |
| UVM | Can get | if (get_port.can_get()) |
🧪 UVM Commands – Reporting & Messages
| Topic | Question | Answer |
|---|---|---|
| UVM | Info message | `uvm_info("TAG", "Message", UVM_LOW) |
| UVM | Warning message | `uvm_warning("TAG", "Warning message") |
| UVM | Error message | `uvm_error("TAG", "Error message") |
| UVM | Fatal message | `uvm_fatal("TAG", "Fatal error") |
| UVM | Info with verbosity | `uvm_info("TAG", $sformatf("Value=%0d", val), UVM_MEDIUM) |
| UVM | Set verbosity | set_report_verbosity_level(UVM_HIGH); |
| UVM | Set hier verbosity | uvm_top.set_report_verbosity_level_hier(UVM_HIGH); |
| UVM | Set severity action | set_report_severity_action(UVM_ERROR, UVM_DISPLAY | UVM_LOG); |
| UVM | Set id action | set_report_id_action("TAG", UVM_DISPLAY); |
| UVM | Set max quit count | set_report_max_quit_count(10); |
| UVM | Report handler | uvm_report_handler handler = get_report_handler(); |
🧪 UVM Commands – Utilities & Misc
| Topic | Question | Answer |
|---|---|---|
| UVM | Run test | run_test("test_name"); |
| UVM | Run test default | run_test(); (uses +UVM_TESTNAME) |
| UVM | Print topology | uvm_top.print_topology(); |
| UVM | Set timeout | uvm_top.set_timeout(1000ns); |
| UVM | Global timeout | uvm_top.set_timeout(1ms, 0); |
| UVM | Get parent | parent = get_parent(); |
| UVM | Get full name | name = get_full_name(); |
| UVM | Get type name | type_name = get_type_name(); |
| UVM | Get name | name = get_name(); |
| UVM | Print object | obj.print(); |
| UVM | Sprint object | string s = obj.sprint(); |
| UVM | Copy object | dest.copy(src); |
| UVM | Compare objects | if (obj1.compare(obj2)) |
| UVM | Clone object | obj2 = obj1.clone(); |
| UVM | Pack | obj.pack(packer); |
| UVM | Unpack | obj.unpack(packer); |
| UVM | Record | obj.record(recorder); |
| UVM | Do pack | function void do_pack(uvm_packer packer); |
| UVM | Do unpack | function void do_unpack(uvm_packer packer); |
| UVM | Do copy | function void do_copy(uvm_object rhs); |
| UVM | Do compare | function bit do_compare(uvm_object rhs, uvm_comparer comparer); |
| UVM | Do print | function void do_print(uvm_printer printer); |
| UVM | Convert2string | function string convert2string(); |
| UVM | Callbacks add | uvm_callbacks#(T, CB)::add(obj, cb); |
| UVM | Callbacks delete | uvm_callbacks#(T, CB)::delete(obj, cb); |
| UVM | Event pool | uvm_event_pool pool = uvm_event_pool::get_global_pool(); |
| UVM | Barrier | uvm_barrier barrier = new("barrier", 3); |
| UVM | Wait for barrier | barrier.wait_for(); |
| UVM | Heartbeat | uvm_heartbeat hb; |
| UVM | Register model | class name extends uvm_reg_block; |
| UVM | Register | class name extends uvm_reg; |
| UVM | Register field | rand uvm_reg_field field_name; |