Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / vhdl_json / vhdl_files / 2-exportOK / cnes_guidelines / rule / data / best-chronometer-ever / src / centisecond_timer.json @ 2051e520

History | View | Annotate | Download (16 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"]]]]]], "library" : ["ENTITY_DECLARATION", {
5
        "name" : ["IDENTIFIER", "centisecond_timer"], "generics" : [{
6
          "names" : [["IDENTIFIER", "g_clock_cycle_per_centisecond"]], "typ" : {
7
            "name" : ["SIMPLE_NAME", "natural"]}
8
          , "expr" : ["EXPRESSION", {
9
            "args" : [["EXPRESSION", {
10
              "args" : [["EXPRESSION", {
11
                "args" : [["EXPRESSION", {
12
                  "args" : [["CONSTANT_VALUE", {
13
                    "value" : ["CST_LITERAL", "8"]}
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"]], "mode" : ["in"], "typ" : {
25
            "name" : ["SIMPLE_NAME", "std_logic"]}
26
          }
27
        , {
28
          "names" : [["IDENTIFIER", "i_raz"]], "mode" : ["in"], "typ" : {
29
            "name" : ["SIMPLE_NAME", "std_logic"]}
30
          }
31
        , {
32
          "names" : [["IDENTIFIER", "i_enable"]], "mode" : ["in"], "typ" : {
33
            "name" : ["SIMPLE_NAME", "std_logic"]}
34
          }
35
        , {
36
          "names" : [["IDENTIFIER", "o_new_centisecond"]], "mode" : ["out"], "typ" : {
37
            "name" : ["SIMPLE_NAME", "std_logic"]}
38
          }
39
        ], "ENTITY_DECLARATIVE_PART" : [], "ENTITY_STATEMENT_PART" : []}
40
      ]}
41
    , {
42
      "contexts" : [], "library" : ["ARCHITECTURE_BODY", {
43
        "name" : ["IDENTIFIER", "behavioral"], "entity" : ["IDENTIFIER", "centisecond_timer"], "ARCHITECTURE_DECLARATIVE_PART" : [{
44
          "declaration" : ["SIGNAL_DECLARATION", {
45
            "names" : [["IDENTIFIER", "timer"]], "typ" : {
46
              "name" : ["SIMPLE_NAME", "natural"], "const" : ["RANGE_CONSTRAINT", {
47
                "range" : ["RANGE_WITH_DIRECTION", {
48
                  "direction" : "to", "from" : ["EXPRESSION", {
49
                    "args" : [["EXPRESSION", {
50
                      "args" : [["CONSTANT_VALUE", {
51
                        "value" : ["CST_LITERAL", "1"]}
52
                      ]]}
53
                    ]]}
54
                  ], "_to" : ["EXPRESSION", {
55
                    "args" : [["EXPRESSION", {
56
                      "args" : [["CALL", ["SIMPLE_NAME", "g_clock_cycle_per_centisecond"]]]}
57
                    ]]}
58
                  ]}
59
                ]}
60
              ]}
61
            }
62
          ]}
63
        ], "ARCHITECTURE_STATEMENT_PART" : [["PROCESS_STATEMENT", {
64
          "id" : ["IDENTIFIER", "P_TIME_COUNTER"], "active_sigs" : [["SIMPLE_NAME", "i_clock"], ["SIMPLE_NAME", "i_reset"]], "PROCESS_STATEMENT_PART" : [["IF_STATEMENT", {
65
            "if_cases" : [{
66
              "if_cond" : ["EXPRESSION", {
67
                "args" : [["EXPRESSION", {
68
                  "args" : [["EXPRESSION", {
69
                    "args" : [["EXPRESSION", {
70
                      "args" : [["EXPRESSION", {
71
                        "id" : "=", "args" : [["EXPRESSION", {
72
                          "args" : [["EXPRESSION", {
73
                            "args" : [["EXPRESSION", {
74
                              "args" : [["CALL", ["SIMPLE_NAME", "i_reset"]]]}
75
                            ]]}
76
                          ]]}
77
                        ], ["EXPRESSION", {
78
                          "args" : [["EXPRESSION", {
79
                            "args" : [["EXPRESSION", {
80
                              "args" : [["CONSTANT_VALUE", {
81
                                "value" : ["CST_LITERAL", "'1'"]}
82
                              ]]}
83
                            ]]}
84
                          ]]}
85
                        ]]}
86
                      ]]}
87
                    ]]}
88
                  ]]}
89
                ]]}
90
              ], "if_block" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
91
                "lhs" : ["SIMPLE_NAME", "timer"], "rhs" : [{
92
                  "value" : ["EXPRESSION", {
93
                    "args" : [["EXPRESSION", {
94
                      "args" : [["EXPRESSION", {
95
                        "args" : [["EXPRESSION", {
96
                          "args" : [["CONSTANT_VALUE", {
97
                            "value" : ["CST_LITERAL", "1"]}
98
                          ]]}
99
                        ]]}
100
                      ]]}
101
                    ]]}
102
                  ]}
103
                ]}
104
              ]]}
105
            ], "default" : [["IF_STATEMENT", {
106
              "if_cases" : [{
107
                "if_cond" : ["EXPRESSION", {
108
                  "args" : [["EXPRESSION", {
109
                    "args" : [["EXPRESSION", {
110
                      "args" : [["EXPRESSION", {
111
                        "args" : [["EXPRESSION", {
112
                          "args" : [["EXPRESSION", {
113
                            "args" : [["EXPRESSION", {
114
                              "args" : [["EXPRESSION", {
115
                                "args" : [["CALL", ["FUNCTION_CALL", {
116
                                  "id" : ["SIMPLE_NAME", "rising_edge"], "assoc_list" : [{
117
                                    "actual_designator" : ["SIMPLE_NAME", "i_clock"]}
118
                                  ]}
119
                                ]]]}
120
                              ]]}
121
                            ]]}
122
                          ]]}
123
                        ]]}
124
                      ]]}
125
                    ]]}
126
                  ]]}
127
                ], "if_block" : [["IF_STATEMENT", {
128
                  "if_cases" : [{
129
                    "if_cond" : ["EXPRESSION", {
130
                      "args" : [["EXPRESSION", {
131
                        "args" : [["EXPRESSION", {
132
                          "args" : [["EXPRESSION", {
133
                            "args" : [["EXPRESSION", {
134
                              "id" : "=", "args" : [["EXPRESSION", {
135
                                "args" : [["EXPRESSION", {
136
                                  "args" : [["EXPRESSION", {
137
                                    "args" : [["CALL", ["SIMPLE_NAME", "i_raz"]]]}
138
                                  ]]}
139
                                ]]}
140
                              ], ["EXPRESSION", {
141
                                "args" : [["EXPRESSION", {
142
                                  "args" : [["EXPRESSION", {
143
                                    "args" : [["CONSTANT_VALUE", {
144
                                      "value" : ["CST_LITERAL", "'1'"]}
145
                                    ]]}
146
                                  ]]}
147
                                ]]}
148
                              ]]}
149
                            ]]}
150
                          ]]}
151
                        ]]}
152
                      ]]}
153
                    ], "if_block" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
154
                      "lhs" : ["SIMPLE_NAME", "timer"], "rhs" : [{
155
                        "value" : ["EXPRESSION", {
156
                          "args" : [["EXPRESSION", {
157
                            "args" : [["EXPRESSION", {
158
                              "args" : [["EXPRESSION", {
159
                                "args" : [["CONSTANT_VALUE", {
160
                                  "value" : ["CST_LITERAL", "1"]}
161
                                ]]}
162
                              ]]}
163
                            ]]}
164
                          ]]}
165
                        ]}
166
                      ]}
167
                    ]]}
168
                  ], "default" : [["IF_STATEMENT", {
169
                    "if_cases" : [{
170
                      "if_cond" : ["EXPRESSION", {
171
                        "args" : [["EXPRESSION", {
172
                          "args" : [["EXPRESSION", {
173
                            "args" : [["EXPRESSION", {
174
                              "args" : [["EXPRESSION", {
175
                                "id" : "or", "args" : [["EXPRESSION", {
176
                                  "args" : [["EXPRESSION", {
177
                                    "args" : [["EXPRESSION", {
178
                                      "args" : [["EXPRESSION", {
179
                                        "args" : [["EXPRESSION", {
180
                                          "id" : "=", "args" : [["EXPRESSION", {
181
                                            "args" : [["EXPRESSION", {
182
                                              "args" : [["EXPRESSION", {
183
                                                "args" : [["CALL", ["SIMPLE_NAME", "i_enable"]]]}
184
                                              ]]}
185
                                            ]]}
186
                                          ], ["EXPRESSION", {
187
                                            "args" : [["EXPRESSION", {
188
                                              "args" : [["EXPRESSION", {
189
                                                "args" : [["CONSTANT_VALUE", {
190
                                                  "value" : ["CST_LITERAL", "'0'"]}
191
                                                ]]}
192
                                              ]]}
193
                                            ]]}
194
                                          ]]}
195
                                        ]]}
196
                                      ]]}
197
                                    ]]}
198
                                  ]]}
199
                                ], ["EXPRESSION", {
200
                                  "args" : [["EXPRESSION", {
201
                                    "args" : [["EXPRESSION", {
202
                                      "args" : [["EXPRESSION", {
203
                                        "args" : [["EXPRESSION", {
204
                                          "id" : ">=", "args" : [["EXPRESSION", {
205
                                            "args" : [["EXPRESSION", {
206
                                              "args" : [["EXPRESSION", {
207
                                                "args" : [["CALL", ["SIMPLE_NAME", "timer"]]]}
208
                                              ]]}
209
                                            ]]}
210
                                          ], ["EXPRESSION", {
211
                                            "args" : [["EXPRESSION", {
212
                                              "args" : [["EXPRESSION", {
213
                                                "args" : [["CALL", ["SIMPLE_NAME", "g_clock_cycle_per_centisecond"]]]}
214
                                              ]]}
215
                                            ]]}
216
                                          ]]}
217
                                        ]]}
218
                                      ]]}
219
                                    ]]}
220
                                  ]]}
221
                                ]]}
222
                              ]]}
223
                            ]]}
224
                          ]]}
225
                        ]]}
226
                      ], "if_block" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
227
                        "lhs" : ["SIMPLE_NAME", "timer"], "rhs" : [{
228
                          "value" : ["EXPRESSION", {
229
                            "args" : [["EXPRESSION", {
230
                              "args" : [["EXPRESSION", {
231
                                "args" : [["EXPRESSION", {
232
                                  "args" : [["CONSTANT_VALUE", {
233
                                    "value" : ["CST_LITERAL", "1"]}
234
                                  ]]}
235
                                ]]}
236
                              ]]}
237
                            ]]}
238
                          ]}
239
                        ]}
240
                      ]]}
241
                    , {
242
                      "if_cond" : ["EXPRESSION", {
243
                        "args" : [["EXPRESSION", {
244
                          "args" : [["EXPRESSION", {
245
                            "args" : [["EXPRESSION", {
246
                              "args" : [["EXPRESSION", {
247
                                "id" : "=", "args" : [["EXPRESSION", {
248
                                  "args" : [["EXPRESSION", {
249
                                    "args" : [["EXPRESSION", {
250
                                      "args" : [["CALL", ["SIMPLE_NAME", "i_enable"]]]}
251
                                    ]]}
252
                                  ]]}
253
                                ], ["EXPRESSION", {
254
                                  "args" : [["EXPRESSION", {
255
                                    "args" : [["EXPRESSION", {
256
                                      "args" : [["CONSTANT_VALUE", {
257
                                        "value" : ["CST_LITERAL", "'1'"]}
258
                                      ]]}
259
                                    ]]}
260
                                  ]]}
261
                                ]]}
262
                              ]]}
263
                            ]]}
264
                          ]]}
265
                        ]]}
266
                      ], "if_block" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
267
                        "lhs" : ["SIMPLE_NAME", "timer"], "rhs" : [{
268
                          "value" : ["EXPRESSION", {
269
                            "args" : [["EXPRESSION", {
270
                              "args" : [["EXPRESSION", {
271
                                "args" : [["EXPRESSION", {
272
                                  "args" : [["EXPRESSION", {
273
                                    "args" : [["EXPRESSION", {
274
                                      "args" : [["EXPRESSION", {
275
                                        "args" : [["EXPRESSION", {
276
                                          "id" : "+", "args" : [["EXPRESSION", {
277
                                            "args" : [["CALL", ["SIMPLE_NAME", "timer"]]]}
278
                                          ], ["EXPRESSION", {
279
                                            "args" : [["CONSTANT_VALUE", {
280
                                              "value" : ["CST_LITERAL", "1"]}
281
                                            ]]}
282
                                          ]]}
283
                                        ]]}
284
                                      ]]}
285
                                    ]]}
286
                                  ]]}
287
                                ]]}
288
                              ]]}
289
                            ]]}
290
                          ]}
291
                        ]}
292
                      ]]}
293
                    ]}
294
                  ]]}
295
                ]]}
296
              ]}
297
            ]]}
298
          ]]}
299
        ], ["CONDITIONAL_SIGNAL_ASSIGNMENT", {
300
          "postponed" : false, "lhs" : ["SIMPLE_NAME", "o_new_centisecond"], "rhs" : [{
301
            "expr" : [{
302
              "value" : ["EXPRESSION", {
303
                "args" : [["EXPRESSION", {
304
                  "args" : [["EXPRESSION", {
305
                    "args" : [["EXPRESSION", {
306
                      "args" : [["CALL", ["SIMPLE_NAME", "i_enable"]]]}
307
                    ]]}
308
                  ]]}
309
                ]]}
310
              ]}
311
            ], "cond" : ["EXPRESSION", {
312
              "args" : [["EXPRESSION", {
313
                "args" : [["EXPRESSION", {
314
                  "args" : [["EXPRESSION", {
315
                    "args" : [["EXPRESSION", {
316
                      "id" : ">=", "args" : [["EXPRESSION", {
317
                        "args" : [["EXPRESSION", {
318
                          "args" : [["EXPRESSION", {
319
                            "args" : [["CALL", ["SIMPLE_NAME", "timer"]]]}
320
                          ]]}
321
                        ]]}
322
                      ], ["EXPRESSION", {
323
                        "args" : [["EXPRESSION", {
324
                          "args" : [["EXPRESSION", {
325
                            "args" : [["CALL", ["SIMPLE_NAME", "g_clock_cycle_per_centisecond"]]]}
326
                          ]]}
327
                        ]]}
328
                      ]]}
329
                    ]]}
330
                  ]]}
331
                ]]}
332
              ]]}
333
            ]}
334
          , {
335
            "expr" : [{
336
              "value" : ["EXPRESSION", {
337
                "args" : [["EXPRESSION", {
338
                  "args" : [["EXPRESSION", {
339
                    "args" : [["EXPRESSION", {
340
                      "args" : [["CONSTANT_VALUE", {
341
                        "value" : ["CST_LITERAL", "'0'"]}
342
                      ]]}
343
                    ]]}
344
                  ]]}
345
                ]]}
346
              ]}
347
            ]}
348
          ]}
349
        ]]}
350
      ]}
351
    ]}
352
  }