-
Notifications
You must be signed in to change notification settings - Fork 792
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
[multitop_dev] Topgen work #25512
Merged
Merged
[multitop_dev] Topgen work #25512
Conversation
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
pamaury
force-pushed
the
multitop_wip2
branch
8 times, most recently
from
December 5, 2024 13:55
9191c9e
to
d9cceaf
Compare
At the moment, topgen simplies serialized the complete topcfg using hjson.dumps() but this poses a few problems. The biggest one is that it is a mix of manual conversion to dict (when calling as_dict() in the various topgen functions) and automatic (when calling _asdict() from hjson.dumps). Furthermore, it turns out that we are missing some fields that probably were never added to _asdict(). This commit introduces a new class (CompleteTopCfg) whose sole purpose is to take the produced Hjson and reconstruct an in-memory topcfg that is *exactly* equivalent (in Pythonic types) to the ones that was dumped. This requires to sometimes reconstruct some classes, sometimes not. Classes that need to be reconstruct get a new method (fromdict) and the CompleteTopCfg does as much automatic deserializing as possible, then some manual fixing. There is also a small tweak to how clock groups are handled: in alert_lpgs, the clock groups are all elements of the clocks.groups but because of the naive serializing, a full copy is made. This commit introduces GroupProxy that behaves like a Group for all purposes but serializes only to the group name. This makes the resulting hjson clearer and the deserialization easier. Since this process is quite fragile, when topgen is running it will actually check that this works by dumping the Hjson, reloading it with the CompleteTopCfg and then checking that the two are equivalent. Signed-off-by: Amaury Pouly <[email protected]>
This functionality was previously implemented in topgen. This commit splits this functinality out of it so that it can be implemented by calling another binary. This will enable running this from bazel instead of generating it with topgen. Signed-off-by: Amaury Pouly <[email protected]>
This is necessary for IPs without DIFs. Signed-off-by: Amaury Pouly <[email protected]>
The template was still using earlgrey types. This requires to pass top information to the generator and templates. Signed-off-by: Amaury Pouly <[email protected]>
There are now several places in the codebase that need to depend on all DIFs. Unfortunately, not every IP has a DIF. This commit introduces a new all_difs cc_library to capture. The list of IPs without DIFs is consolidated in a single place. Signed-off-by: Amaury Pouly <[email protected]>
It is important to properly track those, otherwise Bazel will wrongly cache the output even if the templates change. Signed-off-by: Amaury Pouly <[email protected]>
Signed-off-by: Amaury Pouly <[email protected]>
Signed-off-by: Amaury Pouly <[email protected]>
pamaury
force-pushed
the
multitop_wip2
branch
2 times, most recently
from
December 6, 2024 09:12
11dfa0a
to
e64584a
Compare
Signed-off-by: Amaury Pouly <[email protected]>
Signed-off-by: Amaury Pouly <[email protected]>
Darjeeling does not have the ALERT_EN register. The set_alert_en function will do nothing when asked to enabled and error out if asked to disable (on Darjeeling). Signed-off-by: Amaury Pouly <[email protected]>
Thid DIF exports not function beyond the autogenerated one. It is necessary to have it so that the isr_tstutils and the autogenerated plic tests can compile on Darjeeling. Signed-off-by: Amaury Pouly <[email protected]>
pamaury
force-pushed
the
multitop_wip2
branch
from
December 6, 2024 09:25
e64584a
to
3c1e48c
Compare
pamaury
requested review from
msfschaffner,
cfrantz and
a team
as code owners
December 6, 2024 13:22
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR changes topgen so that it can properly reload the top_X.gen.hjson file which is dumped. By properly reload here we mean reloading the classes and not just the content, so that it can be pass to e.g. TopgenC.
This PR then switch autogen tests to bazel so that they can handle multitop. Several fixes to dependencies and DIFs are necessary to make it work on Darjeeling.