CSL  release 1.0 (2021-09-30)
csl.h
Go to the documentation of this file.
1 
9 #ifndef _TEAMPLAY_CSL_H
10 #define _TEAMPLAY_CSL_H
11 
12 //
13 // Utility Annotations
14 //
15 
28 void __csl_security_set_secret( unsigned long long *var );
29 
30 
31 //
32 // Capture Annotations
33 //
34 
35 /*
36  We use 'TeamPlay variable' to refer to a C variable that is passed to at least one of the capture
37  annotations defined herein.
38 
39  We require/assume that all TeamPlay variables are <em>unique<em>; i.e. the same TeamPlay variable must not be passed to two capture annotations. For clarity, this includes two occurrences of the
40  same capture annotation.
41 
42  In addition to the Non-Functional Properties (NFP) file, the programmer may provide an
43  <em>expert file<em> (name not final). The expert file is a CSV file with four columns:
44 
45  -# TeamPlay variable name (string),
46  -# architecture (unsigned int),
47  -# value (unsigned long long), and
48  -# confidence level (bool).
49 
50  The TeamPlay variable is used to relate an entry (row) in the expert file with a
51  capture annotation in the CSL-annotated source. The architecture value refers to the unique
52  numerical ID for a supported architecture as defined in <tt>teamplay_arch.h</tt>. The value is a
53  user-provided default value to be assigned to the given TeamPlay variable. Finally, the
54  confidence value determines whether the default value should always be used (see
55  <tt>teamplay_reel.h</tt>). The behaviour for pairing entires in the expert file and capture
56  annotations in the CSL-annotated source code when there exists multiple entries in the expert
57  file for the same TeamPlay variable and architecture pair is as yet undefined.
58 */
59 
82 void __csl_time_worst( unsigned long long *var );
83 
106 void __csl_average_time( unsigned long long *var );
107 
108 
131 void __csl_energy( unsigned long long *var );
132 
144 void __csl_security_crypto( unsigned long long *var );
145 
158 void __csl_security_sca_time_worst( unsigned long long *var );
159 
172 void __csl_security_sca_time_average( unsigned long long *var );
173 
186 void __csl_security_sca_time_ratio( unsigned long long *var );
187 
200 void __csl_security_sca_energy_worst( unsigned long long *var );
201 
213 void __csl_security_sca_energy_average( unsigned long long *var );
214 
227 void __csl_security_sca_energy_ratio( unsigned long long *var );
228 
242 void __csl_security_sca_power_worst( unsigned long long *var );
243 
256 void __csl_security_sca_power_average( unsigned long long *var );
257 
270 void __csl_security_sca_power_ratio( unsigned long long *var );
271 
272 //
273 // Assertion Annotations
274 //
275 
314 void __csl_assert( _Bool expr );
315 
316 
323  unsigned long long minimum;
324  unsigned long long maximum;
325 };
326 
336 void __csl_assert_nonground( struct __csl_nonground_int *ngvar, _Bool expr );
337 
338 //
339 // Component Annotations
340 //
341 
364 #define __csl_component_application(x) void dummy_csl_fn_ ## x()
365 
404 #define __csl_component(x) void dummy_csl_fn_ ## x()
405 
409 void __csl_component_deadline(unsigned long long deadline);
410 
414 void __csl_component_period(unsigned long long period);
415 
419 void __csl_component_energy_available(unsigned long long energy);
420 
424 void __csl_component_type_alias(char alias[], char type[], void *dValue);
425 
433 void __csl_component_input(char label[], unsigned long long consume, char alias[]);
434 
443 void __csl_component_output(char label[] , unsigned long long produce, char alias[], char edges[]);
444 
448 void __csl_component_version( char label[] );
449 
453 void __csl_component_security( unsigned long long secLevel);
454 
458 void __csl_component_arch( char arch_label[]);
459 
463 void __csl_component_wcet( unsigned long long wcet );
464 
468 void __csl_component_wcec( unsigned long long wcec );
469 
470 #endif
void __csl_component_energy_available(unsigned long long energy)
CSL Component annotation used to define the energy available for an application.
void __csl_security_sca_power_ratio(unsigned long long *var)
__csl_security_sca_energy_ratio assigns IIRP (Indiscernible Information Ratio for Power) values to a ...
void __csl_security_sca_energy_ratio(unsigned long long *var)
__csl_security_sca_energy_ratio assigns IIRE (Indiscernible Information Ratio for Energy) values to a...
void __csl_component_security(unsigned long long secLevel)
CSL Component annotation used to indicate that a component version has a given security level.
void __csl_component_type_alias(char alias[], char type[], void *dValue)
CSL Component annotation used to define a type alias of a standard C type, along with a default value...
void __csl_security_crypto(unsigned long long *var)
__csl_security_crypto assigns cryptographic strength values to a given TeamPlay variable.
void __csl_component_deadline(unsigned long long deadline)
CSL Component annotation used to define the deadline of either an application or a specific (version ...
void __csl_component_wcet(unsigned long long wcet)
CSL Component annotation used to indicate that a component version has a given worst-case execution t...
void __csl_assert(_Bool expr)
__csl_assert provides C-level contracts in order to enable expression of (non-functional) properties ...
void __csl_security_sca_power_average(unsigned long long *var)
__csl_security_sca_power_average assigns ACDP (Average-Case Discernible Power) values to a given Team...
void __csl_component_arch(char arch_label[])
CSL Component annotation used to indicate that a component version is designed for a given architectu...
void __csl_security_sca_time_worst(unsigned long long *var)
__csl_security_sca_time_worst assigns WCDT (Worst-Case Discernible Time) values to a given TeamPlay v...
void __csl_component_wcec(unsigned long long wcec)
CSL Component annotation used to indicate that a component version has a given worst-case energy cons...
void __csl_security_sca_energy_average(unsigned long long *var)
__csl_security_sca_energy_average assigns ACDE (Average-Case Discernible Energy) values to a given Te...
void __csl_security_set_secret(unsigned long long *var)
__csl_security_set_secret assigns a flag to a given TeamPlay variable stating its secret status.
void __csl_time_worst(unsigned long long *var)
__csl_time_worst assigns WCET (Worst-Case Execution Time) values to a given TeamPlay variable.
void __csl_assert_nonground(struct __csl_nonground_int *ngvar, _Bool expr)
A non-ground assertion; to be defined.
void __csl_security_sca_energy_worst(unsigned long long *var)
__csl_security_sca_energy_worst assigns WCDE (Worst-Case Discernible Energy) values to a given TeamPl...
void __csl_component_input(char label[], unsigned long long consume, char alias[])
CSL Component annotation used to define an input channel of a component.
void __csl_security_sca_power_worst(unsigned long long *var)
__csl_security_sca_power_worst assigns WCDP (Worst-Case Discernible Power) values to a given TeamPlay...
void __csl_component_output(char label[], unsigned long long produce, char alias[], char edges[])
CSL Component annotation used to define an output channel of a component.
void __csl_average_time(unsigned long long *var)
__csl_average_time assigns WCET (Average-Case Execution Time) values to a given TeamPlay variable.
void __csl_security_sca_time_average(unsigned long long *var)
__csl_security_sca_time_average assigns ACDT (Average-Case Discernible Time) values to a given TeamPl...
void __csl_energy(unsigned long long *var)
__csl_energy assigns Average-Case Energy Usage (ACEU) values to a given TeamPlay variable.
void __csl_security_sca_time_ratio(unsigned long long *var)
__csl_security_sca_time_ratio assigns IIRT (Indiscernible Information Ratio for Time) values to a giv...
void __csl_component_version(char label[])
CSL Component annotation used to indicate that the annotated function is a version of a component.
void __csl_component_period(unsigned long long period)
CSL Component annotation used to define the period of either an application or a specific (version of...
A type for representing variables in CSL assertions for which a value is not known.
Definition: csl.h:322
unsigned long long minimum
Definition: csl.h:323
unsigned long long maximum
Definition: csl.h:324

This documentation belongs to the TeamPlay Contract Specification Language (CSL).

https://teamplay-h2020.eu