Jump to content

Fatal: (F4) assertion failed: i >= 0 && i <= j In file: ../../../src/sysc/kernel/sc_simcontext.cpp:1390

Recommended Posts

I am seeing a rare error in my project. We have a model of apb interface in the open source part of the codebase. The code is here: https://bitbucket.org/arch2code/arch2code/src/main/common/systemc/apbBase.h

The code in question is exhibiting a rare error where it is getting stuck. After adding a bunch of debug code, it appears that the requestor(request()) and receiver(reqReceive()) are getting into a situation where they are both waiting on the event from the other, which looks logically impossible. It appears that the event is triggered but not seen by the waiting thread

Debug version: https://bitbucket.org/arch2code/arch2code/src/1c8ed748ff8543441e18cc9bc29e1a7adf237649/common/systemc/apbBase.h?at=feature%2FA2C-253-apb-bus-instability removed the writes ability to post and loop and now the failure has transformed into the 

Fatal: (F4) assertion failed: i >= 0 && i <= j In file: ../../../src/sysc/kernel/sc_simcontext.cpp:1390 error from the title.

Unfortunately I don't have a good test case, it takes anywhere from 10-100 runs before we see the issue

Running systemC 2.3.4

Link to comment
Share on other sites

It looks like we have root-caused it. If event.notify(SC_ZERO_TIME) is called twice in the same delta cycle it can result in failure where the event never happens. The same issue was duplicated in 3.0.0.

This is not an issue in the systemC, it is in our code. The engineer call notify in a separate thread, and did not use threadSafe event.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...