Skip to content

STR-UPM/TASTE_Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TASTE_Scripts badge-scripts

This repository gathers helper scripts created for the TASTE toolchain.

taste-create-gitignore

This python script creates a .gitignore file given a set of TASTE functions passed as command line arguments. The contents of the autogenerated gitignore allows us to untrack autogenerated files for those functions, except for the files implemented by the user.

Usage:

taste-create-gitignore [-h] [-dbg] [-f] [-r ROOT] <FUNCTIONS>

Where:

  • <FUNCTIONS> space separated list of TASTE functions to be ignored. If empty, the whole work directory is ignored (except for the .gitignore file)
  • [-h] print this help and quit.
  • [-dbg] optional flag to run in debug mode and print verbose messages.
  • [-f] if a gitignore file exists, overwrite it.
  • [-r ROOT] specify the TASTE root project location.

Example

Suppose that you are in the src directory, which contains the TASTE project for the ACS use case. Like all TASTE projects, this one contains a work directory for all the TASTE functions implementations. However, only a few source and/or modelling files are intended to be modified by the user and won't be updated by the TASTE code generators. In a real project that uses CVS, it is important to track the changes from these files, and ignore the other ones which will be automatically updated by TASTE.

The following project tree shows the source files that are autogenerated by TASTE but need to be updated by the developers to implement the TASTE functions' logic, i.e.: these files won't be edited by TASTE anymore. So, the desired .gitignore will have to ignore all except the source files shown below.

work/
├── acs_algorithm
│   ├── implem
│   │   ├── cfs
│   │   │   └── QGenC
│   │   │       └── src
│   │   │           └── Step.slx
│   │   └── default
│   │       └── QGenAda
│   │           └── src
│   │               └── Step.slx
│   └── QGenC -> implem/cfs/QGenC
│
├── measurer_and_actuator
│   ├── C -> implem/cfs/C
│   └── implem
│       ├── cfs
│       │   └── C
│       │       └── src
│       │           └── measurer_and_actuator.c
│       └── default
│           └── Ada
│               └── src
│                   └── measurer_and_actuator.adb
│
└── simulated_acs_hw
    ├── C -> implem/cfs/C
    └── implem
        ├── cfs
        │   └── C
        │       └── src
        │           └── simulated_acs_hw.c
        └── default
            └── Ada
                └── src
                    └── simulated_acs_hw.adb

Run the following command to autogenerate the .gitignore:

taste-create-gitignore -r . -f work/acs_algorithm/ \
                               work/measurer_and_actuator/ \
                               work/simulated_acs_hw/

Note that:

  • The -r . option specifies the directory of the TASTE project location, in this case it can be omitted since it's the current directory.
  • The -f flag forces the creation of this file, i.e.: if the file exists, its contents are overwritten.
  • The last three parameters contain the taste functions paths. The script will ignore everything except the hand-written files from these functions.
  • It is not mandatory to specify the relative path from the TASTE functions, the work/ dirnames can be omitted.

License

Copyright (C) 2023 Universidad Politécnica de Madrid

These scripts were developed by the Real-Time Systems Group at the Universidad Politécnica de Madrid under the GNU General Public License v3.

About

Helper scripts for the TASTE toolchain

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published