-
Notifications
You must be signed in to change notification settings - Fork 46
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 --deprecate option for proxy ports and interfaces #209
Merged
mandolaerik
merged 20 commits into
intel:main
from
mandolaerik:pr/add-deprecate-option-for-proxy-ports-and-interfaces
Oct 11, 2023
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
56e5f72
Remove --illegal-attrs flag
mandolaerik df6f8da
Add --deprecate=PORT_PROXY_IFACES
mandolaerik 11c44c0
Add PORT_PROXY_ATTRS deprecation
mandolaerik 4313dcb
Add documentation for --deprecation
mandolaerik 18ad914
Convert --strict-dml12 to three deprecation tags
mandolaerik 2a90ee1
Use integers to represent API versions
mandolaerik 7ff5957
Change --deprecate to --no-compat
mandolaerik 82499b0
Refactor: represent API versions with a dedicated class
mandolaerik 6ed6910
Validate that dml-builtins declares all autoparams
mandolaerik 4c0c05e
Use compat system for --strict-int
mandolaerik 2dad430
Use compat to control the default of use_io_memory param
mandolaerik 20336a6
Use compat system for the obj param of ports/banks
mandolaerik d2867f0
Repair odd ICE
mandolaerik 782a81f
Avoid errors on `typeof $this` in arrays of registers or fields
mandolaerik d06d43e
Avoid overflow with --no-compat=dml12_int
mandolaerik 91e2424
Add rudimentary tests for help flags
mandolaerik ae88ac5
Add release note for --no-compat flag
mandolaerik bc55035
Avoid incorrect ENAMECOLL with dml12_misc
mandolaerik 18febee
Extract goto to a separate compat feature
mandolaerik 0019327
Temporarily bump last API of port proxy flags to 7
mandolaerik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# © 2023 Intel Corporation | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
import sys | ||
from pathlib import Path | ||
[path_to_dml, header, outfile] = sys.argv[1:] | ||
sys.path.append(path_to_dml) | ||
|
||
from dml import compat | ||
from dml.env import api_versions, default_api_version | ||
|
||
by_version = {} | ||
for feature in compat.features.values(): | ||
if (feature.last_api_version in api_versions() | ||
# don't document features that are unconditionally disabled in | ||
# this Simics version | ||
or feature.last_api_version > compat.apis[default_api_version()]): | ||
by_version.setdefault(feature.last_api_version, []).append(feature) | ||
|
||
with open(outfile, 'w') as f: | ||
f.write(Path(header).read_text()) | ||
for (ver, features) in sorted(by_version.items()): | ||
f.write( | ||
f"### Features available up to --simics-api={ver.str}\n") | ||
f.write("<dl>\n") | ||
for feature in sorted(compat.features.values(), key=lambda f: f.tag()): | ||
assert feature.__doc__ | ||
f.write(f" <dt>{feature.tag()}</dt>\n") | ||
doc = '\n'.join(line[4:] if line.startswith(' ') else line | ||
for line in feature.__doc__.strip().splitlines()) | ||
f.write(f" <dd>\n\n{doc}\n</dd>\n") | ||
f.write("</dl>\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<!-- | ||
© 2023 Intel Corporation | ||
SPDX-License-Identifier: MPL-2.0 | ||
--> | ||
|
||
# Managing deprecated language features | ||
|
||
As the DML language evolves, we sometimes need to change the language in | ||
incompatible ways, which requires DML users to migrate their code. This | ||
appendix describes the mechanisms we provide to make this migration process | ||
smooth for users with large DML code bases. | ||
|
||
In DML, deprecations can come in many forms. Deprecations in the form of | ||
removed or renamed symbols in libraries are rather easy to manage, since they | ||
give clear compile errors that often are straightforward to fix. A slightly | ||
harder type of deprecation is when some language construct or API function | ||
adjusts its semantics; this can make the model behave differently without | ||
signalling error messages. A third kind of deprecation is when DML changes how | ||
compiled models appear in Simics, typically to adjust changes in the Simics | ||
API. Such changes add another dimension because they typically affect the | ||
end-users of the DML models, rather than the authors of the models. Thus, as an | ||
author of a model you may need to synchronize your migration of such features | ||
with your end-users, to ease their transition to a new major version. | ||
|
||
## Deprecation mechanisms | ||
|
||
The simplest deprecation mechanism is Simics API versions: Each deprecated DML | ||
feature is associated with a Simics API version, and each Simics version | ||
supports a number of such API versions. Features reach end-of-life when moving | ||
to a new Simics major version, the features belonging to a previous Simics API | ||
version are dropped. Since Simics is currently the primary distribution channel | ||
for DML, this deprecation scheme is used for DML features as well. | ||
|
||
This scheme allows users with a large code base to smoothly migrate from one | ||
Simics major version, N, to the next, N+1: | ||
* First, while still using version N, make sure all Simics modules are updated | ||
to use API version N. Modules can be migrated one by one. | ||
* Second, update the Simics version to N+1. This should normally have no | ||
effect on DML, but may come with other challenges. | ||
* Third, update modules to API N+1, one by one. Simics version N+1 will always | ||
offers full support for API N, so there is no rush to update, but changing | ||
the API version early makes sure deprecated features are not introduced in | ||
new code. | ||
|
||
In addition to the API version, DML offers some compiler flags for selectively | ||
disabling deprecated features that are normally part of the used API. This has | ||
some uses, in particular: | ||
* During migration to a new API version, disabling one deprecated feature at a | ||
time can allow a smoother, more gradual, migration. | ||
* If a legacy feature is still fully supported in the latest API version, then | ||
it cannot be disabled by selecting an API version, so selectively disabling | ||
it is the only way to turn it off. There are reasons to do this, e.g.: | ||
* Disabling a feature before it is deprecated guarantees that it is not | ||
relied upon in new code, which eases later migration. | ||
* Avoiding a feature that has a newer replacement makes the code base | ||
cleaner and more consistent. | ||
* Some legacy features can also bloat models, by exposing features in a | ||
redundant manner. This can also have a negative impact on performance. | ||
|
||
## Controlling deprecation on the DML command-line | ||
DMLC provides a command-line flag `--api-version` to specify the API version to | ||
be used for a model. When building with the standard Simics build system, this | ||
is controlled by the `SIMICS_API_VERSION` variable in `make`, or the | ||
`SIMICS_API`/`MODULE_SIMICS_API` variable in `CMake`. | ||
|
||
DMLC also provides the <code>--no-compat=_tag_</code> flag, which disables the | ||
feature represented by _`tag`_. The available tags are listed in the next | ||
section. The tag also controls the name of a global boolean parameter that the | ||
DML program may use to check whether the feature is available. The parameter's | ||
name is the tag name preceded by `_compat_`. | ||
|
||
## List of deprecated features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait,
<code>the last word is _italicized_</code>
works? Huh. In the ref manual we use<tt>the last work is <em>italicized</em></tt>
. We should pick one for consistency.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree: I will not remember style at this level of detail so it will cost more than it gives. I can see two cases where markdown style matters: