Changeset 32 for sources/src
- Timestamp:
- Jun 4, 2009, 2:09:13 PM (15 years ago)
- Location:
- sources/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/src/global_functions.cc
r27 r32 240 240 internal_sc_initialize (void) 241 241 { 242 242 sort_equi_list (); 243 243 244 244 check_all_method_process (); … … 261 261 cerr << endl; 262 262 } 263 263 264 // Init variables to be able to run combinational functions 264 265 #ifdef CONFIG_CHECK_FSM_RULES 265 266 casc_fsm_step = STIMULI; 266 267 #endif 267 268 … … 274 275 pending_write_vector = NULL; 275 276 else 276 pending_write_vector = (pending_write_vector_t) realloc (pending_write_vector, sizeof (pending_write) * pending_write_vector_capacity);277 pending_write_vector = (pending_write_vector_t) realloc (pending_write_vector, sizeof (pending_write_t) * pending_write_vector_capacity); 277 278 278 279 // create the clock list 279 280 clock_list_t clock_list; 280 281 create_clock_list (clock_list, get_equi_list ()); 281 282 if (dump_netlist_info) … … 291 292 } 292 293 293 294 294 // Check if any constructor wrote into registers 295 if (pending_write_vector_nb != 0) 295 296 { 296 297 cerr << "Error : Register/Signal writing is not allowed before sc_initialize.\n" … … 308 309 use_static_func (); 309 310 310 311 pending_write_vector_nb = 0; 311 312 312 313 check_all_ports (); 313 314 usage.start (); 315 314 316 if (dump_stage) 315 317 cerr << "sc_initialize () done.\n"; 318 316 319 already_initialized = true; 317 320 } … … 323 326 if (already_initialized == false) { 324 327 #if defined(SYSTEMC_VERSION_1_0) 325 328 std::cerr << "Warning : call sc_initialize before executiong simulation.\n"; 326 329 #endif 327 330 internal_sc_initialize (); … … 332 335 exit (0); 333 336 } 334 337 } 335 338 } 336 339 … … 366 369 sc_start(double d_val) 367 370 { 368 371 sc_cycle (d_val); 369 372 #ifdef DUMP_SIGNAL_STATS 370 373 print_registers_writing_stats (cerr); 371 374 #endif 372 375 #ifdef DUMP_SCHEDULE_STATS 373 376 print_schedule_stats (cerr); 374 377 #endif 375 378 } … … 378 381 sc_start() 379 382 { 380 383 sc_cycle (-1); 381 384 #ifdef DUMP_SIGNAL_STATS 382 385 print_registers_writing_stats (cerr); 383 386 #endif 384 387 #ifdef DUMP_SCHEDULE_STATS 385 388 print_schedule_stats (cerr); 386 389 #endif 387 390 } … … 397 400 sc_start( const sc_time& duration ) 398 401 { 399 402 sc_cycle ((double)duration); 400 403 #ifdef DUMP_SIGNAL_STATS 401 404 print_registers_writing_stats (cerr); 402 405 #endif 403 406 #ifdef DUMP_SCHEDULE_STATS 404 407 print_schedule_stats (cerr); 405 408 #endif 406 409 } -
sources/src/sc_signal.h
r27 r32 53 53 extern void bind (sc_port_base &x); 54 54 typedef tab_t base_type; 55 struct pending_write {55 struct pending_write_t { 56 56 base_type *pointer; 57 57 base_type value; 58 //pending_write (base_type *const pointer_, const base_type value_)58 //pending_write_t (base_type *const pointer_, const base_type value_) 59 59 //{ pointer = pointer_; value = value_; } 60 friend std::ostream& operator << (std::ostream &o, const pending_write &p)60 friend std::ostream& operator << (std::ostream &o, const pending_write_t &p) 61 61 { return o << "(pointer = " << p.pointer << "; value = " << p.value << ")\n"; } 62 62 }; … … 67 67 68 68 // Pending write to register (simple stack) 69 typedef pending_write *pending_write_vector_t;69 typedef pending_write_t *pending_write_vector_t; 70 70 extern pending_write_vector_t pending_write_vector; 71 71 extern "C" unsigned int pending_write_vector_nb; … … 96 96 if (sizeof (T) > sizeof (base_type)) { 97 97 #if 0 98 std::cout << "sizeof (T) = " << sizeof (T)98 std::cout << "sizeof (T) = " << sizeof (T) 99 99 << " (base_type = " << sizeof (base_type) << "\n"; 100 100 #endif 101 post_multiwrite (pointer_,value_);101 post_multiwrite (pointer_,value_); 102 102 } else { 103 103 #if defined(CONFIG_DEBUG) 104 104 if (pending_write_vector_nb >= pending_write_vector_capacity) { 105 //if (pending_write_vector_nb >= pending_write_vector_capacity * sizeof(pending_write )) {105 //if (pending_write_vector_nb >= pending_write_vector_capacity * sizeof(pending_write_t)) { 106 106 std::cerr << "Error : The array for posted writing on register is too small.\n"; 107 107 std::cerr << "Up to 1 writing per register is allowed during a cycle.\n"; -
sources/src/sc_trace.cc
r27 r32 300 300 return (*pointer_saved != *pointer_current); 301 301 } else if (bit_size > 16) { 302 const uint32 *const pointer_saved = s2t.pointer;303 const uint32 *const pointer_current = s2t.inter->get_pointer ();302 const uint32 *const pointer_saved = (const uint32*)s2t.pointer; 303 const uint32 *const pointer_current = (const uint32*)s2t.inter->get_pointer (); 304 304 return (*pointer_saved != *pointer_current); 305 305 } else {
Note: See TracChangeset
for help on using the changeset viewer.