test: add regression for debug broken-link assert
This commit is contained in:
parent
d5a28e7f8c
commit
7d68400421
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env python3
|
||||
# DESCRIPTION: Verilator: Regression test for min_uaf_repro_real
|
||||
|
||||
import vltest_bootstrap
|
||||
|
||||
test.scenarios('simulator')
|
||||
test.top_filename = "t/t_min_uaf_repro_real.sv"
|
||||
|
||||
test.compile(verilator_flags2=['--binary', '--timing', '--debug'])
|
||||
|
||||
test.execute()
|
||||
|
||||
test.passes()
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
// DESCRIPTION: Regression test for scope/var lifetime issue (debug build)
|
||||
//
|
||||
// This is derived from testcase/min_uaf_repro_real.sv (from issue reproducer).
|
||||
//
|
||||
|
||||
package p;
|
||||
typedef chandle PyObject;
|
||||
|
||||
class uvm_object;
|
||||
endclass
|
||||
|
||||
class py_object;
|
||||
function new(PyObject o);
|
||||
endfunction
|
||||
endclass
|
||||
|
||||
class pyhdl_uvm_object_rgy;
|
||||
static pyhdl_uvm_object_rgy m_inst;
|
||||
|
||||
static function pyhdl_uvm_object_rgy inst();
|
||||
if (m_inst == null) m_inst = new;
|
||||
return m_inst;
|
||||
endfunction
|
||||
|
||||
function PyObject wrap(uvm_object obj);
|
||||
if (obj == null) return null;
|
||||
return null;
|
||||
endfunction
|
||||
endclass
|
||||
|
||||
class comp_proxy;
|
||||
virtual function PyObject get_config_object(string name, bit clone = 0);
|
||||
uvm_object obj;
|
||||
py_object py_obj;
|
||||
bit has = 0;
|
||||
|
||||
if (has && obj != null) begin
|
||||
py_obj = new(pyhdl_uvm_object_rgy::inst().wrap(obj));
|
||||
end
|
||||
|
||||
return null;
|
||||
endfunction
|
||||
endclass
|
||||
endpackage
|
||||
|
||||
module t;
|
||||
import p::*;
|
||||
|
||||
initial begin
|
||||
comp_proxy cp = new;
|
||||
void'(cp.get_config_object("x"));
|
||||
$finish;
|
||||
end
|
||||
endmodule
|
||||
Loading…
Reference in New Issue