Version 1.16 – released on October 6, 2016

This release brings several new features developed over the last 6 months and many language and tools improvements. The headline new feature for version 1.16 is the multi-interpreter facility in simulation mode that allows to program distributed systems (networks, multicore systems) using a dedicated interpreter per computing ressources (CPU core, network, etc). The CPAL interpreter provides synchronization and data passing mechanisms between interpreters. This release improves also the support of UDP communication with hardware annotations for UDP configuration and timing annotations mechanisms.

Two new helper tools make their way in the distribution: cpal_lint to check the conformance with the CPAL naming convention, and cpal2x to extract information out of CPAL programs, instrument source files for code coverage estimation and format the code (“beautify”) for better readability and maintenability. The latter tool should however be considered as a prototype at this time.

We are pleased to start offering CPAL for Mac OS X with the availability of the command-line tools. The CPAL-editor for Mac OS X will be available very soon.

The CPAL programming manual for version 1.16 is available here. If you experience issues, or simply need help with CPAL, you are much welcome to contact us.

What is new

  • ADDED: unsized array, also called flexible arrays, to allow the use variable length arrays as function and process arguments.

    
    my_function(in uint32: unsized_array[]) {
      var uint32: i;
      for (i = 0; i < unsized_array.max_size; i = i + 1) {
        IO.println("%u", unsized_array[i]);
      }
    }
    
    init() {
      var uint32: a[3] = { 0, 1, 2 };
      const uint32: b[5] = { 0, 1, 2, 3, 4 };
      my_function(a);
      my_function(b);
    }
    
  • ADDED: double precision float64 type on Windows, Linux 32/64bits et Raspberry, and related conversion (e.g., float64.as() ) and mathematical functions (e.g., float64.pow(), float64.sin()).
  • ADDED: the possibility to execute a "final function" right before the program terminates to perform some specific actions such releasing I/Os or outputing some statistics. Below, the function output_count will be executed after the call to exit(0) with the interpreter option --finally-func output_count:

    
    var uint64: instances_count = 0;
    
    processdef A_Process(out uint64: count) {
      state Main_State {
        count = count + 1;
      }
      on (uint8.rand_uniform(1,4) == 1)
      to Exit;
      state Exit {
        exit(0);
      }
    }
    
    output_count() {
      IO.println("Process executed %u times", instances_count);
    }
    
    process A_Process: p1[100ms](instances_count);
    
    init() {
      seed();
    }
    

    On platforms supporting writing to files, it is also possible to redirect the output to a file with the option --finally-output log.txt.

  • ADDED: declaration of time64 quantities mixing different time units

    
    init()
    {
      var time64: same_duration = 5s150ms3ns1ps;
      var time64: a_duration = 5s + 150ms + 3ns + 1ps;
      assert(a_duration == same_duration);
      /* 5s150ms3ns1ps */
      IO.println("%t", a_duration);
    }
    
  • ADDED: cpal_lint utility to check the conformance with the CPAL naming conventions (defined in the programming manual) and catch some possible programming errors.
  • ADDED: cpal2x utility to extract information out of CPAL programs (e.g. annotations, process characteristics for schedulability analysis, etc), instrument source files for code coverage estimation and "beautify" the code for better readability. cpal2x should be considered as a prototype at this point.

What has been fixed or improved

  • CHANGED: timing annotations have been simplified. The distinction between @cpal:time and @cpal:sched has been removed and @cpal:sched annotation has been suppressed from the language. A better mechanim has been introduced to distinguish between annotations that are executed once at startup and annotations that are executed upon each process activation.
  • CHANGED: max_size() changed to max_size for queues and stacks for consistency with arrays and because the value returned does not change at run-time

    
    init()
    {
      var queue: a_queue[10];
      var stack: a_stack[10];
      var uint8: an_array[10];
      assert(a_queue.max_size == a_stack.max_size == an_array.max_size);
    }
    

Code metrics and overhead data (figures for embedded Linux platform)

  • Test code coverage for the execution engine: 84.1% (lines of code), 81.1% (functions) and 71.7% (branches)
  • Tests: parser=3922, interpreter=1201
  • 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