Changeset 60 for sources/src/global_functions.cc
- Timestamp:
- Feb 14, 2017, 11:30:19 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/src/global_functions.cc
r59 r60 246 246 pending_write_vector_capacity = get_signal_table_size(); 247 247 248 if (pending_write_vector_capacity == 0) { 249 pending_write_vector = NULL; 250 } 251 else { 252 pending_write_vector = (pending_write_vector_t) realloc(pending_write_vector, sizeof(pending_write_t) * pending_write_vector_capacity); 253 } 248 assert(pending_write_vector_capacity != 0); 249 250 #ifdef _OPENMP 251 #define LINE_SIZE 128L 252 int malloc_size = (sizeof (pending_write_t) * (pending_write_vector_capacity + 1) + (LINE_SIZE - 1)) & ~(LINE_SIZE - 1); 253 assert((sizeof(pending_write_t) * (pending_write_vector_capacity + 1)) <= malloc_size && "bad allocation size"); 254 255 #pragma omp parallel 256 { 257 posix_memalign((void **) &pending_write_vector, LINE_SIZE, malloc_size); 258 pending_write_vector_nb = (int32_t *) &pending_write_vector[0]; 259 pending_write_vector = &pending_write_vector[1]; 260 //printf("malloc 0x%x @%p, idx @0x%x\n", malloc_size, pending_write_vector, pending_write_vector_nb); 261 *pending_write_vector_nb = 0; 262 } 263 #else 264 pending_write_vector = (pending_write_vector_t) malloc(sizeof(pending_write_t) * pending_write_vector_capacity); 265 #endif 266 254 267 255 268 // create the clock list … … 267 280 } 268 281 // Check if any constructor wrote into registers 269 if ( pending_write_vector_nb != 0) {282 if (*pending_write_vector_nb != 0) { 270 283 cerr << 271 284 "Error : Register/Signal writing is not allowed before sc_initialize.\n" … … 285 298 } 286 299 287 pending_write_vector_nb = 0;300 *pending_write_vector_nb = 0; 288 301 289 302 check_all_ports();
Note: See TracChangeset
for help on using the changeset viewer.