-
-
November 23, 2024 at 9:58 amfdtsaidSubscriberIn
2.2.6 Combining Reset and Clocks
ofScade Language Primer
, there is a code snippet as following:node nat() returns (s: int32)lets = 1 -> (1 + pre s);telnode rst_clk (clock rst:bool; clock h:bool) returns (s:int32; t: int32 when h)lets = (restart nat every rst)();t = (restart nat every rst)(() when h);telButkcg
complains that-- Unexpected operator with clocked I/O-- The output variable t cannot be clocked because operator rst_clk/ is not expandedHow to understand the problem? -
November 25, 2024 at 4:03 pmBenjamin DescorpsAnsys 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);
telHope this helps,
Benjamin
-
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Ansys Innovation Space
Trending discussions
Top Contributors
-
1216
-
543
-
523
-
225
-
209
Top Rated Tags
© 2024 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.