forked from lowRISC/opentitan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[topgen] Add class to load a complete topcfg properly
At the moment, topgen simplies serializes 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. 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]>
- Loading branch information
Showing
9 changed files
with
2,168 additions
and
231 deletions.
There are no files selected for viewing
1,212 changes: 1,072 additions & 140 deletions
1,212
hw/top_darjeeling/data/autogen/top_darjeeling.gen.hjson
Large diffs are not rendered by default.
Oops, something went wrong.
1,015 changes: 925 additions & 90 deletions
1,015
hw/top_earlgrey/data/autogen/top_earlgrey.gen.hjson
Large diffs are not rendered by default.
Oops, something went wrong.
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
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