00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #define _SCV_CHECK_DYNAMIC(feature,return_statement) \
00045 if (!this->_is_dynamic()) { \
00046 _scv_message::message(_scv_message::INTROSPECTION_INVALID_DYNAMIC_EXTENSIONS,#feature); \
00047 return_statement; \
00048 }
00049
00050
00051
00052
00053 #define _SCV_RW_ERROR(feature,type,obj) \
00054 _scv_message::message(_scv_message::INTROSPECTION_INVALID_READ_WRITE,#feature,#type,#obj,this->get_name()) \
00055
00056
00057 class _scv_constraint_data;
00058
00059
00060
00061
00062 class _scv_dynamic_data {
00063 public:
00064 _scv_dynamic_data()
00065 : undefined_(true),
00066 disable_randomization_(false),
00067 cdata_(NULL),
00068 dist_(NULL),
00069 _next_id(0)
00070 {}
00071 ~_scv_dynamic_data();
00072
00073
00074 bool undefined_;
00075 bool disable_randomization_;
00076 _scv_constraint_data* cdata_;
00077 void * dist_;
00078
00079
00080 typedef scv_extension_callbacks_if::callback_base callback_base;
00081 int _next_id;
00082 list<callback_base*> _callbacks;
00083 void execute_callbacks(scv_extensions_if *, scv_extensions_if::callback_reason);
00084 };
00085
00086 #ifdef _SCV_INTROSPECTION_ONLY
00087 #include <stdio.h>
00088 #endif
00089
00090 inline string _scv_ext_util_get_string(int i) {
00091 char tmp[128];
00092 sprintf(tmp,"%d",i);
00093 return tmp;
00094 }
00095
00096 inline const char * _scv_ext_util_get_name(const char* format, const char* name, int N) {
00097 static char tmp[1024];
00098 sprintf(tmp, format, name, N);
00099 return strdup(tmp);
00100 }
00101
00102 inline const char * _scv_ext_util_get_name(const char* format, const char* name) {
00103 static char tmp[1024];
00104 sprintf(tmp, format, name);
00105 return strdup(tmp);
00106 }
00107
00108
00109
00110
00111 #ifdef SYSTEMC_H
00112 #define _SCV_SYSTEMC_BASIC_TYPE_SPECIALIZATION() \
00113 _SCV_COMPONENT(sc_string); \
00114 _SCV_COMPONENT_1(sc_bit); \
00115 _SCV_COMPONENT_1(sc_logic); \
00116 _SCV_COMPONENT_N(sc_int); \
00117 _SCV_COMPONENT_N(sc_uint); \
00118 _SCV_COMPONENT_N(sc_bigint); \
00119 _SCV_COMPONENT_N(sc_biguint); \
00120 _SCV_COMPONENT_N(sc_bv); \
00121 _SCV_COMPONENT_N(sc_lv); \
00122 _SCV_COMPONENT(sc_signed); \
00123 _SCV_COMPONENT(sc_unsigned); \
00124 _SCV_COMPONENT(sc_int_base); \
00125 _SCV_COMPONENT(sc_uint_base); \
00126 _SCV_COMPONENT(sc_lv_base); \
00127 _SCV_COMPONENT(sc_bv_base); \
00128
00129
00130
00131
00132 #else
00133 #define _SCV_SYSTEMC_BASIC_TYPE_SPECIALIZATION()
00134 #endif
00135
00136 #define _SCV_BASIC_TYPE_SPECIALIZATION()\
00137 _SCV_COMPONENT(bool); \
00138 _SCV_COMPONENT(char); \
00139 _SCV_COMPONENT(unsigned char); \
00140 _SCV_COMPONENT(short); \
00141 _SCV_COMPONENT(unsigned short); \
00142 _SCV_COMPONENT(int); \
00143 _SCV_COMPONENT(unsigned int); \
00144 _SCV_COMPONENT(long); \
00145 _SCV_COMPONENT(unsigned long); \
00146 _SCV_COMPONENT(long long); \
00147 _SCV_COMPONENT(unsigned long long); \
00148 _SCV_COMPONENT(float); \
00149 _SCV_COMPONENT(double); \
00150 _SCV_COMPONENT(string); \
00151 _SCV_COMPONENT_N(test_uint); \
00152 _SCV_SYSTEMC_BASIC_TYPE_SPECIALIZATION()\
00153
00154
00155 #include "scv/_scv_ext_util.h"
00156 #include "scv/_scv_ext_type.h"
00157 #include "scv/_scv_ext_rw.h"
00158 #include "scv/_scv_ext_rand.h"
00159 #include "scv/_scv_ext_callbacks.h"
00160
00161 #undef _SCV_SYSTEMC_BASIC_TYPE_SPECIALIZATION
00162 #undef _SCV_BASIC_TYPE_SPECIALIZATION
00163