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 #ifndef SCV_UTIL_H
00042 #define SCV_UTIL_H
00043
00044 #include "scv/scv_config.h"
00045
00046 #ifdef SCV_USE_IOSTREAM_H
00047 # include <iostream.h>
00048 #else
00049 # include <iostream>
00050 #endif
00051
00052 #include <string>
00053
00054 #include "systemc.h"
00055
00056 #ifdef _USE_UINT64_WRITE
00057 inline ostream& operator<<(ostream& os, const unsigned long long& full) {
00058 char image[32];
00059 sprintf(image,"%llu",full);
00060 return os << image;
00061 }
00062 #endif
00063
00064
00065 int _scv_make_unique_id(const string& name, const string& kind);
00066 const string _scv_make_unique_name(const string& name, int id);
00067
00068
00069
00070
00071
00072
00073
00074 typedef const char *(_scv_process_name_server_t)(sc_process_b *proc_p);
00075 extern _scv_process_name_server_t *_scv_process_name_server;
00076 void _scv_set_process_name_server(_scv_process_name_server_t *);
00077 const char *_scv_get_process_name(const sc_process_b *proc_p);
00078
00079 const char *scv_get_process_name(sc_process_b *proc_p);
00080
00081
00082
00083
00084
00085
00086 #define SCV_STARTUP() { \
00087 static bool dummy = scv_startup(); \
00088 if (0) cout << dummy << endl; \
00089 }
00090
00091 bool scv_startup();
00092
00093
00094
00095
00096
00097 extern ostream *_scv_out_p;
00098 #define scv_out (*_scv_out_p)
00099
00100
00101
00102
00103
00104 #define tb_status cout
00105 #define TBS_INFO "%%TB_STATUS_INFO: "
00106 #define TBS_WARNING "%%TB_STATUS_WARNING: "
00107 #define TBS_ERROR "%%TB_STATUS_ERROR: "
00108 #define TBS_SUCCESS "%%TB_STATUS_SUCCESS: "
00109 #define TBS_FAIL "%%TB_STATUS_FAIL: "
00110
00111 #endif