Version 1.17 – released on January 20, 2017
This is maintenance release that consolidates the extensions brought by release 1.16, corrects issues in the distribution packages and comes with an improved documentation.
What is new
- Generation from within the CPAL editor of the binary image containing both the application and the CPAL execution engine to be uploaded through USB to FRDM embedded boards.
- The scheduling policy can be changed through an annotation executed at run-time (at the startup of the execution engine in the example below). Available policies are FIFO (default policy), non-preemptive Fixed Priority (NPFP) and non-preemptive Earliest Deadline First (NPEDF). The
--policy
option of the interpreter has been suppressed. The curent scheduling policy and the parameters of a process under this policy can be queried at run-time.processdef Simple() { state Main { if (system.sched_policy == Scheduling_Policy.NPFP) { IO.println("process priority: %u", self.priority); } } } process Simple: p1[10ms](); process Simple: p2[15ms](); @cpal:time { system.sched_policy = Scheduling_Policy.NPFP; p1.priority = 1; p2.priority = 0; /* lowest priority */ }
- Add hardware annotations to define UDP configuration (#301).
@cpal:hardware:udp_out_client { var UDP : udp1; udp1.port = 12345; udp1.direction = Hw_Direction.HW_OUTPUT; }
What has been fixed or changed
- CPAL now ships with standard libraries located in the
pkg
folder in all distributions. These libraries must be included at parse time, this can be done through the parser option:-I
or by setting theCPAL_PKG_PATH
shell variable to the pkg folder location (e.g. on Linux:export CPAL_PKG_PATH=/home/user/cpal/pkg
in.bashrc
file. - include directive syntax is now of the form
include "my folder /my include with spaces.cpal"
with quotes. - Strong typing in enums: enumerators must be prefixed by the name of the enum, e.g.
Fruit.APPLE
. - Fixed wrong error line numbers with included files.
- Fixed Windows
\n\r
line endings not handled correctly on Linux (#339). - Statements executed in the interactive mode of the interpreter do not need to be prefixed by
$
anymore. - Fixed interpreter terminating when an unknown command is entered in the interactive mode (#337).
- Fixed unknown
@cpal:XX
annotations accepted by the parser. User-defined annotations of the form@first:second:third:etc
, wherefirst
is anything other thancpal
, are ignored by the parser. - In multi-interpreter mode, predictable PIDs are given to the processes of each interpreter: first interpreter PIDs are 0, 1, 2, etc, second interpreter PIDs are 1000, 1001, etc.
Code metrics and overhead data (figures for embedded Linux platform)
- Test code coverage for the execution engine: 78.8% (lines of code), 78.9% (functions) and 65.7% (branches)
- Tests: parser=3948, interpreter=1219, cpal2x=4, others=30
- Timing overhead (Cortex M4 at 120MHz with floating point unit): timer interrupt = 0.6us, scheduler overhead at process activation = 1.6us + n x 4.6 us where n is the number of active processes, process switching time = 2us