Skip to content

Fix immediate after callbacks not notifying about state change #268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions RELEASENOTES-1.4.docu
Original file line number Diff line number Diff line change
Expand Up @@ -526,4 +526,7 @@
<build-id _6="6287" _7="7012"><add-note> Fixed a bug where overlapping
registers would not be rejected if they were part of a bank within a group
or subdevice.</add-note></build-id>
<build-id _6="next" _7="next"><add-note> Fixed a bug where executed callbacks
posted via immediate after statements would not trigger the device state
change notifier.</add-note></build-id>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

state-change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not according to a releasenote in RELEASENOTES-1.2:

Added the --state-change-dml12 flag, allowing the use of an incomplete version of state change notifiers in DML 1.2 devices .

</rn>
1 change: 1 addition & 0 deletions py/dml/c_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,7 @@ def generate_immediate_after_callbacks(device):
indices_lit = 'indices' if info.dimensions else None
args_lit = 'args' if info.args_type else None
info.generate_callback_call(indices_lit, args_lit)
output_dml_state_change('_dev')
out('}\n\n', preindent = -1)
splitting_point()

Expand Down
10 changes: 10 additions & 0 deletions test/1.4/misc/T_notify_state.dml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ attribute ev is write_only_attr {
}
}

attribute immediate_after is write_only_attr {
param type = "n";
method event() {
log info, 1: "Immediate after triggered";
}
method set(attr_value_t val) throws default {
after: event();
}
}

implement signal {
method signal_raise() {
log info, 1: "Interface method called";
Expand Down
8 changes: 8 additions & 0 deletions test/1.4/misc/T_notify_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@
SIM_notify(obj, SIM_notifier_type("statically-exported-entry"))

stest.expect_equal(obj.count, 7)

obj.immediate_after = None

stest.expect_equal(obj.count, 8)

SIM_process_pending_work()

stest.expect_equal(obj.count, 9)