coverify / euvm

Embedded UVM (D Language port of IEEE UVM 1.0)
Apache License 2.0
30 stars 14 forks source link

Segmentation fault in callback remove function. #22

Open ritugoel opened 8 years ago

ritugoel commented 8 years ago

Below given code results in segmentation fault. Result is displayed beneath the code

import esdl; import uvm; class TestBench: RootEntity { uvm_root_entity!(test_root) tb; } class test_root:uvm_root { mixin uvm_component_utils; } class my_catcher: uvm_report_catcher { static int seen = 0; override action_e do_catch() { import std.stdio; writeln("Caught a message...\n"); seen++; return CAUGHT; } } class test: uvm_test {bool pass = 1; my_catcher ctchr ; my_catcher ctchr1 ; my_catcher ctchr2 ; my_catcher ctchr3; mixin uvm_component_utils; this(string name, uvm_component parent = null) {super(name, parent); my_catcher ctchr = new my_catcher; my_catcher ctchr1 = new my_catcher; my_catcher ctchr2 = new my_catcher; my_catcher ctchr3= new my_catcher; } override void run() {import std.stdio; writeln("UVM TEST - WARNING expected since re_registering a default catcher\n"); //add_report_default_catcher(ctchr, UVM_APPEND); uvm_report_cb.add(null,ctchr); uvm_report_cb.add(null,ctchr); writeln("now remove"); uvm_report_cb.remove(null,ctchr); uvm_top.stop_request();} override void report() { import std.stdio; writeln("\ UVM TEST PASSED **\n"); } } void main( string[] argv) { TestBench tb = new TestBench; tb.multiCore(0, 0); tb.elaborate("test", argv); tb.simulate();
} Result:

Starting Phase: BUILD

UVM-1.1d (C) 2007-2013 Mentor Graphics Corporation (C) 2007-2013 Cadence Design Systems, Inc. (C) 2006-2013 Synopsys, Inc. (C) 2011-2013 Cypress Semiconductor Corp.

(C) 2012-2015 Coverify Systems Technology

Starting Phase: CONFIGURE ****** No default timePrecision specified; setting timePrecision to 1.psec ****** No default timeUnit specified; setting timeUnit to 1.nsec Starting Phase: BIND Start of Simulation UVM_INFO @ #0: reporter [RNTST] Running test test (via factory override for test "test.test")... UVM TEST - WARNING expected since re_registering a default catcher

UVMERROR @ #0: reporter [CBUNREG] Null callback object cannot be registered with object () (uvm_report_object) UVMERROR @ #0: reporter [CBUNREG] Null callback object cannot be registered with object () (uvm_report_object) now remove Segmentation fault (core dumped) Kindly resolve this issue. Regards, -Ritu