File tree Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ include ${PSS_HOME}/issue/Make.vars
2
+
3
+ gentarget :
4
+ $(PSSGEN ) test.pss -o test.s -root pss_top::root_a || true
5
+
6
+ clean :
7
+ rm -f test.s result.log
Original file line number Diff line number Diff line change
1
+ /*!
2
+ @weakgroup issue
3
+ @{
4
+ @file
5
+ @author Luther Lee
6
+ @data 2024/05/08
7
+ @brief Test issue 19.
8
+
9
+
10
+ ---------------------------------------------------------------------------------------------------
11
+
12
+ ### Test Command
13
+ @code{.unparsed}
14
+ make
15
+ @endcode
16
+
17
+ @cond
18
+ */
19
+ component pss_top {
20
+ action root_a {
21
+ activity {
22
+ do randWithIfElseCondition with { condition == "foo"; };
23
+ do randWithIfElseCondition with { condition == "bar"; };
24
+ do randWithIfCondition with { condition == "foo"; };
25
+ do randWithIfCondition with { condition == "bar"; };
26
+ }
27
+ }
28
+
29
+ action randWithIfElseCondition {
30
+ rand string condition;
31
+ rand int value;
32
+ constraint {
33
+ if ("foo" == condition) value in [12345];
34
+ else value in [0];
35
+ }
36
+
37
+ exec post_solve {
38
+ if (12345 != value) value = 54321;
39
+ }
40
+ exec body ASM = """randWithIfElseCondition: {{condition}} ; {{value}}""";
41
+ }
42
+
43
+ action randWithIfCondition {
44
+ rand string condition;
45
+ rand int value;
46
+ constraint {
47
+ if ("foo" == condition) value in [12345];
48
+ }
49
+
50
+ exec post_solve {
51
+ if (12345 != value) value = 54321;
52
+ }
53
+ exec body ASM = """randWithIfCondition: {{condition}} ; {{value}}""";
54
+ }
55
+ }
56
+
57
+ /**@}*/
Original file line number Diff line number Diff line change
1
+ randWithIfElseCondition: foo ; 12345
2
+ randWithIfElseCondition: bar ; 54321
3
+ randWithIfCondition: foo ; 12345
4
+ randWithIfCondition: bar ; 54321
You can’t perform that action at this time.
0 commit comments