Skip to content

Instantly share code, notes, and snippets.

@taichi-ishitani
Created July 9, 2019 14:46
Show Gist options
  • Save taichi-ishitani/57c398bc5037cf477a653cb938846c39 to your computer and use it in GitHub Desktop.
Save taichi-ishitani/57c398bc5037cf477a653cb938846c39 to your computer and use it in GitHub Desktop.
UVM Bug (uvm_sequence_base::kill)
package test_pkg;
timeunit 1ns;
import uvm_pkg::*;
`include "uvm_macros.svh"
class inner_sequence extends uvm_sequence;
task body();
#(1s);
endtask
task start(
uvm_sequencer_base sequencer,
uvm_sequence_base parent_sequence = null,
int this_priority = -1,
bit call_pre_post = 1
);
super.start(sequencer, parent_sequence, this_priority, call_pre_post);
`uvm_info("INNER", "finished !", UVM_MEDIUM)
endtask
function new(string name = "inner_sequence");
super.new(name);
endfunction
`uvm_object_utils(inner_sequence)
endclass
class outer_sequence extends uvm_sequence;
task body();
inner_sequence inner;
fork
`uvm_do(inner)
join
endtask
task start(
uvm_sequencer_base sequencer,
uvm_sequence_base parent_sequence = null,
int this_priority = -1,
bit call_pre_post = 1
);
super.start(sequencer, parent_sequence, this_priority, call_pre_post);
`uvm_info("OUTER", "finished !", UVM_MEDIUM)
endtask
function new(string name = "outer_sequence");
super.new(name);
endfunction
`uvm_object_utils(outer_sequence)
endclass
class test extends uvm_test;
uvm_sequencer sequencer;
function void build_phase(uvm_phase phase);
super.build_phase(phase);
sequencer = uvm_sequencer#()::type_id::create("sequencer", this);
uvm_config_db #(uvm_object_wrapper)::set(sequencer, "run_phase", "default_sequence", outer_sequence::type_id::get());
endfunction
task main_phase(uvm_phase phase);
phase.raise_objection(this);
#(1us);
phase.drop_objection(this);
endtask
function new(string name = "test", uvm_component parent = null);
super.new(name, parent);
endfunction
`uvm_component_utils(test)
endclass
endpackage
module top;
import uvm_pkg::*;
import test_pkg::*;
initial begin
run_test("test");
end
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment