Changeset 62 for sources/src/sc_port.cc
- Timestamp:
- Feb 16, 2017, 3:46:11 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/src/sc_port.cc
r60 r62 53 53 extern char unstable; 54 54 char unstable = 0; // not in sc_core namespace because dynamic link support C linkage only 55 int32 * pending_write_vector_nb = 0;55 int32_t * pending_write_vector_nb = 0; 56 56 unsigned long long int total_assig = 0; 57 #ifdef USE_OPENMP 57 58 #pragma omp threadprivate (pending_write_vector_nb, total_assig) 59 #endif 58 60 } 59 61 … … 65 67 const char * const sc_signal_base::kind_string = "sc_signal"; 66 68 67 unsigned int pending_write_vector_capacity = 512;69 unsigned int pending_write_vector_capacity; 68 70 pending_write_vector_t pending_write_vector = NULL; 71 #ifdef USE_OPENMP 69 72 #pragma omp threadprivate (pending_write_vector) 73 #endif 70 74 extern equi_list_t equi_list; 71 75 … … 215 219 void update() { 216 220 #if defined(DUMP_STAGE) 217 218 #endif 219 220 221 221 cerr << "Updating... "; 222 #endif 223 // stl vectors are too slow 224 // memcopy is not better 225 // signal table sorting doesn't give any better performance 222 226 #if defined(DUMP_STAGE) 223 224 225 #endif 226 227 227 cerr << "(" << *pending_write_vector_nb 228 << " internal pending writings) "; 229 #endif 230 unsigned int i; 231 for (i = 0; i < *pending_write_vector_nb; ++i) { 228 232 #define iter (sc_core::pending_write_vector[i]) 229 233 #ifdef CONFIG_DEBUG 230 231 232 233 234 if (iter.pointer == NULL) { 235 cerr << "Internal error : trying to apply a posted write from an unassigned signal/port\n"; 236 exit (8); 237 } 234 238 #endif 235 239 #ifdef DUMP_SIGNAL_STATS 236 237 238 239 240 #endif 241 240 if (*(iter.pointer) == iter.value) { 241 unnecessary++; 242 } 243 counter[iter.pointer]++; 244 #endif 245 *(iter.pointer) = iter.value; 242 246 #undef iter 243 247 } 244 248 #ifdef DUMP_SIGNAL_STATS 245 246 #endif 247 248 249 total_assig += *pending_write_vector_nb; 250 #endif 251 total_assig += *pending_write_vector_nb; 252 *pending_write_vector_nb = 0; 249 253 250 254 #if defined(DUMP_STAGE) 251 252 #endif 253 255 cerr << "done.\n"; 256 #endif 257 } 254 258 255 259 } // end of extern "C"
Note: See TracChangeset
for help on using the changeset viewer.