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 @ 3fd18385

History | View | Annotate | Download (16.3 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", ["INDEXED_NAME", {
116
                                  "id" : ["SIMPLE_NAME", "rising_edge"], "exprs" : [["EXPRESSION", {
117
                                    "args" : [["EXPRESSION", {
118
                                      "args" : [["EXPRESSION", {
119
                                        "args" : [["EXPRESSION", {
120
                                          "args" : [["CALL", ["SIMPLE_NAME", "i_clock"]]]}
121
                                        ]]}
122
                                      ]]}
123
                                    ]]}
124
                                  ]]}
125
                                ]]]}
126
                              ]]}
127
                            ]]}
128
                          ]]}
129
                        ]]}
130
                      ]]}
131
                    ]]}
132
                  ]]}
133
                ], "if_block" : [["IF_STATEMENT", {
134
                  "if_cases" : [{
135
                    "if_cond" : ["EXPRESSION", {
136
                      "args" : [["EXPRESSION", {
137
                        "args" : [["EXPRESSION", {
138
                          "args" : [["EXPRESSION", {
139
                            "args" : [["EXPRESSION", {
140
                              "id" : "=", "args" : [["EXPRESSION", {
141
                                "args" : [["EXPRESSION", {
142
                                  "args" : [["EXPRESSION", {
143
                                    "args" : [["CALL", ["SIMPLE_NAME", "i_raz"]]]}
144
                                  ]]}
145
                                ]]}
146
                              ], ["EXPRESSION", {
147
                                "args" : [["EXPRESSION", {
148
                                  "args" : [["EXPRESSION", {
149
                                    "args" : [["CONSTANT_VALUE", {
150
                                      "value" : ["CST_LITERAL", "'1'"]}
151
                                    ]]}
152
                                  ]]}
153
                                ]]}
154
                              ]]}
155
                            ]]}
156
                          ]]}
157
                        ]]}
158
                      ]]}
159
                    ], "if_block" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
160
                      "lhs" : ["SIMPLE_NAME", "timer"], "rhs" : [{
161
                        "value" : ["EXPRESSION", {
162
                          "args" : [["EXPRESSION", {
163
                            "args" : [["EXPRESSION", {
164
                              "args" : [["EXPRESSION", {
165
                                "args" : [["CONSTANT_VALUE", {
166
                                  "value" : ["CST_LITERAL", "1"]}
167
                                ]]}
168
                              ]]}
169
                            ]]}
170
                          ]]}
171
                        ]}
172
                      ]}
173
                    ]]}
174
                  ], "default" : [["IF_STATEMENT", {
175
                    "if_cases" : [{
176
                      "if_cond" : ["EXPRESSION", {
177
                        "args" : [["EXPRESSION", {
178
                          "args" : [["EXPRESSION", {
179
                            "args" : [["EXPRESSION", {
180
                              "args" : [["EXPRESSION", {
181
                                "id" : "or", "args" : [["EXPRESSION", {
182
                                  "args" : [["EXPRESSION", {
183
                                    "args" : [["EXPRESSION", {
184
                                      "args" : [["EXPRESSION", {
185
                                        "args" : [["EXPRESSION", {
186
                                          "id" : "=", "args" : [["EXPRESSION", {
187
                                            "args" : [["EXPRESSION", {
188
                                              "args" : [["EXPRESSION", {
189
                                                "args" : [["CALL", ["SIMPLE_NAME", "i_enable"]]]}
190
                                              ]]}
191
                                            ]]}
192
                                          ], ["EXPRESSION", {
193
                                            "args" : [["EXPRESSION", {
194
                                              "args" : [["EXPRESSION", {
195
                                                "args" : [["CONSTANT_VALUE", {
196
                                                  "value" : ["CST_LITERAL", "'0'"]}
197
                                                ]]}
198
                                              ]]}
199
                                            ]]}
200
                                          ]]}
201
                                        ]]}
202
                                      ]]}
203
                                    ]]}
204
                                  ]]}
205
                                ], ["EXPRESSION", {
206
                                  "args" : [["EXPRESSION", {
207
                                    "args" : [["EXPRESSION", {
208
                                      "args" : [["EXPRESSION", {
209
                                        "args" : [["EXPRESSION", {
210
                                          "id" : ">=", "args" : [["EXPRESSION", {
211
                                            "args" : [["EXPRESSION", {
212
                                              "args" : [["EXPRESSION", {
213
                                                "args" : [["CALL", ["SIMPLE_NAME", "timer"]]]}
214
                                              ]]}
215
                                            ]]}
216
                                          ], ["EXPRESSION", {
217
                                            "args" : [["EXPRESSION", {
218
                                              "args" : [["EXPRESSION", {
219
                                                "args" : [["CALL", ["SIMPLE_NAME", "g_clock_cycle_per_centisecond"]]]}
220
                                              ]]}
221
                                            ]]}
222
                                          ]]}
223
                                        ]]}
224
                                      ]]}
225
                                    ]]}
226
                                  ]]}
227
                                ]]}
228
                              ]]}
229
                            ]]}
230
                          ]]}
231
                        ]]}
232
                      ], "if_block" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
233
                        "lhs" : ["SIMPLE_NAME", "timer"], "rhs" : [{
234
                          "value" : ["EXPRESSION", {
235
                            "args" : [["EXPRESSION", {
236
                              "args" : [["EXPRESSION", {
237
                                "args" : [["EXPRESSION", {
238
                                  "args" : [["CONSTANT_VALUE", {
239
                                    "value" : ["CST_LITERAL", "1"]}
240
                                  ]]}
241
                                ]]}
242
                              ]]}
243
                            ]]}
244
                          ]}
245
                        ]}
246
                      ]]}
247
                    , {
248
                      "if_cond" : ["EXPRESSION", {
249
                        "args" : [["EXPRESSION", {
250
                          "args" : [["EXPRESSION", {
251
                            "args" : [["EXPRESSION", {
252
                              "args" : [["EXPRESSION", {
253
                                "id" : "=", "args" : [["EXPRESSION", {
254
                                  "args" : [["EXPRESSION", {
255
                                    "args" : [["EXPRESSION", {
256
                                      "args" : [["CALL", ["SIMPLE_NAME", "i_enable"]]]}
257
                                    ]]}
258
                                  ]]}
259
                                ], ["EXPRESSION", {
260
                                  "args" : [["EXPRESSION", {
261
                                    "args" : [["EXPRESSION", {
262
                                      "args" : [["CONSTANT_VALUE", {
263
                                        "value" : ["CST_LITERAL", "'1'"]}
264
                                      ]]}
265
                                    ]]}
266
                                  ]]}
267
                                ]]}
268
                              ]]}
269
                            ]]}
270
                          ]]}
271
                        ]]}
272
                      ], "if_block" : [["SIGNAL_ASSIGNMENT_STATEMENT", {
273
                        "lhs" : ["SIMPLE_NAME", "timer"], "rhs" : [{
274
                          "value" : ["EXPRESSION", {
275
                            "args" : [["EXPRESSION", {
276
                              "args" : [["EXPRESSION", {
277
                                "args" : [["EXPRESSION", {
278
                                  "args" : [["EXPRESSION", {
279
                                    "args" : [["EXPRESSION", {
280
                                      "args" : [["EXPRESSION", {
281
                                        "args" : [["EXPRESSION", {
282
                                          "id" : "+", "args" : [["EXPRESSION", {
283
                                            "args" : [["CALL", ["SIMPLE_NAME", "timer"]]]}
284
                                          ], ["EXPRESSION", {
285
                                            "args" : [["CONSTANT_VALUE", {
286
                                              "value" : ["CST_LITERAL", "1"]}
287
                                            ]]}
288
                                          ]]}
289
                                        ]]}
290
                                      ]]}
291
                                    ]]}
292
                                  ]]}
293
                                ]]}
294
                              ]]}
295
                            ]]}
296
                          ]}
297
                        ]}
298
                      ]]}
299
                    ]}
