I have a dpi function, which I want to sample when there will be new transaction item available. Is there possible to have a sensitivity list inside task, similar to always block, so when the value of items change it will sample the dpi function.
That should work assuming item_1_input is a class member (not local to the tasks). The only problem is if the value of data does not change between transactions, the dpi_function does not get called. If that is a problem, you could do @(item_1) instead.
In reply to jianfeng.he:
Your understanding of the fork/join is wrong.
Your fork/join has 2 branches,the repeat and the print part. In you case it selects the repeat branch first and executes it.This is a loop with 20 executions. Afterwards it continues with the print part, but nothing chanes there. It rmaons qiete leaves the fork/join.
I believe you want to see a simulation result like this.
In fact, I want to test whether it is feasible to use @ (*) when the sensitive list is a non packaged array, as Dave said. From the experimental results, there are two questions that make me confused.
The two parallel processes (repeat/forever) did not run as expected: the change in the value of arry in line 15 was not captured by the sensitive list in line 19, but it was OK to use the commented line 18.
When using the statement in line 18, the simulation did not report a timeout because of forever, but ended after the repeat process ended
In reply to chr_sue:
I find that the 2nd code is the same as the 1st code. It doesn’t seem to show the behavior that @ (*) can capture changes in non packaged arrays