Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 1 | /* |
Nik Dewally | bacae6c | 2024-07-30 16:58:14 +0100 | [diff] [blame^] | 2 | * Copyright (c) 2024, Arm Limited. All rights reserved. |
Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #include <string> |
Nik Dewally | bacae6c | 2024-07-30 16:58:14 +0100 | [diff] [blame^] | 9 | |
| 10 | #include "find_or_create_asset.hpp" |
Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 11 | |
| 12 | /* This file defines information to track regarding variables in the generated test |
| 13 | code. */ |
| 14 | |
| 15 | #ifndef VARIABLES_HPP |
| 16 | #define VARIABLES_HPP |
| 17 | |
Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 18 | using namespace std; |
| 19 | |
| 20 | |
| 21 | /********************************************************************************** |
| 22 | Class variable_info tracks everything we know about a given variable in the |
| 23 | generated C code. |
| 24 | **********************************************************************************/ |
| 25 | |
| 26 | class variable_info |
| 27 | { |
| 28 | public: |
| 29 | // Data members: |
| 30 | /* The existence of this variable tracker means that the data variable and |
| 31 | the length variable have been declared, but there are other variants on |
| 32 | this variable that may or may not have been declared already. Thus |
| 33 | the *_declared bool(s) below. */ |
| 34 | bool hash_declared; // true if the hash of this variable has been declared |
| 35 | bool value_known; // true if the variable's value can be known in simulation |
| 36 | string name; // variable name |
| 37 | unsigned char value[2048]; // the current value of the variable |
| 38 | int length; // of the variable's value |
| 39 | psa_asset_type type; // type of info contained in the variable |
| 40 | |
| 41 | // Methods: |
| 42 | variable_info (void); // (default constructor) |
| 43 | variable_info ( // (constructor with known name and type) |
| 44 | string var_name, psa_asset_type var_type |
| 45 | ); |
| 46 | ~variable_info (void); // (destructor) |
| 47 | |
| 48 | protected: |
| 49 | // Data members: |
| 50 | }; |
| 51 | |
| 52 | |
| 53 | #endif // VARIABLES_HPP |