Resume Based Interview Material
Resume Based Interview Material
VERIFICATION
CRACK YOUR
INTERVIEW WITH
100% CONFIDENCE
Your Complete Experience-Level Guide
By Prasanthi chanda
1.How do you handle multiple virtual sequences running on different
interfaces?
Solution :
SOLUTION APPROACH
We will implement:
Virtual Sequencer: A top-level sequencer that coordinates different
sequencers.
Virtual Sequence: A sequence that controls multiple lower level
sequences.
Test Class: A test that starts the virtual sequence.
IMPLEMENTATION STEPS
Step 1: Define the Virtual Sequencer
The Virtual Sequencer contains handles to all sub-sequencers.
// Instantiate sub-sequences
my_axi_sequence axi_seq;
my_spi_sequence spi_seq;
task body();
// Ensure we have a valid virtual sequencer
if (!$cast(p_sequencer, m_sequencer)) begin
`uvm_fatal("VSEQ", "Virtual Sequencer casting failed!")
end
my_virtual_sequencer vseqr;
axi_agent axi_ag;
spi_agent spi_ag;
vseqr.axi_seqr = axi_ag.sequencer;
vseqr.spi_seqr = spi_ag.sequencer;
endfunction
endclass
Step 5: Define the Test Class
The Test Class starts the virtual sequence.
class my_test extends uvm_test;
`uvm_component_utils(my_test)
my_env env;
my_virtual_sequence vseq;
Solution :
property p_retention_check;
@(posedge clk) disable iff (!rst)
(!power_on && $past(power_on)) |-> (reg_out == $past(reg_out));
endproperty
ASSERT_RETENTION: assert property (p_retention_check);
Solution :
Solution :
property p_axi_addr_decoding;
@(posedge clk) disable iff (!rst)
(awvalid && awready) |-> (awaddr inside {[0x1000:0x2000]});
endproperty
ASSERT_AXI_ADDR_DECODING: assert property (p_axi_addr_decoding);
Check Write Data Integrity Across Transactions
property p_axi_data_integrity;
@(posedge clk) disable iff (!rst)
(wvalid && wready) |-> (wdata == $past(wdata));
endproperty
ASSERT_AXI_DATA_INTEGRITY: assert property (p_axi_data_integrity);
Solution :
For a large SoC, achieving 100% functional coverage is challenging.
Follow these strategies:
1. Identify Coverage Gaps Using UVM Reports
if (uvm_report_server::get_server().get_coverage() < 100)
`uvm_info("COVERAGE", "Coverage is incomplete! Identifying missing
bins...", UVM_MEDIUM)
21. How do you ensure all critical paths in an SoC are covered in
functional verification?
Solution :
Functional coverage should ensure all critical data paths are exercised.
1. Define Coverage for Data Paths
covergroup data_path_cg;
addr: coverpoint transaction.addr;
data: coverpoint transaction.data;
cross addr, data;
endgroup
2. Implement Directed Tests for Uncovered Paths
if (!$is_covered(data_path_cg))
run_directed_test();
22. How do you verify clock domain crossing (CDC) coverage in a multi-
clock SoC?
Solution :
CDC verification requires checking handshake signals and metastability
scenarios.
1. Ensure Data is Captured Correctly in Destination Domain
property p_cdc_stability;
@(posedge dest_clk) disable iff (!rst)
(src_valid) |-> ##[1:5] (dest_valid);
endproperty
ASSERT_CDC_STABILITY: assert property (p_cdc_stability);
2. Use Functional Coverage for CDC Transitions
covergroup cdc_cg;
src_clk: coverpoint source_clk_edge;
dest_clk: coverpoint dest_clk_edge;
cross src_clk, dest_clk;
endgroup
property p_min_delay;
@(posedge clk) disable iff (!rst)
(transaction_valid) |-> ##[5:20] (transaction_complete);
endproperty
ASSERT_MIN_DELAY: assert property (p_min_delay);
property p_cache_coherence;
@(posedge clk) disable iff (!rst)
(cpu1_write && cpu2_write && (cpu1_addr == cpu2_addr)) |-> ##1
error_signal;
endproperty
ASSERT_CACHE_COHERENCE: assert property (p_cache_coherence);
covergroup cache_cg;
cache_line: coverpoint cache_addr;
access_type: coverpoint access_mode;
cross cache_line, access_type;
endgroup
25. How do you verify speculative execution and branch
prediction logic using assertions?
Solution :
Branch prediction and speculative execution require correct state
transitions and rollbacks.
1. Ensure Speculative Execution Is Rolled Back on Mispredict
property p_branch_mispredict;
@(posedge clk) disable iff (!rst)
(branch_predict_taken && !branch_actual_taken) |-> rollback_occurred;
endproperty
ASSERT_BRANCH_MISPREDICT: assert property (p_branch_mispredict);
2. Ensure Prefetched Instructions Are Flushed on Pipeline Stall
property p_pipeline_flush;
@(posedge clk) disable iff (!rst)
(stall_signal) |-> ##1 (instruction_cache_flush);
endproperty
ASSERT_PIPELINE_FLUSH: assert property (p_pipeline_flush);
property p_reorder_check;
@(posedge clk) disable iff (!rst)
(inst_issue && !inst_dependency) |-> ##[1:$] (inst_complete);
endproperty
ASSERT_REORDER_CHECK: assert property (p_reorder_check);
2. Track Speculative Execution and Rollbacks
property p_spec_exec;
@(posedge clk) disable iff (!rst)
(branch_predict_taken && !branch_actual_taken) |-> rollback_occurred;
endproperty
ASSERT_SPEC_EXEC: assert property (p_spec_exec);
28. How do you verify write buffering and forwarding in a
pipeline using assertions?
Solution :
Write buffering allows forwarding values from earlier pipeline stages.
1. Ensure Writes Are Buffered Correctly
property p_write_buffer;
@(posedge clk) disable iff (!rst)
(write_enable && !write_commit) |-> ##[1:$] (write_commit);
endproperty
ASSERT_WRITE_BUFFER: assert property (p_write_buffer);
covergroup concurrency_cg;
write_req: coverpoint axi_write;
read_req: coverpoint axi_read;
cross write_req, read_req;
endgroup
2. Measure Multi-Core Execution Overlap
covergroup multicore_cg;
core_id: coverpoint cpu_core { bins core0 = {0}; bins core1 = {1}; }
instr_exec: coverpoint instr_opcode;
cross core_id, instr_exec;
endgroup
Solution :
Clock gating is used to reduce power consumption but must be verified
to ensure correct operation.
1. Ensure Gated Clock Is Disabled When No Activity
property p_clock_gating;
@(posedge clk) disable iff (!rst)
(!activity_detected) |-> (clk_gated == 1);
endproperty
ASSERT_CLOCK_GATING: assert property (p_clock_gating);
2. Verify Gated Clock Is Re-enabled on Activity Detection
property p_clk_enable;
@(posedge clk) disable iff (!rst)
(activity_detected) |-> ##[1:5] (clk_gated == 0);
endproperty
ASSERT_CLK_ENABLE: assert property (p_clk_enable);
33. How do you verify security access control violations using
assertions?
Solution :
Security access control ensures that unauthorized access attempts trigger
alarms.
1. Detect Unauthorized Access Attempts
property p_security_violation;
@(posedge clk) disable iff (!rst)
(unauthorized_request && !valid_key) |-> security_alert;
endproperty
ASSERT_SECURITY_VIOLATION: assert property (p_security_violation);
2. Check Role-Based Access Control Compliance
property p_role_access;
@(posedge clk) disable iff (!rst)
(user_role inside {ADMIN, USER}) |-> access_granted;
endproperty
ASSERT_ROLE_ACCESS: assert property (p_role_access);
34. How do you verify adaptive voltage scaling (AVS) logic using
assertions?
Solution :
AVS dynamically adjusts the voltage level based on processing demand.
1. Ensure Voltage Scaling Happens Correctly
property p_avs_scaling;
@(posedge clk) disable iff (!rst)
(high_processing_load) |-> ##[1:5] (voltage_level == HIGH);
endproperty
ASSERT_AVS_SCALING: assert property (p_avs_scaling);
2. Ensure Voltage Drops During Idle States
property p_avs_idle;
@(posedge clk) disable iff (!rst)
(!processing_active) |-> ##[5:10] (voltage_level == LOW);
endproperty
ASSERT_AVS_IDLE: assert property (p_avs_idle);
property p_checkpoint_restore;
@(posedge clk) disable iff (!rst)
(rollback_occurred) |-> ##1 (system_state == saved_checkpoint);
endproperty
ASSERT_CHECKPOINT_RESTORE: assert property (p_checkpoint_restore);
36. How do you verify speculative execution security
vulnerabilities (e.g., Spectre, Meltdown) using assertions?
Solution :
Speculative execution vulnerabilities allow unauthorized access to
protected memory regions.
1. Ensure Speculative Execution Does Not Access Protected Memory
property p_spec_exec_protect;
@(posedge clk) disable iff (!rst)
(spec_exec_active && (access_addr inside {[SECURE_REGION]})) |->
security_violation;
endproperty
ASSERT_SPEC_EXEC_PROTECT: assert property (p_spec_exec_protect);
property p_memory_commit;
@(posedge clk) disable iff (!rst)
(memory_access) |-> ##[1:10] memory_commit;
endproperty
ASSERT_MEMORY_COMMIT: assert property (p_memory_commit);
property p_timing_leakage;
@(posedge clk) disable iff (!rst)
(crypto_op_start) |-> ##[10:20] crypto_op_end;
endproperty
ASSERT_TIMING_LEAKAGE: assert property (p_timing_leakage);
39. How do you handle complex sequence randomization in a
UVM testbench for SoC verification?
Solution :
1. Use Layered Sequences for Better Control
class complex_sequence extends uvm_sequence#(transaction);
`uvm_object_utils(complex_sequence)
function new(string name = "complex_sequence");
super.new(name);
endfunction
task body();
transaction t;
repeat(10) begin
t = transaction::type_id::create("t");
start_item(t);
assert(t.randomize() with { addr inside {[0:4096]}; data dist {8'h00
:= 20, 8'hFF := 5, [8'h01:8'hFE] := 75}; });
finish_item(t);
end
endtask
endclass
uvm_factory::get().set_type_override_by_type(base_sequencer::get_type(),
optimized_sequencer::get_type());
uvm_analysis_imp#(transaction, self_checking_scoreboard)
input_analysis_imp;
axi_seq axi_sequence;
pcie_seq pcie_sequence;
uart_seq uart_sequence;
task body();
axi_sequence = axi_seq::type_id::create("axi_sequence");
pcie_sequence = pcie_seq::type_id::create("pcie_sequence");
uart_sequence = uart_seq::type_id::create("uart_sequence");
fork
axi_sequence.start(p_sequencer.axi_sequencer);
pcie_sequence.start(p_sequencer.pcie_sequencer);
uart_sequence.start(p_sequencer.uart_sequencer);
join
endtask
endclass
my_monitor mon;
my_driver drv;
my_sequencer seq;
uvm_active_passive_enum is_active;
task body();
transaction tr;
repeat (5) begin
tr = transaction::type_id::create("tr");
start_item(tr);
assert(tr.randomize());
finish_item(tr);
end
endtask
endclass
covergroup test_mode_cg;
mode: coverpoint test_mode { bins functional = {0}; bins directed =
{1}; }
endgroup
task body();
uvm_status_e status;
bit [31:0] read_data;
reg_model.ctrl_reg.write(status, 32'hA5A5A5A5);
reg_model.ctrl_reg.read(status, read_data);
+91- 9182280927