LiCoRICE CLI

Commands

Generate

licorice generate <model_name>

Generate LiCoRICE user-level per-tick Python snippet files. This includes parsers, constructors, and destructors. Filenames are taken from module definitions in the YAML configuration and files are written to the default module directory (overridden by LICORICE_MODULE_PATH). The generated files are just a scaffold and must be filled out by the user with code that will run for that module function each tick.

Parse

licorice parse <model_name>

Parse a LiCoRICE YAML file. This command reads in and validates the LiCoRICE model, constructs any variables needed for templating, and writes rendered template files to the default output directory (overridden by LICORICE_OUTPUT_DIR)

Compile

licorice compile <model_name>

Compile a LiCoRICE model from the files written to the model output directory. This currently just runs make clean and make from the output directory, which compiles all the Cython and C files to executables.

Run

licorice run <model_name>

Runs a LiCoRICE model from the compiled executables in the model output directory. This is as simple as running the timer executable with the right priority which kicks off the rest of the module processes.

Go

licorice go <model_name>

Combine the behavior of parse, compile, and run into a single command for convenience.

Export

licorice export <model_name>

Export LiCoRICE module and output directories to the export directory (overridden by LiCORICE_EXPORT_DIR)

Reference

The full CLI command reference can be viewed by running licorice -h and is printed below for convenience:

usage: licorice [-h] [-y] [--rt] [--dbg] [--config CONFIG]
                [--working_path WORKING_PATH] [--template_path TEMPLATE_PATH]
                [--generator_path GENERATOR_PATH] [--module_path MODULE_PATH]
                [--model_path MODEL_PATH] [--output_dir OUTPUT_DIR]
                [--export_dir EXPORT_DIR] [--tmp_module_dir TMP_MODULE_DIR]
                [--tmp_output_dir TMP_OUTPUT_DIR]
                {generate,parse,compile,run,go,export} model

LiCoRICE config parser.

positional arguments:
  {generate,parse,compile,run,go,export}
                        LiCoRICE command to run.
  model                 YAML model file name to parse. File extension
                        optional.

optional arguments:
  -h, --help            show this help message and exit
  -y, --confirm         bypass user confirmation on action
  --rt, --realtime      run LiCoRICE with realtime timing guarantees
  --dbg, --debug        run LiCoRICE with gdb for debugging
  --config CONFIG       override model configuration. accepts JSON input
  --working_path WORKING_PATH
                        Overrides LiCoRICE PATH environment variable
                        LICORICE_WORKING_PATH
  --template_path TEMPLATE_PATH
                        Overrides LiCoRICE PATH environment variable
                        LICORICE_TEMPLATE_PATH
  --generator_path GENERATOR_PATH
                        Overrides LiCoRICE PATH environment variable
                        LICORICE_GENERATOR_PATH
  --module_path MODULE_PATH
                        Overrides LiCoRICE PATH environment variable
                        LICORICE_MODULE_PATH
  --model_path MODEL_PATH
                        Overrides LiCoRICE PATH environment variable
                        LICORICE_MODEL_PATH
  --output_dir OUTPUT_DIR
                        Overrides LiCoRICE DIR environment variable
                        LICORICE_OUTPUT_DIR
  --export_dir EXPORT_DIR
                        Overrides LiCoRICE DIR environment variable
                        LICORICE_EXPORT_DIR
  --tmp_module_dir TMP_MODULE_DIR
                        Overrides LiCoRICE DIR environment variable
                        LICORICE_TMP_MODULE_DIR
  --tmp_output_dir TMP_OUTPUT_DIR
                        Overrides LiCoRICE DIR environment variable
                        LICORICE_TMP_OUTPUT_DIR