Changeset 42


Ignore:
Timestamp:
Aug 24, 2009, 1:12:39 PM (15 years ago)
Author:
buchmann
Message:

Changes:

  • code cleanup
  • now prints correctly unsigned/signed (serialization.cc)

Fix:

  • when the --help option is used, there is no simulation performed.
Location:
sources/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sources/src/dump_used_env.cc

    r27 r42  
    4343sc_core::get_used_env()
    4444{
    45   const char *compiler = getenv ("GCC");
     45  const char *compiler    = getenv ("GCC");
    4646  const char *systemc_dir = getenv ("SYSTEMCASS");
    4747  const char *target_arch = getenv ("TARGET_ARCH");
  • sources/src/dump_used_options.cc

    r27 r42  
    7171  "CONFIG_CHECK_FSM_RULES, "
    7272#endif
    73 #ifdef COMPIL_DEBUG 
    74   "COMPIL_DEBUG,"       
     73#ifdef CONFIG_CHECK_MULTIWRITING2PORT     
     74  "CONFIG_CHECK_MULTIWRITING2PORT, "
     75#endif
     76#ifdef CONFIG_CHECK_MULTIWRITING2REGISTER     
     77  "CONFIG_CHECK_MULTIWRITING2REGISTER, "
     78#endif
     79#ifdef CONFIG_DEFAULT_RUNTIME_COMPILATION     
     80  "CONFIG_DEFAULT_RUNTIME_COMPILATION, "
     81#endif
     82#ifdef CONFIG_OS_DARWIN     
     83  "CONFIG_OS_DARWIN, "
     84#endif
     85#ifdef CONFIG_OS_LINUX     
     86  "CONFIG_OS_LINUX, "
     87#endif
     88#ifdef CONFIG_PAT_TRACE_FORMAT     
     89  "CONFIG_PAT_TRACE_FORMAT, "
    7590#endif
    7691#ifdef CONFIG_DEBUG
     
    8297#ifdef INIT_SIGNALS_TO_ZERO
    8398  "INIT_SIGNALS_TO_ZERO, "
     99#endif
     100#ifdef _OPENMP
     101  "_OPENMP, "
    84102#endif
    85103  "...";
  • sources/src/global_functions.cc

    r36 r42  
    9898                   const equi_list_t &el)
    9999{
    100         equi_list_t::const_iterator i;
    101         for (i = el.begin (); i != el.end(); ++i) {
    102                 equi_t::const_iterator j;
    103                 for (j = i->begin (); j != i->end (); ++j) {
    104                         if (j->kind () == sc_clock::kind_string)
    105                                 c.insert ((const sc_clock*)j->object);
    106           }
    107         }
     100  equi_list_t::const_iterator i;
     101  for (i = el.begin (); i != el.end(); ++i) {
     102    equi_t::const_iterator j;
     103    for (j = i->begin (); j != i->end (); ++j) {
     104      if (j->kind () == sc_clock::kind_string)
     105        c.insert ((const sc_clock*)j->object);
     106    }
     107  }
    108108}
    109109
     
    234234#endif
    235235 
    236         link (lib_absolutepath);
     236  link (lib_absolutepath);
    237237}
    238238
     
    277277  else
    278278    pending_write_vector = (pending_write_vector_t) realloc (pending_write_vector, sizeof (pending_write_t) * pending_write_vector_capacity);
    279        
     279 
    280280  // create the clock list
    281281  clock_list_t clock_list;
     
    295295  // Check if any constructor wrote into registers
    296296  if (pending_write_vector_nb != 0)
    297         {
    298                 cerr << "Error : Register/Signal writing is not allowed before sc_initialize.\n"
    299                         "Move initializations from constructors/sc_main to module reset sequences.\n";
    300                 // we are unable to dump register(s) name(s)
    301                 // because the table binding is not yet completed.
    302                 exit (24);
    303         }
     297  {
     298    cerr << "Error : Register/Signal writing is not allowed before sc_initialize.\n"
     299      "Move initializations from constructors/sc_main to module reset sequences.\n";
     300    // we are unable to dump register(s) name(s)
     301    // because the table binding is not yet completed.
     302    exit (24);
     303  }
    304304 
    305305  string base_name = get_scheduling (scheduling_method);
  • sources/src/sc_main.cc

    r38 r42  
    266266            cerr << get_used_options  () << "\n";
    267267            cerr << get_used_env () << "\n";
    268             continue;
     268            cerr << sc_version () << "\n\n";
     269            exit (0);
    269270          case 'u' :
    270271            if (strcmp (argv[i]+2, "usage") == 0)
  • sources/src/serialization.cc

    r27 r42  
    9898  } else if (bit_number <= 16) {
    9999    uint16 v = *((const uint16*)val);
    100     sprintf (buf, "%d", v);
     100    sprintf (buf, "%u", (uint32) v);
    101101  } else if (bit_number <= 32) {
    102102    uint32 v = *((const uint32*)val);
    103     sprintf (buf, "%d", v);
     103    sprintf (buf, "%u", v);
    104104  } else if (bit_number <= 64) {
    105105    uint64 v = *((const uint64*)val);
    106     sprintf (buf, "%lld", v);
     106    sprintf (buf, "%llu", v);
    107107  }
    108108}
Note: See TracChangeset for help on using the changeset viewer.