Skip to content

Commit 61164d4

Browse files
Sandeep PinnintiSandeep Pinninti
authored andcommitted
Rfe/ric 979 support symmetric events (#53)
* symmetric events example * Update md file * symmetric_events to workspace * rename file name * RIC-979 removed rsarte-auto folder --------- Co-authored-by: Sandeep Pinninti <sandeep.pinninti@prod.hclpnp.com>
1 parent ad5742b commit 61164d4

4 files changed

Lines changed: 164 additions & 0 deletions

File tree

art-comp-test/art-comp-test.code-workspace

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@
173173
{
174174
"path": "tests/struct_type_descriptor_nested"
175175
},
176+
{
177+
"path": "tests/symmetric_events"
178+
},
176179
{
177180
"path": "tests/tc_getTopTC"
178181
},
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
2+
/**
3+
Exoected RTOutSignal void, RTInSignal void in Base and Conjugate
4+
*/
5+
protocol Proto1{
6+
in sayHello();
7+
out sayBye();
8+
};
9+
10+
/**
11+
Exoected RTSymmetricSignal in Base and Conjugate
12+
*/
13+
protocol Proto2{
14+
in sayHello();
15+
out sayHello();
16+
};
17+
18+
/**
19+
Expected RTOutSignal with 1 args and RTInSignal void in Conjugate
20+
Expected RTSymmetricSignal in Base
21+
*/
22+
protocol Proto3{
23+
in sayHello(`int`);
24+
out sayHello();
25+
};
26+
27+
28+
/**
29+
Expected RTOutSignal with 1 args and RTInSignal void in Base
30+
Exoected RTSymmetricSignal in Conjugate
31+
*/
32+
protocol Proto4{
33+
in sayHello();
34+
out sayHello(`int`);
35+
};
36+
37+
38+
/**
39+
Expected RTOutSignal with 1 args and RTInSignal void in both Base and Conjugate
40+
*/
41+
protocol Proto5{
42+
in sayHello(`int`);
43+
out sayHello(`int`);
44+
};
45+
46+
capsule Top {
47+
[[rt::impl_preface]]
48+
`
49+
#include <iostream>
50+
#include "testlib.art.h"
51+
`
52+
53+
behavior port timer : Timing;
54+
part pingger: Ping, pongger: Pong;
55+
connect pingger._porto1 with pongger._porto1;
56+
connect pingger._porto2 with pongger._porto2;
57+
connect pingger._porto3 with pongger._porto3;
58+
connect pingger._porto4 with pongger._porto4;
59+
connect pingger._porto5 with pongger._porto5;
60+
61+
statemachine {
62+
state S1, S2;
63+
initial -> S1;
64+
};
65+
};
66+
67+
capsule Ping {
68+
[[rt::impl_preface]]
69+
`
70+
#include <iostream>
71+
#include "testlib.art.h"
72+
`
73+
74+
service behavior port _porto1: Proto1, _porto2: Proto2, _porto3: Proto3, _porto4: Proto4, _porto5: Proto5;
75+
statemachine {
76+
state S1 {
77+
ponged1: on _porto1.sayHello
78+
`
79+
std::cout << "Ponged 1!" << std::endl;
80+
_porto2.sayHello().send();
81+
`;
82+
ponged2: on _porto2.sayHello
83+
`
84+
std::cout << "Ponged 2!" << std::endl;
85+
_porto3.sayHello().send();
86+
`;
87+
ponged3: on _porto3.sayHello
88+
`
89+
std::cout << "Ponged 3!" << std::endl;
90+
_porto4.sayHello(1).send();
91+
`;
92+
ponged4: on _porto4.sayHello
93+
`
94+
std::cout << "Ponged 4!" << std::endl;
95+
_porto5.sayHello(99).send();
96+
`;
97+
ponged5: on _porto5.sayHello
98+
`
99+
std::cout << "Ponged 5!" << std::endl;
100+
PASS();
101+
`;
102+
};
103+
initial -> S1 `
104+
std::cout << "Ping initial !" << std::endl;
105+
_porto1.sayBye().send();
106+
`;
107+
108+
};
109+
};
110+
111+
capsule Pong {
112+
[[rt::impl_preface]]
113+
`
114+
#include <iostream>
115+
#include "testlib.art.h"
116+
`
117+
118+
service behavior port _porto1~: Proto1, _porto2~: Proto2, _porto3~: Proto3, _porto4~: Proto4, _porto5~: Proto5;
119+
statemachine {
120+
state S1{
121+
pinged1: on _porto1.sayBye
122+
`
123+
std::cout << "Pinged 1!" << std::endl;
124+
_porto1.sayHello().send();
125+
`;
126+
pinged2: on _porto2.sayHello
127+
`
128+
std::cout << "Pinged 2!" << std::endl;
129+
_porto2.sayHello().send();
130+
`;
131+
pinged3: on _porto3.sayHello
132+
`
133+
std::cout << "Pinged 3!" << std::endl;
134+
_porto3.sayHello(99).send();
135+
`;
136+
pinged4: on _porto4.sayHello
137+
`
138+
std::cout << "Pinged 4!" << std::endl;
139+
_porto4.sayHello().send();
140+
`;
141+
pinged5: on _porto5.sayHello
142+
`
143+
std::cout << "Pinged 5!" << std::endl;
144+
_porto5.sayHello(99).send();
145+
`;
146+
};
147+
initial -> S1 `
148+
std::cout << "Pong initial !" << std::endl;
149+
`;
150+
151+
};
152+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
group: cpp_code_generation
3+
---
4+
This test case is designed to cover symmetric events, assessing their behavior in scenarios both with and without parameters.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//Transformation Configuration File
2+
let tc = TCF.define(TCF.CPP_TRANSFORM);
3+
tc.topCapsule = 'Top';
4+
tc.prerequisites = ["../../TestUtils/testlib.tcjs"];
5+
tc.targetFolder = 'symmetric_events_target';

0 commit comments

Comments
 (0)