-
Notifications
You must be signed in to change notification settings - Fork 777
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
[WIP] Multi-top SW #24453
base: master
Are you sure you want to change the base?
[WIP] Multi-top SW #24453
Commits on Sep 30, 2024
-
[bazel,sw] Refactor header generation for IP blocks
Presently, every IP block exports Rust/C headers using rules in `autogen.bzl`. However, this is suboptimal because every time we want to make a change, it needs to be replicated in all IP blocks. Furthermore, IP blocks should not be concerned about how the hjson is used to create register definitions. This commit create a new macro `autogen_hjson_sw_headers` that every IP block must call to create all necessary SW artifacts. This commit introduces no functional change, all bazel targets are still exactly the same as before. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 39c8882 - Browse repository at this point
Copy the full SHA 39c8882View commit details -
[topgen] Add missing dependency in BUILD file
Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 56810c4 - Browse repository at this point
Copy the full SHA 56810c4View commit details -
[topgen] Small code improvement
The source tree location is computed once at the top, make sure that the rest of code uses this location instead of recomputing some path. This makes the code more consistent and understandable. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e67ede3 - Browse repository at this point
Copy the full SHA e67ede3View commit details -
[topgen] Include warning in generated C files
The top-level C library files should include a warning about being generated and how they were generated. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 851caee - Browse repository at this point
Copy the full SHA 851caeeView commit details -
[topgen] Render a list of clocks in top header
This list will be useful for the multi-top support. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0a2aa9d - Browse repository at this point
Copy the full SHA 0a2aa9dView commit details -
[topgen] Autogenerate the BUILD file sw/autogen
Currently, this BUILD file is created manually which is not consistent. With this commit, it is now generated from a template. The generated content is exactly identical to the current one except for the warning message. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 34e31a9 - Browse repository at this point
Copy the full SHA 34e31a9View commit details -
[util] Add new tool to generate devicetables from templates
Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6e59764 - Browse repository at this point
Copy the full SHA 6e59764View commit details -
[bazel,sw] Add DT header generation for IP blocks
All IP blocks now generate a new bazel target for the IP-specific part of the devicetables. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 24cda4d - Browse repository at this point
Copy the full SHA 24cda4dView commit details -
[bazel] Collect all DT library for ealrgrey in a single bazel target
We lack a unified scheme where we put the generated headers (C, rust, DT). Therefore we need a manual target for each tops that lists the DT library for all IP blocks. Maybe this can be autogenerated in the future. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6a63bf7 - Browse repository at this point
Copy the full SHA 6a63bf7View commit details -
[bazel] Add rule to autogenerate the top-specific DT code
This commit introduces a new rule `autogen_dttool` to run the `dttool` and generate the top-specific DT code (dt_api.h, devicetables.c/h). It also introduces a convenience macro `autogen_top_dt` that will run `dttool` and create a necessary libraries to write the devicetables library. There is a small annoyance here due to two details of our current flow: - dttool needs access to all hjson files, not just the generate top configuration, but which hjson files were used is not recorded anywhere so it must be manually provided to the rule - we don't have a standard naming scheme for IP headers so the generate DT definitions are all over the place in hw/ip/<ip>/data, sometimes in /data/autogen, and so on. Therefore the devicetables depends on some manually specified (`dt_ip_deps`) deps. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 566bb76 - Browse repository at this point
Copy the full SHA 566bb76View commit details -
[topgen] Add target in toplevel BUILD file to autogenerate top DT code
In order to run the dttool using bazel, we need not only to provide information about the top but also point to the topgen-generated cfg (top_<name>.gen.hjson) AND the IP block hjson. Unfortunately, this latter information is currently not recorded anywhere but topgen knows it so it can render it in the bazel file. Note that even topgen cannot reliable generate the list of IP DT dependencies without some hacks because of our very inconsistent naming scheme. Therefore we for now point to `//hw/<top>:dt_headers` which is a manually created list. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d0162e1 - Browse repository at this point
Copy the full SHA d0162e1View commit details -
All changes in this commit are autogenerated by running: ``` util/topgen.py -t hw/top_earlgrey/data/top_earlgrey.hjson ``` Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 68b0beb - Browse repository at this point
Copy the full SHA 68b0bebView commit details -
[bazel] Link devicetables in every opentitan binary
Signed-off-by: Amaury Pouly <[email protected]> Co-authored-by: Alexander Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for efaf796 - Browse repository at this point
Copy the full SHA efaf796View commit details -
[make_new_dif] Add support for DT in autogenerated DIF-code
This commit changes the generator as follows: - a new `dif_<ip>_init_from_dt` function to initialize from DT instead of from an IO region - the dif IRQ names and types are now defines/typedefs to the DT types: this ensures compatibility with existing code and an incremental transition Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 647da74 - Browse repository at this point
Copy the full SHA 647da74View commit details -
All changes in this commit are autogenerated by running: ``` util/make_new_dif.py --mode=regen --only=autogen ``` Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fde5716 - Browse repository at this point
Copy the full SHA fde5716View commit details -
[dif] Add devicetable dependency to all DIFs
This is necessary since the autogen part of DIFs now depends on DT. Signed-off-by: Amaury Pouly <[email protected]> Co-authored-by: Alexander Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a1da913 - Browse repository at this point
Copy the full SHA a1da913View commit details -
[rv_plic,dif,unittest] Add some type casts
The DT commit changed the type `dif_rv_plic_irq_id_t` from `uint32_t` to an enumeration. This makes certain implicit casts in the C++ code invalid now. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ab500c5 - Browse repository at this point
Copy the full SHA ab500c5View commit details -
[dif,rv_plic] Make dif_rv_plic_irq_id_t an alias for dt_irq_t
This is for documentation purposes, to make it clear that DT IRQ IDs are PLIC IRQ IDs. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 87d9cff - Browse repository at this point
Copy the full SHA 87d9cffView commit details -
[tests] Fix i2c_target_smbus_arp_test
The compiler is not happy about a missing case for kDtI2cIrqCount which is obviously invalid. Add a default to please the compiler. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9d76c43 - Browse repository at this point
Copy the full SHA 9d76c43View commit details -
[sw] Port aon_timer_irq_test to devicetables
Signed-off-by: Amaury Pouly <[email protected]> Co-authored-by: Alexander Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 240b600 - Browse repository at this point
Copy the full SHA 240b600View commit details -
[sw] Port sysrst_ctrl_outputs_test to device tables
Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 02414f0 - Browse repository at this point
Copy the full SHA 02414f0View commit details -
[bazel] Add a new /hw/top directory to point to the actual top
In the future, we want SW to depend on top elements without knowing which top is it compiled for. The way to achieve this is to introduce a layer of indirection: SW would depend on e.g. //hw/top:something instead of //hw/top_earlgrey:something. Currently, this commit only points everything to earlgrey but more tops can be added in the future and the top selection becomes part of the bazel configuration using a config_setting. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5120fb0 - Browse repository at this point
Copy the full SHA 5120fb0View commit details -
[dif] Make the DIFs point to //hw/top instead of //hw/top_earlgrey
Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1dbd018 - Browse repository at this point
Copy the full SHA 1dbd018View commit details -
Configuration menu - View commit details
-
Copy full SHA for fc8113e - Browse repository at this point
Copy the full SHA fc8113eView commit details -
[topgen] Generate device tests in a top-specific directory
Currently, topgen generates plic_all_irqs_test and alert_test in sw/device/tests/autogen. But this is incompatible with multi-top so change this behaviour to create a one directory per top in sw/device/test/autogen. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 97298e4 - Browse repository at this point
Copy the full SHA 97298e4View commit details -
This commit contains two changes: - regenerate the top using util/topgen.py -t hw/top_earlgrey/data/top_earlgrey.hjson - manually tell git about the moved files Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 47675dd - Browse repository at this point
Copy the full SHA 47675ddView commit details -
[gitignore] Remove ignore lines for english_breakfast
Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f37a75a - Browse repository at this point
Copy the full SHA f37a75aView commit details -
We now treat english_breakfast as a proper top and we check-in the autogenerated files just like earlgrey. All files were generated using util/topgen.py -t hw/top_englishbreakfast/data/top_englishbreakfast.hjson and the new files were checked-in. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6953773 - Browse repository at this point
Copy the full SHA 6953773View commit details -
[english_breakfast] Add BUILD file in data/ for consistency
Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6b2ce51 - Browse repository at this point
Copy the full SHA 6b2ce51View commit details -
[english_breakfast] Create the various top-level BUILD files
Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 149efbb - Browse repository at this point
Copy the full SHA 149efbbView commit details -
[hw/top] Add support for english_breakfast
Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b4177fb - Browse repository at this point
Copy the full SHA b4177fbView commit details -
[dif,pinmux] Add helper function to connect an MIO DT pin/pad.
Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a3e658c - Browse repository at this point
Copy the full SHA a3e658cView commit details -
[test_rom] Make test_rom buildable for english breakfast.
This commit converts just the necessary files to DT to be able to build the test_rom for english breakfast. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4f03305 - Browse repository at this point
Copy the full SHA 4f03305View commit details -
[topgen-fusesoc] Modify how the script handles output
The script previously outputed to a dedicated temporary directory and deletes some files before generating them. Now that we are checking files in, we need to change this behaviour. The script now doesn't remote anything and outputs to hw/<top_name>. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e50e47e - Browse repository at this point
Copy the full SHA e50e47eView commit details -
All files were generated by running: ``` ./util/topgen-fusesoc.py --files-root=. --topname=top_englishbreakfast ``` and checking-in new files. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c012fca - Browse repository at this point
Copy the full SHA c012fcaView commit details -
[hw] Make verilator build work for both earlgrey and englishbreakfast
The two tops do not quite use the same flow, in particular they use different flags to specify the fileset. This requires to tweak the fusesoc rule to make it more general. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f3dff16 - Browse repository at this point
Copy the full SHA f3dff16View commit details -
Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6b0cf3a - Browse repository at this point
Copy the full SHA 6b0cf3aView commit details
Commits on Oct 7, 2024
-
[rom_ctrl,util] Fix scrambling script to handle english breakfast
The script assumes that scrambling is always enabled but in fact there is a setting for that and it is used on english breakfast. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ca5db86 - Browse repository at this point
Copy the full SHA ca5db86View commit details -
[hw/top] Add new config setting to select the top
This setting is not yet wired with the rest of the build system. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 731f908 - Browse repository at this point
Copy the full SHA 731f908View commit details -
[bazel] Set copt and features on RV transition based on top
With the upcoming change to use //hw/top:top to select the top, the per-top copts and feature will not be set on the command-line but instead added when transitioning to build RV targets. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 092a4b6 - Browse repository at this point
Copy the full SHA 092a4b6View commit details -
[english breakfast] Remove //sw/device:is_english_breakfast
All select are now changed to use //hw/top:top Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 13bf78a - Browse repository at this point
Copy the full SHA 13bf78aView commit details -
[verilator] Create verilator exec env aliases in //hw/top
To avoid a massive duplication, and as a first step toward a new exec_env-less system, we will move all exec_env to //hw/top so that they work for all tops. The easiest to change is verilator. For now, only convert the test_rom_test to point to this new env. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5edffc8 - Browse repository at this point
Copy the full SHA 5edffc8View commit details -
[test_framework] Partially port the test framework to the DT
This is enough to be able to run the test_rom_test in verilator Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3655b9e - Browse repository at this point
Copy the full SHA 3655b9eView commit details
Commits on Oct 8, 2024
-
[dttool] Add named constants for specific IP instances
Some IP instances have a name, e.g. sram_ctrl_ret_aon and sram_ctrl_main. In some cases, it is important to refer to a specific instance, e.g. `kDtSramCtrl[<index of the ret_aon>]`. This commit generates names so that one can now do `kDtSramCtrl[kDtIndexSramCtrlRetAon]`. Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9245313 - Browse repository at this point
Copy the full SHA 9245313View commit details -
[ottf] Use named constant to access sram_ctrl_main
Signed-off-by: Amaury Pouly <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 21ab9f5 - Browse repository at this point
Copy the full SHA 21ab9f5View commit details