]> git.nickg.me.uk Git - nvc.git/commit
model: Correct timing of RT_LAST_KNOWN_DELTA_CYCLE
authorSean Anderson <seanga2@gmail.com>
Sat, 20 May 2023 17:55:37 +0000 (13:55 -0400)
committerNick Gasson <nick@nickg.me.uk>
Sun, 21 May 2023 07:22:47 +0000 (07:22 +0000)
commit9bfee0e361df1490e52836d562a82b2e905f56f2
tree570c94d0d3b1bf9481f56d12a4d91dc7f6ad8054
parent1fb01aac3d6fafc441b5c948fdd348d9756630bc
model: Correct timing of RT_LAST_KNOWN_DELTA_CYCLE

According to the spec, vhpiCbLastKnownDeltaCycle callbacks can create
further delta cycles:

> h) If the next simulation cycle will be a delta cycle, the remainder of
> step h) is skipped. Otherwise, the following actions occur in the
> indicated order:
>
>   1. Each registered and enabled `vhpiCbLastKnownDeltaCycle` and
>      `vhpiCbRepLastKnownDeltaCycle` callback is executed. T_n is
>      recalculated according to the rules of 14.7.5.1.
>   2. If the next simulation cycle will be a delta cycle, the remainder
>      of step h) is skipped.
>   3. ...

Fire RT_LAST_KNOWN_DELTA_CYCLE before disabling delta cycles to allow
this to happen.
src/rt/model.c
test/vhpi/vhpi2.c