Files
powertrain-build/docs/powertrain_build_introduction.md
Henrik Wahlqvist 38a1ecd2dc ARTCSF-3856: Set up simple sample projects and jobs/tests
Change-Id: I5b397ad0e490343ee9a751f81c40e3ebc9ff2bb5
2025-09-04 12:04:07 +00:00

2.0 KiB

Introduction

[TOC]

General Information

powertrain-build introduction introduces installation and basic usage of powertrain-build.

Code Base

The basic code introduction is placed in General Code Introduction.

Deployment

Information on how to deploy powertrain-build can be found here.

Code Generators

powertrain-build collects code generated from Simulink models in Matlab. powertrain-build was originally designed to work with TargetLink but with the correct setup it can also support Embedded Coder. For instance, Embedded Coder needs to be configured to mimic the variable classes. The part of powertrain-build's codebase that processes Simulink models is located in powertrain_build/matlab_scripts folder.

For more information about the TargetLink setup see this page.

Development

If you want to develop powertrain-build, you can run it directly from the Git repositories. You probably need a separate virtual environment, as any installed release versions of powertrain-build would interfere:

python3 -m venv powertrain_build_venv
source ./powertrain_build_venv/bin/activate

Once activated, you can execute it:

PYTHONPATH=<path_to>//powertrain-build python -m powertrain_build.wrapper build-specific --project-config Projects/CSP/PvcDepDemo/ProjectCfg.json --core-dummy

Local Testing

Other than the unit tests, there are two very small sample projects to build. These projects can be found in the test_data/test_repo/Projects folder.

The project ZC/ZCLA_LVCSC generates a yaml file describing the interface, as well as collecting/generating source code. CSP/CATC only collects/generates source code.

To test run one of these projects, start a terminal in the test_data/test_repo folder and execute:

  • export PYTHONPATH=my/path/to/powertrain-build/
  • python3 -m powertrain_build.wrapper --build CSP/CATC