Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / vhdl_json / vhdl_files / 2-exportOK / cnes_guidelines / rule / data / CNE_04500_bad.json @ 2051e520

History | View | Annotate | Download (23.4 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_04500_bad"], "generics" : [{
6
          "names" : [["IDENTIFIER", "g_Width"]], "typ" : {
7
            "name" : ["SIMPLE_NAME", "positive"]}
8
          , "expr" : ["EXPRESSION", {
9
            "args" : [["EXPRESSION", {
10
              "args" : [["EXPRESSION", {
11
                "args" : [["EXPRESSION", {
12
                  "args" : [["CONSTANT_VALUE", {
13
                    "value" : ["CST_LITERAL", "4"]}
14
                  ]]}
15
                ]]}
16
              ]]}
17
            ]]}
18
          ]}
19
        ], "ports" : [{
20
          "names" : [["IDENTIFIER", "i_Clock"]], "mode" : ["in"], "typ" : {
21
            "name" : ["SIMPLE_NAME", "std_logic"]}
22
          }
23
        , {
24
          "names" : [["IDENTIFIER", "i_Reset_n"]], "mode" : ["in"], "typ" : {
25
            "name" : ["SIMPLE_NAME", "std_logic"]}
26
          }
27
        , {
28
          "names" : [["IDENTIFIER", "i_Data"]], "mode" : ["in"], "typ" : {
29
            "name" : ["SIMPLE_NAME", "std_logic_vector"], "const" : ["INDEX_CONSTRAINT", {
30
              "ranges" : [["RANGE_WITH_DIRECTION", {
31
                "direction" : "downto", "from" : ["EXPRESSION", {
32
                  "args" : [["EXPRESSION", {
33
                    "id" : "-", "args" : [["EXPRESSION", {
34
                      "args" : [["CALL", ["SIMPLE_NAME", "g_Width"]]]}
35
                    ], ["EXPRESSION", {
36
                      "args" : [["CONSTANT_VALUE", {
37
                        "value" : ["CST_LITERAL", "1"]}
38
                      ]]}
39
                    ]]}
40
                  ]]}
41
                ], "_to" : ["EXPRESSION", {
42
                  "args" : [["EXPRESSION", {
43
                    "args" : [["CONSTANT_VALUE", {
44
                      "value" : ["CST_LITERAL", "0"]}
45
                    ]]}
46
                  ]]}
47
                ]}
48
              ]]}
49
            ]}
50
          }
51
        , {
52
          "names" : [["IDENTIFIER", "o_Sum"]], "mode" : ["out"], "typ" : {
53
            "name" : ["SIMPLE_NAME", "std_logic_vector"], "const" : ["INDEX_CONSTRAINT", {
54
              "ranges" : [["RANGE_WITH_DIRECTION", {
55
                "direction" : "downto", "from" : ["EXPRESSION", {
56
                  "args" : [["EXPRESSION", {
57
                    "args" : [["CALL", ["SIMPLE_NAME", "g_Width"]]]}
58
                  ]]}
59
                ], "_to" : ["EXPRESSION", {
60
                  "args" : [["EXPRESSION", {
61
                    "args" : [["CONSTANT_VALUE", {
62
                      "value" : ["CST_LITERAL", "0"]}
63
                    ]]}
64
                  ]]}
65
                ]}
66
              ]]}
67
            ]}
68
          }
69
        ], "ENTITY_DECLARATIVE_PART" : [], "ENTITY_STATEMENT_PART" : []}
70
      ]}
