Skip to content

Commit

Permalink
Refinement of Simplified Generator Proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
ReinhardKeil committed Sep 4, 2023
1 parent c336f00 commit 2dd5e8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions tools/projmgr/docs/Manual/Simplified Generator Proposal.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generator Workflow (Proposal) - Revised 1. Sept 2023
# Generator Workflow (Proposal) - Revised 4. Sept 2023
<!-- markdownlint-disable MD013 -->

- [Generator Workflow (Proposal) - Revised 1. Sept 2023](#generator-workflow-proposal---revised-1-sept-2023)
- [Generator Workflow (Proposal) - Revised 4. Sept 2023](#generator-workflow-proposal---revised-4-sept-2023)
- [User Steps](#user-steps)
- [Generator Interface](#generator-interface)
- [Project Scenarios](#project-scenarios)
Expand Down Expand Up @@ -32,22 +32,22 @@ Typically generators are used to:

## Generator Interface

The diagram below shows how the Generator is integrated into the CMSIS-Build tools. The data flow is exemplified on STM32CubeMX (or just CubeMX). The information about the project is delivered in `*.cbuild-idx.yml` and `<context>.cbuild.yml` files. Using this information provides CubeMX with the project context, such as selected board or device, and CPU mode such as TrustZone disabled/enabled.
The diagram below shows how the Generator is integrated into the CMSIS-Build tools. The data flow is exemplified on STM32CubeMX (or just CubeMX). The information about the project is delivered in `*.cbuild-gen-idx.yml` and `<context>.cbuild-gen.yml` files. This information provides CubeMX with the project context, such as selected board or device, and CPU mode such as TrustZone disabled/enabled.

![Generator Information](./images/Generator-Information.png "Generator Information")

CubeMX generates:
CubeMX/CubeMXBridge generates:

- `*.ioc` CubeMX project file with current project settings
- `*.c/.h` source files, i.e. for interfacing with drivers
- `<context>.cgen.yml` which provides the data for project import into the csolution build process.
- `cgen.yml` which provides the data for project import into the csolution build process.

> **Note:** As CubeMX itself does not have the required interfaces to the csolution project format, there is a utility `CubeMX Bridge` that converts the `*.cbuild*.yml` files into command-line options for CubeMX. It also generates the `<context>.cgen.yml` based on the generator information.
> **Note:** As CubeMX itself does not have the required interfaces to the csolution project format, there is a utility `CubeMX Bridge` that converts the `*.cbuild-gen*.yml` files into command-line options for CubeMX. It also generates the `cgen.yml` based on the information generated by CubeMX.
## Project Scenarios

The following in an analysis of the different project scenarios, again exemplified with STM32CubeMX.
Note that the directory structure can be controlled already using the key [`generators:`](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/main/docs/YML-Input-Format.md#generators). Hence the following is just a proposal for changing default locations.
Note that the directory structure can be controlled already using the key [`generators:`](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/main/docs/YML-Input-Format.md#generators). Hence the following is just a proposal for default locations.

### Single-Core

Expand All @@ -73,12 +73,11 @@ Generator files belong to `csolution.yml` or to a `clayer-idx.yml` file.

> **Notes:**
>
> - New Access Sequences are introduced: $GenID$, $LayerDir()$, $LayerIdxDir()$.
> - For using layers with Multi-Core and TrustZone projects
> - New Access Sequences are introduced: `$GenID$`, `$LayerDir()$`, `$LayerIdxDir()$`.
> - When components with **GenID** are intermixed (some in `*.clayer.yml`, some in `*.cproject.yml`) an error is displayed with the request to use explicit [`generators:`](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/main/docs/YML-Input-Format.md#generators) settings.
```txt
error: <context> requires explicit generator base directory, use key generator:
error: <context> requires explicit generator base directory, use key `generator:`
```

## Global Generator Registry
Expand All @@ -95,7 +94,6 @@ generators:
- generator: CubeMX # potentially with version added by `@` notation
download-url: https://www.st.com/en/development-tools/stm32cubemx.html
exe: ../bin/CubeMX2cgen
build-info: abs # default setting is relative
args:
- arg: <access-sequence>
- arg: <access-sequence>
Expand All @@ -112,8 +110,6 @@ generators:
- generator: Renesas...
```
With `build-info: abs`, it is required for generate absolute paths for the build invocation files. In this case `<context>.cbuild-gen.yml` files are written by csolution prior to calling the generator and passed as file reference to generator via `$G` command line argument. This file follows the `cbuild.yml` schema but contains absolute paths.

## Impact to PDSC files and Packs
The following changes might be implemented in the PDSC files:
Expand Down
Binary file modified tools/projmgr/docs/Manual/images/Generator-Information.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2dd5e8b

Please sign in to comment.