Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / vhdl_json / vhdl_files / 2-exportOK / cnes_guidelines / rule / data / CNE_02000_bad.json @ 3fd18385

History | View | Annotate | Download (17.6 KB)

1
{
2
  "DESIGN_FILE" : {
3
    "design_units" : [{
4
      "contexts" : [["LIBRARY_CLAUSE", [["IDENTIFIER", "IEEE"]]], ["USE_CLAUSE", [["SELECTED_NAME", [["SIMPLE_NAME", "IEEE"], ["SIMPLE_NAME", "std_logic_1164"]]]]], ["USE_CLAUSE", [["SELECTED_NAME", [["SIMPLE_NAME", "IEEE"], ["SIMPLE_NAME", "numeric_std"]]]]]], "library" : ["ENTITY_DECLARATION", {
5
        "name" : ["IDENTIFIER", "CNE_02000_bad"], "ports" : [{
6
          "names" : [["IDENTIFIER", "i_Clock"]], "mode" : ["in"], "typ" : {
7
            "name" : ["SIMPLE_NAME", "std_logic"]}
8
          }
9
        , {
10
          "names" : [["IDENTIFIER", "i_Reset_n"]], "mode" : ["in"], "typ" : {
11
            "name" : ["SIMPLE_NAME", "std_logic"]}
12
          }
13
        , {
14
          "names" : [["IDENTIFIER", "i_Start"]], "mode" : ["in"], "typ" : {
15
            "name" : ["SIMPLE_NAME", "std_logic"]}
16
          }
17
        , {
18
          "names" : [["IDENTIFIER", "i_Stop"]], "mode" : ["in"], "typ" : {
19
            "name" : ["SIMPLE_NAME", "std_logic"]}
20
          }
21
        ], "ENTITY_DECLARATIVE_PART" : [], "ENTITY_STATEMENT_PART" : []}
22
      ]}
23
    , {
24
      "contexts" : [], "library" : ["ARCHITECTURE_BODY", {
25
        "name" : ["IDENTIFIER", "Behavioral"], "entity" : ["IDENTIFIER", "CNE_02000_bad"], "ARCHITECTURE_DECLARATIVE_PART" : [{
26
          "declaration" : ["CONSTANT_DECLARATION", {
27
            "names" : [["IDENTIFIER", "c_Length"]], "typ" : {
28
              "name" : ["SIMPLE_NAME", "std_logic_vector"], "const" : ["INDEX_CONSTRAINT", {
29
                "ranges" : [["RANGE_WITH_DIRECTION", {
30
                  "direction" : "downto", "from" : ["EXPRESSION", {
31
                    "args" : [["EXPRESSION", {
32
                      "args" : [["CONSTANT_VALUE", {
33
                        "value" : ["CST_LITERAL", "3"]}
34
                      ]]}
35
                    ]]}
36
                  ], "_to" : ["EXPRESSION", {
37
                    "args" : [["EXPRESSION", {
38
                      "args" : [["CONSTANT_VALUE", {
39
                        "value" : ["CST_LITERAL", "0"]}
40
                      ]]}
41
                    ]]}
42
                  ]}
43
                ]]}
44
              ]}
45
            , "init_val" : ["EXPRESSION", {
46
              "args" : [["EXPRESSION", {
47
                "args" : [["EXPRESSION", {
48
                  "args" : [["EXPRESSION", {
49
                    "args" : [["AGGREGATE", {
50
                      "elems" : [{
51
                        "choices" : [["OTHERS"]], "expr" : ["EXPRESSION", {
52
                          "args" : [["EXPRESSION", {
53
                            "args" : [["EXPRESSION", {
54
                              "args" : [["EXPRESSION", {
55
                                "args" : [["CONSTANT_VALUE", {
56
                                  "value" : ["CST_LITERAL", "'1'"]}
57
                                ]]}
58
                              ]]}
59
                            ]]}
60
                          ]]}
61
                        ]}
62
                      ]}
63
                    ]]}
64
                  ]]}
65
                ]]}
66
              ]]}
67
            ]}
68
          ]}
69
        , {
70
          "definition" : ["TYPE_DECLARATION", {
71
            "name" : ["IDENTIFIER", "t_state"], "definition" : ["ENUMERATION_TYPE_DEFINITION", [["IDENTIFIER", "init"], ["IDENTIFIER", "loading"], ["IDENTIFIER", "enabled"], ["IDENTIFIER", "finished"]]]}
72
          ]}
73
        , {
74
          "declaration" : ["SIGNAL_DECLARATION", {
75
            "names" : [["IDENTIFIER", "State"]], "typ" : {
76
              "name" : ["SIMPLE_NAME", "t_state"]}
77
            }
78
          ]}
79
        , {
80
          "declaration" : ["SIGNAL_DECLARATION", {
81
            "names" : [["IDENTIFIER", "Raz"]], "typ" : {
82
              "name" : ["SIMPLE_NAME", "std_logic"]}
83
            }
84
          ]}
85
        , {
86
          "declaration" : ["SIGNAL_DECLARATION", {
87
            "names" : [["IDENTIFIER", "Enable"]], "typ" : {
88
              "name" : ["SIMPLE_NAME", "std_logic"]}
89
            }
90
          ]}
91
        , {
92
          "declaration" : ["SIGNAL_DECLARATION", {
93
            "names" : [["IDENTIFIER", "Length"]], "typ" : {
94
              "name" : ["SIMPLE_NAME", "std_logic_vector"], "const" : ["INDEX_CONSTRAINT", {
95
                "ranges" : [["RANGE_WITH_DIRECTION", {
96
                  "direction" : "downto", "from" : ["EXPRESSION", {
97
                    "args" : [["EXPRESSION", {
98
                      "args" : [["CONSTANT_VALUE", {
99
                        "value" : ["CST_LITERAL", "3"]}
100
                      ]]}
101
                    ]]}
102
                  ], "_to" : ["EXPRESSION", {
103
                    "args" : [["EXPRESSION", {
104
                      "args" : [["CONSTANT_VALUE", {
105
                        "value" : ["CST_LITERAL", "0"]}
106
                      ]]}
107
                    ]]}
108
                  ]}
109
                ]]}
110
              ]}
111
            }
112
          ]}
113
        , {
114
          "declaration" : ["SIGNAL_DECLARATION", {
115
            "names" : [["IDENTIFIER", "End_Count"]], "typ" : {
116
              "name" : ["SIMPLE_NAME", "std_logic"]}
117
            }
118
          ]}
119
        ], "ARCHITECTURE_STATEMENT_PART" : [["COMPONENT_INSTANTIATION_STATEMENT", {
120
          "name" : ["IDENTIFIER", "Counter"], "inst_unit" : ["SIMPLE_NAME", "Counter"], "inst_unit_type" : "component", "port_map" : [{
121
            "formal_name" : ["SIMPLE_NAME", "i_Clock"], "actual_designator" : ["SIMPLE_NAME", "i_Clock"]}
122
          , {
123
            "formal_name" : ["SIMPLE_NAME", "i_Reset_n"], "actual_designator" : ["SIMPLE_NAME", "i_Reset_n"]}
124
          , {
125
            "formal_name" : ["SIMPLE_NAME", "i_Raz"], "actual_designator" : ["SIMPLE_NAME", "Raz"]}
126
          , {
127
            "formal_name" : ["SIMPLE_NAME", "i_Enable"], "actual_designator" : ["SIMPLE_NAME", "Enable"]}
128
          , {
129
            "formal_name" : ["SIMPLE_NAME", "i_Length"], "actual_designator" : ["SIMPLE_NAME", "Length"]}
130
          , {
131
            "formal_name" : ["SIMPLE_NAME", "o_Done"], "actual_designator" : ["SIMPLE_NAME", "End_Count"]}
132
          ]}
133
        ], ["PROCESS_STATEMENT", {
134
          "id" : ["IDENTIFIER", "P_FSM"], "active_sigs" : [["SIMPLE_NAME", "i_Reset_n"], ["SIMPLE_NAME", "i_Clock"]], "PROCESS_STATEMENT_PART" : [["IF_STATEMENT", {
135
            "if_cases" : [{
136
              "if_cond" : ["EXPRESSION", {
137
                "args" : [["EXPRESSION", {
138
                  "args" : [["EXPRESSION", {
139
                    "args" : [["EXPRESSION", {
140
                      "args" : [["EXPRESSION", {
141
                        "id" : "=", "args" : [["EXPRESSION", {
142
                          "args" : [["EXPRESSION", {
143
                            "args" : [["EXPRESSION", {
144
                              "args" : [["CALL", ["SIMPLE_NAME", "i_Reset_n"]]]}
145
                            ]]}
146
                          ]]}
147
                        ], ["EXPRESSION", {
148
                          "args" : [["EXPRESSION", {
149
                            "args" : [["EXPRESSION", {
150
                              "args" : [["CONSTANT_VALUE", {
151
                                "value" : ["CST_LITERAL", "'0'"]}
152
                              ]]}
153
                            ]]}
154
                          ]]}
155
                        ]]}
156
                      ]]}
157
                    ]]}
158
                  ]]}
159
                ]]}
160
              ], "if_block" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
161
                "lhs" : ["SIMPLE_NAME", "State"], "rhs" : [{
162
                  "value" : ["EXPRESSION", {
163
                    "args" : [["EXPRESSION", {
164
                      "args" : [["EXPRESSION", {
165
                        "args" : [["EXPRESSION", {
166
                          "args" : [["CALL", ["SIMPLE_NAME", "init"]]]}
167
                        ]]}
168
                      ]]}
169
                    ]]}
170
                  ]}
171
                ]}
172
              ]]}
173
            , {
174
              "if_cond" : ["EXPRESSION", {
175
                "args" : [["EXPRESSION", {
176
                  "args" : [["EXPRESSION", {
177
                    "args" : [["EXPRESSION", {
178
                      "args" : [["EXPRESSION", {
179
                        "args" : [["EXPRESSION", {
180
                          "args" : [["EXPRESSION", {
181
                            "args" : [["EXPRESSION", {
182
                              "args" : [["CALL", ["INDEXED_NAME", {
183
                                "id" : ["SIMPLE_NAME", "rising_edge"], "exprs" : [["EXPRESSION", {
184
                                  "args" : [["EXPRESSION", {
185
                                    "args" : [["EXPRESSION", {
186
                                      "args" : [["EXPRESSION", {
187
                                        "args" : [["CALL", ["SIMPLE_NAME", "i_Clock"]]]}
188
                                      ]]}
189
                                    ]]}
190
                                  ]]}
191
                                ]]}
192
                              ]]]}
193
                            ]]}
194
                          ]]}
195
                        ]]}
196
                      ]]}
197
                    ]]}
198
                  ]]}
199
                ]]}
200
              ], "if_block" : [["CASE_STATEMENT_TREE", {
201
                "guard" : ["EXPRESSION", {
202
                  "args" : [["EXPRESSION", {
203
                    "args" : [["EXPRESSION", {
204
                      "args" : [["EXPRESSION", {
205
                        "args" : [["CALL", ["SIMPLE_NAME", "State"]]]}
206
                      ]]}
207
                    ]]}
208
                  ]]}
209
                ], "branches" : [{
210
                  "when_cond" : [["EXPRESSION", {
211
                    "args" : [["EXPRESSION", {
212
                      "args" : [["CALL", ["SIMPLE_NAME", "init"]]]}
213
                    ]]}
214
                  ]], "when_stmt" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
215
                    "lhs" : ["SIMPLE_NAME", "Length"], "rhs" : [{
216
                      "value" : ["EXPRESSION", {
217
                        "args" : [["EXPRESSION", {
218
                          "args" : [["EXPRESSION", {
219
                            "args" : [["EXPRESSION", {
220
                              "args" : [["CALL", ["SIMPLE_NAME", "c_Length"]]]}
221
                            ]]}
222
                          ]]}
223
                        ]]}
224
                      ]}
225
                    ]}
226
                  ], ["SIGNAL_ASSIGNMENT_STATEMENT", {
227
                    "lhs" : ["SIMPLE_NAME", "State"], "rhs" : [{
228
                      "value" : ["EXPRESSION", {
229
                        "args" : [["EXPRESSION", {
230
                          "args" : [["EXPRESSION", {
231
                            "args" : [["EXPRESSION", {
232
                              "args" : [["CALL", ["SIMPLE_NAME", "loading"]]]}
233
                            ]]}
234
                          ]]}
235
                        ]]}
236
                      ]}
237
                    ]}
238
                  ]]}
239
                , {
240
                  "when_cond" : [["EXPRESSION", {
241
                    "args" : [["EXPRESSION", {
242
                      "args" : [["CALL", ["SIMPLE_NAME", "loading"]]]}
243
                    ]]}
244
                  ]], "when_stmt" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
245
                    "lhs" : ["SIMPLE_NAME", "Raz"], "rhs" : [{
246
                      "value" : ["EXPRESSION", {
247
                        "args" : [["EXPRESSION", {
248
                          "args" : [["EXPRESSION", {
249
                            "args" : [["EXPRESSION", {
250
                              "args" : [["CONSTANT_VALUE", {
251
                                "value" : ["CST_LITERAL", "'1'"]}
252
                              ]]}
253
                            ]]}
254
                          ]]}
255
                        ]]}
256
                      ]}
257
                    ]}
258
                  ], ["SIGNAL_ASSIGNMENT_STATEMENT", {
259
                    "lhs" : ["SIMPLE_NAME", "State"], "rhs" : [{
260
                      "value" : ["EXPRESSION", {
261
                        "args" : [["EXPRESSION", {
262
                          "args" : [["EXPRESSION", {
263
                            "args" : [["EXPRESSION", {
264
                              "args" : [["CALL", ["SIMPLE_NAME", "enabled"]]]}
265
                            ]]}
266
                          ]]}
267
                        ]]}
268
                      ]}
269
                    ]}
270
                  ]]}
271
                , {
272
                  "when_cond" : [["EXPRESSION", {
273
                    "args" : [["EXPRESSION", {
274
                      "args" : [["CALL", ["SIMPLE_NAME", "enabled"]]]}
275
                    ]]}
276
                  ]], "when_stmt" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
277
                    "lhs" : ["SIMPLE_NAME", "Raz"], "rhs" : [{
278
                      "value" : ["EXPRESSION", {
279
                        "args" : [["EXPRESSION", {
280
                          "args" : [["EXPRESSION", {
281
                            "args" : [["EXPRESSION", {
282
                              "args" : [["CONSTANT_VALUE", {
283
                                "value" : ["CST_LITERAL", "'0'"]}
284
                              ]]}
285
                            ]]}
286
                          ]]}
287
                        ]]}
288
                      ]}
289
                    ]}
290
                  ], ["IF_STATEMENT", {
291
                    "if_cases" : [{
292
                      "if_cond" : ["EXPRESSION", {
293
                        "args" : [["EXPRESSION", {
294
                          "args" : [["EXPRESSION", {
295
                            "args" : [["EXPRESSION", {
296
                              "args" : [["EXPRESSION", {
297
                                "id" : "=", "args" : [["EXPRESSION", {
298
                                  "args" : [["EXPRESSION", {
299
                                    "args" : [["EXPRESSION", {
300
                                      "args" : [["CALL", ["SIMPLE_NAME", "End_Count"]]]}
301
                                    ]]}
302
                                  ]]}
303
                                ], ["EXPRESSION", {
304
                                  "args" : [["EXPRESSION", {
305
                                    "args" : [["EXPRESSION", {
306
                                      "args" : [["CONSTANT_VALUE", {
307
                                        "value" : ["CST_LITERAL", "'0'"]}
308
                                      ]]}
309
                                    ]]}
310
                                  ]]}
311
                                ]]}
312
                              ]]}
313
                            ]]}
314
                          ]]}
315
                        ]]}
316
                      ], "if_block" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
317
                        "lhs" : ["SIMPLE_NAME", "Enable"], "rhs" : [{
318
                          "value" : ["EXPRESSION", {
319
                            "id" : "xor", "args" : [["EXPRESSION", {
320
                              "args" : [["EXPRESSION", {
321
                                "args" : [["EXPRESSION", {
322
                                  "args" : [["EXPRESSION", {
323
                                    "args" : [["CALL", ["SIMPLE_NAME", "i_Start"]]]}
324
                                  ]]}
325
                                ]]}
326
                              ]]}
327
                            ], ["EXPRESSION", {
328
                              "args" : [["EXPRESSION", {
329
                                "args" : [["EXPRESSION", {
330
                                  "args" : [["EXPRESSION", {
331
                                    "id" : "not", "args" : [["CALL", ["SIMPLE_NAME", "i_Stop"]]]}
332
                                  ]]}
333
                                ]]}
334
                              ]]}
335
                            ]]}
336
                          ]}
337
                        ]}
338
                      ], ["SIGNAL_ASSIGNMENT_STATEMENT", {
339
                        "lhs" : ["SIMPLE_NAME", "State"], "rhs" : [{
340
                          "value" : ["EXPRESSION", {
341
                            "args" : [["EXPRESSION", {
342
                              "args" : [["EXPRESSION", {
343
                                "args" : [["EXPRESSION", {
344
                                  "args" : [["CALL", ["SIMPLE_NAME", "Enabled"]]]}
345
                                ]]}
346
                              ]]}
347
                            ]]}
348
                          ]}
349
                        ]}
350
                      ]]}
351
                    ], "default" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
352
                      "lhs" : ["SIMPLE_NAME", "Enable"], "rhs" : [{
353
                        "value" : ["EXPRESSION", {
354
                          "args" : [["EXPRESSION", {
355
                            "args" : [["EXPRESSION", {
356
                              "args" : [["EXPRESSION", {
357
                                "args" : [["CONSTANT_VALUE", {
358
                                  "value" : ["CST_LITERAL", "'0'"]}
359
                                ]]}
360
                              ]]}
361
                            ]]}
362
                          ]]}
363
                        ]}
364
                      ]}
365
                    ], ["SIGNAL_ASSIGNMENT_STATEMENT", {
366
                      "lhs" : ["SIMPLE_NAME", "State"], "rhs" : [{
367
                        "value" : ["EXPRESSION", {
368
                          "args" : [["EXPRESSION", {
369
                            "args" : [["EXPRESSION", {
370
                              "args" : [["EXPRESSION", {
371
                                "args" : [["CALL", ["SIMPLE_NAME", "finished"]]]}
372
                              ]]}
373
                            ]]}
374
                          ]]}
375
                        ]}
376
                      ]}
377
                    ]]}
378
                  ]]}
379
                , {
380
                  "when_cond" : [["OTHERS"]], "when_stmt" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
381
                    "lhs" : ["SIMPLE_NAME", "State"], "rhs" : [{
382
                      "value" : ["EXPRESSION", {
383
                        "args" : [["EXPRESSION", {
384
                          "args" : [["EXPRESSION", {
385
                            "args" : [["EXPRESSION", {
386
                              "args" : [["CALL", ["SIMPLE_NAME", "init"]]]}
387
                            ]]}
388
                          ]]}
389
                        ]]}
390
                      ]}
391
                    ]}
392
                  ]]}
393
                ]}
394
              ]]}
395
            ]}
396
          ]]}
397
        ]]}
398
      ]}
399
    ]}
400
  }