Changes in / [20:30]


Ignore:
Files:
15 added
14 deleted
79 edited

Legend:

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

    r20 r30  
    1818#include <sc_logic.h>
    1919#include <sc_bv.h>
     20#include <cstdlib>
    2021
    2122// ----------------------------------------------------------------------------
     
    135136  sc_int()                 { val = 0; }
    136137//  sc_int(data_type val_)  { val = 0; write (val_); }
    137   sc_int (const char *a)   { val = 0; write (atoi (a)); }
     138  sc_int (const char *a)   { val = 0; write (std::atoi (a)); }
    138139  sc_int (unsigned short a){ val = 0; write (a); }
    139140  sc_int (short a)         { val = 0; write (a); }
     
    197198
    198199  // arithmetic
    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; }
     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
    229217  inline sc_int_bit_ref& operator [] (int v)
    230218  { return (vf.valW >> v) & 1; }
  • /branches/with_autoconf/src/sc_signal.h

    r20 r30  
    8282        size_t size = (sizeof (T)-1) / sizeof (base_type);
    8383        size_t i = 0;
    84         const base_type *pvalue = (const base_type*)(&value_);
     84        const base_type *pvalue = (const base_type*)(void*)(&value_);
    8585        do {
    8686#if 0
     
    9696        if (sizeof (T) > sizeof (base_type)) {
    9797#if 0
    98     cout << "sizeof (T) = " << sizeof (T) << " (base_type = " << sizeof
    99 (base_type) << "\n";
     98  std::cout << "sizeof (T) = " << sizeof (T)
     99            << " (base_type = " << sizeof (base_type) << "\n";
    100100#endif
    101101                post_multiwrite (pointer_,value_);
     
    171171  typedef T  data_type;
    172172  typedef sc_signal < T >  this_type;
     173
    173174        ///////////
    174175        // Internal
    175176        public: void init ();
    176177        ///////////
     178
    177179//  virtual void update ();
    178180  void check_writer ();
     
    230232sc_signal<T>::init()
    231233{
    232   set_pointer ((tab_t*)&val);
     234        set_pointer ((tab_t*)(void*)&val);
    233235  set_kind    (kind_string);
    234236        sc_interface::init (sizeof (data_type));
  • /branches/with_autoconf/src/sc_uint.h

    r20 r30  
    183183
    184184  // arithmetic
    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; }
     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
    215213  inline sc_uint_bit_ref operator [] (int v)
    216214  { return (vf.valW >> v) & 1; }
  • /sources/INSTALL

    r20 r30  
    1 SystemCASS Installation
    2 =======================
    3 
    4 To install SystemCASS on linux, do the following steps:
    5 
    6   1. Set the following environment variable(s):
    7 
    8      TARGET_ARCH : architecture name.
    9 
    10      SYSTEMCASS  : SystemCASS top directory.
    11 
    12      ALLIANCE (optional) : ALLIANCE top directory
    13                            See also 'PAT trace output' section.
    14 
    15      For example :
    16 
    17        setenv TARGET_ARCH linux
    18        setenv SYSTEMCASS /users/tools/systemcass/
    19 
    20   2. Change to the top level directory (systemcass)
    21 
    22   3. Type the following command:
    23 
    24        (cd src ; make)
    25 
    26 
    27 PAT trace ouput
    28 ===============
    29 
    30 PAT trace output is disable by default.
    31 Set the environment variable 'ALLIANCE' to ALLIANCE top directory,
    32 then make again.
    33 
     1Installation Instructions
     2*************************
     3
     4Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
     5Software Foundation, Inc.
     6
     7This file is free documentation; the Free Software Foundation gives
     8unlimited permission to copy, distribute and modify it.
     9
     10Basic Installation
     11==================
     12
     13These are generic installation instructions.
     14
     15   The `configure' shell script attempts to guess correct values for
     16various system-dependent variables used during compilation.  It uses
     17those values to create a `Makefile' in each directory of the package.
     18It may also create one or more `.h' files containing system-dependent
     19definitions.  Finally, it creates a shell script `config.status' that
     20you can run in the future to recreate the current configuration, and a
     21file `config.log' containing compiler output (useful mainly for
     22debugging `configure').
     23
     24   It can also use an optional file (typically called `config.cache'
     25and enabled with `--cache-file=config.cache' or simply `-C') that saves
     26the results of its tests to speed up reconfiguring.  (Caching is
     27disabled by default to prevent problems with accidental use of stale
     28cache files.)
     29
     30   If you need to do unusual things to compile the package, please try
     31to figure out how `configure' could check whether to do them, and mail
     32diffs or instructions to the address given in the `README' so they can
     33be considered for the next release.  If you are using the cache, and at
     34some point `config.cache' contains results you don't want to keep, you
     35may remove or edit it.
     36
     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
     40a newer version of `autoconf'.
     41
     42The simplest way to compile this package is:
     43
     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.
     49
     50     Running `configure' takes awhile.  While running, it prints some
     51     messages telling which features it is checking for.
     52
     53  2. Type `make' to compile the package.
     54
     55  3. Optionally, type `make check' to run any self-tests that come with
     56     the package.
     57
     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
     70Compilers and Options
     71=====================
     72
     73Some systems require unusual options for compilation or linking that the
     74`configure' script does not know about.  Run `./configure --help' for
     75details on some of the pertinent environment variables.
     76
     77   You can give `configure' initial values for configuration parameters
     78by setting variables in the command line or in the environment.  Here
     79is an example:
     80
     81     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
     82
     83   *Note Defining Variables::, for more details.
     84
     85Compiling For Multiple Architectures
     86====================================
     87
     88You can compile the package for more than one kind of computer at the
     89same time, by placing the object files for each architecture in their
     90own directory.  To do this, you must use a version of `make' that
     91supports the `VPATH' variable, such as GNU `make'.  `cd' to the
     92directory where you want the object files and executables to go and run
     93the `configure' script.  `configure' automatically checks for the
     94source 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'
     97variable, you have to compile the package for one architecture at a
     98time in the source code directory.  After you have installed the
     99package for one architecture, use `make distclean' before reconfiguring
     100for another architecture.
     101
     102Installation Names
     103==================
     104
     105By default, `make install' installs the package's commands under
     106`/usr/local/bin', include files under `/usr/local/include', etc.  You
     107can 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
     111architecture-specific files and architecture-independent files.  If you
     112pass the option `--exec-prefix=PREFIX' to `configure', the package uses
     113PREFIX as the prefix for installing programs and libraries.
     114Documentation and other data files still use the regular prefix.
     115
     116   In addition, if you use an unusual directory layout you can give
     117options like `--bindir=DIR' to specify different values for particular
     118kinds of files.  Run `configure --help' for a list of the directories
     119you can set and what kinds of files go in them.
     120
     121   If the package supports it, you can cause programs to be installed
     122with an extra prefix or suffix on their names by giving `configure' the
     123option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
     124
     125Optional Features
     126=================
     127
     128Some packages pay attention to `--enable-FEATURE' options to
     129`configure', where FEATURE indicates an optional part of the package.
     130They may also pay attention to `--with-PACKAGE' options, where PACKAGE
     131is something like `gnu-as' or `x' (for the X Window System).  The
     132`README' should mention any `--enable-' and `--with-' options that the
     133package recognizes.
     134
     135   For packages that use the X Window System, `configure' can usually
     136find the X include and library files automatically, but if it doesn't,
     137you can use the `configure' options `--x-includes=DIR' and
     138`--x-libraries=DIR' to specify their locations.
     139
     140Specifying the System Type
     141==========================
     142
     143There may be some features `configure' cannot figure out automatically,
     144but needs to determine by the type of machine the package will run on.
     145Usually, assuming the package is built to be run on the _same_
     146architectures, `configure' can figure that out, but if it prints a
     147message saying it cannot guess the machine type, give it the
     148`--build=TYPE' option.  TYPE can either be a short name for the system
     149type, such as `sun4', or a canonical name which has the form:
     150
     151     CPU-COMPANY-SYSTEM
     152
     153where 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
     159need to know the machine type.
     160
     161   If you are _building_ compiler tools for cross-compiling, you should
     162use the option `--target=TYPE' to select the type of system they will
     163produce code for.
     164
     165   If you want to _use_ a cross compiler, that generates code for a
     166platform different from the build platform, you should specify the
     167"host" platform (i.e., that on which the generated programs will
     168eventually be run) with `--host=TYPE'.
     169
     170Sharing Defaults
     171================
     172
     173If you want to set default values for `configure' scripts to share, you
     174can create a site shell script called `config.site' that gives default
     175values 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.
     179A warning: not all `configure' scripts look for a site script.
     180
     181Defining Variables
     182==================
     183
     184Variables not defined in a site shell script can be set in the
     185environment passed to `configure'.  However, some packages may run
     186configure again during the build, and the customized values of these
     187variables may be lost.  In order to avoid this problem, you should set
     188them in the `configure' command line, using `VAR=value'.  For example:
     189
     190     ./configure CC=/usr/local2/bin/gcc
     191
     192causes the specified `gcc' to be used as the C compiler (unless it is
     193overridden in the site shell script).  Here is a another example:
     194
     195     /bin/bash ./configure CONFIG_SHELL=/bin/bash
     196
     197Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
     198configuration-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

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

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

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

    r20 r30  
    1313#define __DATA_FIELD_H__
    1414
    15 #include <endianness.h>
    16 
    1715template<int      WIDTH,
    1816         int      PADDING,
    1917         typename data_type>
    20 struct val_field { /* try to work with little endianess */
    21 #if defined(little_endian)
    22   /* little endian */
    23 //  data_type pad:PADDING;
     18struct val_field {
    2419  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
    3220};
    3321
  • /sources/src/dump_dot.cc

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

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

    r20 r30  
    3535
    3636#include "dump_used_options.h"
     37#ifdef HAVE_CONFIG_H
     38#include "config.h"
     39#endif
    3740
    3841namespace sc_core {
     
    6568  "DUMP_STAGE, "
    6669#endif
    67 #ifdef CHECK_FSM_RULES     
    68   "CHECK_FSM_RULES, "
     70#ifdef CONFIG_CHECK_FSM_RULES     
     71  "CONFIG_CHECK_FSM_RULES, "
    6972#endif
    7073#ifdef COMPIL_DEBUG 
    7174  "COMPIL_DEBUG,"       
    7275#endif
    73 #ifdef DEBUG
    74   "DEBUG, "         
     76#ifdef CONFIG_DEBUG
     77  "CONFIG_DEBUG, "         
    7578#endif
    7679#ifdef UINT64             
  • /sources/src/entity.cc

    r20 r30  
    3535 */
    3636
    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"
     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
    4851
    4952using namespace std;
     
    175178    typedef std::map<const tab_t *,equi_list_t::iterator,predic4tab_t2equi_t_t> tab_t2equi_it_t;
    176179    static tab_t2equi_it_t tab2equi_map;
    177     ASSERT(pointer != NULL);
     180    assert(pointer != NULL);
    178181
    179182    // boost
     
    240243        {
    241244                equi_t::const_iterator top_iter = e.begin ();
    242 #ifdef DEBUG
     245#ifdef CONFIG_DEBUG
    243246                if (top_iter == e.end ()) {
    244247                        cerr << "Internal error : no signal in " << e << endl;
     
    357360        }
    358361       
    359 #if defined(DUMP_SIGNALS_STATS)
     362#if defined(DUMP_SIGNAL_STATS)
    360363        static unsigned int equi_real_size;
    361364#endif
     
    389392    unsigned int table_size = get_sizeof_signals_table ();
    390393                equi_table = new tab_t[table_size]; //(0xCD);
    391 #if defined(DUMP_SIGNALS_STATS)
     394#if defined(DUMP_SIGNAL_STATS)
    392395                equi_real_size = table_size;
    393396#endif
     
    403406  bind_equi_to_table (equi_t &e, tab_t * const pointer)
    404407  {
    405     ASSERT(pointer != NULL);
     408    assert(pointer != NULL);
    406409    equi_t::iterator i;
    407410    for (i = e.begin (); i != e.end (); ++i) {
     
    455458    o << ")";
    456459#else
    457    ASSERT(e.object != NULL);
     460   assert(e.object != NULL);
    458461   o << e.object->name ();
    459462#endif
     
    494497  print_table_stats (ostream &o)
    495498  {
    496 #if defined(DUMP_SIGNALS_STATS)
     499#if defined(DUMP_SIGNAL_STATS)
    497500                int nb_reg = 0;
    498501                int nb_sig = 0;
     
    537540        }
    538541        const entity &ent = *(eq.begin ());
    539 #ifdef DEBUG
     542#ifdef CONFIG_DEBUG
    540543        if (ent.type != sc_core::entity::SIGNAL)
    541544                exit(28);
     
    544547        const char *sig_name = ent.object->name ();
    545548        const char *sep  = strchr (sig_name,'.');
    546 #ifdef DEBUG
     549#ifdef CONFIG_DEBUG
    547550        if (sep == NULL) {
    548551                exit (30);
     
    595598#endif
    596599
    597 #if defined(DUMP_SIGNALS_STATS)
     600#if defined(DUMP_SIGNAL_STATS)
    598601static unsigned int equi_real_size;
    599602#endif
     
    603606{
    604607#if 0
    605 //defined(DEBUG)
     608//defined(CONFIG_DEBUG)
    606609  equi_list_t::iterator x_equi = get_equi (x);
    607610  if ((x_equi != equi_list.end())) {
     
    640643tbind (sc_port_base &x,T &y)
    641644{
    642 //  ASSERT(x.get_pointer () != NULL); // x pointer may be NULL
    643 //  ASSERT(y.get_pointer () != NULL); // y pointer may be NULL
     645//  assert(x.get_pointer () != NULL); // x pointer may be NULL
     646//  assert(y.get_pointer () != NULL); // y pointer may be NULL
    644647  equi_list_t::iterator x_equi = get_equi (x);
    645648  equi_list_t::iterator y_equi = get_equi (y);
  • /sources/src/entity.h

    r20 r30  
    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

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

    r20 r30  
    3434 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    3535 */
    36 #ifndef _WIN32
     36#if defined(__linux__)
    3737#include <linux/limits.h>
    38 #else
     38#elif defined(WIN32)
    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 
    53 #ifdef CHECK_FSM_RULES
    54 #define fsm_check_flag "-DCHECK_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#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"
    5559#else
    5660#define fsm_check_flag
    5761#endif
    5862
    59 #define casc_cflags CFLAGS " " fsm_check_flag
    60 
    61 #if defined(darwin)
    62 #define macosx
    63 #endif
     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
    6467
    6568using namespace std;
     
    9194                << m.module->name() << "->" << m.name << "()\\n\");\n";
    9295  o << " p.integer = " << func << ";\n";
    93 #if CPP_CALL
     96#ifdef CPP_CALL
    9497  o << " (((sc_module*)(" << m.module << "))->*(p.pmf)) (); /* "
    9598                << m.module->name () << "->" << m.name << "() */\n";
     
    143146  }
    144147
    145 #ifdef DEBUG
     148#ifdef CONFIG_DEBUG
    146149  cerr << "opened temporary filename : " << temp << "\n";
    147150#endif
     
    268271
    269272  o << "// generated by " << sc_version () << endl
    270                 << "#include<casc.h>\n\n"
    271                 << "#include<cstdio>\n\n"
    272 //              << "#include<iostream>\n\n"
     273                << "#include <casc.h>\n\n"
     274                << "#include <cstdio>\n\n"
     275//              << "#include <iostream>\n\n"
    273276                << "namespace sc_core {\n"
    274277    << " typedef void (sc_module::*SC_ENTRY_FUNC)();\n"
     
    329332
    330333  o << "// generated by " << sc_version () << endl
    331                 << "#include<casc.h>\n\n"
    332                 << "#include<cstdio>\n\n"
    333 //              << "#include<iostream>\n\n"
     334                << "#include <casc.h>\n\n"
     335                << "#include <cstdio>\n\n"
     336//              << "#include <iostream>\n\n"
    334337                << "namespace sc_core {\n"
    335338    << " typedef void (sc_module::*SC_ENTRY_FUNC)();\n"
     
    377380//  const char *target_arch = getenv ("TARGET_ARCH");
    378381        const char *default_compiler =
    379 #if CPP_CALL
     382#ifdef CPP_CALL
    380383                "g++";
    381384#else
     
    418421  /* COMPILE */
    419422  /* ******* */
    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);
     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)"
    439428#else
    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
     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);
    449440
    450441  if (dump_stage)
     
    461452  sprintf (target_name, "%s.so", base_name);
    462453
    463 #if defined(linux)
     454#ifdef CONFIG_OS_LINUX
    464455  sprintf (source_name, "%s.lo", base_name);
    465456  sprintf(compil_str, "(cd %s ; pwd ; libtool --mode=link %s %s -shared -rdynamic -o %s %s)", /* -L. -L%s/lib-%s */
     
    560551  for (i = 0; i < n; ++i)
    561552  {
    562 #if 0 //defined(DEBUG)
     553#if 0 //defined(CONFIG_DEBUG)
    563554    sc_module *m = (sc_module*)(fc.instance[i]);
    564555    cerr << m->name () << endl;
     
    575566void static_simulate_1_cycle (void)
    576567{
    577 #ifdef CHECK_FSM_RULES
     568#ifdef CONFIG_CHECK_FSM_RULES
    578569        casc_fsm_step = TRANSITION;
    579570#endif
    580571  call_functions (pf[0]); // transition
    581572  update     ();
    582 #ifdef CHECK_FSM_RULES
     573#ifdef CONFIG_CHECK_FSM_RULES
    583574        casc_fsm_step = GEN_MOORE;
    584575#endif
    585576  call_functions (pf[1]); // moore generation
    586 #ifdef CHECK_FSM_RULES
     577#ifdef CONFIG_CHECK_FSM_RULES
    587578        casc_fsm_step = GEN_MEALY;
    588579#endif
    589580  call_functions (pf[2]); // mealy generation
    590 #ifdef CHECK_FSM_RULES
     581#ifdef CONFIG_CHECK_FSM_RULES
    591582        casc_fsm_step = STIMULI;
    592583#endif
     
    634625void quasistatic_simulate_1_cycle (void)
    635626{
    636 #ifdef CHECK_FSM_RULES
     627#ifdef CONFIG_CHECK_FSM_RULES
    637628        casc_fsm_step = TRANSITION;
    638629#endif
     
    644635  }
    645636  update     ();
    646 #ifdef CHECK_FSM_RULES
     637#ifdef CONFIG_CHECK_FSM_RULES
    647638        casc_fsm_step = GEN_MOORE;
    648639#endif
     
    652643    Call (m);
    653644  }
    654 #ifdef CHECK_FSM_RULES
     645#ifdef CONFIG_CHECK_FSM_RULES
    655646        casc_fsm_step = GEN_MEALY;
    656647#endif
    657648  quasistatic_mealy_generation ();
    658 #ifdef CHECK_FSM_RULES
     649#ifdef CONFIG_CHECK_FSM_RULES
    659650        casc_fsm_step = STIMULI;
    660651#endif
  • /sources/src/gen_code.h

    r20 r30  
    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 DEBUG
     107#ifdef CONFIG_DEBUG
    108108        // Check dynamic linkage
    109109  if ((func_combinationals == NULL) || (func_simulate_1_cycle == NULL)) {
     
    121121#endif
    122122        update ();
    123 #ifdef CHECK_FSM_RULES
     123#ifdef CONFIG_CHECK_FSM_RULES
    124124                casc_fsm_step = GEN_MEALY;
    125125#endif
     
    132132  if (is_posted_write ()) {
    133133    update ();
    134 #ifdef CHECK_FSM_RULES
     134#ifdef CONFIG_CHECK_FSM_RULES
    135135                casc_fsm_step = GEN_MEALY;
    136136#endif
  • /sources/src/global_functions.cc

    r20 r30  
    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"
     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
    4653
    4754using namespace std;
     
    218225   
    219226  char lib_absolutepath[256];
    220 #if defined(darwin) //macosx)
     227#if defined(CONFIG_OS_DARWIN)
    221228  sprintf(lib_absolutepath, "/tmp/%s.so", base_name);
    222 #elif defined(linux)
     229#elif defined(CONFIG_OS_LINUX)
    223230  sprintf(lib_absolutepath, "/tmp/%s.so", base_name);
    224231#else
     
    255262  }
    256263  // Init variables to be able to run combinational functions
    257 #ifdef CHECK_FSM_RULES
     264#ifdef CONFIG_CHECK_FSM_RULES
    258265        casc_fsm_step = STIMULI;
    259266#endif
  • /sources/src/global_functions.h

    r20 r30  
    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

    r20 r30  
    113113#include "sc_module.h"
    114114#include "sc_port.h"
     115#ifdef HAVE_CONFIG_H
     116#include "config.h"
     117#endif
    115118
    116119using namespace std;
     
    154157{
    155158Arc *a;
    156 #ifdef DEBUG
     159#ifdef CONFIG_DEBUG
    157160        if ((u == NULL) || (v == NULL))
    158161                exit(29042004);
  • /sources/src/graph_cass.cc

    r20 r30  
    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
    132135
    133136using namespace std;
  • /sources/src/graph_signals.cc

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

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

    r20 r30  
    3434 */
    3535
    36 #include "assert.h"
     36#include <cassert>
    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
    4245
    4346using namespace std;
     
    4750get_name (const method_process_t *method)
    4851{
    49   ASSERT(method != NULL);
     52  assert(method != NULL);
    5053  const sc_module *module = method->module;
    51   ASSERT(module != NULL);
     54  assert(module != NULL);
    5255  const char *module_name = module->name ();
    5356  const char *function_name = method->name;
     
    8588    const SignalDependency &sd = *it;
    8689    const equi_t           *source_equi     = sd.source;
    87     ASSERT(source_equi != NULL);
     90    assert(source_equi != NULL);
    8891          const method_process_t *source_method   = table[source_equi];
    8992    if (source_method == NULL)
  • /sources/src/module_hierarchy.cc

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

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

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

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

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

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

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

    r20 r30  
    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

    r20 r30  
    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

    r20 r30  
    3535 */
    3636
    37 #include"sc_clock.h"
    38 #include"assert.h"
     37#include "sc_clock.h"
     38#include <cassert>
     39#ifdef HAVE_CONFIG_H
     40#include "config.h"
     41#endif
    3942
    4043using namespace std;
     
    6972{
    7073        init ();
    71   ASSERT(period_     == 1);
    72   ASSERT(duty_cycle_ == 0.5);
    73   ASSERT(start_time_ == SC_ZERO_TIME);
     74  assert(period_     == 1);
     75  assert(duty_cycle_ == 0.5);
     76  assert(start_time_ == SC_ZERO_TIME);
    7477  posedge_first = posedge_first_;
    7578}
     
    8285{
    8386        init ();
    84   ASSERT(period_     == 1);
    85   ASSERT(duty_cycle_ == 0.5);
    86   ASSERT(start_time_ == SC_ZERO_TIME);
     87  assert(period_     == 1);
     88  assert(duty_cycle_ == 0.5);
     89  assert(start_time_ == SC_ZERO_TIME);
    8790  posedge_first = posedge_first_;
    8891}
  • /sources/src/sc_clock.h

    r20 r30  
    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

    r20 r30  
    3535
    3636
    37 #include<iostream>
    38 #include"sc_event.h"
    39 #include"sc_interface.h"
    40 #include"sc_port_ext.h"
     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
    4144
    4245using namespace std;
  • /sources/src/sc_event.h

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

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

    r20 r30  
    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

    r20 r30  
    1818#include <sc_logic.h>
    1919#include <sc_bv.h>
     20#include <cstdlib>
    2021
    2122// ----------------------------------------------------------------------------
     
    2829// ----------------------------------------------------------------------------
    2930
    30 #include"sc_nbdefs.h"
     31#include "sc_nbdefs.h"
    3132
    3233namespace sc_dt {
     
    135136  sc_int()                 { val = 0; }
    136137//  sc_int(data_type val_)  { val = 0; write (val_); }
    137   sc_int (const char *a)   { val = 0; write (atoi (a)); }
     138  sc_int (const char *a)   { val = 0; write (std::atoi (a)); }
    138139  sc_int (unsigned short a){ val = 0; write (a); }
    139140  sc_int (short a)         { val = 0; write (a); }
     
    197198
    198199  // arithmetic
    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; }
     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
    229217  inline sc_int_bit_ref& operator [] (int v)
    230218  { return (vf.valW >> v) & 1; }
  • /sources/src/sc_interface.cc

    r20 r30  
    3434 */
    3535
    36 #include"sc_interface.h"
    37 #include"sc_event.h"
    38 #include"assert.h"
    39 #include<iostream>
    40 #include<map>
     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
    4145#include<cstdlib>  //exit
    4246
     
    106110{
    107111        interface2infos_t::iterator i = interface2infos.find (this);
    108 #ifdef DEBUG
     112#ifdef CONFIG_DEBUG
    109113        if (i == interface2infos.end ()) {
    110114                cerr << "Internal error : can't find data size of " << this << "\n";
     
    119123{
    120124        interface2infos_t::iterator i = interface2infos.find (this);
    121 #ifdef DEBUG
     125#ifdef CONFIG_DEBUG
    122126        if (i == interface2infos.end ()) {
    123127                cerr << "Internal error : can't find default event of " << this << "\n";
  • /sources/src/sc_interface.h

    r20 r30  
    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

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

    r20 r30  
    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

    r20 r30  
    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

    r20 r30  
    3535 */
    3636
    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"
     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
    5155
    5256//
     
    6064
    6165bool        check_port_dependencies = false;
     66#ifdef CONFIG_DEFAULT_RUNTIME_COMPILATION
     67bool        dynamic_link_of_scheduling_code = true;
     68#else
    6269bool        dynamic_link_of_scheduling_code = false;
     70#endif
    6371bool        dump_netlist_info       = false;
    6472bool        dump_funclist_info      = false;
     
    108116  switch (scheduling_method) {
    109117  case CASS_SCHEDULING :
    110     ASSERT(use_port_dependency == false);
     118    assert(use_port_dependency == false);
    111119    break;
    112120  case BUCHMANN_SCHEDULING :
     
    125133    exit (33);
    126134  }
    127   ASSERT(use_port_dependency || use_sensitivity_list);
     135  assert(use_port_dependency || use_sensitivity_list);
    128136}
    129137
  • /sources/src/sc_module.cc

    r20 r30  
    4848#include "sc_clock.h" // is_clock
    4949#include "entity.h"
    50 #include "assert.h"
     50#include <cassert>
     51#ifdef HAVE_CONFIG_H
     52#include "config.h"
     53#endif
    5154
    5255//
     
    160163  sensitivity_list_t::iterator i;
    161164  for (i = sensitivity_list.begin (); i != sensitivity_list.end (); ++i) {
    162 #if defined(_DEBUG)
     165#if defined(CONFIG_DEBUG) && 0
    163166    if (i->get_interface() == NULL)
    164167    {
     
    238241          sensitive (this)
    239242{
    240   ASSERT(nm != NULL);
     243  assert(nm != NULL);
    241244#if 0
    242245  cerr << "sc_module constructor with const char * parameter\n";
     
    498501  if (m_pushed == false)
    499502    return;
    500   ASSERT(sc_core::module_name_stack.empty () == false);
     503  assert(sc_core::module_name_stack.empty () == false);
    501504  sc_core::module_name_stack.pop_back ();
    502505        modules_stack.pop ();
     
    504507  cout << "~sc_module_name <- " << m_name << endl;
    505508#endif
    506   ASSERT(temp_list.empty () == false);
     509  assert(temp_list.empty () == false);
    507510  sc_module *last1 = temp_list.back();
    508511  temp_list.pop_back();
     
    526529  if (m.dont_initialize == false)
    527530  {
    528     ASSERT(m.module != NULL);
    529 #if DEBUG
     531    assert(m.module != NULL);
     532#ifdef CONFIG_DEBUG
    530533    std::cerr << "Warning : SystemCASS doesn't perform SC_METHOD(S) initializations.\n"
    531534              << "Please turn off automatic initialization for '" << m.name
  • /sources/src/sc_module.h

    r20 r30  
    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

    r20 r30  
    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

    r20 r30  
    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

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

    r20 r30  
    4040#include <map>
    4141
    42 #include "assert.h"
     42#include <cassert>
    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
    4851
    4952using namespace std;
     
    7174//    out += ".";
    7275  }
    73 //  ASSERT(name != NULL);
     76//  assert(name != NULL);
    7477  if (name)
    7578    out += name;
     
    203206{
    204207        object2name_t::iterator i = object2fullname.find (this);
    205 #ifdef DEBUG
     208#ifdef CONFIG_DEBUG
    206209        if (i == object2fullname.end ()) {
    207210                cerr << "Internal error : can't find name of " << this << "\n";
     
    217220/*
    218221        object2name_t::iterator i = object2fullname.find (this);
    219 #ifdef DEBUG
     222#ifdef CONFIG_DEBUG
    220223        if (i == object2fullname.end ()) {
    221224                cerr << "Internal error : can't find name of " << this << "\n";
     
    235238    string     out;
    236239    sc_object* obj = *it;
    237     ASSERT(obj != NULL);
     240    assert(obj != NULL);
    238241    build_full_name (out, *obj);
    239242  }
     
    243246{
    244247        object2infos_t::iterator i = object2infos.find (this);
    245 #ifdef DEBUG
     248#ifdef CONFIG_DEBUG
    246249        if (i == object2infos.end ()) {
    247250                cerr << "Internal error : can't find kind of " << this << "\n";
  • /sources/src/sc_pat_trace.cc

    r20 r30  
    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>
     43#include <ctime>
     44#ifdef HAVE_CONFIG_H
     45#include "config.h"
     46#endif
    4447
    45 #ifdef PAT_TRACE_FORMAT
     48#ifdef CONFIG_PAT_TRACE_FORMAT
    4649
    4750//-----------------------------------------
  • /sources/src/sc_port.cc

    r20 r30  
    3636
    3737
    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"
     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
    4751
    4852extern "C" {
     
    5458using namespace std;
    5559
    56 #ifdef CHECK_FSM_RULES
    57 #include"fsm_rules.h"
     60#ifdef CONFIG_CHECK_FSM_RULES
     61#include "fsm_rules.h"
    5862namespace sc_core {
    5963casc_fsm_step_t casc_fsm_step = ELABORATION;
     
    108112sc_port_base::init ()
    109113{
    110 #ifdef DEBUG
     114#ifdef CONFIG_DEBUG
    111115        if (modules_stack.empty ()) {
    112116                cerr << "Internal error : modules stack empty\n";
     
    233237#endif
    234238#define iter (sc_core::pending_write_vector[i])
    235 #ifdef DEBUG
     239#ifdef CONFIG_DEBUG
    236240                if (iter.pointer == NULL) {
    237241                        cerr << "Internal error : trying to apply a posted write from an unassigned signal/port\n";
     
    255259  cerr << "done.\n";
    256260#endif
    257 #if defined(CHECK_MULTIWRITING2REGISTER)
     261#if defined(CONFIG_CHECK_MULTIWRITING2REGISTER)
    258262  sc_core::pending_writing2register_clear ();
    259263#endif
     
    310314{
    311315  const tab_t *pointer = port.get_pointer ();
    312   //ASSERT(pointer != NULL);
     316  //assert(pointer != NULL);
    313317  if (pointer == NULL)
    314318    return false; // case : sc_in not bound
     
    343347  {
    344348    /*const*/ sc_port_base *port = i->first;
    345     ASSERT(port != NULL);
     349    assert(port != NULL);
    346350    check_port (*port);
    347351  }
     
    350354}
    351355
    352 #if defined(CHECK_MULTIWRITING2REGISTER)
     356#if defined(CONFIG_CHECK_MULTIWRITING2REGISTER)
    353357typedef set<const tab_t*> pending_writing2register_set_t;
    354358pending_writing2register_set_t pending_writing2register_set;
  • /sources/src/sc_port.h

    r20 r30  
    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

    r20 r30  
    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 CHECK_FSM_RULES macro
     56// this declaration is not in casc.h since the CONFIG_CHECK_FSM_RULES macro
    5757// is not defined.
    5858
     
    184184                << " on signal " << name () << "\n";
    185185#endif
    186 #ifdef CHECK_FSM_RULES
     186#ifdef CONFIG_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 CHECK_FSM_RULES
     296#ifdef CONFIG_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 CHECK_FSM_RULES
     318#ifdef CONFIG_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(CHECK_MULTIWRITING2PORT)
     327#if defined(CONFIG_CHECK_MULTIWRITING2PORT)
    328328  check_multiwriting2port ();
    329329#endif
  • /sources/src/sc_sensitive.cc

    r20 r30  
    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"
     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
    4346
    4447using namespace std;
  • /sources/src/sc_sensitive.h

    r20 r30  
    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

    r20 r30  
    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"
     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
    2729#include "fsm_rules.h"
     30#endif
    2831
    2932namespace sc_core {
     
    4245        ///////////////////// DEPRECATED
    4346// C ANSI-only since it is needed to link with extern "C"
    44 // this declaration is not in casc.h since the CHECK_FSM_RULES macro
     47// this declaration is not in casc.h since the CONFIG_CHECK_FSM_RULES macro
    4548// is not defined.
    4649
     
    7982        size_t size = (sizeof (T)-1) / sizeof (base_type);
    8083        size_t i = 0;
    81         const base_type *pvalue = (const base_type*)(&value_);
     84        const base_type *pvalue = (const base_type*)(void*)(&value_);
    8285        do {
    8386#if 0
     
    9194                        const T          value_)
    9295{
    93         if (sizeof (T) > sizeof (base_type)) {
     96  if (sizeof (T) > sizeof (base_type)) {
    9497#if 0
    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_;
     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_;
    110113//      pending_write_vector[pending_write_vector_nb++].value = *(reinterpret_cast<const base_type*const>(&value_)); => bug !
    111   pending_write_vector[pending_write_vector_nb++].value = value_; // => bug avec blues !
     114    pending_write_vector[pending_write_vector_nb++].value = value_; // => bug avec blues !
    112115
    113116        // -> fix to use user-defined struct in sc_signal/sc_in/sc_out/sc_inout
     
    121124                return;
    122125#endif
    123         };
     126  };
    124127}
    125128
    126129inline bool is_posted_write ()
    127130{
    128                 return pending_write_vector_nb > 0;
     131  return pending_write_vector_nb > 0;
    129132}
    130133
     
    139142class sc_signal_base : public sc_object, public sc_interface
    140143{
    141         //////
    142         // Internal
     144  //////
     145  // Internal
    143146  friend class sc_clock;
    144147  friend class sc_port_base;
    145148  void init ();
    146         //////                           
     149  //////                                 
    147150 
    148151
     
    158161  sc_signal_base(const char* name_);
    159162  sc_signal_base(const char* name_, void*);
    160         ~sc_signal_base();
     163  ~sc_signal_base();
    161164};
    162165
     
    165168{
    166169private:
    167         T val;
    168   typedef T  data_type;
     170  T val;
     171  typedef T                data_type;
    169172  typedef sc_signal < T >  this_type;
    170         ///////////
    171         // Internal
    172         public: void init ();
    173         ///////////
    174 //  virtual void update ();
     173
     174  ///////////
     175  // Internal
     176public: void init ();
     177  ///////////
     178
     179  //  virtual void update ();
    175180  void check_writer ();
    176181public:
    177182  // constructors, destructor
    178183  sc_signal ()
    179         { init (); }
     184  { init (); }
    180185  explicit sc_signal (const char *name_): sc_signal_base(name_)
    181         { init (); }
     186  { init (); }
    182187  /*virtual */~ sc_signal ()
    183188  {}
     
    227232sc_signal<T>::init()
    228233{
    229   set_pointer ((tab_t*)&val);
     234        set_pointer ((tab_t*)(void*)&val);
    230235  set_kind    (kind_string);
    231         sc_interface::init (sizeof (data_type));
     236  sc_interface::init (sizeof (data_type));
    232237  val = 0; /* The simulator initializes the signal/register to 0.    */
    233238           /* However, hardware initialization still has to be done. */
     
    245250                << " on signal " << name () << "\n";
    246251#endif
    247 #ifdef CHECK_FSM_RULES
     252#ifdef CONFIG_CHECK_FSM_RULES
    248253        // we can read value from sc_signal type (used like a register) at any time
    249254#endif 
     
    257262sc_signal<T>::write( const data_type& value_ )
    258263{
    259 #ifdef CHECK_FSM_RULES
     264#ifdef CONFIG_CHECK_FSM_RULES
    260265        if ((casc_fsm_step != TRANSITION)
    261266                        && ( casc_fsm_step != STIMULI)) {
     
    266271        }               
    267272#endif
    268 #ifdef DEBUG
     273#ifdef CONFIG_DEBUG
    269274  if (get_pointer() == NULL)
    270275  {
     
    273278  }
    274279#endif
    275 #ifdef CHECK_MULTIWRITING2REGISTER
     280#ifdef CONFIG_CHECK_MULTIWRITING2REGISTER
    276281  pending_writing2register_record_and_check (get_pointer ());
    277282#endif
  • /sources/src/sc_time.cc

    r20 r30  
    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
    4245
    4346namespace sc_core {
  • /sources/src/sc_trace.cc

    r20 r30  
    4141#include "bit2string.h"
    4242#include "hex2string.h"
    43 #include "assert.h"
    44 
     43
     44#include <cassert>
    4545#include <list>
    4646#include <cstdio>
     
    4848#include <cstring> //strlen
    4949
     50#ifdef HAVE_CONFIG_H
     51#include "config.h"
     52#endif
     53
    5054//-----------------------------------------
    5155
     
    5357
    5458//-----------------------------------------
    55 #ifdef PAT_TRACE_FORMAT
     59#ifdef CONFIG_PAT_TRACE_FORMAT
    5660
    5761extern "C" {
     
    6367#include <cstdio>
    6468
    65 #endif // PAT_TRACE_FORMAT
     69#endif // CONFIG_PAT_TRACE_FORMAT
    6670//-----------------------------------------
    6771
     
    165169    {
    166170      sc_trace_file *tf = *ptf;
    167       ASSERT(tf != NULL);
     171      assert(tf != NULL);
    168172                trace (*tf, part);
    169173    }
     
    173177}
    174178
    175 #if PAT_TRACE_FORMAT
     179#ifdef CONFIG_PAT_TRACE_FORMAT
    176180static void
    177181pat_set_value (char *buf, const signal2trace &s)
     
    283287{
    284288}
    285 #endif // PAT_TRACE_FORMAT
     289#endif // CONFIG_PAT_TRACE_FORMAT
    286290
    287291static
     
    414418  else
    415419    vcd_signal_table = (tab_t*) malloc (sizeof (tab_t) * size);
    416 #if DEBUG
     420#ifdef CONFIG_DEBUG
    417421  if (vcd_signal_table == NULL)
    418422  {
     
    486490      vcd_trace_init (tf);
    487491  } else {
    488 #if defined(DEBUG)
     492#if defined(CONFIG_DEBUG)
    489493      if (vcd_signal_table == NULL)
    490494      {
     
    580584&name)
    581585{
    582 #ifdef PAT_TRACE_FORMAT
     586#ifdef CONFIG_PAT_TRACE_FORMAT
    583587        //exemple:
    584588        //DECLAR ("a", ":2", "X", IN, "3  downto 0", "" );
     
    630634#endif
    631635        DECLAR ((char*)(name.c_str ()), ":1", format, dir,(char *) downto.c_str(), "" );
    632 #endif // PAT_TRACE_FORMAT
     636#endif // CONFIG_PAT_TRACE_FORMAT
    633637}
    634638
  • /sources/src/sc_uint.h

    r20 r30  
    2525// ----------------------------------------------------------------------------
    2626
    27 #include"sc_nbdefs.h"
     27#include "sc_nbdefs.h"
    2828
    2929namespace sc_dt {
     
    183183
    184184  // arithmetic
    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; }
     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
    215213  inline sc_uint_bit_ref operator [] (int v)
    216214  { return (vf.valW >> v) & 1; }
  • /sources/src/sc_uint_subref_r.cc

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

    r20 r30  
    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

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

    r20 r30  
    4040#include <cstdlib> //exit
    4141
     42#ifdef HAVE_CONFIG_H
     43#include "config.h"
     44#endif
     45
    4246namespace sc_core {
    4347
     
    6165        "\n"
    6266        "         Cycle Accurate System Simulator\n"
    63 #ifdef DEBUG
     67#ifdef CONFIG_DEBUG
    6468  "            DEBUG version\n"
    6569#endif
  • /sources/src/schedulers.cc

    r20 r30  
    3535 */
    3636
    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"
     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
    4954
    5055using namespace std;
     
    95100                         const method_process_t *a2)
    96101{
    97   ASSERT(a1 != NULL);
    98   ASSERT(a2 != NULL);
     102  assert(a1 != NULL);
     103  assert(a2 != NULL);
    99104  sc_module *m1 = a1->module;
    100105  sc_module *m2 = a2->module;
     
    114119    addr1.func = a1->func;
    115120    addr2.func = a2->func;
    116     ASSERT(addr1.addr_ll != addr2.addr_ll);
     121    assert(addr1.addr_ll != addr2.addr_ll);
    117122    if ( sizeof(SC_ENTRY_FUNC) == 4 ) {
    118123        return (addr1.addr_l < addr2.addr_l);
     
    130135                    const method_process_t *a2)
    131136{
    132   ASSERT(a1 != NULL);
    133   ASSERT(a2 != NULL);
     137  assert(a1 != NULL);
     138  assert(a2 != NULL);
    134139  return (a1->module < a2->module);
    135140}
     
    140145                 const method_process_t *a2)
    141146{
    142     ASSERT(a1 != NULL);
    143     ASSERT(a2 != NULL);
     147    assert(a1 != NULL);
     148    assert(a2 != NULL);
    144149    union {
    145150        SC_ENTRY_FUNC func;
     
    237242{
    238243  SignalDependencyGraph *sig_graph = MakeAcyclicSignalDependencyGraph ();
    239   ASSERT(sig_graph != NULL);
     244  assert(sig_graph != NULL);
    240245  // Create the process evaluation list
    241246  ProcessDependencyList* process_list = MakeMouchardScheduling (*sig_graph);
    242   ASSERT(process_list != NULL);
     247  assert(process_list != NULL);
    243248
    244249  if (dump_all_graph)
     
    284289    // Uses port dependancies like Dr. Mouchard.
    285290    ProcessDependencyList* process_list = BuchmannScheduling ();
    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);
     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);
    288295    break;
    289296  }
     
    295302    // and does not use an event-driven scheduler.
    296303    ProcessDependencyList* process_list = MouchardScheduling ();
    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);
     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);
    299308    break;
    300309  }
     
    307316      graph2dot("module_graph", *g);
    308317    strong_component_list_t *strong_list = strong_component (g);
    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);
     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);
    311322    break;
    312323  }
  • /sources/src/schedulers.h

    r20 r30  
    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

    r20 r30  
    3535
    3636
    37 #include<map>
    38 #include<fstream>
    39 //#include<vector> // save_module_hierarchy
    40 
    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"
     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"
     43
     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
    4852
    4953using namespace std;
     
    8488            int          bit_number)
    8589{
    86   ASSERT(bit_number <= 64);
     90  assert(bit_number <= 64);
    8791  if (bit_number == 1) {
    8892    bool v = *((const bool*) val);
     
    140144                    save_fct_t1      fct)
    141145{
    142   //ASSERT(fct != NULL);
     146  //assert(fct != NULL);
    143147  //sc_module2save_fct_t1::value_type pair(&mod,fct);
    144148  //save_handler_table.insert (pair);
     
    158162    const sc_module *mod = it->first;
    159163    save_fct_t1      fct = it->second;
    160     ASSERT(mod != NULL);
    161 //    ASSERT(fct != NULL);
     164    assert(mod != NULL);
     165//    assert(fct != NULL);
    162166    //o << mod->name () << endl;
    163167    fprintf (o,"module\n%s\n",mod->name ());
     
    185189  file.close ();
    186190  FILE *f = fopen (filename, "a+");
    187   ASSERT(f != NULL);
     191  assert(f != NULL);
    188192  save_modules (f);
    189193  fclose (f);
  • /sources/src/serialization.h

    r20 r30  
    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

    r20 r30  
    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

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

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

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

    r20 r30  
    1313
    1414struct test : sc_module {
    15   int                             reg;
     15  int32_t                         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
    4044      ASSERT(((double)reg)          == reg_double.read());
    4145      ASSERT(((long)  reg)          == reg_long  .read());
     
    4852      ASSERT(((signed int) reg & 0xFFFFFFFF) == (signed int) (reg_i32 .read()));
    4953      ASSERT(((signed int) reg & 0x0000FFFF) == (signed int) (reg_i16 .read()));
    50       ASSERT(((signed int) reg & 0x0000003F)  == (signed int) (reg_i6  .read()));
     54      ASSERT(((signed int) reg & 0x0000003F) == (signed int) (reg_i6  .read()));
    5155      reg        = reg + 1;
    5256      reg_bool   = reg & 1;
     
    5458      reg_unsigned_int = reg;
    5559      reg_char   = reg;
    56       reg_double = reg;
     60      reg_double .write(reg);
    5761      reg_long   = reg;
    5862      reg_ui32   = reg;
     
    8084
    8185  SC_HAS_PROCESS(test);
    82         test (sc_module_name n) : sc_module (n),
     86    test (sc_module_name n) : sc_module (n),
    8387    clk("clk")
    8488  {
    85                 SC_METHOD(trans);
    86                 sensitive << clk.pos();
     89    SC_METHOD(trans);
     90    sensitive << clk.pos();
    8791    dont_initialize();
    88         };
     92  };
    8993};
    9094
    9195int sc_main (int argc, char *argv[])
    9296{
    93         sc_clock        signal_clk("my_clock",1, 0.5);
     97  sc_clock        signal_clk("my_clock",1, 0.5);
    9498  sc_signal<bool> resetn("resetn");
    9599
     
    98102  test1.resetn (resetn);
    99103
    100         // Init & run
    101         sc_start (0);
     104  // Init & run
     105  sc_start (0);
    102106
    103107  resetn = false;
    104         sc_start (4);
     108  sc_start (4);
    105109  resetn = true;
    106110  sc_start (100);
    107111
    108         return EXIT_SUCCESS;
     112  return EXIT_SUCCESS;
    109113}
    110114
  • /sources/test_regression/15042009/Makefile

    r20 r30  
    11include ../env.mk
    22
    3 SYSTEM    = system.cpp
     3SYSTEM    = system.cpp system2.cpp system3.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} ; \
    2123        #
    2224
  • /sources/test_regression/19042005/system.cpp

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

    r20 r30  
    77$var wire    1  aaa  clk       $end
    88$var wire    1  aab  b1       $end
    9 $var wire   32  aac  l1 [31:0]       $end
     9$var wire   64  aac  l1 [63: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

    r20 r30  
    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
    3235  ASSERT((int) (t.to_double ()) == i * 1000);
     36#endif
    3337  CERR(t.to_seconds ());
    3438        double seconds = t.to_seconds()*1000000000;
     
    3741  char s[256];
    3842  const char *unit;
     43#ifdef SYSTEMCASS_SPECIFIC
     44  unit = "NS";
     45#else
    3946  if (i == 0)
    4047    unit = "s";
     
    4350  else
    4451    unit = "ns";
     52#endif
    4553  sprintf (s, "%d %s", i,unit);
    4654  CERR(s);
     
    5563
    5664  check_time (0);
    57         sc_start (0);
     65  sc_start (0);
    5866
    5967  check_time (0);
    60         sc_start (1);
     68  sc_start (1);
    6169  check_time (1);
    6270
    63         sc_start (15);
     71  sc_start (15);
    6472  check_time (16);
    6573
    66         sc_start (7);
     74  sc_start (7);
    6775  check_time (23);
    6876
    69         sc_start (100);
     77  sc_start (100);
    7078  check_time (123);
    7179
    72         sc_start (1000);
     80  sc_start (1000);
    7381  check_time (1123);
    7482  cerr << "Test OK.\n";
  • /sources/test_regression/env.mk

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