Changes in / [30:20]


Ignore:
Files:
16 added
15 deleted
79 edited

Legend:

Unmodified
Added
Removed
  • /branches/with_autoconf/src/sc_int.h

    r30 r20  
    1818#include <sc_logic.h>
    1919#include <sc_bv.h>
    20 #include <cstdlib>
    2120
    2221// ----------------------------------------------------------------------------
     
    136135  sc_int()                 { val = 0; }
    137136//  sc_int(data_type val_)  { val = 0; write (val_); }
    138   sc_int (const char *a)   { val = 0; write (std::atoi (a)); }
     137  sc_int (const char *a)   { val = 0; write (atoi (a)); }
    139138  sc_int (unsigned short a){ val = 0; write (a); }
    140139  sc_int (short a)         { val = 0; write (a); }
     
    198197
    199198  // arithmetic
    200 #define DEFINE_OPERATOR(OPER)        \
    201   template <typename T>              \
    202   inline sc_int& operator OPER (T v) \
    203   { vf.valW OPER v; return *this; }
    204 
    205   DEFINE_OPERATOR(<<=)
    206   DEFINE_OPERATOR(>>=)
    207   DEFINE_OPERATOR(+=)
    208   DEFINE_OPERATOR(-=)
    209   DEFINE_OPERATOR(*=)
    210   DEFINE_OPERATOR(/=)
    211   DEFINE_OPERATOR(%=)
    212   DEFINE_OPERATOR(&=)
    213   DEFINE_OPERATOR(|=)
    214   DEFINE_OPERATOR(^=)
    215 #undef DEFINE_OPERATOR
    216 
     199  template <typename T>
     200  inline sc_int& operator <<= (T v)
     201  { vf.valW <<= v; return *this; }
     202  template <typename T>
     203  inline sc_int& operator >>= (T v)
     204  { vf.valW >>= v; return *this; }
     205  template <typename T>
     206  inline sc_int& operator += (T v)
     207  { vf.valW += v; return *this; }
     208  template <typename T>
     209  inline sc_int& operator -= (T v)
     210  { vf.valW -= v; return *this; }
     211  template <typename T>
     212  inline sc_int& operator *= (T v)
     213  { vf.valW *= v; return *this; }
     214  template <typename T>
     215  inline sc_int& operator /= (T v)
     216  { vf.valW /= v; return *this; }
     217  template <typename T>
     218  inline sc_int& operator %= (T v)
     219  { vf.valW %= v; return *this; }
     220  template <typename T>
     221  inline sc_int& operator &= (T v)
     222  { vf.valW &= v; return *this; }
     223  template <typename T>
     224  inline sc_int& operator |= (T v)
     225  { vf.valW |= v; return *this; }
     226  template <typename T>
     227  inline sc_int& operator ^= (T v)
     228  { vf.valW ^= v; return *this; }
    217229  inline sc_int_bit_ref& operator [] (int v)
    218230  { return (vf.valW >> v) & 1; }
  • /branches/with_autoconf/src/sc_signal.h

    r30 r20  
    8282        size_t size = (sizeof (T)-1) / sizeof (base_type);
    8383        size_t i = 0;
    84         const base_type *pvalue = (const base_type*)(void*)(&value_);
     84        const base_type *pvalue = (const base_type*)(&value_);
    8585        do {
    8686#if 0
     
    9696        if (sizeof (T) > sizeof (base_type)) {
    9797#if 0
    98   std::cout << "sizeof (T) = " << sizeof (T)
    99             << " (base_type = " << sizeof (base_type) << "\n";
     98    cout << "sizeof (T) = " << sizeof (T) << " (base_type = " << sizeof
     99(base_type) << "\n";
    100100#endif
    101101                post_multiwrite (pointer_,value_);
     
    171171  typedef T  data_type;
    172172  typedef sc_signal < T >  this_type;
    173 
    174173        ///////////
    175174        // Internal
    176175        public: void init ();
    177176        ///////////
    178 
    179177//  virtual void update ();
    180178  void check_writer ();
     
    232230sc_signal<T>::init()
    233231{
    234         set_pointer ((tab_t*)(void*)&val);
     232  set_pointer ((tab_t*)&val);
    235233  set_kind    (kind_string);
    236234        sc_interface::init (sizeof (data_type));
  • /branches/with_autoconf/src/sc_uint.h

    r30 r20  
    183183
    184184  // arithmetic
    185 #define DEFINE_OPERATOR(OPER)        \
    186   template <typename T>              \
    187   inline sc_uint& operator OPER (T v)\
    188   { vf.valW OPER v; return *this; }
    189 
    190   DEFINE_OPERATOR(<<=)
    191   DEFINE_OPERATOR(>>=)
    192   DEFINE_OPERATOR(+=)
    193   DEFINE_OPERATOR(-=)
    194   DEFINE_OPERATOR(*=)
    195   DEFINE_OPERATOR(/=)
    196   DEFINE_OPERATOR(%=)
    197   DEFINE_OPERATOR(&=)
    198   DEFINE_OPERATOR(|=)
    199   DEFINE_OPERATOR(^=)
    200 #undef DEFINE_OPERATOR
    201 
    202 #if 0
    203 #define DEFINE_OPERATOR(OPER)                                              \
    204   friend bool operator OPER (const data_type& a, const data_type& b);
    205 //  { return (a.valW) OPER (b.valW); }
    206 
    207   DEFINE_OPERATOR(==)
    208   DEFINE_OPERATOR(!=)
    209   DEFINE_OPERATOR(>=)
    210   DEFINE_OPERATOR(<=)
    211 #undef DEFINE_OPERATOR
    212 #endif
     185  template <typename T>
     186  inline sc_uint& operator <<= (T v)
     187  { vf.valW <<= v; return *this; }
     188  template <typename T>
     189  inline sc_uint& operator >>= (T v)
     190  { vf.valW >>= v; return *this; }
     191  template <typename T>
     192  inline sc_uint& operator += (T v)
     193  { vf.valW += v; return *this; }
     194  template <typename T>
     195  inline sc_uint& operator -= (T v)
     196  { vf.valW -= v; return *this; }
     197  template <typename T>
     198  inline sc_uint& operator *= (T v)
     199  { vf.valW *= v; return *this; }
     200  template <typename T>
     201  inline sc_uint& operator /= (T v)
     202  { vf.valW /= v; return *this; }
     203  template <typename T>
     204  inline sc_uint& operator %= (T v)
     205  { vf.valW %= v; return *this; }
     206  template <typename T>
     207  inline sc_uint& operator &= (T v)
     208  { vf.valW &= v; return *this; }
     209  template <typename T>
     210  inline sc_uint& operator |= (T v)
     211  { vf.valW |= v; return *this; }
     212  template <typename T>
     213  inline sc_uint& operator ^= (T v)
     214  { vf.valW ^= v; return *this; }
    213215  inline sc_uint_bit_ref operator [] (int v)
    214216  { return (vf.valW >> v) & 1; }
  • /sources/INSTALL

    r30 r20  
    1 Installation Instructions
    2 *************************
     1SystemCASS Installation
     2=======================
    33
    4 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
    5 Software Foundation, Inc.
     4To install SystemCASS on linux, do the following steps:
    65
    7 This file is free documentation; the Free Software Foundation gives
    8 unlimited permission to copy, distribute and modify it.
     6  1. Set the following environment variable(s):
    97
    10 Basic Installation
    11 ==================
     8     TARGET_ARCH : architecture name.
    129
    13 These are generic installation instructions.
     10     SYSTEMCASS  : SystemCASS top directory.
    1411
    15    The `configure' shell script attempts to guess correct values for
    16 various system-dependent variables used during compilation.  It uses
    17 those values to create a `Makefile' in each directory of the package.
    18 It may also create one or more `.h' files containing system-dependent
    19 definitions.  Finally, it creates a shell script `config.status' that
    20 you can run in the future to recreate the current configuration, and a
    21 file `config.log' containing compiler output (useful mainly for
    22 debugging `configure').
     12     ALLIANCE (optional) : ALLIANCE top directory
     13                           See also 'PAT trace output' section.
    2314
    24    It can also use an optional file (typically called `config.cache'
    25 and enabled with `--cache-file=config.cache' or simply `-C') that saves
    26 the results of its tests to speed up reconfiguring.  (Caching is
    27 disabled by default to prevent problems with accidental use of stale
    28 cache files.)
     15     For example :
    2916
    30    If you need to do unusual things to compile the package, please try
    31 to figure out how `configure' could check whether to do them, and mail
    32 diffs or instructions to the address given in the `README' so they can
    33 be considered for the next release.  If you are using the cache, and at
    34 some point `config.cache' contains results you don't want to keep, you
    35 may remove or edit it.
     17       setenv TARGET_ARCH linux
     18       setenv SYSTEMCASS /users/tools/systemcass/
    3619
    37    The file `configure.ac' (or `configure.in') is used to create
    38 `configure' by a program called `autoconf'.  You only need
    39 `configure.ac' if you want to change it or regenerate `configure' using
    40 a newer version of `autoconf'.
     20  2. Change to the top level directory (systemcass)
    4121
    42 The simplest way to compile this package is:
     22  3. Type the following command:
    4323
    44   1. `cd' to the directory containing the package's source code and type
    45      `./configure' to configure the package for your system.  If you're
    46      using `csh' on an old version of System V, you might need to type
    47      `sh ./configure' instead to prevent `csh' from trying to execute
    48      `configure' itself.
     24       (cd src ; make)
    4925
    50      Running `configure' takes awhile.  While running, it prints some
    51      messages telling which features it is checking for.
    5226
    53   2. Type `make' to compile the package.
     27PAT trace ouput
     28===============
    5429
    55   3. Optionally, type `make check' to run any self-tests that come with
    56      the package.
     30PAT trace output is disable by default.
     31Set the environment variable 'ALLIANCE' to ALLIANCE top directory,
     32then make again.
    5733
    58   4. Type `make install' to install the programs and any data files and
    59      documentation.
    60 
    61   5. You can remove the program binaries and object files from the
    62      source code directory by typing `make clean'.  To also remove the
    63      files that `configure' created (so you can compile the package for
    64      a different kind of computer), type `make distclean'.  There is
    65      also a `make maintainer-clean' target, but that is intended mainly
    66      for the package's developers.  If you use it, you may have to get
    67      all sorts of other programs in order to regenerate files that came
    68      with the distribution.
    69 
    70 Compilers and Options
    71 =====================
    72 
    73 Some systems require unusual options for compilation or linking that the
    74 `configure' script does not know about.  Run `./configure --help' for
    75 details on some of the pertinent environment variables.
    76 
    77    You can give `configure' initial values for configuration parameters
    78 by setting variables in the command line or in the environment.  Here
    79 is an example:
    80 
    81      ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
    82 
    83    *Note Defining Variables::, for more details.
    84 
    85 Compiling For Multiple Architectures
    86 ====================================
    87 
    88 You can compile the package for more than one kind of computer at the
    89 same time, by placing the object files for each architecture in their
    90 own directory.  To do this, you must use a version of `make' that
    91 supports the `VPATH' variable, such as GNU `make'.  `cd' to the
    92 directory where you want the object files and executables to go and run
    93 the `configure' script.  `configure' automatically checks for the
    94 source code in the directory that `configure' is in and in `..'.
    95 
    96    If you have to use a `make' that does not support the `VPATH'
    97 variable, you have to compile the package for one architecture at a
    98 time in the source code directory.  After you have installed the
    99 package for one architecture, use `make distclean' before reconfiguring
    100 for another architecture.
    101 
    102 Installation Names
    103 ==================
    104 
    105 By default, `make install' installs the package's commands under
    106 `/usr/local/bin', include files under `/usr/local/include', etc.  You
    107 can specify an installation prefix other than `/usr/local' by giving
    108 `configure' the option `--prefix=PREFIX'.
    109 
    110    You can specify separate installation prefixes for
    111 architecture-specific files and architecture-independent files.  If you
    112 pass the option `--exec-prefix=PREFIX' to `configure', the package uses
    113 PREFIX as the prefix for installing programs and libraries.
    114 Documentation and other data files still use the regular prefix.
    115 
    116    In addition, if you use an unusual directory layout you can give
    117 options like `--bindir=DIR' to specify different values for particular
    118 kinds of files.  Run `configure --help' for a list of the directories
    119 you can set and what kinds of files go in them.
    120 
    121    If the package supports it, you can cause programs to be installed
    122 with an extra prefix or suffix on their names by giving `configure' the
    123 option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
    124 
    125 Optional Features
    126 =================
    127 
    128 Some packages pay attention to `--enable-FEATURE' options to
    129 `configure', where FEATURE indicates an optional part of the package.
    130 They may also pay attention to `--with-PACKAGE' options, where PACKAGE
    131 is something like `gnu-as' or `x' (for the X Window System).  The
    132 `README' should mention any `--enable-' and `--with-' options that the
    133 package recognizes.
    134 
    135    For packages that use the X Window System, `configure' can usually
    136 find the X include and library files automatically, but if it doesn't,
    137 you can use the `configure' options `--x-includes=DIR' and
    138 `--x-libraries=DIR' to specify their locations.
    139 
    140 Specifying the System Type
    141 ==========================
    142 
    143 There may be some features `configure' cannot figure out automatically,
    144 but needs to determine by the type of machine the package will run on.
    145 Usually, assuming the package is built to be run on the _same_
    146 architectures, `configure' can figure that out, but if it prints a
    147 message saying it cannot guess the machine type, give it the
    148 `--build=TYPE' option.  TYPE can either be a short name for the system
    149 type, such as `sun4', or a canonical name which has the form:
    150 
    151      CPU-COMPANY-SYSTEM
    152 
    153 where SYSTEM can have one of these forms:
    154 
    155      OS KERNEL-OS
    156 
    157    See the file `config.sub' for the possible values of each field.  If
    158 `config.sub' isn't included in this package, then this package doesn't
    159 need to know the machine type.
    160 
    161    If you are _building_ compiler tools for cross-compiling, you should
    162 use the option `--target=TYPE' to select the type of system they will
    163 produce code for.
    164 
    165    If you want to _use_ a cross compiler, that generates code for a
    166 platform different from the build platform, you should specify the
    167 "host" platform (i.e., that on which the generated programs will
    168 eventually be run) with `--host=TYPE'.
    169 
    170 Sharing Defaults
    171 ================
    172 
    173 If you want to set default values for `configure' scripts to share, you
    174 can create a site shell script called `config.site' that gives default
    175 values for variables like `CC', `cache_file', and `prefix'.
    176 `configure' looks for `PREFIX/share/config.site' if it exists, then
    177 `PREFIX/etc/config.site' if it exists.  Or, you can set the
    178 `CONFIG_SITE' environment variable to the location of the site script.
    179 A warning: not all `configure' scripts look for a site script.
    180 
    181 Defining Variables
    182 ==================
    183 
    184 Variables not defined in a site shell script can be set in the
    185 environment passed to `configure'.  However, some packages may run
    186 configure again during the build, and the customized values of these
    187 variables may be lost.  In order to avoid this problem, you should set
    188 them in the `configure' command line, using `VAR=value'.  For example:
    189 
    190      ./configure CC=/usr/local2/bin/gcc
    191 
    192 causes the specified `gcc' to be used as the C compiler (unless it is
    193 overridden in the site shell script).  Here is a another example:
    194 
    195      /bin/bash ./configure CONFIG_SHELL=/bin/bash
    196 
    197 Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
    198 configuration-related scripts to be executed by `/bin/bash'.
    199 
    200 `configure' Invocation
    201 ======================
    202 
    203 `configure' recognizes the following options to control how it operates.
    204 
    205 `--help'
    206 `-h'
    207      Print a summary of the options to `configure', and exit.
    208 
    209 `--version'
    210 `-V'
    211      Print the version of Autoconf used to generate the `configure'
    212      script, and exit.
    213 
    214 `--cache-file=FILE'
    215      Enable the cache: use and save the results of the tests in FILE,
    216      traditionally `config.cache'.  FILE defaults to `/dev/null' to
    217      disable caching.
    218 
    219 `--config-cache'
    220 `-C'
    221      Alias for `--cache-file=config.cache'.
    222 
    223 `--quiet'
    224 `--silent'
    225 `-q'
    226      Do not print messages saying which checks are being made.  To
    227      suppress all normal output, redirect it to `/dev/null' (any error
    228      messages will still be shown).
    229 
    230 `--srcdir=DIR'
    231      Look for the package's source code in directory DIR.  Usually
    232      `configure' can determine that directory automatically.
    233 
    234 `configure' also accepts some other, not widely useful, options.  Run
    235 `configure --help' for more details.
    236 
  • /sources/src/alias.cc

    r30 r20  
    3333 */
    3434
    35 #include "alias.h"
    36 #include <iostream>
    37 #ifdef HAVE_CONFIG_H
    38 #include "config.h"
    39 #endif
     35#include"alias.h"
     36#include<iostream>
    4037
    4138const char * alias ()
  • /sources/src/bit2string.cc

    r30 r20  
    4141#include <cstdlib>
    4242#include <iostream>
    43 #ifdef HAVE_CONFIG_H
    44 #include "config.h"
    45 #endif
    4643       
    4744using namespace std;
  • /sources/src/casc.h

    r30 r20  
    4848EXTERN void simulate_1_cycle (void)
    4949{
    50 #ifdef CONFIG_CHECK_FSM_RULES
     50#ifdef CHECK_FSM_RULES
    5151        casc_fsm_step = TRANSITION;
    5252#endif
    5353  transition ();
    5454  update     ();
    55 #ifdef CONFIG_CHECK_FSM_RULES
     55#ifdef CHECK_FSM_RULES
    5656        casc_fsm_step = GEN_MOORE;
    5757#endif
    5858  moore_generation ();
    59 #ifdef CONFIG_CHECK_FSM_RULES
     59#ifdef CHECK_FSM_RULES
    6060        casc_fsm_step = GEN_MEALY;
    6161#endif
    6262  mealy_generation ();
    63 #ifdef CONFIG_CHECK_FSM_RULES
     63#ifdef CHECK_FSM_RULES
    6464        casc_fsm_step = STIMULI;
    6565#endif
  • /sources/src/data_field.h

    r30 r20  
    1313#define __DATA_FIELD_H__
    1414
     15#include <endianness.h>
     16
    1517template<int      WIDTH,
    1618         int      PADDING,
    1719         typename data_type>
    18 struct val_field {
     20struct val_field { /* try to work with little endianess */
     21#if defined(little_endian)
     22  /* little endian */
     23//  data_type pad:PADDING;
    1924  data_type valW:WIDTH;
     25#elif defined(big_endian)
     26  /* big endian */
     27  data_type pad:PADDING;
     28  data_type valW:WIDTH;
     29#else
     30#error You must define endianness.
     31#endif
    2032};
    2133
  • /sources/src/dump_dot.cc

    r30 r20  
    4040#include "simplify_string.h"
    4141#include "sc_ver.h" // sc_version
    42 #ifdef HAVE_CONFIG_H
    43 #include "config.h"
    44 #endif
    4542
    4643typedef std::list<sc_core::sc_port_base*> port_list_t;
  • /sources/src/dump_used_env.cc

    r30 r20  
    3636#include <cstdlib>
    3737#include "dump_used_env.h"
    38 #ifdef HAVE_CONFIG_H
    39 #include "config.h"
    40 #endif
    4138
    4239std::string
  • /sources/src/dump_used_options.cc

    r30 r20  
    3535
    3636#include "dump_used_options.h"
    37 #ifdef HAVE_CONFIG_H
    38 #include "config.h"
    39 #endif
    4037
    4138namespace sc_core {
     
    6865  "DUMP_STAGE, "
    6966#endif
    70 #ifdef CONFIG_CHECK_FSM_RULES     
    71   "CONFIG_CHECK_FSM_RULES, "
     67#ifdef CHECK_FSM_RULES     
     68  "CHECK_FSM_RULES, "
    7269#endif
    7370#ifdef COMPIL_DEBUG 
    7471  "COMPIL_DEBUG,"       
    7572#endif
    76 #ifdef CONFIG_DEBUG
    77   "CONFIG_DEBUG, "         
     73#ifdef DEBUG
     74  "DEBUG, "         
    7875#endif
    7976#ifdef UINT64             
  • /sources/src/entity.cc

    r30 r20  
    3535 */
    3636
    37 #include <cstring>
    38 #include <iomanip>
    39 #include <list>
    40 #include <map>
    41 #include <vector>
    42 
    43 #include <cassert>
    44 #include "entity.h"
    45 #include "sc_port.h"
    46 #include "sc_signal.h"
    47 #include "sc_module.h"
    48 #ifdef HAVE_CONFIG_H
    49 #include "config.h"
    50 #endif
     37#include<cstring>
     38#include<iomanip>
     39#include<list>
     40#include<map>
     41#include<vector>
     42
     43#include"assert.h"
     44#include"entity.h"
     45#include"sc_port.h"
     46#include"sc_signal.h"
     47#include"sc_module.h"
    5148
    5249using namespace std;
     
    178175    typedef std::map<const tab_t *,equi_list_t::iterator,predic4tab_t2equi_t_t> tab_t2equi_it_t;
    179176    static tab_t2equi_it_t tab2equi_map;
    180     assert(pointer != NULL);
     177    ASSERT(pointer != NULL);
    181178
    182179    // boost
     
    243240        {
    244241                equi_t::const_iterator top_iter = e.begin ();
    245 #ifdef CONFIG_DEBUG
     242#ifdef DEBUG
    246243                if (top_iter == e.end ()) {
    247244                        cerr << "Internal error : no signal in " << e << endl;
     
    360357        }
    361358       
    362 #if defined(DUMP_SIGNAL_STATS)
     359#if defined(DUMP_SIGNALS_STATS)
    363360        static unsigned int equi_real_size;
    364361#endif
     
    392389    unsigned int table_size = get_sizeof_signals_table ();
    393390                equi_table = new tab_t[table_size]; //(0xCD);
    394 #if defined(DUMP_SIGNAL_STATS)
     391#if defined(DUMP_SIGNALS_STATS)
    395392                equi_real_size = table_size;
    396393#endif
     
    406403  bind_equi_to_table (equi_t &e, tab_t * const pointer)
    407404  {
    408     assert(pointer != NULL);
     405    ASSERT(pointer != NULL);
    409406    equi_t::iterator i;
    410407    for (i = e.begin (); i != e.end (); ++i) {
     
    458455    o << ")";
    459456#else
    460    assert(e.object != NULL);
     457   ASSERT(e.object != NULL);
    461458   o << e.object->name ();
    462459#endif
     
    497494  print_table_stats (ostream &o)
    498495  {
    499 #if defined(DUMP_SIGNAL_STATS)
     496#if defined(DUMP_SIGNALS_STATS)
    500497                int nb_reg = 0;
    501498                int nb_sig = 0;
     
    540537        }
    541538        const entity &ent = *(eq.begin ());
    542 #ifdef CONFIG_DEBUG
     539#ifdef DEBUG
    543540        if (ent.type != sc_core::entity::SIGNAL)
    544541                exit(28);
     
    547544        const char *sig_name = ent.object->name ();
    548545        const char *sep  = strchr (sig_name,'.');
    549 #ifdef CONFIG_DEBUG
     546#ifdef DEBUG
    550547        if (sep == NULL) {
    551548                exit (30);
     
    598595#endif
    599596
    600 #if defined(DUMP_SIGNAL_STATS)
     597#if defined(DUMP_SIGNALS_STATS)
    601598static unsigned int equi_real_size;
    602599#endif
     
    606603{
    607604#if 0
    608 //defined(CONFIG_DEBUG)
     605//defined(DEBUG)
    609606  equi_list_t::iterator x_equi = get_equi (x);
    610607  if ((x_equi != equi_list.end())) {
     
    643640tbind (sc_port_base &x,T &y)
    644641{
    645 //  assert(x.get_pointer () != NULL); // x pointer may be NULL
    646 //  assert(y.get_pointer () != NULL); // y pointer may be NULL
     642//  ASSERT(x.get_pointer () != NULL); // x pointer may be NULL
     643//  ASSERT(y.get_pointer () != NULL); // y pointer may be NULL
    647644  equi_list_t::iterator x_equi = get_equi (x);
    648645  equi_list_t::iterator y_equi = get_equi (y);
  • /sources/src/entity.h

    r30 r20  
    1414#define __ENTITY_H__
    1515
    16 #include <iostream>
    17 #include <list>
    18 #include "sc_fwd.h"
    19 #include "sc_port.h"
    20 #include "sc_signal.h"
     16#include<iostream>
     17#include<list>
     18#include"sc_fwd.h"
     19#include"sc_port.h"
     20#include"sc_signal.h"
    2121
    2222namespace sc_core {
  • /sources/src/fsm_rules.h

    r30 r20  
    1313#define __FSM_RULES_H__
    1414
    15 #ifdef HAVE_CONFIG_H
    16 #include "config.h"
    17 #endif
    18 
    19 #ifdef CONFIG_CHECK_FSM_RULES
     15#ifdef CHECK_FSM_RULES
    2016
    2117namespace sc_core {
  • /sources/src/gen_code.cc

    r30 r20  
    3434 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    3535 */
    36 #if defined(__linux__)
     36#ifndef _WIN32
    3737#include <linux/limits.h>
    38 #elif defined(WIN32)
     38#else
    3939#include <windows.h>
    4040#endif
     
    4545#include<fstream>
    4646
    47 #include "internal.h"
    48 #include "gen_code.h"
    49 #include "sc_module.h"
    50 #include "sc_ver.h"
    51 #include "process_dependency.h"
    52 #ifdef HAVE_CONFIG_H
    53 #include "config.h"
    54 #endif
    55 
    56 #ifdef CONFIG_CHECK_FSM_RULES
    57 #include "fsm_rules.h"
    58 #define fsm_check_flag "-DCONFIG_CHECK_FSM_RULES"
     47#include"internal.h"
     48#include"gen_code.h"
     49#include"sc_module.h"
     50#include"sc_ver.h"
     51#include"process_dependency.h"
     52
     53#ifdef CHECK_FSM_RULES
     54#define fsm_check_flag "-DCHECK_FSM_RULES"
    5955#else
    6056#define fsm_check_flag
    6157#endif
    6258
    63 #define casc_cflags GENERATED_MODULE_CFLAGS " " fsm_check_flag
    64 
    65 // Enable CPP call, this is useful for typeinfo-enabled classes
    66 #define CPP_CALL
     59#define casc_cflags CFLAGS " " fsm_check_flag
     60
     61#if defined(darwin)
     62#define macosx
     63#endif
    6764
    6865using namespace std;
     
    9491                << m.module->name() << "->" << m.name << "()\\n\");\n";
    9592  o << " p.integer = " << func << ";\n";
    96 #ifdef CPP_CALL
     93#if CPP_CALL
    9794  o << " (((sc_module*)(" << m.module << "))->*(p.pmf)) (); /* "
    9895                << m.module->name () << "->" << m.name << "() */\n";
     
    146143  }
    147144
    148 #ifdef CONFIG_DEBUG
     145#ifdef DEBUG
    149146  cerr << "opened temporary filename : " << temp << "\n";
    150147#endif
     
    271268
    272269  o << "// generated by " << sc_version () << endl
    273                 << "#include <casc.h>\n\n"
    274                 << "#include <cstdio>\n\n"
    275 //              << "#include <iostream>\n\n"
     270                << "#include<casc.h>\n\n"
     271                << "#include<cstdio>\n\n"
     272//              << "#include<iostream>\n\n"
    276273                << "namespace sc_core {\n"
    277274    << " typedef void (sc_module::*SC_ENTRY_FUNC)();\n"
     
    332329
    333330  o << "// generated by " << sc_version () << endl
    334                 << "#include <casc.h>\n\n"
    335                 << "#include <cstdio>\n\n"
    336 //              << "#include <iostream>\n\n"
     331                << "#include<casc.h>\n\n"
     332                << "#include<cstdio>\n\n"
     333//              << "#include<iostream>\n\n"
    337334                << "namespace sc_core {\n"
    338335    << " typedef void (sc_module::*SC_ENTRY_FUNC)();\n"
     
    380377//  const char *target_arch = getenv ("TARGET_ARCH");
    381378        const char *default_compiler =
    382 #ifdef CPP_CALL
     379#if CPP_CALL
    383380                "g++";
    384381#else
     
    421418  /* COMPILE */
    422419  /* ******* */
    423   const char *commandline_template =
    424 #if defined(CONFIG_OS_DARWIN)
    425           "(cd %s ;"                     " %s %s -DSCHEDULING_BY_CASC -I%s/include -fno-common -dynamic -o %s -c %s)"
    426 #elif defined(CONFIG_OS_LINUX)
    427           "(cd %s ; libtool --mode=compile %s %s -DSCHEDULING_BY_CASC -I%s/include -shared -o %s -c %s)"
     420#if defined(macosx)
     421    sprintf(compil_str,
     422                                "(cd %s ; %s %s -DSCHEDULING_BY_CASC -I%s/include -fno-common -dynamic -o %s -c %s)",
     423        temporary_dir,
     424                                compiler,
     425                                casc_cflags,
     426                                systemc_dir,
     427                                target_name,
     428                                source_name);
     429//    sprintf(compil_str,"");
     430#elif defined(linux)
     431    sprintf(compil_str,
     432                                "(cd %s ; libtool --mode=compile %s %s -DSCHEDULING_BY_CASC -I%s/include -shared -o %s -c %s)",
     433        temporary_dir,
     434                                compiler,
     435                                casc_cflags,
     436                                systemc_dir,
     437                                target_name,
     438                                source_name);
    428439#else
    429           "(cd %s ;"                     " %s %s -DSCHEDULING_BY_CASC -I%s/include -dynamiclib -o %s -c %s)"
    430 #endif
    431           ;
    432   sprintf(compil_str,
    433                   commandline_template,
    434                   temporary_dir,
    435                   compiler,
    436                   casc_cflags,
    437                   systemc_dir,
    438                   target_name,
    439                   source_name);
     440    sprintf(compil_str,
     441                                "(cd %s ; %s %s -DSCHEDULING_BY_CASC -I%s/include -dynamiclib -o %s -c %s)",
     442        temporary_dir,
     443                                compiler,
     444                                casc_cflags,
     445                                systemc_dir,
     446                                target_name,
     447                                source_name);
     448#endif
    440449
    441450  if (dump_stage)
     
    452461  sprintf (target_name, "%s.so", base_name);
    453462
    454 #ifdef CONFIG_OS_LINUX
     463#if defined(linux)
    455464  sprintf (source_name, "%s.lo", base_name);
    456465  sprintf(compil_str, "(cd %s ; pwd ; libtool --mode=link %s %s -shared -rdynamic -o %s %s)", /* -L. -L%s/lib-%s */
     
    551560  for (i = 0; i < n; ++i)
    552561  {
    553 #if 0 //defined(CONFIG_DEBUG)
     562#if 0 //defined(DEBUG)
    554563    sc_module *m = (sc_module*)(fc.instance[i]);
    555564    cerr << m->name () << endl;
     
    566575void static_simulate_1_cycle (void)
    567576{
    568 #ifdef CONFIG_CHECK_FSM_RULES
     577#ifdef CHECK_FSM_RULES
    569578        casc_fsm_step = TRANSITION;
    570579#endif
    571580  call_functions (pf[0]); // transition
    572581  update     ();
    573 #ifdef CONFIG_CHECK_FSM_RULES
     582#ifdef CHECK_FSM_RULES
    574583        casc_fsm_step = GEN_MOORE;
    575584#endif
    576585  call_functions (pf[1]); // moore generation
    577 #ifdef CONFIG_CHECK_FSM_RULES
     586#ifdef CHECK_FSM_RULES
    578587        casc_fsm_step = GEN_MEALY;
    579588#endif
    580589  call_functions (pf[2]); // mealy generation
    581 #ifdef CONFIG_CHECK_FSM_RULES
     590#ifdef CHECK_FSM_RULES
    582591        casc_fsm_step = STIMULI;
    583592#endif
     
    625634void quasistatic_simulate_1_cycle (void)
    626635{
    627 #ifdef CONFIG_CHECK_FSM_RULES
     636#ifdef CHECK_FSM_RULES
    628637        casc_fsm_step = TRANSITION;
    629638#endif
     
    635644  }
    636645  update     ();
    637 #ifdef CONFIG_CHECK_FSM_RULES
     646#ifdef CHECK_FSM_RULES
    638647        casc_fsm_step = GEN_MOORE;
    639648#endif
     
    643652    Call (m);
    644653  }
    645 #ifdef CONFIG_CHECK_FSM_RULES
     654#ifdef CHECK_FSM_RULES
    646655        casc_fsm_step = GEN_MEALY;
    647656#endif
    648657  quasistatic_mealy_generation ();
    649 #ifdef CONFIG_CHECK_FSM_RULES
     658#ifdef CHECK_FSM_RULES
    650659        casc_fsm_step = STIMULI;
    651660#endif
  • /sources/src/gen_code.h

    r30 r20  
    1414#define __GEN_CODE_H__
    1515
    16 #include "internal.h"
    17 #include "global_functions.h"
    18 #include "graph.h"
    19 #include "sc_port.h"
    20 #include "sc_trace.h"
    21 #include "process_dependency.h"
     16#include"internal.h"
     17#include"global_functions.h"
     18#include"graph.h"
     19#include"sc_port.h"
     20#include"sc_trace.h"
     21#include"process_dependency.h"
    2222
    2323//-------------------------------------------------------------------
     
    105105internal_sc_cycle0( double duration )  // in default time units
    106106{
    107 #ifdef CONFIG_DEBUG
     107#ifdef DEBUG
    108108        // Check dynamic linkage
    109109  if ((func_combinationals == NULL) || (func_simulate_1_cycle == NULL)) {
     
    121121#endif
    122122        update ();
    123 #ifdef CONFIG_CHECK_FSM_RULES
     123#ifdef CHECK_FSM_RULES
    124124                casc_fsm_step = GEN_MEALY;
    125125#endif
     
    132132  if (is_posted_write ()) {
    133133    update ();
    134 #ifdef CONFIG_CHECK_FSM_RULES
     134#ifdef CHECK_FSM_RULES
    135135                casc_fsm_step = GEN_MEALY;
    136136#endif
  • /sources/src/global_functions.cc

    r30 r20  
    3535 */
    3636
    37 #include <iostream>
    38 #include <dlfcn.h>
    39 #include "schedulers.h" // get_scheduling & run_schedule_editor
    40 #include "sc_module.h" // check_all_method_process
    41 #include "gen_code.h"  // gen_scheduling_code_for_dynamic_link & gen_scheduling_code_for_static_func
    42 #include "sc_clock_ext.h" // clock list
    43 #include "usage.h"
    44 #include "module_hierarchy2dot.h"
    45 #include "assert.h"
    46 #ifdef HAVE_CONFIG_H
    47 #include "config.h"
    48 #endif
    49 
    50 #ifdef CONFIG_CHECK_FSM_RULES
    51 #include "fsm_rules.h"
    52 #endif
     37#include<iostream>
     38#include<dlfcn.h>
     39#include"schedulers.h" // get_scheduling & run_schedule_editor
     40#include"sc_module.h" // check_all_method_process
     41#include"gen_code.h"  // gen_scheduling_code_for_dynamic_link & gen_scheduling_code_for_static_func
     42#include"sc_clock_ext.h" // clock list
     43#include"usage.h"
     44#include"module_hierarchy2dot.h"
     45#include"assert.h"
    5346
    5447using namespace std;
     
    225218   
    226219  char lib_absolutepath[256];
    227 #if defined(CONFIG_OS_DARWIN)
     220#if defined(darwin) //macosx)
    228221  sprintf(lib_absolutepath, "/tmp/%s.so", base_name);
    229 #elif defined(CONFIG_OS_LINUX)
     222#elif defined(linux)
    230223  sprintf(lib_absolutepath, "/tmp/%s.so", base_name);
    231224#else
     
    262255  }
    263256  // Init variables to be able to run combinational functions
    264 #ifdef CONFIG_CHECK_FSM_RULES
     257#ifdef CHECK_FSM_RULES
    265258        casc_fsm_step = STIMULI;
    266259#endif
  • /sources/src/global_functions.h

    r30 r20  
    1313#define __GLOBAL_FUNCTIONS_H__
    1414
    15 #include "sc_fwd.h"
    16 #include "sc_time.h"
     15#include"sc_fwd.h"
     16#include"sc_time.h"
    1717
    1818extern int sc_main(int, char **);
  • /sources/src/graph.cc

    r30 r20  
    113113#include "sc_module.h"
    114114#include "sc_port.h"
    115 #ifdef HAVE_CONFIG_H
    116 #include "config.h"
    117 #endif
    118115
    119116using namespace std;
     
    157154{
    158155Arc *a;
    159 #ifdef CONFIG_DEBUG
     156#ifdef DEBUG
    160157        if ((u == NULL) || (v == NULL))
    161158                exit(29042004);
  • /sources/src/graph_cass.cc

    r30 r20  
    130130#include "simplify_string.h" // simplify_string
    131131#include "sc_ver_ext.h"      // sc_version for dumping to DOT
    132 #ifdef HAVE_CONFIG_H
    133 #include "config.h"
    134 #endif
    135132
    136133using namespace std;
  • /sources/src/graph_signals.cc

    r30 r20  
    138138#include "sc_module.h"
    139139#include "sc_port.h"
    140 #ifdef HAVE_CONFIG_H
    141 #include "config.h"
    142 #endif
    143140
    144141using namespace std;
  • /sources/src/hex2string.cc

    r30 r20  
    4141#include <cstdlib>
    4242#include <iostream>
    43 #ifdef HAVE_CONFIG_H
    44 #include "config.h"
    45 #endif
    4643       
    4744using namespace std;
  • /sources/src/methodprocess_dependency.cc

    r30 r20  
    3434 */
    3535
    36 #include <cassert>
     36#include "assert.h"
    3737#include "methodprocess_dependency.h"
    3838#include "simplify_string.h"
     
    4040#include <iostream>
    4141#include <fstream>
    42 #ifdef HAVE_CONFIG_H
    43 #include "config.h"
    44 #endif
    4542
    4643using namespace std;
     
    5047get_name (const method_process_t *method)
    5148{
    52   assert(method != NULL);
     49  ASSERT(method != NULL);
    5350  const sc_module *module = method->module;
    54   assert(module != NULL);
     51  ASSERT(module != NULL);
    5552  const char *module_name = module->name ();
    5653  const char *function_name = method->name;
     
    8885    const SignalDependency &sd = *it;
    8986    const equi_t           *source_equi     = sd.source;
    90     assert(source_equi != NULL);
     87    ASSERT(source_equi != NULL);
    9188          const method_process_t *source_method   = table[source_equi];
    9289    if (source_method == NULL)
  • /sources/src/module_hierarchy.cc

    r30 r20  
    3636#include "module_hierarchy.h"
    3737#include "sc_module.h"
    38 #include <cassert>
     38#include "assert.h"
    3939#include <map>
    40 #ifdef HAVE_CONFIG_H
    41 #include "config.h"
    42 #endif
    4340#include <cstdlib>
    4441#include <cstring>
     
    7673      return; //obj_list = &top_level_objects;
    7774    else {
    78       assert(parent != &obj);
     75      ASSERT(parent != &obj);
    7976      const sc_object *pobj      = (const sc_module *) parent;
    8077      obj_list = &(object2childs[pobj]);
  • /sources/src/module_hierarchy2dot.cc

    r30 r20  
    4343#include "sc_signal.h"
    4444#include "entity.h"
    45 #include <cassert>
     45#include "assert.h"
    4646#include "internal.h"
    47 #ifdef HAVE_CONFIG_H
    48 #include "config.h"
    49 #endif
    5047
    5148using namespace std;
     
    9188      const entity &in_entity  = *it;
    9289      sc_object    *in_obj     = in_entity.object;
    93       assert(in_obj != NULL);
     90      ASSERT(in_obj != NULL);
    9491      const sc_module *in_parent = NULL;
    9592      switch (in_entity.type) {
  • /sources/src/mouchard_scheduling.cc

    r30 r20  
    4545#include "sc_module.h"
    4646#include "sc_ver.h"
    47 #ifdef HAVE_CONFIG_H
    48 #include "config.h"
    49 #endif
    5047
    5148using namespace std;
  • /sources/src/port_dependency.cc

    r30 r20  
    4545#include "sc_port.h"
    4646#include "sc_ver_ext.h"
    47 #ifdef HAVE_CONFIG_H
    48 #include "config.h"
    49 #endif
    5047
    5148using namespace std;
     
    111108        p.destination = &b;
    112109        aPortDependencyGraph.push_back (p);
    113 #ifdef DUMP_PORT_DEPENDENCY
     110#if DUMP_PORT_DEPENDENCY
    114111        if (a) {
    115112                cerr << "'" << ((sc_object&)b).name()
  • /sources/src/process_dependency.cc

    r30 r20  
    4444#include "sc_module.h"
    4545#include "sc_ver.h"
    46 #ifdef HAVE_CONFIG_H
    47 #include "config.h"
    48 #endif
    4946
    5047using namespace std;
  • /sources/src/sc_bigint.h

    r30 r20  
    2222// ----------------------------------------------------------------------------
    2323
    24 #include "sc_nbdefs.h"
     24#include"sc_nbdefs.h"
    2525
    2626namespace sc_dt {
  • /sources/src/sc_biguint.h

    r30 r20  
    1818// ----------------------------------------------------------------------------
    1919
    20 #include "sc_nbdefs.h"
     20#include"sc_nbdefs.h"
    2121
    2222namespace sc_dt {
  • /sources/src/sc_bit.h

    r30 r20  
    1313#define __SC_BIT_H__
    1414
    15 #include "sc_nbdefs.h"
    16 #include "sc_fwd.h"
    17 #include "sc_logic.h"
    18 #include "sc_string.h"
    19 #include "sc_numrep.h"
     15#include"sc_nbdefs.h"
     16#include"sc_fwd.h"
     17#include"sc_logic.h"
     18#include"sc_string.h"
     19#include"sc_numrep.h"
    2020
    2121// ----------------------------------------------------------------------------
  • /sources/src/sc_bv.h

    r30 r20  
    1818// ----------------------------------------------------------------------------
    1919
    20 #include "sc_nbdefs.h"
    21 #include "sc_logic.h"
    22 #include "sc_unsigned.h"
    23 #include "sc_signed.h"
    24 #include "sc_uint.h"
    25 #include "sc_int.h"
     20#include"sc_nbdefs.h"
     21#include"sc_logic.h"
     22#include"sc_unsigned.h"
     23#include"sc_signed.h"
     24#include"sc_uint.h"
     25#include"sc_int.h"
    2626
    2727namespace sc_dt {
  • /sources/src/sc_clock.cc

    r30 r20  
    3535 */
    3636
    37 #include "sc_clock.h"
    38 #include <cassert>
    39 #ifdef HAVE_CONFIG_H
    40 #include "config.h"
    41 #endif
     37#include"sc_clock.h"
     38#include"assert.h"
    4239
    4340using namespace std;
     
    7269{
    7370        init ();
    74   assert(period_     == 1);
    75   assert(duty_cycle_ == 0.5);
    76   assert(start_time_ == SC_ZERO_TIME);
     71  ASSERT(period_     == 1);
     72  ASSERT(duty_cycle_ == 0.5);
     73  ASSERT(start_time_ == SC_ZERO_TIME);
    7774  posedge_first = posedge_first_;
    7875}
     
    8582{
    8683        init ();
    87   assert(period_     == 1);
    88   assert(duty_cycle_ == 0.5);
    89   assert(start_time_ == SC_ZERO_TIME);
     84  ASSERT(period_     == 1);
     85  ASSERT(duty_cycle_ == 0.5);
     86  ASSERT(start_time_ == SC_ZERO_TIME);
    9087  posedge_first = posedge_first_;
    9188}
  • /sources/src/sc_clock.h

    r30 r20  
    1414#define __SC_CLOCK_H__
    1515
    16 #include "sc_clock_ext.h"
     16#include"sc_clock_ext.h"
    1717
    1818
  • /sources/src/sc_event.cc

    r30 r20  
    3535
    3636
    37 #include <iostream>
    38 #include "sc_event.h"
    39 #include "sc_interface.h"
    40 #include "sc_port_ext.h"
    41 #ifdef HAVE_CONFIG_H
    42 #include "config.h"
    43 #endif
     37#include<iostream>
     38#include"sc_event.h"
     39#include"sc_interface.h"
     40#include"sc_port_ext.h"
    4441
    4542using namespace std;
  • /sources/src/sc_event.h

    r30 r20  
    1313#define __SC_EVENT_H__
    1414
    15 #include "sc_fwd.h"
    16 #include <iostream>
     15#include"sc_fwd.h"
    1716#include<iostream>
    1817
  • /sources/src/sc_event_finder.cc

    r30 r20  
    3535
    3636
    37 #include "sc_event_finder.h"
    38 #ifdef HAVE_CONFIG_H
    39 #include "config.h"
    40 #endif
     37#include"sc_event_finder.h"
    4138
    4239namespace sc_core {
  • /sources/src/sc_event_finder.h

    r30 r20  
    1313#define __SC_EVENT_FINDER_H__
    1414
    15 #include "sc_fwd.h"
     15#include"sc_fwd.h"
    1616
    1717namespace sc_core {
  • /sources/src/sc_int.h

    r30 r20  
    1818#include <sc_logic.h>
    1919#include <sc_bv.h>
    20 #include <cstdlib>
    2120
    2221// ----------------------------------------------------------------------------
     
    2928// ----------------------------------------------------------------------------
    3029
    31 #include "sc_nbdefs.h"
     30#include"sc_nbdefs.h"
    3231
    3332namespace sc_dt {
     
    136135  sc_int()                 { val = 0; }
    137136//  sc_int(data_type val_)  { val = 0; write (val_); }
    138   sc_int (const char *a)   { val = 0; write (std::atoi (a)); }
     137  sc_int (const char *a)   { val = 0; write (atoi (a)); }
    139138  sc_int (unsigned short a){ val = 0; write (a); }
    140139  sc_int (short a)         { val = 0; write (a); }
     
    198197
    199198  // arithmetic
    200 #define DEFINE_OPERATOR(OPER)        \
    201   template <typename T>              \
    202   inline sc_int& operator OPER (T v) \
    203   { vf.valW OPER v; return *this; }
    204 
    205   DEFINE_OPERATOR(<<=)
    206   DEFINE_OPERATOR(>>=)
    207   DEFINE_OPERATOR(+=)
    208   DEFINE_OPERATOR(-=)
    209   DEFINE_OPERATOR(*=)
    210   DEFINE_OPERATOR(/=)
    211   DEFINE_OPERATOR(%=)
    212   DEFINE_OPERATOR(&=)
    213   DEFINE_OPERATOR(|=)
    214   DEFINE_OPERATOR(^=)
    215 #undef DEFINE_OPERATOR
    216 
     199  template <typename T>
     200  inline sc_int& operator <<= (T v)
     201  { vf.valW <<= v; return *this; }
     202  template <typename T>
     203  inline sc_int& operator >>= (T v)
     204  { vf.valW >>= v; return *this; }
     205  template <typename T>
     206  inline sc_int& operator += (T v)
     207  { vf.valW += v; return *this; }
     208  template <typename T>
     209  inline sc_int& operator -= (T v)
     210  { vf.valW -= v; return *this; }
     211  template <typename T>
     212  inline sc_int& operator *= (T v)
     213  { vf.valW *= v; return *this; }
     214  template <typename T>
     215  inline sc_int& operator /= (T v)
     216  { vf.valW /= v; return *this; }
     217  template <typename T>
     218  inline sc_int& operator %= (T v)
     219  { vf.valW %= v; return *this; }
     220  template <typename T>
     221  inline sc_int& operator &= (T v)
     222  { vf.valW &= v; return *this; }
     223  template <typename T>
     224  inline sc_int& operator |= (T v)
     225  { vf.valW |= v; return *this; }
     226  template <typename T>
     227  inline sc_int& operator ^= (T v)
     228  { vf.valW ^= v; return *this; }
    217229  inline sc_int_bit_ref& operator [] (int v)
    218230  { return (vf.valW >> v) & 1; }
  • /sources/src/sc_interface.cc

    r30 r20  
    3434 */
    3535
    36 #include "sc_interface.h"
    37 #include "sc_event.h"
    38 #include "assert.h"
    39 #include <iostream>
    40 #include <map>
    41 #ifdef HAVE_CONFIG_H
    42 #include "config.h"
    43 #endif
    44 #include <cstdlib>  //exit
     36#include"sc_interface.h"
     37#include"sc_event.h"
     38#include"assert.h"
     39#include<iostream>
     40#include<map>
    4541#include<cstdlib>  //exit
    4642
     
    110106{
    111107        interface2infos_t::iterator i = interface2infos.find (this);
    112 #ifdef CONFIG_DEBUG
     108#ifdef DEBUG
    113109        if (i == interface2infos.end ()) {
    114110                cerr << "Internal error : can't find data size of " << this << "\n";
     
    123119{
    124120        interface2infos_t::iterator i = interface2infos.find (this);
    125 #ifdef CONFIG_DEBUG
     121#ifdef DEBUG
    126122        if (i == interface2infos.end ()) {
    127123                cerr << "Internal error : can't find default event of " << this << "\n";
  • /sources/src/sc_interface.h

    r30 r20  
    1313#define __SC_INTERFACE_H__
    1414
    15 #include "sc_fwd.h"
    16 #include "internal_ext.h"
     15#include"sc_fwd.h"
     16#include"internal_ext.h"
    1717
    1818namespace sc_core {
  • /sources/src/sc_logic.cc

    r30 r20  
    3939// ----------------------------------------------------------------------------
    4040
    41 #include "sc_logic.h"
    42 #ifdef HAVE_CONFIG_H
    43 #include "config.h"
    44 #endif
     41#include"sc_logic.h"
    4542
    4643namespace sc_dt {
  • /sources/src/sc_logic.h

    r30 r20  
    1818// ----------------------------------------------------------------------------
    1919
    20 #include "sc_nbdefs.h"
    21 #include "sc_fwd.h"
     20#include"sc_nbdefs.h"
     21#include"sc_fwd.h"
    2222
    2323namespace sc_dt {
  • /sources/src/sc_lv.h

    r30 r20  
    1818// ----------------------------------------------------------------------------
    1919
    20 #include "sc_nbdefs.h"
    21 #include "sc_logic.h"
    22 #include "sc_unsigned.h"
    23 #include "sc_signed.h"
    24 #include "sc_uint.h"
    25 #include "sc_int.h"
     20#include"sc_nbdefs.h"
     21#include"sc_logic.h"
     22#include"sc_unsigned.h"
     23#include"sc_signed.h"
     24#include"sc_uint.h"
     25#include"sc_int.h"
    2626
    2727
  • /sources/src/sc_main.cc

    r30 r20  
    3535 */
    3636
    37 #include <sstream>
    38 #include <list>
    39 #include <set>
    40 #include <cstring> // strcmp
    41 #include <cassert>
    42 
    43 #include "internal.h"
    44 #include "global_functions.h"
    45 #include "sc_ver.h"
    46 #include "sc_module.h"
    47 #include "sc_signal.h" // pending_write_vector
    48 #include "dump_dot.h"
    49 #include "dump_used_options.h"
    50 #include "dump_used_env.h"
    51 
    52 #ifdef HAVE_CONFIG_H
    53 #include "config.h"
    54 #endif
     37#include<sstream>
     38#include<list>
     39#include<set>
     40#include<cstring> // strcmp
     41
     42#include"internal.h"
     43#include"global_functions.h"
     44#include"sc_ver.h"
     45#include"sc_module.h"
     46#include"sc_signal.h" // pending_write_vector
     47#include"dump_dot.h"
     48#include"dump_used_options.h"
     49#include"dump_used_env.h"
     50#include"assert.h"
    5551
    5652//
     
    6460
    6561bool        check_port_dependencies = false;
    66 #ifdef CONFIG_DEFAULT_RUNTIME_COMPILATION
    67 bool        dynamic_link_of_scheduling_code = true;
    68 #else
    6962bool        dynamic_link_of_scheduling_code = false;
    70 #endif
    7163bool        dump_netlist_info       = false;
    7264bool        dump_funclist_info      = false;
     
    116108  switch (scheduling_method) {
    117109  case CASS_SCHEDULING :
    118     assert(use_port_dependency == false);
     110    ASSERT(use_port_dependency == false);
    119111    break;
    120112  case BUCHMANN_SCHEDULING :
     
    133125    exit (33);
    134126  }
    135   assert(use_port_dependency || use_sensitivity_list);
     127  ASSERT(use_port_dependency || use_sensitivity_list);
    136128}
    137129
  • /sources/src/sc_module.cc

    r30 r20  
    4848#include "sc_clock.h" // is_clock
    4949#include "entity.h"
    50 #include <cassert>
    51 #ifdef HAVE_CONFIG_H
    52 #include "config.h"
    53 #endif
     50#include "assert.h"
    5451
    5552//
     
    163160  sensitivity_list_t::iterator i;
    164161  for (i = sensitivity_list.begin (); i != sensitivity_list.end (); ++i) {
    165 #if defined(CONFIG_DEBUG) && 0
     162#if defined(_DEBUG)
    166163    if (i->get_interface() == NULL)
    167164    {
     
    241238          sensitive (this)
    242239{
    243   assert(nm != NULL);
     240  ASSERT(nm != NULL);
    244241#if 0
    245242  cerr << "sc_module constructor with const char * parameter\n";
     
    501498  if (m_pushed == false)
    502499    return;
    503   assert(sc_core::module_name_stack.empty () == false);
     500  ASSERT(sc_core::module_name_stack.empty () == false);
    504501  sc_core::module_name_stack.pop_back ();
    505502        modules_stack.pop ();
     
    507504  cout << "~sc_module_name <- " << m_name << endl;
    508505#endif
    509   assert(temp_list.empty () == false);
     506  ASSERT(temp_list.empty () == false);
    510507  sc_module *last1 = temp_list.back();
    511508  temp_list.pop_back();
     
    529526  if (m.dont_initialize == false)
    530527  {
    531     assert(m.module != NULL);
    532 #ifdef CONFIG_DEBUG
     528    ASSERT(m.module != NULL);
     529#if DEBUG
    533530    std::cerr << "Warning : SystemCASS doesn't perform SC_METHOD(S) initializations.\n"
    534531              << "Please turn off automatic initialization for '" << m.name
  • /sources/src/sc_module.h

    r30 r20  
    1616#include "sc_module_ext.h"
    1717
    18 #include <list>
    19 #include <set>
    20 #include <stack>
    21 #include "sc_fwd.h"
    22 #include "internal.h"
    23 #include "sc_object.h"
    24 #include "sc_sensitive.h"
     18#include<list>
     19#include<set>
     20#include<stack>
     21#include"sc_fwd.h"
     22#include"internal.h"
     23#include"sc_object.h"
     24#include"sc_sensitive.h"
    2525
    2626namespace sc_core {
  • /sources/src/sc_module_ext.h

    r30 r20  
    3838#define __SC_MODULE_EXT_H__
    3939
    40 #include "sc_fwd.h"
    41 #include "internal_ext.h"
    42 #include "sc_object.h"
    43 #include "sc_sensitive.h"
    44 #include "serialization_ext.h"
     40#include"sc_fwd.h"
     41#include"internal_ext.h"
     42#include"sc_object.h"
     43#include"sc_sensitive.h"
     44#include"serialization_ext.h"
    4545
    4646namespace sc_core {
  • /sources/src/sc_module_name.h

    r30 r20  
    1414#define __SC_MODULE_NAME_H__
    1515
    16 #include "sc_fwd.h"
     16#include"sc_fwd.h"
    1717
    1818namespace sc_core {
  • /sources/src/sc_numrep.cc

    r30 r20  
    3636#include <string>
    3737#include "sc_numrep.h"
    38 #ifdef HAVE_CONFIG_H
    39 #include "config.h"
    40 #endif
    4138
    4239namespace sc_dt {
  • /sources/src/sc_object.cc

    r30 r20  
    4040#include <map>
    4141
    42 #include <cassert>
     42#include "assert.h"
    4343#include "sc_object.h"
    4444//#include "sc_port.h"
     
    4646#include "sc_signal.h"
    4747#include "module_hierarchy.h"
    48 #ifdef HAVE_CONFIG_H
    49 #include "config.h"
    50 #endif
    5148
    5249using namespace std;
     
    7471//    out += ".";
    7572  }
    76 //  assert(name != NULL);
     73//  ASSERT(name != NULL);
    7774  if (name)
    7875    out += name;
     
    206203{
    207204        object2name_t::iterator i = object2fullname.find (this);
    208 #ifdef CONFIG_DEBUG
     205#ifdef DEBUG
    209206        if (i == object2fullname.end ()) {
    210207                cerr << "Internal error : can't find name of " << this << "\n";
     
    220217/*
    221218        object2name_t::iterator i = object2fullname.find (this);
    222 #ifdef CONFIG_DEBUG
     219#ifdef DEBUG
    223220        if (i == object2fullname.end ()) {
    224221                cerr << "Internal error : can't find name of " << this << "\n";
     
    238235    string     out;
    239236    sc_object* obj = *it;
    240     assert(obj != NULL);
     237    ASSERT(obj != NULL);
    241238    build_full_name (out, *obj);
    242239  }
     
    246243{
    247244        object2infos_t::iterator i = object2infos.find (this);
    248 #ifdef CONFIG_DEBUG
     245#ifdef DEBUG
    249246        if (i == object2infos.end ()) {
    250247                cerr << "Internal error : can't find kind of " << this << "\n";
  • /sources/src/sc_pat_trace.cc

    r30 r20  
    3636
    3737
    38 #include "sc_trace.h"
    39 #include "sc_pat_trace.h"
    40 #include "sc_ver.h"
    41 #include "internal.h" // notrace
     38#include"sc_trace.h"
     39#include"sc_pat_trace.h"
     40#include"sc_ver.h"
     41#include"internal.h" // notrace
    4242
    43 #include <ctime>
    44 #ifdef HAVE_CONFIG_H
    45 #include "config.h"
    46 #endif
     43#include<ctime>
    4744
    48 #ifdef CONFIG_PAT_TRACE_FORMAT
     45#ifdef PAT_TRACE_FORMAT
    4946
    5047//-----------------------------------------
  • /sources/src/sc_port.cc

    r30 r20  
    3636
    3737
    38 #include <iomanip>
    39 #include <map>
    40 #include <cassert>
    41 
    42 #include "sc_port.h"
    43 #include "sc_signal.h"
    44 #include "sc_module.h"
    45 #include "entity.h"
    46 #include "global_functions.h"
    47 
    48 #ifdef HAVE_CONFIG_H
    49 #include "config.h"
    50 #endif
     38#include<iomanip>
     39#include<map>
     40
     41#include"sc_port.h"
     42#include"sc_signal.h"
     43#include"sc_module.h"
     44#include"entity.h"
     45#include"global_functions.h"
     46#include"assert.h"
    5147
    5248extern "C" {
     
    5854using namespace std;
    5955
    60 #ifdef CONFIG_CHECK_FSM_RULES
    61 #include "fsm_rules.h"
     56#ifdef CHECK_FSM_RULES
     57#include"fsm_rules.h"
    6258namespace sc_core {
    6359casc_fsm_step_t casc_fsm_step = ELABORATION;
     
    112108sc_port_base::init ()
    113109{
    114 #ifdef CONFIG_DEBUG
     110#ifdef DEBUG
    115111        if (modules_stack.empty ()) {
    116112                cerr << "Internal error : modules stack empty\n";
     
    237233#endif
    238234#define iter (sc_core::pending_write_vector[i])
    239 #ifdef CONFIG_DEBUG
     235#ifdef DEBUG
    240236                if (iter.pointer == NULL) {
    241237                        cerr << "Internal error : trying to apply a posted write from an unassigned signal/port\n";
     
    259255  cerr << "done.\n";
    260256#endif
    261 #if defined(CONFIG_CHECK_MULTIWRITING2REGISTER)
     257#if defined(CHECK_MULTIWRITING2REGISTER)
    262258  sc_core::pending_writing2register_clear ();
    263259#endif
     
    314310{
    315311  const tab_t *pointer = port.get_pointer ();
    316   //assert(pointer != NULL);
     312  //ASSERT(pointer != NULL);
    317313  if (pointer == NULL)
    318314    return false; // case : sc_in not bound
     
    347343  {
    348344    /*const*/ sc_port_base *port = i->first;
    349     assert(port != NULL);
     345    ASSERT(port != NULL);
    350346    check_port (*port);
    351347  }
     
    354350}
    355351
    356 #if defined(CONFIG_CHECK_MULTIWRITING2REGISTER)
     352#if defined(CHECK_MULTIWRITING2REGISTER)
    357353typedef set<const tab_t*> pending_writing2register_set_t;
    358354pending_writing2register_set_t pending_writing2register_set;
  • /sources/src/sc_port.h

    r30 r20  
    1414#define __SC_PORT_H__
    1515
    16 #include "sc_port_ext.h"
    17 #include "sc_fwd.h"
    18 //#include "internal_ext.h"
     16#include"sc_port_ext.h"
     17#include"sc_fwd.h"
     18//#include"internal_ext.h"
    1919
    2020#include <list>
  • /sources/src/sc_port_ext.h

    r30 r20  
    1515
    1616// Define registers writing method
    17 #include <iostream>
    18 #include <cstdlib>
    19 #include "sc_fwd.h"
    20 #include "sc_nbdefs.h"
    21 //#include "sc_event_finder.h"
    22 #include "sc_event.h"
    23 #include "sc_object.h"
    24 #include "sc_interface.h"
    25 #include "internal_ext.h"
    26 #include "port_dependency_ext.h"
    27 #include "fsm_rules.h"
     17#include<iostream>
     18#include<cstdlib>
     19#include"sc_fwd.h"
     20#include"sc_nbdefs.h"
     21//#include"sc_event_finder.h"
     22#include"sc_event.h"
     23#include"sc_object.h"
     24#include"sc_interface.h"
     25#include"internal_ext.h"
     26#include"port_dependency_ext.h"
     27#include"fsm_rules.h"
    2828
    2929
     
    5454        ///////////////////// DEPRECATED
    5555// C ANSI-only since it is needed to link with extern "C"
    56 // this declaration is not in casc.h since the CONFIG_CHECK_FSM_RULES macro
     56// this declaration is not in casc.h since the CHECK_FSM_RULES macro
    5757// is not defined.
    5858
     
    184184                << " on signal " << name () << "\n";
    185185#endif
    186 #ifdef CONFIG_CHECK_FSM_RULES
     186#ifdef CHECK_FSM_RULES
    187187        if (casc_fsm_step == GEN_MOORE) {
    188188                std::cerr << "FSM rules error : trying to read on input port '"
     
    294294                << " on signal " << name () << "\n";
    295295#endif
    296 #ifdef CONFIG_CHECK_FSM_RULES
     296#ifdef CHECK_FSM_RULES
    297297        if (casc_fsm_step == GEN_MOORE) {
    298298                std::cerr << "FSM rules error : trying to read on input/output port "
     
    316316            << " on in/out port (writing into a signal) '" << name () << "'\n";
    317317#endif
    318 #ifdef CONFIG_CHECK_FSM_RULES
     318#ifdef CHECK_FSM_RULES
    319319        if ((casc_fsm_step != GEN_MOORE) && ( casc_fsm_step != GEN_MEALY)) {
    320320                std::cerr << "FSM rules error : trying to write on output port "
     
    325325#endif
    326326//      T& ref = *(T*)(get_pointer());
    327 #if defined(CONFIG_CHECK_MULTIWRITING2PORT)
     327#if defined(CHECK_MULTIWRITING2PORT)
    328328  check_multiwriting2port ();
    329329#endif
  • /sources/src/sc_sensitive.cc

    r30 r20  
    3535
    3636
    37 #include "sc_sensitive.h"
    38 #include "sc_port.h"
    39 #include "sc_event.h"
    40 #include "sc_event_finder.h"
    41 #include "sc_module.h"
    42 #include "internal.h"
    43 #ifdef HAVE_CONFIG_H
    44 #include "config.h"
    45 #endif
     37#include"sc_sensitive.h"
     38#include"sc_port.h"
     39#include"sc_event.h"
     40#include"sc_event_finder.h"
     41#include"sc_module.h"
     42#include"internal.h"
    4643
    4744using namespace std;
  • /sources/src/sc_sensitive.h

    r30 r20  
    1313#define __SC_SENSITIVE_H__
    1414
    15 #include <list>
    16 #include "sc_fwd.h"
    17 //#include "sc_event.h"
    18 //#include "sc_interface.h"
    19 //#include "internal_ext.h"
     15#include<list>
     16#include"sc_fwd.h"
     17//#include"sc_event.h"
     18//#include"sc_interface.h"
     19//#include"internal_ext.h"
    2020
    2121namespace sc_core {
  • /sources/src/sc_signal.h

    r30 r20  
    1515
    1616// Define registers writing method
    17 #include <iostream>
    18 #include <cstdlib>
    19 #include "sc_fwd.h"
    20 #include "sc_nbdefs.h"
    21 //#include "sc_event_finder.h"
    22 //#include "sc_event.h"
    23 #include "sc_time.h" // SC_ZERO_TIME
    24 #include "sc_object.h"
    25 #include "sc_interface.h"
    26 #include "internal_ext.h"
    27 
    28 #ifdef CONFIG_CHECK_FSM_RULES
     17#include<iostream>
     18#include<cstdlib>
     19#include"sc_fwd.h"
     20#include"sc_nbdefs.h"
     21//#include"sc_event_finder.h"
     22//#include"sc_event.h"
     23#include"sc_time.h" // SC_ZERO_TIME
     24#include"sc_object.h"
     25#include"sc_interface.h"
     26#include"internal_ext.h"
    2927#include "fsm_rules.h"
    30 #endif
    3128
    3229namespace sc_core {
     
    4542        ///////////////////// DEPRECATED
    4643// C ANSI-only since it is needed to link with extern "C"
    47 // this declaration is not in casc.h since the CONFIG_CHECK_FSM_RULES macro
     44// this declaration is not in casc.h since the CHECK_FSM_RULES macro
    4845// is not defined.
    4946
     
    8279        size_t size = (sizeof (T)-1) / sizeof (base_type);
    8380        size_t i = 0;
    84         const base_type *pvalue = (const base_type*)(void*)(&value_);
     81        const base_type *pvalue = (const base_type*)(&value_);
    8582        do {
    8683#if 0
     
    9491                        const T          value_)
    9592{
    96   if (sizeof (T) > sizeof (base_type)) {
     93        if (sizeof (T) > sizeof (base_type)) {
    9794#if 0
    98   std::cout << "sizeof (T) = " << sizeof (T)
    99             << " (base_type = " << sizeof (base_type) << "\n";
    100 #endif
    101   post_multiwrite (pointer_,value_);
    102   } else {
    103 #if defined(CONFIG_DEBUG)
    104     if (pending_write_vector_nb >= pending_write_vector_capacity) {
    105       //if (pending_write_vector_nb >= pending_write_vector_capacity * sizeof(pending_write)) {
    106       std::cerr << "Error : The array for posted writing on register is too small.\n";
    107       std::cerr << "Up to 1 writing per register is allowed during a cycle.\n";
    108       std::cerr << "Please check the hardware description.\n";
    109       exit (-1);
    110     }
    111 #endif // CONFIG_DEBUG
    112     pending_write_vector[pending_write_vector_nb].pointer = pointer_;
     95    cout << "sizeof (T) = " << sizeof (T) << " (base_type = " << sizeof
     96(base_type) << "\n";
     97#endif
     98                post_multiwrite (pointer_,value_);
     99        } else {
     100#if defined(DEBUG)
     101        if (pending_write_vector_nb >= pending_write_vector_capacity) {
     102        //if (pending_write_vector_nb >= pending_write_vector_capacity * sizeof(pending_write)) {
     103                std::cerr << "Error : The array for posted writing on register is too small.\n";
     104                std::cerr << "Up to 1 writing per register is allowed during a cycle.\n";
     105                std::cerr << "Please check the hardware description.\n";
     106                exit (-1);
     107        }
     108#endif // DEBUG
     109  pending_write_vector[pending_write_vector_nb].pointer = pointer_;
    113110//      pending_write_vector[pending_write_vector_nb++].value = *(reinterpret_cast<const base_type*const>(&value_)); => bug !
    114     pending_write_vector[pending_write_vector_nb++].value = value_; // => bug avec blues !
     111  pending_write_vector[pending_write_vector_nb++].value = value_; // => bug avec blues !
    115112
    116113        // -> fix to use user-defined struct in sc_signal/sc_in/sc_out/sc_inout
     
    124121                return;
    125122#endif
    126   };
     123        };
    127124}
    128125
    129126inline bool is_posted_write ()
    130127{
    131   return pending_write_vector_nb > 0;
     128                return pending_write_vector_nb > 0;
    132129}
    133130
     
    142139class sc_signal_base : public sc_object, public sc_interface
    143140{
    144   //////
    145   // Internal
     141        //////
     142        // Internal
    146143  friend class sc_clock;
    147144  friend class sc_port_base;
    148145  void init ();
    149   //////                                 
     146        //////                           
    150147 
    151148
     
    161158  sc_signal_base(const char* name_);
    162159  sc_signal_base(const char* name_, void*);
    163   ~sc_signal_base();
     160        ~sc_signal_base();
    164161};
    165162
     
    168165{
    169166private:
    170   T val;
    171   typedef T                data_type;
     167        T val;
     168  typedef T  data_type;
    172169  typedef sc_signal < T >  this_type;
    173 
    174   ///////////
    175   // Internal
    176 public: void init ();
    177   ///////////
    178 
    179   //  virtual void update ();
     170        ///////////
     171        // Internal
     172        public: void init ();
     173        ///////////
     174//  virtual void update ();
    180175  void check_writer ();
    181176public:
    182177  // constructors, destructor
    183178  sc_signal ()
    184   { init (); }
     179        { init (); }
    185180  explicit sc_signal (const char *name_): sc_signal_base(name_)
    186   { init (); }
     181        { init (); }
    187182  /*virtual */~ sc_signal ()
    188183  {}
     
    232227sc_signal<T>::init()
    233228{
    234         set_pointer ((tab_t*)(void*)&val);
     229  set_pointer ((tab_t*)&val);
    235230  set_kind    (kind_string);
    236   sc_interface::init (sizeof (data_type));
     231        sc_interface::init (sizeof (data_type));
    237232  val = 0; /* The simulator initializes the signal/register to 0.    */
    238233           /* However, hardware initialization still has to be done. */
     
    250245                << " on signal " << name () << "\n";
    251246#endif
    252 #ifdef CONFIG_CHECK_FSM_RULES
     247#ifdef CHECK_FSM_RULES
    253248        // we can read value from sc_signal type (used like a register) at any time
    254249#endif 
     
    262257sc_signal<T>::write( const data_type& value_ )
    263258{
    264 #ifdef CONFIG_CHECK_FSM_RULES
     259#ifdef CHECK_FSM_RULES
    265260        if ((casc_fsm_step != TRANSITION)
    266261                        && ( casc_fsm_step != STIMULI)) {
     
    271266        }               
    272267#endif
    273 #ifdef CONFIG_DEBUG
     268#ifdef DEBUG
    274269  if (get_pointer() == NULL)
    275270  {
     
    278273  }
    279274#endif
    280 #ifdef CONFIG_CHECK_MULTIWRITING2REGISTER
     275#ifdef CHECK_MULTIWRITING2REGISTER
    281276  pending_writing2register_record_and_check (get_pointer ());
    282277#endif
  • /sources/src/sc_time.cc

    r30 r20  
    3535
    3636
    37 #include "sc_time.h"
     37#include"sc_time.h"
    3838#include <ctime>
    3939#include <sys/time.h>
    4040#include <string>
    4141#include <sstream>
    42 #ifdef HAVE_CONFIG_H
    43 #include "config.h"
    44 #endif
    4542
    4643namespace sc_core {
  • /sources/src/sc_trace.cc

    r30 r20  
    4141#include "bit2string.h"
    4242#include "hex2string.h"
    43 
    44 #include <cassert>
     43#include "assert.h"
     44
    4545#include <list>
    4646#include <cstdio>
     
    4848#include <cstring> //strlen
    4949
    50 #ifdef HAVE_CONFIG_H
    51 #include "config.h"
    52 #endif
    53 
    5450//-----------------------------------------
    5551
     
    5753
    5854//-----------------------------------------
    59 #ifdef CONFIG_PAT_TRACE_FORMAT
     55#ifdef PAT_TRACE_FORMAT
    6056
    6157extern "C" {
     
    6763#include <cstdio>
    6864
    69 #endif // CONFIG_PAT_TRACE_FORMAT
     65#endif // PAT_TRACE_FORMAT
    7066//-----------------------------------------
    7167
     
    169165    {
    170166      sc_trace_file *tf = *ptf;
    171       assert(tf != NULL);
     167      ASSERT(tf != NULL);
    172168                trace (*tf, part);
    173169    }
     
    177173}
    178174
    179 #ifdef CONFIG_PAT_TRACE_FORMAT
     175#if PAT_TRACE_FORMAT
    180176static void
    181177pat_set_value (char *buf, const signal2trace &s)
     
    287283{
    288284}
    289 #endif // CONFIG_PAT_TRACE_FORMAT
     285#endif // PAT_TRACE_FORMAT
    290286
    291287static
     
    418414  else
    419415    vcd_signal_table = (tab_t*) malloc (sizeof (tab_t) * size);
    420 #ifdef CONFIG_DEBUG
     416#if DEBUG
    421417  if (vcd_signal_table == NULL)
    422418  {
     
    490486      vcd_trace_init (tf);
    491487  } else {
    492 #if defined(CONFIG_DEBUG)
     488#if defined(DEBUG)
    493489      if (vcd_signal_table == NULL)
    494490      {
     
    584580&name)
    585581{
    586 #ifdef CONFIG_PAT_TRACE_FORMAT
     582#ifdef PAT_TRACE_FORMAT
    587583        //exemple:
    588584        //DECLAR ("a", ":2", "X", IN, "3  downto 0", "" );
     
    634630#endif
    635631        DECLAR ((char*)(name.c_str ()), ":1", format, dir,(char *) downto.c_str(), "" );
    636 #endif // CONFIG_PAT_TRACE_FORMAT
     632#endif // PAT_TRACE_FORMAT
    637633}
    638634
  • /sources/src/sc_uint.h

    r30 r20  
    2525// ----------------------------------------------------------------------------
    2626
    27 #include "sc_nbdefs.h"
     27#include"sc_nbdefs.h"
    2828
    2929namespace sc_dt {
     
    183183
    184184  // arithmetic
    185 #define DEFINE_OPERATOR(OPER)        \
    186   template <typename T>              \
    187   inline sc_uint& operator OPER (T v)\
    188   { vf.valW OPER v; return *this; }
    189 
    190   DEFINE_OPERATOR(<<=)
    191   DEFINE_OPERATOR(>>=)
    192   DEFINE_OPERATOR(+=)
    193   DEFINE_OPERATOR(-=)
    194   DEFINE_OPERATOR(*=)
    195   DEFINE_OPERATOR(/=)
    196   DEFINE_OPERATOR(%=)
    197   DEFINE_OPERATOR(&=)
    198   DEFINE_OPERATOR(|=)
    199   DEFINE_OPERATOR(^=)
    200 #undef DEFINE_OPERATOR
    201 
    202 #if 0
    203 #define DEFINE_OPERATOR(OPER)                                              \
    204   friend bool operator OPER (const data_type& a, const data_type& b);
    205 //  { return (a.valW) OPER (b.valW); }
    206 
    207   DEFINE_OPERATOR(==)
    208   DEFINE_OPERATOR(!=)
    209   DEFINE_OPERATOR(>=)
    210   DEFINE_OPERATOR(<=)
    211 #undef DEFINE_OPERATOR
    212 #endif
     185  template <typename T>
     186  inline sc_uint& operator <<= (T v)
     187  { vf.valW <<= v; return *this; }
     188  template <typename T>
     189  inline sc_uint& operator >>= (T v)
     190  { vf.valW >>= v; return *this; }
     191  template <typename T>
     192  inline sc_uint& operator += (T v)
     193  { vf.valW += v; return *this; }
     194  template <typename T>
     195  inline sc_uint& operator -= (T v)
     196  { vf.valW -= v; return *this; }
     197  template <typename T>
     198  inline sc_uint& operator *= (T v)
     199  { vf.valW *= v; return *this; }
     200  template <typename T>
     201  inline sc_uint& operator /= (T v)
     202  { vf.valW /= v; return *this; }
     203  template <typename T>
     204  inline sc_uint& operator %= (T v)
     205  { vf.valW %= v; return *this; }
     206  template <typename T>
     207  inline sc_uint& operator &= (T v)
     208  { vf.valW &= v; return *this; }
     209  template <typename T>
     210  inline sc_uint& operator |= (T v)
     211  { vf.valW |= v; return *this; }
     212  template <typename T>
     213  inline sc_uint& operator ^= (T v)
     214  { vf.valW ^= v; return *this; }
    213215  inline sc_uint_bit_ref operator [] (int v)
    214216  { return (vf.valW >> v) & 1; }
  • /sources/src/sc_uint_subref_r.cc

    r30 r20  
    3636#include <iostream>
    3737#include "sc_uint.h"
    38 #ifdef HAVE_CONFIG_H
    39 #include "config.h"
    40 #endif
    4138
    4239using namespace std;
  • /sources/src/sc_unsigned.h

    r30 r20  
    1818// ----------------------------------------------------------------------------
    1919
    20 #include "sc_nbdefs.h"
    21 #include "sc_logic.h"
     20#include"sc_nbdefs.h"
     21#include"sc_logic.h"
    2222
    2323
  • /sources/src/sc_vcd_trace.cc

    r30 r20  
    3636
    3737
    38 #include "sc_trace.h"
    39 #include "sc_vcd_trace.h"
    40 #include "sc_ver.h"
    41 #include "internal.h"
     38#include"sc_trace.h"
     39#include"sc_vcd_trace.h"
     40#include"sc_ver.h"
     41#include"internal.h"
     42#include"assert.h"
    4243
    43 #include <cassert>
    44 #include <ctime>
    45 #include <string>
    46 
    47 #ifdef HAVE_CONFIG_H
    48 #include "config.h"
    49 #endif
     44#include<ctime>
     45#include<string>
    5046
    5147//-----------------------------------------*/
     
    6258  if (notrace)
    6359    return NULL;
    64   assert(name != NULL);
     60  ASSERT(name != NULL);
    6561        string filename;
    6662        filename = name;
  • /sources/src/sc_ver.cc

    r30 r20  
    4040#include <cstdlib> //exit
    4141
    42 #ifdef HAVE_CONFIG_H
    43 #include "config.h"
    44 #endif
    45 
    4642namespace sc_core {
    4743
     
    6561        "\n"
    6662        "         Cycle Accurate System Simulator\n"
    67 #ifdef CONFIG_DEBUG
     63#ifdef DEBUG
    6864  "            DEBUG version\n"
    6965#endif
  • /sources/src/schedulers.cc

    r30 r20  
    3535 */
    3636
    37 #include "sc_module.h" // method_process_t
    38 #include "gen_code.h"  // gen_scheduling_code_for_dynamic_link & gen_scheduling_code_for_static_func
    39 #include "internal.h"  // dump_all_graph
    40 #include "graph_cass.h" // makegraph
    41 #include "process_dependency.h" // MakeProcessDependencyList
    42 #include "signal_dependency.h" // MakeSignalDependencyGraph
    43 #include "mouchard_scheduling.h" // MakeMouchardScheduling
    44 #include "graph_signals.h" // makegraph
    45 //#include "module_hierarchy2dot.h"
    46 
    47 #include <cassert>
    48 #include <iostream>
    49 #include <algorithm> //std::sort
    50 
    51 #ifdef HAVE_CONFIG_H
    52 #include "config.h"
    53 #endif
     37#include<iostream>
     38#include<algorithm> //std::sort
     39#include"sc_module.h" // method_process_t
     40#include"gen_code.h"  // gen_scheduling_code_for_dynamic_link & gen_scheduling_code_for_static_func
     41#include"internal.h"  // dump_all_graph
     42#include"graph_cass.h" // makegraph
     43#include"process_dependency.h" // MakeProcessDependencyList
     44#include"signal_dependency.h" // MakeSignalDependencyGraph
     45#include"mouchard_scheduling.h" // MakeMouchardScheduling
     46#include"graph_signals.h" // makegraph
     47//#include"module_hierarchy2dot.h"
     48#include"assert.h"
    5449
    5550using namespace std;
     
    10095                         const method_process_t *a2)
    10196{
    102   assert(a1 != NULL);
    103   assert(a2 != NULL);
     97  ASSERT(a1 != NULL);
     98  ASSERT(a2 != NULL);
    10499  sc_module *m1 = a1->module;
    105100  sc_module *m2 = a2->module;
     
    119114    addr1.func = a1->func;
    120115    addr2.func = a2->func;
    121     assert(addr1.addr_ll != addr2.addr_ll);
     116    ASSERT(addr1.addr_ll != addr2.addr_ll);
    122117    if ( sizeof(SC_ENTRY_FUNC) == 4 ) {
    123118        return (addr1.addr_l < addr2.addr_l);
     
    135130                    const method_process_t *a2)
    136131{
    137   assert(a1 != NULL);
    138   assert(a2 != NULL);
     132  ASSERT(a1 != NULL);
     133  ASSERT(a2 != NULL);
    139134  return (a1->module < a2->module);
    140135}
     
    145140                 const method_process_t *a2)
    146141{
    147     assert(a1 != NULL);
    148     assert(a2 != NULL);
     142    ASSERT(a1 != NULL);
     143    ASSERT(a2 != NULL);
    149144    union {
    150145        SC_ENTRY_FUNC func;
     
    242237{
    243238  SignalDependencyGraph *sig_graph = MakeAcyclicSignalDependencyGraph ();
    244   assert(sig_graph != NULL);
     239  ASSERT(sig_graph != NULL);
    245240  // Create the process evaluation list
    246241  ProcessDependencyList* process_list = MakeMouchardScheduling (*sig_graph);
    247   assert(process_list != NULL);
     242  ASSERT(process_list != NULL);
    248243
    249244  if (dump_all_graph)
     
    289284    // Uses port dependancies like Dr. Mouchard.
    290285    ProcessDependencyList* process_list = BuchmannScheduling ();
    291         if (dynamic_link_of_scheduling_code)
    292                 base_name = gen_scheduling_code_for_dynamic_link (transition_func_list, moore_func_list,*process_list);
    293         else
    294                 gen_scheduling_code_for_static_func (transition_func_list, moore_func_list, *process_list);
     286    base_name = gen_scheduling_code_for_dynamic_link (transition_func_list, moore_func_list,*process_list);
     287    gen_scheduling_code_for_static_func (transition_func_list, moore_func_list, *process_list);
    295288    break;
    296289  }
     
    302295    // and does not use an event-driven scheduler.
    303296    ProcessDependencyList* process_list = MouchardScheduling ();
    304         if (dynamic_link_of_scheduling_code)
    305                 base_name = gen_scheduling_code_for_dynamic_link(transition_func_list, moore_func_list,*process_list);
    306         else
    307                 gen_scheduling_code_for_static_func (transition_func_list, moore_func_list, *process_list);
     297    base_name = gen_scheduling_code_for_dynamic_link(transition_func_list, moore_func_list,*process_list);
     298    gen_scheduling_code_for_static_func (transition_func_list, moore_func_list, *process_list);
    308299    break;
    309300  }
     
    316307      graph2dot("module_graph", *g);
    317308    strong_component_list_t *strong_list = strong_component (g);
    318         if (dynamic_link_of_scheduling_code)
    319                 base_name = gen_scheduling_code_for_dynamic_link(transition_func_list, moore_func_list,*strong_list);
    320         else
    321                 gen_scheduling_code_for_quasistatic_func (transition_func_list, moore_func_list, *strong_list);
     309    base_name = gen_scheduling_code_for_dynamic_link(transition_func_list, moore_func_list,*strong_list);
     310    gen_scheduling_code_for_quasistatic_func (transition_func_list, moore_func_list, *strong_list);
    322311    break;
    323312  }
  • /sources/src/schedulers.h

    r30 r20  
    1313#define __SCHEDULERS_H__
    1414
    15 #include "sc_fwd.h"
    16 #include "sc_time.h"
     15#include"sc_fwd.h"
     16#include"sc_time.h"
    1717
    1818namespace sc_core {
  • /sources/src/serialization.cc

    r30 r20  
    3535
    3636
    37 #include "internal_ext.h" // tab_t
    38 #include "serialization.h"
    39 #include "entity.h"
    40 #include "sc_module.h"
    41 #include "sc_object.h"
    42 #include "hex2string.h"
     37#include<map>
     38#include<fstream>
     39//#include<vector> // save_module_hierarchy
    4340
    44 #include <cassert>
    45 #include <map>
    46 #include <fstream>
    47 //#include <vector> // save_module_hierarchy
    48 
    49 #ifdef HAVE_CONFIG_H
    50 #include "config.h"
    51 #endif
     41#include"internal_ext.h" // tab_t
     42#include"serialization.h"
     43#include"entity.h"
     44#include"sc_module.h"
     45#include"sc_object.h"
     46#include"hex2string.h"
     47#include"assert.h"
    5248
    5349using namespace std;
     
    8884            int          bit_number)
    8985{
    90   assert(bit_number <= 64);
     86  ASSERT(bit_number <= 64);
    9187  if (bit_number == 1) {
    9288    bool v = *((const bool*) val);
     
    144140                    save_fct_t1      fct)
    145141{
    146   //assert(fct != NULL);
     142  //ASSERT(fct != NULL);
    147143  //sc_module2save_fct_t1::value_type pair(&mod,fct);
    148144  //save_handler_table.insert (pair);
     
    162158    const sc_module *mod = it->first;
    163159    save_fct_t1      fct = it->second;
    164     assert(mod != NULL);
    165 //    assert(fct != NULL);
     160    ASSERT(mod != NULL);
     161//    ASSERT(fct != NULL);
    166162    //o << mod->name () << endl;
    167163    fprintf (o,"module\n%s\n",mod->name ());
     
    189185  file.close ();
    190186  FILE *f = fopen (filename, "a+");
    191   assert(f != NULL);
     187  ASSERT(f != NULL);
    192188  save_modules (f);
    193189  fclose (f);
  • /sources/src/serialization.h

    r30 r20  
    1313#define __SERIALIZATION_H__
    1414
    15 #include "serialization_ext.h"
    16 #include "sc_fwd.h"
     15#include"serialization_ext.h"
     16#include"sc_fwd.h"
    1717
    1818namespace sc_core {
  • /sources/src/serialization_ext.h

    r30 r20  
    3737#define __SERIALIZATION_EXT_H__
    3838
    39 #include <iostream>
    40 #include "sc_fwd.h"
     39#include<iostream>
     40#include"sc_fwd.h"
    4141
    4242namespace sc_core {
  • /sources/src/signal_dependency.cc

    r30 r20  
    4343#include "sc_module.h"
    4444#include "sc_ver_ext.h"
    45 #ifdef HAVE_CONFIG_H
    46 #include "config.h"
    47 #endif
    4845
    4946using namespace std;
  • /sources/src/simplify_string.cc

    r30 r20  
    3535
    3636#include "simplify_string.h"
    37 #ifdef HAVE_CONFIG_H
    38 #include "config.h"
    39 #endif
    4037
    4138using namespace std;
  • /sources/src/systemc

    r30 r20  
    2929#include"sc_vcd_trace.h"
    3030#include"sc_pat_trace.h"
     31#include"endianness.h"
    3132
    3233#endif
  • /sources/test_regression/02052006/system.cpp

    r30 r20  
    1313
    1414struct test : sc_module {
    15   int32_t                         reg;
     15  int                             reg;
    1616  sc_signal<bool>                 reg_bool;
    1717  sc_signal<int>                  reg_int;
     
    3838      ASSERT(((unsigned int)reg)    == reg_unsigned_int   .read());
    3939      ASSERT(((char)  reg)        == reg_char  .read());
    40 #if 0
    41       cout << (double)reg << " " << reg_double.read() << endl;
    42       cout << sizeof (double) << " " << sizeof (reg_double.read()) << endl;
    43 #endif
    4440      ASSERT(((double)reg)          == reg_double.read());
    4541      ASSERT(((long)  reg)          == reg_long  .read());
     
    5248      ASSERT(((signed int) reg & 0xFFFFFFFF) == (signed int) (reg_i32 .read()));
    5349      ASSERT(((signed int) reg & 0x0000FFFF) == (signed int) (reg_i16 .read()));
    54       ASSERT(((signed int) reg & 0x0000003F) == (signed int) (reg_i6  .read()));
     50      ASSERT(((signed int) reg & 0x0000003F)  == (signed int) (reg_i6  .read()));
    5551      reg        = reg + 1;
    5652      reg_bool   = reg & 1;
     
    5854      reg_unsigned_int = reg;
    5955      reg_char   = reg;
    60       reg_double .write(reg);
     56      reg_double = reg;
    6157      reg_long   = reg;
    6258      reg_ui32   = reg;
     
    8480
    8581  SC_HAS_PROCESS(test);
    86     test (sc_module_name n) : sc_module (n),
     82        test (sc_module_name n) : sc_module (n),
    8783    clk("clk")
    8884  {
    89     SC_METHOD(trans);
    90     sensitive << clk.pos();
     85                SC_METHOD(trans);
     86                sensitive << clk.pos();
    9187    dont_initialize();
    92   };
     88        };
    9389};
    9490
    9591int sc_main (int argc, char *argv[])
    9692{
    97   sc_clock        signal_clk("my_clock",1, 0.5);
     93        sc_clock        signal_clk("my_clock",1, 0.5);
    9894  sc_signal<bool> resetn("resetn");
    9995
     
    10298  test1.resetn (resetn);
    10399
    104   // Init & run
    105   sc_start (0);
     100        // Init & run
     101        sc_start (0);
    106102
    107103  resetn = false;
    108   sc_start (4);
     104        sc_start (4);
    109105  resetn = true;
    110106  sc_start (100);
    111107
    112   return EXIT_SUCCESS;
     108        return EXIT_SUCCESS;
    113109}
    114110
  • /sources/test_regression/15042009/Makefile

    r30 r20  
    11include ../env.mk
    22
    3 SYSTEM    = system.cpp system2.cpp system3.cpp
     3SYSTEM    = system.cpp
    44EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
    55EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
     
    1919  done
    2020        echo Testing system_systemcass.x ; system_systemcass.x || eval ${failcom} ; \
    21         echo Testing system2_systemcass.x ; system2_systemcass.x || eval ${failcom} ; \
    22         echo Testing system3_systemcass.x ; system3_systemcass.x || eval ${failcom} ; \
    2321        #
    2422
  • /sources/test_regression/19042005/system.cpp

    r30 r20  
    128128        sc_trace(system_trace_file, signal_clk, "clk");
    129129
    130   bool     b1 = 0;
    131   uint64_t l1 = 0;
     130  bool   b1 = 0;
     131  long  l1 = 0;
    132132
    133133#if 0
  • /sources/test_regression/19042005/system_systemcass.x-60_reference.vcd

    r30 r20  
    77$var wire    1  aaa  clk       $end
    88$var wire    1  aab  b1       $end
    9 $var wire   64  aac  l1 [63:0]       $end
     9$var wire   32  aac  l1 [31:0]       $end
    1010$var wire    1  aad  test1.i1       $end
    1111$var wire    8  aae  test1.i2 [7:0]       $end
  • /sources/test_regression/28102005/system.cpp

    r30 r20  
    2727check_time (int i)
    2828{
    29   const sc_time &t = sc_time_stamp ();
     29        const sc_time &t = sc_time_stamp ();
    3030  CERR(i);
    3131  CERR(t.to_double());
    32 #ifdef SYSTEMCASS_SPECIFIC
    33   ASSERT((int) (t.to_double ()) == i);
    34 #else
    3532  ASSERT((int) (t.to_double ()) == i * 1000);
    36 #endif
    3733  CERR(t.to_seconds ());
    3834        double seconds = t.to_seconds()*1000000000;
     
    4137  char s[256];
    4238  const char *unit;
    43 #ifdef SYSTEMCASS_SPECIFIC
    44   unit = "NS";
    45 #else
    4639  if (i == 0)
    4740    unit = "s";
     
    5043  else
    5144    unit = "ns";
    52 #endif
    5345  sprintf (s, "%d %s", i,unit);
    5446  CERR(s);
     
    6355
    6456  check_time (0);
    65   sc_start (0);
     57        sc_start (0);
    6658
    6759  check_time (0);
    68   sc_start (1);
     60        sc_start (1);
    6961  check_time (1);
    7062
    71   sc_start (15);
     63        sc_start (15);
    7264  check_time (16);
    7365
    74   sc_start (7);
     66        sc_start (7);
    7567  check_time (23);
    7668
    77   sc_start (100);
     69        sc_start (100);
    7870  check_time (123);
    7971
    80   sc_start (1000);
     72        sc_start (1000);
    8173  check_time (1123);
    8274  cerr << "Test OK.\n";
  • /sources/test_regression/env.mk

    r30 r20  
    2222SYSTEMCASS_INC  = $(SYSTEMCASS)/include
    2323SYSTEMC_LIB     = $(SYSTEMC)/lib-${TARGET_PLATFORM}-${TARGET_ARCH}/libsystemc.a
    24 SYSTEMCASS_LIB  = $(SYSTEMCASS)/lib-linux/libsystemc.a
     24SYSTEMCASS_LIB  = $(SYSTEMCASS)/lib/libsystemc_$(firstword $(CXX))-d.a
    2525#CXX                    = g++
    2626#CXX                    = icc -w1
Note: See TracChangeset for help on using the changeset viewer.