300
                  ]]}
301
                ]]}
302
              ]}
303
            ]]}
304
          ]]}
305
        ], ["CONDITIONAL_SIGNAL_ASSIGNMENT", {
306
          "postponed" : false, "lhs" : ["SIMPLE_NAME", "o_new_centisecond"], "rhs" : [{
307
            "expr" : [{
308
              "value" : ["EXPRESSION", {
309
                "args" : [["EXPRESSION", {
310
                  "args" : [["EXPRESSION", {
311
                    "args" : [["EXPRESSION", {
312
                      "args" : [["CALL", ["SIMPLE_NAME", "i_enable"]]]}
313
                    ]]}
314
                  ]]}
315
                ]]}
316
              ]}
317
            ], "cond" : ["EXPRESSION", {
318
              "args" : [["EXPRESSION", {
319
                "args" : [["EXPRESSION", {
320
                  "args" : [["EXPRESSION", {
321
                    "args" : [["EXPRESSION", {
322
                      "id" : ">=", "args" : [["EXPRESSION", {
323
                        "args" : [["EXPRESSION", {
324
                          "args" : [["EXPRESSION", {
325
                            "args" : [["CALL", ["SIMPLE_NAME", "timer"]]]}
326
                          ]]}
327
                        ]]}
328
                      ], ["EXPRESSION", {
329
                        "args" : [["EXPRESSION", {
330
                          "args" : [["EXPRESSION", {
331
                            "args" : [["CALL", ["SIMPLE_NAME", "g_clock_cycle_per_centisecond"]]]}
332
                          ]]}
333
                        ]]}
334
                      ]]}
335
                    ]]}
336
                  ]]}
337
                ]]}
338
              ]]}
339
            ]}
340
          , {
341
            "expr" : [{
342
              "value" : ["EXPRESSION", {
343
                "args" : [["EXPRESSION", {
344
                  "args" : [["EXPRESSION", {
345
                    "args" : [["EXPRESSION", {
346
                      "args" : [["CONSTANT_VALUE", {
347
                        "value" : ["CST_LITERAL", "'0'"]}
348
                      ]]}
349
                    ]]}
350
                  ]]}
351
                ]]}
352
              ]}
353
            ]}
354
          ]}
355
        ]]}
356
      ]}
357
    ]}
358
  }