Autogen Framework#
The Autogen framework generates NVIDIA DriveOS™ platform configuration artifacts from Autogen input data. The default Autogen flow uses manifest-selected CUE inputs to update GPIO ownership in PCT data and regenerate PCT output artifacts.
For NVIDIA DriveOS developers, Autogen provides a single framework that runs a configured sequence of plugins. Each plugin receives only the data it requests, updates shared framework data, and passes the result to the next plugin in the pipeline. This topic documents the default GPIO-focused pipeline.
Autogen is useful for the following tasks:
GPIO ownership updates – Apply GPIO ownership assignments to the PCT dictionary.
PCT generation – Generate
pct.binand PCT source artifacts from the updated PCT dictionary.Manifest-based input selection – Select Autogen input CUE files through the internal and customer manifests, then export the selected CUE data to YAML during the
bind_partitionsflow.Configuration generation – Generate input YAML interactively, or consume YAML exported from CUE platform configuration data.
Runing Autogen During bind_partitions#
To invoke Autogen as part of the bind_partitions flow, pass -a with the
normal board and operating-system arguments:
$ bind_partitions -b <board_name> <os> -a
For example:
$ bind_partitions -b p3960-10-sw03 linux -a
When Autogen is invoked through bind_partitions, the build exports the
configured Autogen CUE inputs to YAML and runs the framework against the PCT
output directory for the selected platform. The CUE inputs are selected through
the internal and customer manifests. For details, see
Using Autogen Input CUE Files from a Customer Manifest.
Using Autogen Input CUE Files from a Customer Manifest#
For customer platforms, create the required Autogen input .cue files under
the customer configuration tree, then list those files in the customer manifest
under autogen.paths.
The default customer manifest is:
drive-foundation/platform-config/hardware/nvidia/platform/t264/automotive/automotive-platform-configs/driveos_customer_config/nv_platforms/nv_platforms_manifest.cue
The build also reads the internal manifest:
drive-foundation/platform-config/hardware/nvidia/platform/t264/automotive/automotive-platform-configs/driveos_internal_config/driveos_internal_manifest.cue
The internal manifest provides the NVIDIA-shipped GPIO CUE file selection. Use it as a reference when adding customer Autogen inputs.
The autogen.paths structure is selected by AUTO_DOMAIN, PCT, and
BOARD_FLAVOR. For example, the internal manifest selects the base Autogen
input file and a board-specific GPIO CUE file for P3960-10 Linux builds:
autogen: {
paths: drive_av: {
linux: {
"p3960-10.*": [
"<DRIVE_OS_INTERNAL_CONFIG_PATH>/autogen/autogen_inputs.cue",
"<DRIVE_OS_INTERNAL_CONFIG_PATH>/autogen/gpio/drive_av/linux/p3960-10-gpio.cue",
]
}
}
}
For a customer platform, add a matching entry to the customer manifest and point it to the customer CUE files. The following example keeps the base internal Autogen input and adds a customer GPIO CUE file:
autogen: {
paths: drive_av: {
linux: {
"p3960-10.*": [
"<DRIVE_OS_INTERNAL_CONFIG_PATH>/autogen/autogen_inputs.cue",
"<DRIVE_OS_CUSTOMER_CONFIG_PATH>/nv_platforms/common/autogen/gpio/my-p3960-10-gpio.cue",
]
}
}
}
If your build uses an alternate customer manifest, pass or set that manifest
through the build flow that defines CUSTOMER_MANIFEST. The Autogen resolver
merges the internal and customer manifests, then uses the matching
autogen.paths entry for the current AUTO_DOMAIN, PCT, and
BOARD_FLAVOR. When a customer manifest defines the same domain, PCT, and
board-regex key as the internal manifest, the customer entry replaces that file
list. Include all CUE files required for the run, including the base internal
Autogen input file if it is still required.
When bind_partitions -a runs, the build resolves the matching manifest
entry, exports the listed CUE files to YAML, and passes the generated YAML to
the Autogen framework. Use the GPIO reference file to identify valid GPIO banks
and pins when creating customer GPIO inputs:
drive-foundation/platform-config/hardware/nvidia/platform/t264/automotive/automotive-platform-configs/driveos_internal_config/autogen/gpio_reference_t26x.txt
Standalone Autogen Run#
Autogen can also be run directly from the framework entry point when the PCT output directory and input YAML file already exist:
$ python3 $NV_WORKSPACE/drive-foundation/tools/autogen/framework/framework.py \
--libpct_path <pct-output-dir> \
--outdir_path <pct-output-dir> \
--arch <architecture> \
--input_yaml_path <autogen-inputs.yaml>
The --libpct_path directory must contain the generated libpct Python
package and dtb_filenames.json file produced by the PCT build.
Standalone framework runs consume YAML through --input_yaml_path. The
manifest-based CUE selection and CUE-to-YAML export are handled automatically
only when Autogen is invoked through bind_partitions -a.
CLI Reference#
Argument |
Description |
|---|---|
|
Path to the PCT output directory that contains |
|
Output directory where Autogen writes generated PCT artifacts. In the
build flow, this is the same PCT output directory passed to
|
|
Platform architecture, such as |
|
Path to the Autogen input YAML file. |
|
Optional plugin list. If omitted, Autogen uses the bundled
|
|
Set to |
|
UI mode for interactive runs. One of |
|
Port for the interactive web UI. The default is |
Input YAML Reference#
The input YAML is validated before plugin execution. In the default pipeline,
the active modifier consumes the gpio_mappings section:
Section |
Description |
|---|---|
|
GPIO ownership assignments keyed by guest VM. Each entry identifies the GPIO socket, bank, and pin. |
The input YAML used by bind_partitions -a is exported from the CUE files
selected by the manifests. For direct framework runs, provide the already
exported YAML file with --input_yaml_path.
Plugin Pipeline#
Autogen runs plugins in the order defined by the active plugin YAML file. The
bundled default plugins.yaml enables the GPIO-focused PCT pipeline. The
active GPIO plugin is:
Stage |
Plugin |
Purpose |
|---|---|---|
Modifier |
|
Applies |
Additional plugins may exist in the framework source tree, but they do not run unless they are listed in the active plugin YAML file.
Generated Output#
Autogen writes output according to the generators enabled in the active plugin YAML file. In the default pipeline, the enabled PCT generator writes:
Output |
Description |
|---|---|
|
Generated PCT binary written to the output directory. If an existing
|
|
Directory containing generated PCT source artifacts and
|
Limitations#
The available output depends on the plugin YAML used for the run. A plugin that is not listed in the active plugin YAML does not run, even if its input section exists in the YAML file.
Direct framework runs require a valid PCT output directory. Running
framework.pywithout generatedlibpctfiles ordtb_filenames.jsonwill fail.