Changeset 32 for sources/src


Ignore:
Timestamp:
Jun 4, 2009, 2:09:13 PM (15 years ago)
Author:
buchmann
Message:

Changes:

  • rename pending_write into pending_write_t
  • indent code
Location:
sources/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sources/src/global_functions.cc

    r27 r32  
    240240internal_sc_initialize (void)
    241241{
    242         sort_equi_list ();
     242  sort_equi_list ();
    243243
    244244  check_all_method_process ();
     
    261261    cerr << endl;
    262262  }
     263
    263264  // Init variables to be able to run combinational functions
    264265#ifdef CONFIG_CHECK_FSM_RULES
    265         casc_fsm_step = STIMULI;
     266  casc_fsm_step = STIMULI;
    266267#endif
    267268
     
    274275    pending_write_vector = NULL;
    275276  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);
    277278       
    278279  // create the clock list
    279         clock_list_t clock_list;
     280  clock_list_t clock_list;
    280281  create_clock_list (clock_list, get_equi_list ());
    281282  if (dump_netlist_info)
     
    291292  }
    292293
    293         // Check if any constructor wrote into registers
    294         if (pending_write_vector_nb != 0)
     294  // Check if any constructor wrote into registers
     295  if (pending_write_vector_nb != 0)
    295296        {
    296297                cerr << "Error : Register/Signal writing is not allowed before sc_initialize.\n"
     
    308309    use_static_func ();
    309310 
    310         pending_write_vector_nb = 0;
     311  pending_write_vector_nb = 0;
    311312 
    312313  check_all_ports ();
    313314  usage.start ();
     315
    314316  if (dump_stage)
    315317    cerr << "sc_initialize () done.\n";
     318
    316319  already_initialized = true;
    317320}
     
    323326  if (already_initialized == false) {
    324327#if defined(SYSTEMC_VERSION_1_0)
    325                 std::cerr << "Warning : call sc_initialize before executiong simulation.\n";
     328    std::cerr << "Warning : call sc_initialize before executiong simulation.\n";
    326329#endif
    327330    internal_sc_initialize ();
     
    332335      exit (0);
    333336    }
    334         }
     337  }
    335338}
    336339
     
    366369sc_start(double d_val)
    367370{
    368         sc_cycle (d_val);
     371  sc_cycle (d_val);
    369372#ifdef DUMP_SIGNAL_STATS
    370         print_registers_writing_stats (cerr);
     373  print_registers_writing_stats (cerr);
    371374#endif
    372375#ifdef DUMP_SCHEDULE_STATS
    373         print_schedule_stats (cerr);
     376  print_schedule_stats (cerr);
    374377#endif
    375378}
     
    378381sc_start()
    379382{
    380         sc_cycle (-1);
     383  sc_cycle (-1);
    381384#ifdef DUMP_SIGNAL_STATS
    382         print_registers_writing_stats (cerr);
     385  print_registers_writing_stats (cerr);
    383386#endif
    384387#ifdef DUMP_SCHEDULE_STATS
    385         print_schedule_stats (cerr);
     388  print_schedule_stats (cerr);
    386389#endif
    387390}
     
    397400sc_start( const sc_time& duration )
    398401{
    399         sc_cycle ((double)duration);
     402  sc_cycle ((double)duration);
    400403#ifdef DUMP_SIGNAL_STATS
    401         print_registers_writing_stats (cerr);
     404  print_registers_writing_stats (cerr);
    402405#endif
    403406#ifdef DUMP_SCHEDULE_STATS
    404         print_schedule_stats (cerr);
     407  print_schedule_stats (cerr);
    405408#endif
    406409}
  • sources/src/sc_signal.h

    r27 r32  
    5353extern void bind (sc_port_base   &x);
    5454typedef tab_t base_type;
    55 struct pending_write {
     55struct pending_write_t {
    5656        base_type   *pointer;
    5757        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_)
    5959        //{     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)
    6161        { return o << "(pointer = " << p.pointer << "; value = " << p.value << ")\n"; }
    6262};
     
    6767
    6868// Pending write to register (simple stack)
    69 typedef pending_write *pending_write_vector_t;
     69typedef pending_write_t *pending_write_vector_t;
    7070extern pending_write_vector_t pending_write_vector;
    7171extern "C" unsigned int pending_write_vector_nb;
     
    9696  if (sizeof (T) > sizeof (base_type)) {
    9797#if 0
    98   std::cout << "sizeof (T) = " << sizeof (T)
     98    std::cout << "sizeof (T) = " << sizeof (T)
    9999            << " (base_type = " << sizeof (base_type) << "\n";
    100100#endif
    101   post_multiwrite (pointer_,value_);
     101    post_multiwrite (pointer_,value_);
    102102  } else {
    103103#if defined(CONFIG_DEBUG)
    104104    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)) {
    106106      std::cerr << "Error : The array for posted writing on register is too small.\n";
    107107      std::cerr << "Up to 1 writing per register is allowed during a cycle.\n";
  • sources/src/sc_trace.cc

    r27 r32  
    300300    return (*pointer_saved != *pointer_current);
    301301  } 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 ();
    304304    return (*pointer_saved != *pointer_current);
    305305  } else {
Note: See TracChangeset for help on using the changeset viewer.