Skip to content
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

Add support for writing thread-aware device models #269

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lwaern-intel
Copy link
Contributor

Depends on #268

Tests are currently only a skeleton, cribbed from 1.4/misc/notify_state. As such, this is only a draft PR, and the implementation has not been tested for correctness. I've checked generated C and verified lock acquisition and releases are generated as desired, and compiles, but that is only one aspect of the whole implementation.

@AleksandrDanilovIntel can't add you as reviewer for whatever reason, so pinging you instead.

@lwaern-intel lwaern-intel requested a review from mandolaerik April 4, 2024 12:31
@lwaern-intel lwaern-intel marked this pull request as draft April 4, 2024 12:31
@@ -578,6 +594,172 @@ template device {
method destroy() default { }
}

/**
## Device templates
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AleksandrDanilovIntel Here's the documentation

@AleksandrDanilovIntel
Copy link

@jakob-engblom-i Do you have an idea how to test the tread awareness of DML devices?

@lwaern-intel
Copy link
Contributor Author

lwaern-intel commented Apr 4, 2024

@jakob-engblom-i Do you have an idea how to test the tread awareness of DML devices?

Me and Erik have brainstormed some ideas, by abusing thread sleep to ensure the tests being deterministic enough. But really, it shouldn't be any different from tests on mutex implementations (save for the object/target/cell distinctions) so I can always just dig for ideas online.

into the device. This includes interface and attribute implementations,
callbacks of event objects and `after` statements, exported methods,
and method references converted to function pointers (except if the
method is `independent`.)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: more hyperlinks

@@ -1386,6 +1575,10 @@ The `init_as_subobj` inherits the [`init`](#init) and
template init_as_subobj is (connect, init) {
param classname : const char *;
param configuration default "none";
#if (dev.thread_aware) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: document init_as_subobj as incompatible with thread-aware device models.

Copy link
Contributor Author

@lwaern-intel lwaern-intel Apr 4, 2024

Choose a reason for hiding this comment

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

This is because there is no way to prevent the created subobject from being placed in the same, independent thread domain as the device object; which is wrong if the subobject device class is not thread aware. (Well, ok, there is technically one way but it is horribly hacky and I'd consider non-viable.) The Framework team knows about this issue.

lib/1.4/dml-builtins.dml Outdated Show resolved Hide resolved
py/dml/structure.py Outdated Show resolved Hide resolved
@syssimics
Copy link
Contributor

Verification #13220390: fail

lib/1.4/dml-builtins.dml Outdated Show resolved Hide resolved
lib/1.4/dml-builtins.dml Outdated Show resolved Hide resolved
lib/1.4/dml-builtins.dml Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants