blob: 886acc355d581b6f16f4e9449ecb33cb309b2bc2 [file] [log] [blame]
Karl Zhang3de5ab12021-05-31 11:45:48 +08001/*
2 * Copyright (c) 2020, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#include <string>
9#include <vector>
10
11/* This file defines information to track regarding variables in the generated test
12 code. */
13
14#ifndef VARIABLES_HPP
15#define VARIABLES_HPP
16
17/* This project's header files #including other project headers quickly becomes
18 unrealistically complicated. The only solution is for each .cpp to include
19 the headers it needs. However these in particular are mostly axiomatic: Not
20 dependent upon other classes. */
21
22
23using namespace std;
24
25
26/**********************************************************************************
27 Class variable_info tracks everything we know about a given variable in the
28 generated C code.
29**********************************************************************************/
30
31class variable_info
32{
33public:
34 // Data members:
35 /* The existence of this variable tracker means that the data variable and
36 the length variable have been declared, but there are other variants on
37 this variable that may or may not have been declared already. Thus
38 the *_declared bool(s) below. */
39 bool hash_declared; // true if the hash of this variable has been declared
40 bool value_known; // true if the variable's value can be known in simulation
41 string name; // variable name
42 unsigned char value[2048]; // the current value of the variable
43 int length; // of the variable's value
44 psa_asset_type type; // type of info contained in the variable
45
46 // Methods:
47 variable_info (void); // (default constructor)
48 variable_info ( // (constructor with known name and type)
49 string var_name, psa_asset_type var_type
50 );
51 ~variable_info (void); // (destructor)
52
53protected:
54 // Data members:
55};
56
57
58#endif // VARIABLES_HPP
59