Version 1.25 – release date: July 11th, 2018

We are pleased to announce the release of CPAL version 1.25. This release improves the usability of CPAL for the simulation of complex systems. New features highlight line code coverage, process state and process activity monitoring. The CPAL-Editor now supports the execution of CPAL programs in mono and multi-interpreter mode as well as running arbitrarily complex scenarios of executions from within the editor. Result files created during execution can (optionally) be included in the workspace and visualized within the editor.

What is new

  • CPAL-Editor: task activation diagrams now zoomable and scrollable with the mouse
  • Add line coverage based on gcov back-end


    Executing models from within the CPAL-Editor
    Executing models from within the CPAL-Editor
    Line coverage and branch coverage of a CPAL model after the execution of a certain scenario of execution.

    The CPAL program should be instrumented with the following command: cpal2x -Tcpal --code-coverage model.cpal. To get the actual line coverage of an execution, the program should be run with the following options: --finally-func output_line_coverage --finally-output model.info. To generate an html report of the coverage as above, the generated .info file can be processed by the standard gcov/lcov tools, e.g. genhtml --branch-coverage -o coverage model.info.

  • Support # style comments in scenario files @time interpreter-name CPAL-instructions
  • Extend scenarios to multi-interpreter mode (= simulation of multiple threads of simulation, e.g. one per computational ressource)

    
    # set a global variable (structure element) to true on interpreter sw0 at time 0
    # the instructions defined in the scenario will be executed before any other instructions due for execution at the same time point 
    sw0 cm.sync_to_stable_enabled = true;
    # other init. on other threads of simulation
    sm1 active=false;
    sc1 active=false;
    
    # execute the startup() function on two interpreters at specific time points
    @100ms9ns sm1 startup();
    @400ms sc1 startup();
    
    # cut a link to a switch at a precise instant and observe what happens
    @500ms link_sw1_sw0 cut_link_state=true;
    # next instruction will be executed at 500ms as well
    link_sw0_sw1 cut_link_state=true;
    
    #restore link later on in the execution
    @700ms link_sw0_sw1 cut_link_state=false;
    link_sw1_sw0 cut_link_state=false;
    
    # execute shutdown() on sm1 then sm2
    @850ms10ps sm1 shutdown();
    @900ms100us sm2 shutdown();
    
  • Recognize time instructions in scenario commands, e.g.: run +100ms9ps
  • Option to monitor process executions over time and record them in html format: -l or --tasks-log
  • Option to monitor the states of the processes over time and record them in html format: -m or --states-log
  • CPAL-Editor: program execution via menu or right-click on file name in project tree
  • CPAL-Editor: suppression of files and folders from workspace and from disk (#G24)
  • CPAL-Editor: “Parameters” have been moved to “Windows” menu
  • CPAL-Editor: sample files under Windows are now located under user\RTaW\CpalEditor
  • CPAL-Editor: window resizing bar width increased (#G6)
  • CPAL-Editor: LF problem in console fixed under Linux
  • CPAL-Editor: possibility to select font type and size for editing in “Parameters”
  • CPAL-Editor: visualization of output files in html format
  • CPAL-Editor: the directory structure (relative to worspace base directory) is shown in the file tree
  • CPAL-Editor: functional architecture diagram occasionaly not showing up (#G17)
  • CPAL-Editor: scenario files (.sce) included in a project can now be edited and are proposed to be used to drive an execution in the “CPAL execution” dialog
  • CPAL-Editor: “launch configuration” files (.cfg) that save all the execution parameters for an execution (execution time, options, output folder, input scenario, etc) can be included in the workspace and executed with right-click
Executing models from within the CPAL-Editor
The CPAL-Editor shows the functional architecture of a multi-interpreter configuration system (here a CAN communication network) and the dialog that allows to execute CPAL models from within the editor. Checking the boxes “States log” and “Activation log” will create a log in html format of the successive states of the processes and the times at which they execute during the simulation (i.e., start-end of execution). The --finally-func option specifies that the (user-defined) end() function will execute upon the end of execution, here to generate output files with statistics and graphical representation of the transmission schedule in html format. Those output files will be included in the workspace by checking the right box in the dialog. All these choices can be saved in “launch configuration” file (.cfg file), which can be provided along with the model in the worskspace. Through launch configurations, it becomes possible to re-execute the model in similar manner in terms of execution time, command-line options, output directory, input scenario file, etc.

What has been fixed or improved

  • Block file usage in playground
  • New architectural views, e.g., to show multi-interpreter configuration
  • Fixed: multi-interpreteur data flow sync. issue (#403)
  • Fixed: nested currification syntax issue
  • Fixed: display of compound time expression (e.g., in transitions) in CPAL-Editor
  • Remove cppcheck warnings

Test coverage metrics (figures for embedded Linux platform)

  • Test code coverage for runtime engine: 88.0% (lines of code), 82.0% (functions) and 75.9% (branches)
  • Tests: parser=4021, interpreter=913, cpal2x=4211, multi-interpreter=72