Version 1.12 – released on August 18, 2015

This release corrects a number of issues. Importantly, it also introduces several new integer types (uint8, int8, etc) and a new time64 type to measure and manipulate time. A new syncIO() function provides a way to force I/O updates (reading and writing) during the execution of a process.

If you experience issues that are not listed here, or simply need help with CPAL, you are much welcome to contact us.

What is new

  • Added new integer types: uint8, uint16, uint64, int8, int16, int64. Provide binary operators (<<, >>, mod) and conversion functions (type.as(x)) for the new type.
  • Added new time64 type

    
    const time64: delay0 = 3ms;
    
    init() {
      /* Internal granularity of time type is the picosecond (ps). */
      var time64: aDuration = 5s + 150ms + 3ns + 1ps;
      var time64: anotherDuraction = 2 * aDuration - 1ps;
      var time64: timer0 = time();
      var time64: timer1;
      println("Value of aDuration is %t", aDuration);
      assert(1s == 1000ms);
      assert(1ms == 1000us);
      assert(1us == 1000ns);
      assert(1ns == 1000ps);
      sleep(delay0);
      timer1 = time();
      /* In simulation mode, without timing annotations to account for 
      the run-time latencies, it would be '=='. In real-time mode, 
      instructions require time to execute, thus the need for '>='.
      */
      assert(timer1 - timer0 >= delay0);
      println("Current time is %t", time());
    }
    
  • Added synchIO() to explicitly force the update (reading and writing) of the variables mapped to hardware ports. By default, syncIO() is called right before the activation of a process and at the very end of its execution.
  • Added several new sample files which are now indexed here

What has been fixed or improved

  • Improved accuracy of sleep() function on Raspberry
  • Changed: local variables are now initialized to zero by default
  • Fixed: incorrect named block parsing with both declarations and instructions
  • Fixed: segfault on enum fields comparison in specific conditions (#190)
  • Fixed: buggy println of signed integer int32 (#213)
  • [CPAL-editor] Fixed: incorrect html export with non-printable characters (#214)
  • Fixed: incorrect execution with same-name variables declared in different scopes (#215)
  • Fixed: parser error on incorrect structure declaration (#217)
  • [CPAL-editor] Fixed: editor freezes on a syntactically correct program with named blocks (#218)

Code metrics and overhead data

  • Test code coverage for the execution engine: 83.2% (loc), 85% (functions)
  • Tests: parser=3683, interpreter=809, embedded targets=402
  • 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