Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / vhdl_json / vhdl_files / 2-exportOK / ghdl / ghdl / testsuite / vests / vhdl-93 / ashenden / compliant / ch_07_fg_07_18.json @ 3fd18385

History | View | Annotate | Download (10.9 KB)

1
{
2
  "DESIGN_FILE" : {
3
    "design_units" : [{
4
      "contexts" : [], "library" : ["ENTITY_DECLARATION", {
5
        "name" : ["IDENTIFIER", "fg_07_18"], "ENTITY_DECLARATIVE_PART" : [], "ENTITY_STATEMENT_PART" : []}
6
      ]}
7
    , {
8
      "contexts" : [], "library" : ["ARCHITECTURE_BODY", {
9
        "name" : ["IDENTIFIER", "test"], "entity" : ["IDENTIFIER", "fg_07_18"], "ARCHITECTURE_DECLARATIVE_PART" : [{
10
          "declaration" : ["CONSTANT_DECLARATION", {
11
            "names" : [["IDENTIFIER", "target_host_id"]], "typ" : {
12
              "name" : ["SIMPLE_NAME", "natural"]}
13
            , "init_val" : ["EXPRESSION", {
14
              "args" : [["EXPRESSION", {
15
                "args" : [["EXPRESSION", {
16
                  "args" : [["EXPRESSION", {
17
                    "args" : [["CONSTANT_VALUE", {
18
                      "value" : ["CST_LITERAL", "10"]}
19
                    ]]}
20
                  ]]}
21
                ]]}
22
              ]]}
23
            ]}
24
          ]}
25
        , {
26
          "declaration" : ["CONSTANT_DECLARATION", {
27
            "names" : [["IDENTIFIER", "my_host_id"]], "typ" : {
28
              "name" : ["SIMPLE_NAME", "natural"]}
29
            , "init_val" : ["EXPRESSION", {
30
              "args" : [["EXPRESSION", {
31
                "args" : [["EXPRESSION", {
32
                  "args" : [["EXPRESSION", {
33
                    "args" : [["CONSTANT_VALUE", {
34
                      "value" : ["CST_LITERAL", "5"]}
35
                    ]]}
36
                  ]]}
37
                ]]}
38
              ]]}
39
            ]}
40
          ]}
41
        , {
42
          "definition" : ["TYPE_DECLARATION", {
43
            "name" : ["IDENTIFIER", "pkt_types"], "definition" : ["ENUMERATION_TYPE_DEFINITION", [["IDENTIFIER", "control_pkt"], ["IDENTIFIER", "other_pkt"]]]}
44
          ]}
45
        , {
46
          "definition" : ["TYPE_DECLARATION", {
47
            "name" : ["IDENTIFIER", "pkt_header"], "definition" : ["RECORD_TYPE_DEFINITION", [{
48
              "names" : [["IDENTIFIER", "dest"], ["IDENTIFIER", "src"]], "definition" : {
49
                "name" : ["SIMPLE_NAME", "natural"]}
50
              }
51
            , {
52
              "names" : [["IDENTIFIER", "pkt_type"]], "definition" : {
53
                "name" : ["SIMPLE_NAME", "pkt_types"]}
54
              }
55
            , {
56
              "names" : [["IDENTIFIER", "seq"]], "definition" : {
57
                "name" : ["SIMPLE_NAME", "natural"]}
58
              }
59
            ]]}
60
          ]}
61
        ], "ARCHITECTURE_STATEMENT_PART" : [["PROCESS_STATEMENT", {
62
          "id" : ["IDENTIFIER", "network_driver"], "PROCESS_DECLARATIVE_PART" : [{
63
            "declaration" : ["CONSTANT_DECLARATION", {
64
              "names" : [["IDENTIFIER", "seq_modulo"]], "typ" : {
65
                "name" : ["SIMPLE_NAME", "natural"]}
66
              , "init_val" : ["EXPRESSION", {
67
                "args" : [["EXPRESSION", {
68
                  "args" : [["EXPRESSION", {
69
                    "args" : [["EXPRESSION", {
70
                      "id" : "**", "args" : [["CONSTANT_VALUE", {
71
                        "value" : ["CST_LITERAL", "2"]}
72
                      ], ["CONSTANT_VALUE", {
73
                        "value" : ["CST_LITERAL", "5"]}
74
                      ]]}
75
                    ]]}
76
                  ]]}
77
                ]]}
78
              ]}
79
            ]}
80
          , {
81
            "definition" : ["SUBTYPE_DECLARATION", {
82
              "name" : ["IDENTIFIER", "seq_number"], "typ" : {
83
                "name" : ["SIMPLE_NAME", "natural"], "const" : ["RANGE_CONSTRAINT", {
84
                  "range" : ["RANGE_WITH_DIRECTION", {
85
                    "direction" : "to", "from" : ["EXPRESSION", {
86
                      "args" : [["EXPRESSION", {
87
                        "args" : [["CONSTANT_VALUE", {
88
                          "value" : ["CST_LITERAL", "0"]}
89
                        ]]}
90
                      ]]}
91
                    ], "_to" : ["EXPRESSION", {
92
                      "args" : [["EXPRESSION", {
93
                        "id" : "-", "args" : [["EXPRESSION", {
94
                          "args" : [["CALL", ["SIMPLE_NAME", "seq_modulo"]]]}
95
                        ], ["EXPRESSION", {
96
                          "args" : [["CONSTANT_VALUE", {
97
                            "value" : ["CST_LITERAL", "1"]}
98
                          ]]}
99
                        ]]}
100
                      ]]}
101
                    ]}
102
                  ]}
103
                ]}
104
              }
105
            ]}
106
          , {
107
            "declaration" : ["VARIABLE_DECLARATION", {
108
              "names" : [["IDENTIFIER", "next_seq_number"]], "typ" : {
109
                "name" : ["SIMPLE_NAME", "seq_number"]}
110
              , "init_val" : ["EXPRESSION", {
111
                "args" : [["EXPRESSION", {
112
                  "args" : [["EXPRESSION", {
113
                    "args" : [["EXPRESSION", {
114
                      "args" : [["CONSTANT_VALUE", {
115
                        "value" : ["CST_LITERAL", "0"]}
116
                      ]]}
117
                    ]]}
118
                  ]]}
119
                ]]}
120
              ]}
121
            ]}
122
          , {
123
            "declaration" : ["VARIABLE_DECLARATION", {
124
              "names" : [["IDENTIFIER", "new_header"]], "typ" : {
125
                "name" : ["SIMPLE_NAME", "pkt_header"]}
126
              }
127
            ]}
128
          , {
129
            "declaration" : ["SUBPROGRAM_BODY", {
130
              "spec" : {
131
                "name" : "generate_seq_number", "subprogram_type" : "function", "typeMark" : ["SIMPLE_NAME", "seq_number"], "isPure" : false}
132
              , "decl_part" : [["VARIABLE_DECLARATION", {
133
                "names" : [["IDENTIFIER", "number"]], "typ" : {
134
                  "name" : ["SIMPLE_NAME", "seq_number"]}
135
                }
136
              ]], "stmts" : [["VARIABLE_ASSIGNMENT_STATEMENT", {
137
                "lhs" : ["SIMPLE_NAME", "number"], "rhs" : ["EXPRESSION", {
138
                  "args" : [["EXPRESSION", {
139
                    "args" : [["EXPRESSION", {
140
                      "args" : [["EXPRESSION", {
141
                        "args" : [["CALL", ["SIMPLE_NAME", "next_seq_number"]]]}
142
                      ]]}
143
                    ]]}
144
                  ]]}
145
                ]}
146
              ], ["VARIABLE_ASSIGNMENT_STATEMENT", {
147
                "lhs" : ["SIMPLE_NAME", "next_seq_number"], "rhs" : ["EXPRESSION", {
148
                  "args" : [["EXPRESSION", {
149
                    "args" : [["EXPRESSION", {
150
                      "args" : [["EXPRESSION", {
151
                        "id" : "mod", "args" : [["EXPRESSION", {
152
                          "args" : [["EXPRESSION", {
153
                            "args" : [["EXPRESSION", {
154
                              "args" : [["EXPRESSION", {
155
                                "args" : [["EXPRESSION", {
156
                                  "id" : "+", "args" : [["EXPRESSION", {
157
                                    "args" : [["CALL", ["SIMPLE_NAME", "next_seq_number"]]]}
158
                                  ], ["EXPRESSION", {
159
                                    "args" : [["CONSTANT_VALUE", {
160
                                      "value" : ["CST_LITERAL", "1"]}
161
                                    ]]}
162
                                  ]]}
163
                                ]]}
164
                              ]]}
165
                            ]]}
166
                          ]]}
167
                        ], ["EXPRESSION", {
168
                          "args" : [["CALL", ["SIMPLE_NAME", "seq_modulo"]]]}
169
                        ]]}
170
                      ]]}
171
                    ]]}
172
                  ]]}
173
                ]}
174
              ], ["RETURN_STATEMENT", {
175
                "expr" : ["EXPRESSION", {
176
                  "args" : [["EXPRESSION", {
177
                    "args" : [["EXPRESSION", {
178
                      "args" : [["EXPRESSION", {
179
                        "args" : [["CALL", ["SIMPLE_NAME", "number"]]]}
180
                      ]]}
181
                    ]]}
182
                  ]]}
183
                ]}
184
              ]]}
185
            ]}
186
          ], "PROCESS_STATEMENT_PART" : [["WAIT_STATEMENT"], ["VARIABLE_ASSIGNMENT_STATEMENT", {
187
            "lhs" : ["SIMPLE_NAME", "new_header"], "rhs" : ["EXPRESSION", {
188
              "args" : [["EXPRESSION", {
189
                "args" : [["EXPRESSION", {
190
                  "args" : [["EXPRESSION", {
191
                    "args" : [["QUALIFIED_EXPRESSION", {
192
                      "type_mark" : ["SIMPLE_NAME", "pkt_header"], "aggregate" : [{
193
                        "choices" : [["EXPRESSION", {
194
                          "args" : [["EXPRESSION", {
195
                            "args" : [["CALL", ["SIMPLE_NAME", "dest"]]]}
196
                          ]]}
197
                        ]], "expr" : ["EXPRESSION", {
198
                          "args" : [["EXPRESSION", {
199
                            "args" : [["EXPRESSION", {
200
                              "args" : [["EXPRESSION", {
201
                                "args" : [["CALL", ["SIMPLE_NAME", "target_host_id"]]]}
202
                              ]]}
203
                            ]]}
204
                          ]]}
205
                        ]}
206
                      , {
207
                        "choices" : [["EXPRESSION", {
208
                          "args" : [["EXPRESSION", {
209
                            "args" : [["CALL", ["SIMPLE_NAME", "src"]]]}
210
                          ]]}
211
                        ]], "expr" : ["EXPRESSION", {
212
                          "args" : [["EXPRESSION", {
213
                            "args" : [["EXPRESSION", {
214
                              "args" : [["EXPRESSION", {
215
                                "args" : [["CALL", ["SIMPLE_NAME", "my_host_id"]]]}
216
                              ]]}
217
                            ]]}
218
                          ]]}
219
                        ]}
220
                      , {
221
                        "choices" : [["EXPRESSION", {
222
                          "args" : [["EXPRESSION", {
223
                            "args" : [["CALL", ["SIMPLE_NAME", "pkt_type"]]]}
224
                          ]]}
225
                        ]], "expr" : ["EXPRESSION", {
226
                          "args" : [["EXPRESSION", {
227
                            "args" : [["EXPRESSION", {
228
                              "args" : [["EXPRESSION", {
229
                                "args" : [["CALL", ["SIMPLE_NAME", "control_pkt"]]]}
230
                              ]]}
231
                            ]]}
232
                          ]]}
233
                        ]}
234
                      , {
235
                        "choices" : [["EXPRESSION", {
236
                          "args" : [["EXPRESSION", {
237
                            "args" : [["CALL", ["SIMPLE_NAME", "seq"]]]}
238
                          ]]}
239
                        ]], "expr" : ["EXPRESSION", {
240
                          "args" : [["EXPRESSION", {
241
                            "args" : [["EXPRESSION", {
242
                              "args" : [["EXPRESSION", {
243
                                "args" : [["CALL", ["SIMPLE_NAME", "generate_seq_number"]]]}
244
                              ]]}
245
                            ]]}
246
                          ]]}
247
                        ]}
248
                      ]}
249
                    ]]}
250
                  ]]}
251
                ]]}
252
              ]]}
253
            ]}
254
          ]]}
255
        ]]}
256
      ]}
257
    ]}
258
  }