Skip to content

Commit

Permalink
Remove AcConstants.ini (#2496)
Browse files Browse the repository at this point in the history
* Drop AcConstant.ini support

* Update docs to use FPP instead

* Remove AcConstants.ini

* Remove legacy code
  • Loading branch information
thomas-bc authored Feb 1, 2024
1 parent d1f166e commit a3578a0
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 70 deletions.
14 changes: 7 additions & 7 deletions Svc/GenericHub/docs/sdd.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ into the hub which expands the port to the various right-side components.

## Configuration

Generic hub maximum output and input ports are configured using `AcConstants.ini` as shown below. Since hubs work in
Generic hub maximum output and input ports are configured using `AcConstants.fpp` as shown below. Since hubs work in
tandem with another hub, the input ports on the first must match the output ports on the second. Both the number of port
and buffer inputs/outputs may be configured.

```ini
; Hub connections. Connections on all deployments should mirror these settings.
GenericHubInputPorts = 10
GenericHubOutputPorts = 10
GenericHubInputBuffers = 10
GenericHubOutputBuffers = 10
```
@ Hub connections. Connections on all deployments should mirror these settings.
constant GenericHubInputPorts = 10
constant GenericHubOutputPorts = 10
constant GenericHubInputBuffers = 10
constant GenericHubOutputBuffers = 10
```

The above configuration may be used with both deployments hubs as the input/output pairs match.
Expand Down
7 changes: 4 additions & 3 deletions Svc/StaticMemory/docs/sdd.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ expense of extra allocations.

## Configuration

StaticMemory number of allocations and ports are configured using `AcConstants.ini` as shown below. This sets the number
StaticMemory number of allocations and ports are configured using `AcConstants.fpp` as shown below. This sets the number
of allocate and deallocate port indices as well as the memory segments.

```ini
StaticMemoryAllocations = 4
```
@ Number of static memory allocations
constant StaticMemoryAllocations = 4
```

The size of each memory segment is set in `StaticMemoryConfig.hpp` as shown below.
Expand Down
1 change: 0 additions & 1 deletion cmake/autocoder/ai_xml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ macro(__ai_info XML_PATH MODULE_NAME)
# Next parse the output matching one line at a time
read_from_lines("${AI_OUTPUT}" XML_TYPE_FROM_FILE MODULE_DEPENDENCIES FILE_DEPENDENCIES)
endif()
list(APPEND FILE_DEPENDENCIES "${FPRIME_AC_CONSTANTS_FILE}")
endmacro(__ai_info)

####
Expand Down
7 changes: 1 addition & 6 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ endif()
include(CTest)

####
# Locations `FPRIME_FRAMEWORK_PATH`, `FPRIME_PROJECT_ROOT`, `FPRIME_LIBRARY_LOCATIONS`
# `FPRIME_AC_CONSTANTS_FILE`, and `FPRIME_CONFIG_DIR`:
# Locations `FPRIME_FRAMEWORK_PATH`, `FPRIME_PROJECT_ROOT`, `FPRIME_LIBRARY_LOCATIONS`, and `FPRIME_CONFIG_DIR`:
#
# Note: these settings are supplied by `fprime-util` and need not be provided unless running CMake directly or through
# any way bypassing that utility (e.g. inside your beloved IDE).
Expand Down Expand Up @@ -344,10 +343,6 @@ if (NOT DEFINED FPRIME_CONFIG_DIR)
endif()
set(FPRIME_CONFIG_DIR "${FPRIME_CONFIG_DIR}" CACHE PATH "F prime configuration header directory" FORCE)

# Override the AC constants file when specified
if (NOT DEFINED FPRIME_AC_CONSTANTS_FILE)
set(FPRIME_AC_CONSTANTS_FILE "${FPRIME_CONFIG_DIR}/AcConstants.ini" CACHE PATH "F prime AC constants.ini file" FORCE)
endif()

# Set FPRIME_TOOLCHAIN_NAME when not set by toolchain directly
if (NOT DEFINED FPRIME_TOOLCHAIN_NAME)
Expand Down
1 change: 0 additions & 1 deletion cmake/settings/ini-to-stdio.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def print_list_settings(items: List[str]):
"FPRIME_LIBRARY_LOCATIONS", ";".join(str(item) for item in value)
),
"default_cmake_options": lambda value: print_list_settings(value.split("\n")),
"ac_constants": partial(print_setting, "FPRIME_AC_CONSTANTS_FILE"),
# Sets two settings from install dest: fprime and cmake settings
"install_destination": partial(print_setting, "CMAKE_INSTALL_PREFIX"),
}
Expand Down
1 change: 0 additions & 1 deletion cmake/settings/ini.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ set(FPRIME_UTIL_CRITICAL_LIST
"FPRIME_LIBRARY_LOCATIONS"
"FPRIME_PROJECT_ROOT"
"FPRIME_ENVIRONMENT_FILE"
"FPRIME_AC_CONSTANTS_FILE"
"FPRIME_CONFIG_DIR"
"FPRIME_INSTALL_DEST"
)
Expand Down
20 changes: 0 additions & 20 deletions config/AcConstants.ini

This file was deleted.

