Embedded Software

Embedded Software

Topics related to SCADE Suite, SCADE Display, SCADE One and more.

“Unexpected operator with clocked I/O” issue.

    • fdtsaid
      Subscriber
      In 2.2.6 Combining Reset and Clocks of Scade Language Primer, there is a code snippet as following:

      node nat() returns (s: int32)
      let
        s = 1 -> (1 + pre s);
      tel

      node rst_clk (clock rst:bool; clock h:bool) returns (s:int32; t: int32 when h)
      let
        s = (restart nat every rst)();
        t = (restart nat every rst)(() when h);
      tel

      But kcg complains that
      -- Unexpected operator with clocked I/O
      -- The output variable t cannot be clocked because operator rst_clk/ is not expanded

      How to understand the problem?
    • Benjamin Descorps
      Ansys Employee

      Hello,

      This example is correct from a Scade language point of view. But it cannot be compiled as a C function as the operator declares a clocked variable at the interface.

      You may have to instantiate this operator or to modify the interface of the operator rst_clk if you want to generate C code. Here is an example on how to modify the operator to generate C code:

      node rst_clk(rst:bool; clock h:bool) returns (s:int32; t:int32 )
      let 
          s = (restart nat every rst) ();
          t = merge (h; (restart nat every rst)(() when h); 0 when not h);
      tel

      Hope this helps,

      Benjamin

Viewing 1 reply thread
  • You must be logged in to reply to this topic.