71
    , {
72
      "contexts" : [], "library" : ["ARCHITECTURE_BODY", {
73
        "name" : ["IDENTIFIER", "Behavioral"], "entity" : ["IDENTIFIER", "CNE_04500_bad"], "ARCHITECTURE_DECLARATIVE_PART" : [{
74
          "definition" : ["TYPE_DECLARATION", {
75
            "name" : ["IDENTIFIER", "Data_4_Reg"], "definition" : ["ARRAY_TYPE_DEFINITION", {
76
              "const" : ["INDEX_CONSTRAINT", {
77
                "ranges" : [["RANGE_WITH_DIRECTION", {
78
                  "direction" : "to", "from" : ["EXPRESSION", {
79
                    "args" : [["EXPRESSION", {
80
                      "args" : [["CONSTANT_VALUE", {
81
                        "value" : ["CST_LITERAL", "0"]}
82
                      ]]}
83
                    ]]}
84
                  ], "_to" : ["EXPRESSION", {
85
                    "args" : [["EXPRESSION", {
86
                      "args" : [["CONSTANT_VALUE", {
87
                        "value" : ["CST_LITERAL", "3"]}
88
                      ]]}
89
                    ]]}
90
                  ]}
91
                ]]}
92
              ], "definition" : {
93
                "name" : ["SIMPLE_NAME", "std_logic_vector"], "const" : ["INDEX_CONSTRAINT", {
94
                  "ranges" : [["RANGE_WITH_DIRECTION", {
95
                    "direction" : "downto", "from" : ["EXPRESSION", {
96
                      "args" : [["EXPRESSION", {
97
                        "id" : "-", "args" : [["EXPRESSION", {
98
                          "args" : [["CALL", ["SIMPLE_NAME", "g_Width"]]]}
99
                        ], ["EXPRESSION", {
100
                          "args" : [["CONSTANT_VALUE", {
101
                            "value" : ["CST_LITERAL", "1"]}
102
                          ]]}
103
                        ]]}
104
                      ]]}
105
                    ], "_to" : ["EXPRESSION", {
106
                      "args" : [["EXPRESSION", {
107
                        "args" : [["CONSTANT_VALUE", {
108
                          "value" : ["CST_LITERAL", "0"]}
109
                        ]]}
110
                      ]]}
111
                    ]}
112
                  ]]}
113
                ]}
114
              }
115
            ]}
116
          ]}
117
        , {
118
          "declaration" : ["SIGNAL_DECLARATION", {
119
            "names" : [["IDENTIFIER", "Data_Reg"]], "typ" : {
120
              "name" : ["SIMPLE_NAME", "Data_4_Reg"]}
121
            }
122
          ]}
123
        , {
124
          "declaration" : ["SIGNAL_DECLARATION", {
125
            "names" : [["IDENTIFIER", "Sum"]], "typ" : {
126
              "name" : ["SIMPLE_NAME", "std_logic_vector"], "const" : ["INDEX_CONSTRAINT", {
127
                "ranges" : [["RANGE_WITH_DIRECTION", {
128
                  "direction" : "downto", "from" : ["EXPRESSION", {
129
                    "args" : [["EXPRESSION", {
130
                      "args" : [["CALL", ["SIMPLE_NAME", "g_Width"]]]}
131
                    ]]}
132
                  ], "_to" : ["EXPRESSION", {
133
                    "args" : [["EXPRESSION", {
134
                      "args" : [["CONSTANT_VALUE", {
135
                        "value" : ["CST_LITERAL", "0"]}
136
                      ]]}
137
                    ]]}
138
                  ]}
139
                ]]}
140
              ]}
141
            }
142
          ]}
143
        , {
144
          "declaration" : ["SIGNAL_DECLARATION", {
145
            "names" : [["IDENTIFIER", "Sum_r"]], "typ" : {
146
              "name" : ["SIMPLE_NAME", "std_logic_vector"], "const" : ["INDEX_CONSTRAINT", {
147
                "ranges" : [["RANGE_WITH_DIRECTION", {
148
                  "direction" : "downto", "from" : ["EXPRESSION", {
149
                    "args" : [["EXPRESSION", {
150
                      "args" : [["CALL", ["SIMPLE_NAME", "g_Width"]]]}
151
                    ]]}
152
                  ], "_to" : ["EXPRESSION", {
153
                    "args" : [["EXPRESSION", {
154
                      "args" : [["CONSTANT_VALUE", {
155
                        "value" : ["CST_LITERAL", "0"]}
156
                      ]]}
157
                    ]]}
158
                  ]}
159
                ]]}
160
              ]}
161
            }
162
          ]}
163
        ], "ARCHITECTURE_STATEMENT_PART" : [["PROCESS_STATEMENT", {
164
          "id" : ["IDENTIFIER", "p_Reg"], "active_sigs" : [["SIMPLE_NAME", "i_Reset_n"], ["SIMPLE_NAME", "i_Clock"]], "PROCESS_STATEMENT_PART" : [["IF_STATEMENT", {
165
            "if_cases" : [{
166
              "if_cond" : ["EXPRESSION", {
167
                "args" : [["EXPRESSION", {
168
                  "args" : [["EXPRESSION", {
169
                    "args" : [["EXPRESSION", {
170
                      "args" : [["EXPRESSION", {
171
                        "id" : "=", "args" : [["EXPRESSION", {
172
                          "args" : [["EXPRESSION", {
173
                            "args" : [["EXPRESSION", {
174
                              "args" : [["CALL", ["SIMPLE_NAME", "i_Reset_n"]]]}
175
                            ]]}
176
                          ]]}
177
                        ], ["EXPRESSION", {
178
                          "args" : [["EXPRESSION", {
179
                            "args" : [["EXPRESSION", {
180
                              "args" : [["CONSTANT_VALUE", {
181
                                "value" : ["CST_LITERAL", "'0'"]}
182
                              ]]}
183
                            ]]}
184
                          ]]}
185
                        ]]}
186
                      ]]}
187
                    ]]}
188
                  ]]}
189
                ]]}
190
              ], "if_block" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
191
                "lhs" : ["SIMPLE_NAME", "Data_Reg"], "rhs" : [{
192
                  "value" : ["EXPRESSION", {
193
                    "args" : [["EXPRESSION", {
194
                      "args" : [["EXPRESSION", {
195
                        "args" : [["EXPRESSION", {
196
                          "args" : [["AGGREGATE", {
197
                            "elems" : [{
198
                              "choices" : [["OTHERS"]], "expr" : ["EXPRESSION", {
199
                                "args" : [["EXPRESSION", {
200
                                  "args" : [["EXPRESSION", {
201
                                    "args" : [["EXPRESSION", {
202
                                      "args" : [["AGGREGATE", {
203
                                        "elems" : [{
204
                                          "choices" : [["OTHERS"]], "expr" : ["EXPRESSION", {
205
                                            "args" : [["EXPRESSION", {
206
                                              "args" : [["EXPRESSION", {
207
                                                "args" : [["EXPRESSION", {
208
                                                  "args" : [["CONSTANT_VALUE", {
209
                                                    "value" : ["CST_LITERAL", "'0'"]}
210
                                                  ]]}
211
                                                ]]}
212
                                              ]]}
213
                                            ]]}
214
                                          ]}
215
                                        ]}
216
                                      ]]}
217
                                    ]]}
218
                                  ]]}
219
                                ]]}
220
                              ]}
221
                            ]}
222
                          ]]}
223
                        ]]}
224
                      ]]}
225
                    ]]}
226
                  ]}
227
                ]}
228
              ]]}
229
            , {
230
              "if_cond" : ["EXPRESSION", {
231
                "args" : [["EXPRESSION", {
232
                  "args" : [["EXPRESSION", {
233
                    "args" : [["EXPRESSION", {
234
                      "args" : [["EXPRESSION", {
235
                        "args" : [["EXPRESSION", {
236
                          "args" : [["EXPRESSION", {
237
                            "args" : [["EXPRESSION", {
238
                              "args" : [["CALL", ["FUNCTION_CALL", {
239
                                "id" : ["SIMPLE_NAME", "rising_edge"], "assoc_list" : [{
240
                                  "actual_designator" : ["SIMPLE_NAME", "i_Clock"]}
241
                                ]}
242
                              ]]]}
243
                            ]]}
244
                          ]]}
245
                        ]]}
246
                      ]]}
247
                    ]]}
248
                  ]]}
249
                ]]}
250
              ], "if_block" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
251
                "lhs" : ["INDEXED_NAME", {
252
                  "id" : ["SIMPLE_NAME", "Data_Reg"], "exprs" : [["EXPRESSION", {
253
                    "args" : [["EXPRESSION", {
254
                      "args" : [["EXPRESSION", {
255
                        "args" : [["EXPRESSION", {
256
                          "args" : [["CONSTANT_VALUE", {
257
                            "value" : ["CST_LITERAL", "3"]}
258
                          ]]}
259
                        ]]}
260
                      ]]}
261
                    ]]}
262
                  ]]}
263
                ], "rhs" : [{
264
                  "value" : ["EXPRESSION", {
265
                    "args" : [["EXPRESSION", {
266
                      "args" : [["EXPRESSION", {
267
                        "args" : [["EXPRESSION", {
268
                          "args" : [["CALL", ["FUNCTION_CALL", {
269
                            "id" : ["SIMPLE_NAME", "Data_Reg"], "assoc_list" : [{
270
                              "actual_expr" : ["EXPRESSION", {
271
                                "args" : [["EXPRESSION", {
272
                                  "args" : [["EXPRESSION", {
273
                                    "args" : [["EXPRESSION", {
274
                                      "args" : [["CONSTANT_VALUE", {
275
                                        "value" : ["CST_LITERAL", "2"]}
276
                                      ]]}
277
                                    ]]}
278
                                  ]]}
279
                                ]]}
280
                              ]}
281
                            ]}
282
                          ]]]}
283
                        ]]}
284
                      ]]}
285
                    ]]}
286
                  ]}
287
                ]}
288
              ], ["SIGNAL_ASSIGNMENT_STATEMENT", {
289
                "lhs" : ["INDEXED_NAME", {
290
                  "id" : ["SIMPLE_NAME", "Data_Reg"], "exprs" : [["EXPRESSION", {
291
                    "args" : [["EXPRESSION", {
292
                      "args" : [["EXPRESSION", {
293
                        "args" : [["EXPRESSION", {
294
                          "args" : [["CONSTANT_VALUE", {
295
                            "value" : ["CST_LITERAL", "2"]}
296
                          ]]}
297
                        ]]}
298
                      ]]}
299
                    ]]}
300
                  ]]}
301
                ], "rhs" : [{
302
                  "value" : ["EXPRESSION", {
303
                    "args" : [["EXPRESSION", {
304
                      "args" : [["EXPRESSION", {
305
                        "args" : [["EXPRESSION", {
306
                          "args" : [["CALL", ["FUNCTION_CALL", {
307
                            "id" : ["SIMPLE_NAME", "Data_Reg"], "assoc_list" : [{
308
                              "actual_expr" : ["EXPRESSION", {
309
                                "args" : [["EXPRESSION", {
310
                                  "args" : [["EXPRESSION", {
311
                                    "args" : [["EXPRESSION", {
312
                                      "args" : [["CONSTANT_VALUE", {
313
                                        "value" : ["CST_LITERAL", "1"]}
314
                                      ]]}
315
                                    ]]}
316
                                  ]]}
317
                                ]]}
318
                              ]}
319
                            ]}
320
                          ]]]}
321
                        ]]}
322
                      ]]}
323
                    ]]}
324
                  ]}
325
                ]}
326
              ], ["SIGNAL_ASSIGNMENT_STATEMENT", {
327
                "lhs" : ["INDEXED_NAME", {
328
                  "id" : ["SIMPLE_NAME", "Data_Reg"], "exprs" : [["EXPRESSION", {
329
                    "args" : [["EXPRESSION", {
330
                      "args" : [["EXPRESSION", {
331
                        "args" : [["EXPRESSION", {
332
                          "args" : [["CONSTANT_VALUE", {
333
                            "value" : ["CST_LITERAL", "1"]}
334
                          ]]}
335
                        ]]}
336
                      ]]}
337
                    ]]}
338
                  ]]}
339
                ], "rhs" : [{
340
                  "value" : ["EXPRESSION", {
341
                    "args" : [["EXPRESSION", {
342
                      "args" : [["EXPRESSION", {
343
                        "args" : [["EXPRESSION", {
344
                          "args" : [["CALL", ["FUNCTION_CALL", {
345
                            "id" : ["SIMPLE_NAME", "Data_Reg"], "assoc_list" : [{
346
                              "actual_expr" : ["EXPRESSION", {
347
                                "args" : [["EXPRESSION", {
348
                                  "args" : [["EXPRESSION", {
349
                                    "args" : [["EXPRESSION", {
350
                                      "args" : [["CONSTANT_VALUE", {
351
                                        "value" : ["CST_LITERAL", "0"]}
352
                                      ]]}
353
                                    ]]}
354
                                  ]]}
355
                                ]]}
356
                              ]}
357
                            ]}
358
                          ]]]}
359
                        ]]}
360
                      ]]}
361
                    ]]}
362
                  ]}
363
                ]}
364
              ], ["SIGNAL_ASSIGNMENT_STATEMENT", {
365
                "lhs" : ["INDEXED_NAME", {
366
                  "id" : ["SIMPLE_NAME", "Data_Reg"], "exprs" : [["EXPRESSION", {
367
                    "args" : [["EXPRESSION", {
368
                      "args" : [["EXPRESSION", {
369
                        "args" : [["EXPRESSION", {
370
                          "args" : [["CONSTANT_VALUE", {
371
                            "value" : ["CST_LITERAL", "0"]}
372
                          ]]}
373
                        ]]}
374
                      ]]}
375
                    ]]}
376
                  ]]}
377
                ], "rhs" : [{
378
                  "value" : ["EXPRESSION", {
379
                    "args" : [["EXPRESSION", {
380
                      "args" : [["EXPRESSION", {
381
                        "args" : [["EXPRESSION", {
382
                          "args" : [["CALL", ["SIMPLE_NAME", "i_Data"]]]}
383
                        ]]}
384
                      ]]}
385
                    ]]}
386
                  ]}
387
                ]}
388
              ], ["SIGNAL_ASSIGNMENT_STATEMENT", {
389
                "lhs" : ["SIMPLE_NAME", "Sum_r"], "rhs" : [{
390
                  "value" : ["EXPRESSION", {
391
                    "args" : [["EXPRESSION", {
392
                      "args" : [["EXPRESSION", {
393
                        "args" : [["EXPRESSION", {
394
                          "args" : [["CALL", ["SIMPLE_NAME", "Sum"]]]}
395
                        ]]}
396
                      ]]}
397
                    ]]}
398
                  ]}
399
                ]}
400
              ]]}
401
            ]}
402
          ]]}
