taichi-ishitani / tvip-axi

AMBA AXI VIP
Apache License 2.0
331 stars 99 forks source link

Another NULL pointer dereference after reset in the middle #35

Closed kazt81 closed 2 years ago

kazt81 commented 2 years ago

The latest version has another NULL pointer dereference as below:

xmsim: *E,TRNULLID: NULL pointer dereference.
          File: /opt/eda/cadence/XCELIUM2103/tools/methodology/UVM/CDNS-1.2/sv/src/base/uvm_transaction.svh, line = 521, pos = 14
         Scope: worklib.uvm_pkg::uvm_transaction::get_event_pool
          Time: 7134 NS + 13
Verilog Stack Trace:
0: function worklib.uvm_pkg::uvm_transaction::get_event_pool at /opt/eda/cadence/XCELIUM2103/tools/methodology/UVM/CDNS-1.2/sv/src/base/uvm_transaction.svh:521
1: function worklib.tue_pkg::tue_sequence_item_base#(uvm_pkg::uvm_sequence_item,tvip_axi_pkg::tvip_axi_configuration,tvip_axi_pkg::tvip_axi_status,tvip_axi_pkg::tvip_axi_configuration,tvip_axi_pkg::tvip_axi_status)::get_event at /path/to/tvip-axi/tue/src/seq/tue_sequence_item_base.svh:41
2: function worklib.tue_pkg::tue_sequence_item_base#(uvm_pkg::uvm_sequence_item,tvip_axi_pkg::tvip_axi_configuration,tvip_axi_pkg::tvip_axi_status,tvip_axi_pkg::tvip_axi_configuration,tvip_axi_pkg::tvip_axi_status)::ended at /path/to/tvip-axi/tue/src/seq/tue_sequence_item_base.svh:51
3: task worklib.tvip_axi_pkg::tvip_axi_slave_driver_start_delay_consumer@13753_2.delay_thread at /path/to/tvip-axi/src/tvip_axi_slave_driver.svh:66
4: process in worklib.tvip_axi_pkg::tvip_axi_slave_driver_start_delay_consumer@13753_2.start_delay_thread.unmblk1 at /path/to/tvip-axi/src/tvip_axi_slave_driver.svh:48
kazt81 commented 2 years ago

I've confirmed if this line is moved after the while loop then this issue isn't observed: https://github.com/taichi-ishitani/tvip-axi/blob/0deaa6f9e28dae65d84de73bf1c23e6709b0883b/src/tvip_axi_slave_driver.svh#L64

taichi-ishitani commented 2 years ago

Hi @kazt81 , Thank you for reporting this error. Can you change tvip_axi_slave_driver.svh: line 66 like below and try again?

if ((item.item != null) && (!item.item.ended())) begin
taichi-ishitani commented 2 years ago

I have also committed the fix for this error. https://github.com/taichi-ishitani/tvip-axi/commit/e2d29ef857fe73a8ec33747ad25e6717951e25ea

kazt81 commented 2 years ago

How about line 71 that seems to require non-NULL checking?

taichi-ishitani commented 2 years ago

How about line 71 that seems to require non-NULL checking?

In this case, delay_queue[id].try_get(item) should return 0 so I think null pointer check is not needed. https://github.com/taichi-ishitani/tvip-axi/blob/0deaa6f9e28dae65d84de73bf1c23e6709b0883b/src/tvip_axi_slave_driver.svh#L70

kazt81 commented 2 years ago

Thanks, I've check there's no issue with the latest commit.

taichi-ishitani commented 2 years ago

Thank you for your checking. I've merged the fix for this error. f79a6f74cef595a501985d9decedfbb69e90eb6b