1 change: 0 additions & 1 deletion docs/UsersGuide/dev/configure-ide.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ the IDE as deliberate settings, but they can be set as part of the build setup.
| -DFPRIME_LIBRARY_LOCATIONS | path/to/lib:path/to/lib:... | **unneeded** |
| | | |
| **Custom Configuration** | | |
| -DFPRIME_AC_CONSTANTS_FILE | path/to/project/ac/file | **unneeded** |
| -DFPRIME_CONFIG_DIR | path/to/project/conf/dir | **unneeded** |

**Note:** See [CMake Settings](cmake-settings.md) for a further description of these and other settings.
Expand Down
25 changes: 9 additions & 16 deletions docs/UsersGuide/dev/configuring-fprime.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ system is most efficient.

This guide includes:
- [How to Configure F´](#how-to-configure-f)
- [AcConstants.ini](#acconstantsini)
- [AcConstants.fpp](#acconstantsfpp)
- [FpConfig.hpp](#fpconfighpp)
- [Type Settings](#type-settings)
- [Object Settings](#object-settings)
Expand All @@ -24,21 +24,19 @@ This guide includes:
## How To Configure F´

All configurable files (top-level and component-specific) for F´ are available in the top-level
`config` directory. By default, all deployments use the F´ provided default configuration options,
but as of F´ version 1.5, deployments can provide their own `AcConstants.ini` and configuration
`*.hpp` files by using the `ac_constants` and `config_directory` options in the deployment's
`settings.ini` file. See the [settings.ini guide](../user/settings.md) for more details.
`config` directory. By default, all deployments use the F´ provided default configuration options.

A deployment can clone `AcConstants.ini` or the whole set of `*.hpp` files or both. The deployment
must take ownership of all `*.hpp` due to C++ compiler constraints.
Projects can also take ownership of the `config` directory to provide their own `AcConstants.fpp`
and configuration `*.hpp` files. To do so, copy the `config` directory into your project and use the
`config_directory` options in the project's `settings.ini` file.
See the [settings.ini guide](../user/settings.md) for more details.

AcConstants.ini follows [python's INI](https://docs.python.org/3/library/configparser.html#supported-ini-file-structure)
format and the `FpConfig.h` file is a C header allowing the user to define global settings.
The `FpConfig.h` file is a C header allowing the user to define global settings.
Where components allow specific configuration, a `<component>Cfg.hpp` is available to be modified as well.

## AcConstants.ini
## AcConstants.fpp

AcConstants.ini is used to set the constants for the autocoded components provided by the framework. This allows
`AcConstants.fpp` is used to set the constants for the autocoded components provided by the framework. This allows
projects to appropriately size the number of ports provided by many of the command and data handling components defined
in the `Svc` package.

Expand All @@ -56,11 +54,6 @@ number of components.
| RateGroupDriverRateGroupPorts | Number of rate group driver output ports. Limits total number of different rate groups | 3 | Positive integer |
| HealthPingPorts | Number of health ping output ports. Limits number of components attached to health component | 25 | Positive integer |

An example INI setting would look like:

```ini
setting = 123; Comment
```

## FpConfig.h

Expand Down
13 changes: 5 additions & 8 deletions docs/UsersGuide/dev/source-tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,17 @@ This code should not be modified (with one exception, see Cfg in Section
5.3.1) by developers using the framework. The code generation relies on
the types declared to construct the entities in the architecture.

### Cfg
### config

The Cfg directory contains a header file (Config.hpp) that is used to
The config directory contains header files used to
configure various properties of the architecture. The developer can
modify the file to tune the architecture for the requirements of a
particular deployment environment. The contents are described in Section
9.

The file AcConstants.ini contains a set of values for variables used in
the code generator. This file follows the Python ConfigParser syntax,
which is based on Windows .ini files. Using this file allows component
features like opcodes and port numbers to be changed without modifying
the component XML itself. See the component XML specification in Section
6.6.3.
The file AcConstants.fpp contains a set of values for variables used in
the code generation. Using this file allows component features like opcodes
and port numbers to be changed without modifying the component FPP itself.

### Types

Expand Down
9 changes: 3 additions & 6 deletions docs/UsersGuide/user/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ These settings include:
computer platform.
- `environment_file`: An ini file that can be used to set environmental variables during the build
process.
- `ac_constants`: Path to autocode constants ini file.
- `config_directory`: Path to configuration header directory.

### Platform Sections
Expand All @@ -52,9 +51,8 @@ Some settings may be overridden for specific platforms using specific platform s
have the same name as the platform and may set the following settings:

1. `config_directory`
2. `ac_constants`
3. `install_destination`
4. `environment_file`
2. `install_destination`
3. `environment_file`

These settings only apply when building for the specified platform.

Expand All @@ -71,8 +69,7 @@ framework_path: ../fprime
library_locations: ../fprime-vxworks:../fprime-sphinx-drivers:../fprime-jplffs
default_toolchain: gr712-vxworks6
environment_file: ../fprime-vxworks/cmake/env/VxWorks-GR712.ini
ac_constants: ./Cfg/AcConstants.ini
config_directory: Cfg
config_directory: ./config

[gr712-vxworks6]
config_directory: Cfg_gr712
Expand Down

0 comments on commit a3578a0

Please sign in to comment.