403
        ], ["CONDITIONAL_SIGNAL_ASSIGNMENT", {
404
          "postponed" : false, "lhs" : ["SIMPLE_NAME", "Sum"], "rhs" : [{
405
            "expr" : [{
406
              "value" : ["EXPRESSION", {
407
                "args" : [["EXPRESSION", {
408
                  "args" : [["EXPRESSION", {
409
                    "args" : [["EXPRESSION", {
410
                      "args" : [["CALL", ["FUNCTION_CALL", {
411
                        "id" : ["SIMPLE_NAME", "std_logic_vector"], "assoc_list" : [{
412
                          "actual_expr" : ["EXPRESSION", {
413
                            "args" : [["EXPRESSION", {
414
                              "args" : [["EXPRESSION", {
415
                                "args" : [["EXPRESSION", {
416
                                  "id" : "+", "args" : [["EXPRESSION", {
417
                                    "args" : [["CALL", ["FUNCTION_CALL", {
418
                                      "id" : ["SIMPLE_NAME", "unsigned"], "assoc_list" : [{
419
                                        "actual_expr" : ["EXPRESSION", {
420
                                          "args" : [["EXPRESSION", {
421
                                            "args" : [["EXPRESSION", {
422
                                              "args" : [["EXPRESSION", {
423
                                                "id" : "&", "args" : [["EXPRESSION", {
424
                                                  "args" : [["CONSTANT_VALUE", {
425
                                                    "value" : ["CST_LITERAL", "'0'"]}
426
                                                  ]]}
427
                                                ], ["EXPRESSION", {
428
                                                  "args" : [["CALL", ["FUNCTION_CALL", {
429
                                                    "id" : ["SIMPLE_NAME", "Data_Reg"], "assoc_list" : [{
430
                                                      "actual_expr" : ["EXPRESSION", {
431
                                                        "args" : [["EXPRESSION", {
432
                                                          "args" : [["EXPRESSION", {
433
                                                            "args" : [["EXPRESSION", {
434
                                                              "args" : [["CONSTANT_VALUE", {
435
                                                                "value" : ["CST_LITERAL", "3"]}
436
                                                              ]]}
437
                                                            ]]}
438
                                                          ]]}
439
                                                        ]]}
440
                                                      ]}
441
                                                    ]}
442
                                                  ]]]}
443
                                                ]]}
444
                                              ]]}
445
                                            ]]}
446
                                          ]]}
447
                                        ]}
448
                                      ]}
449
                                    ]]]}
450
                                  ], ["EXPRESSION", {
451
                                    "args" : [["CALL", ["FUNCTION_CALL", {
452
                                      "id" : ["SIMPLE_NAME", "unsigned"], "assoc_list" : [{
453
                                        "actual_expr" : ["EXPRESSION", {
454
                                          "args" : [["EXPRESSION", {
455
                                            "args" : [["EXPRESSION", {
456
                                              "args" : [["EXPRESSION", {
457
                                                "id" : "&", "args" : [["EXPRESSION", {
458
                                                  "args" : [["CONSTANT_VALUE", {
459
                                                    "value" : ["CST_LITERAL", "'0'"]}
460
                                                  ]]}
461
                                                ], ["EXPRESSION", {
462
                                                  "args" : [["CALL", ["FUNCTION_CALL", {
463
                                                    "id" : ["SIMPLE_NAME", "Data_Reg"], "assoc_list" : [{
464
                                                      "actual_expr" : ["EXPRESSION", {
465
                                                        "args" : [["EXPRESSION", {
466
                                                          "args" : [["EXPRESSION", {
467
                                                            "args" : [["EXPRESSION", {
468
                                                              "args" : [["CONSTANT_VALUE", {
469
                                                                "value" : ["CST_LITERAL", "2"]}
470
                                                              ]]}
471
                                                            ]]}
472
                                                          ]]}
473
                                                        ]]}
474
                                                      ]}
475
                                                    ]}
476
                                                  ]]]}
477
                                                ]]}
478
                                              ]]}
479
                                            ]]}
480
                                          ]]}
481
                                        ]}
482
                                      ]}
483
                                    ]]]}
484
                                  ]]}
485
                                ]]}
486
                              ]]}
487
                            ]]}
488
                          ]}
489
                        ]}
490
                      ]]]}
491
                    ]]}
492
                  ]]}
493
                ]]}
494
              ]}
495
            ]}
496
          ]}
497
        ], ["CONDITIONAL_SIGNAL_ASSIGNMENT", {
498
          "postponed" : false, "lhs" : ["SIMPLE_NAME", "o_Sum"], "rhs" : [{
499
            "expr" : [{
500
              "value" : ["EXPRESSION", {
501
                "args" : [["EXPRESSION", {
502
                  "args" : [["EXPRESSION", {
503
                    "args" : [["EXPRESSION", {
504
                      "args" : [["CALL", ["SIMPLE_NAME", "Sum_r"]]]}
505
                    ]]}
506
                  ]]}
507
                ]]}
508
              ]}
509
            ]}
510
          ]}
511
        ]]}
512
      ]}
513
    ]}
514
  }