]> git.nickg.me.uk Git - nvc.git/commit
vhpi: Calculate callback timeout at registration
authorSean Anderson <seanga2@gmail.com>
Sat, 20 May 2023 21:02:19 +0000 (17:02 -0400)
committerNick Gasson <nick@nickg.me.uk>
Sun, 21 May 2023 07:22:47 +0000 (07:22 +0000)
commit8c4d9aba4d343f46e8ad916b93476aa6b57be682
tree83339e8140b48cdfb6fc36b51adda224c4671dab
parenta21a360e8950ef080fa062dcdd3310112a98193f
vhpi: Calculate callback timeout at registration

Callback timeouts must be calculated at registration, not at enabling:

> Disabling a callback simply determines whether or not the callback will
> be triggered when its trigger event occurs. For example, disabling a
> callback that is registered to trigger after a given delay and
> subsequently enabling before expiry of the delay does not postpone the
> time at which the trigger event occurs.

Additionally, any data in cb_data_p that we do not save (such as time)
may not be accessed after we return from registration.
src/vhpi/vhpi-model.c