- Files:
-
- 16 added
- 15 deleted
- 79 edited
Legend:
- Unmodified
- Added
- Removed
-
/branches/with_autoconf/src/sc_int.h
r30 r20 18 18 #include <sc_logic.h> 19 19 #include <sc_bv.h> 20 #include <cstdlib>21 20 22 21 // ---------------------------------------------------------------------------- … … 136 135 sc_int() { val = 0; } 137 136 // 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)); } 139 138 sc_int (unsigned short a){ val = 0; write (a); } 140 139 sc_int (short a) { val = 0; write (a); } … … 198 197 199 198 // 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; } 217 229 inline sc_int_bit_ref& operator [] (int v) 218 230 { return (vf.valW >> v) & 1; } -
/branches/with_autoconf/src/sc_signal.h
r30 r20 82 82 size_t size = (sizeof (T)-1) / sizeof (base_type); 83 83 size_t i = 0; 84 const base_type *pvalue = (const base_type*)( void*)(&value_);84 const base_type *pvalue = (const base_type*)(&value_); 85 85 do { 86 86 #if 0 … … 96 96 if (sizeof (T) > sizeof (base_type)) { 97 97 #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"; 100 100 #endif 101 101 post_multiwrite (pointer_,value_); … … 171 171 typedef T data_type; 172 172 typedef sc_signal < T > this_type; 173 174 173 /////////// 175 174 // Internal 176 175 public: void init (); 177 176 /////////// 178 179 177 // virtual void update (); 180 178 void check_writer (); … … 232 230 sc_signal<T>::init() 233 231 { 234 set_pointer ((tab_t*)(void*)&val);232 set_pointer ((tab_t*)&val); 235 233 set_kind (kind_string); 236 234 sc_interface::init (sizeof (data_type)); -
/branches/with_autoconf/src/sc_uint.h
r30 r20 183 183 184 184 // 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; } 213 215 inline sc_uint_bit_ref operator [] (int v) 214 216 { return (vf.valW >> v) & 1; } -
/sources/INSTALL
r30 r20 1 Installation Instructions 2 ************************* 1 SystemCASS Installation 2 ======================= 3 3 4 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free 5 Software Foundation, Inc. 4 To install SystemCASS on linux, do the following steps: 6 5 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): 9 7 10 Basic Installation 11 ================== 8 TARGET_ARCH : architecture name. 12 9 13 These are generic installation instructions.10 SYSTEMCASS : SystemCASS top directory. 14 11 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. 23 14 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 : 29 16 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/ 36 19 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) 41 21 42 The simplest way to compile this package is:22 3. Type the following command: 43 23 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) 49 25 50 Running `configure' takes awhile. While running, it prints some51 messages telling which features it is checking for.52 26 53 2. Type `make' to compile the package. 27 PAT trace ouput 28 =============== 54 29 55 3. Optionally, type `make check' to run any self-tests that come with 56 the package. 30 PAT trace output is disable by default. 31 Set the environment variable 'ALLIANCE' to ALLIANCE top directory, 32 then make again. 57 33 58 4. Type `make install' to install the programs and any data files and59 documentation.60 61 5. You can remove the program binaries and object files from the62 source code directory by typing `make clean'. To also remove the63 files that `configure' created (so you can compile the package for64 a different kind of computer), type `make distclean'. There is65 also a `make maintainer-clean' target, but that is intended mainly66 for the package's developers. If you use it, you may have to get67 all sorts of other programs in order to regenerate files that came68 with the distribution.69 70 Compilers and Options71 =====================72 73 Some systems require unusual options for compilation or linking that the74 `configure' script does not know about. Run `./configure --help' for75 details on some of the pertinent environment variables.76 77 You can give `configure' initial values for configuration parameters78 by setting variables in the command line or in the environment. Here79 is an example:80 81 ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix82 83 *Note Defining Variables::, for more details.84 85 Compiling For Multiple Architectures86 ====================================87 88 You can compile the package for more than one kind of computer at the89 same time, by placing the object files for each architecture in their90 own directory. To do this, you must use a version of `make' that91 supports the `VPATH' variable, such as GNU `make'. `cd' to the92 directory where you want the object files and executables to go and run93 the `configure' script. `configure' automatically checks for the94 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 a98 time in the source code directory. After you have installed the99 package for one architecture, use `make distclean' before reconfiguring100 for another architecture.101 102 Installation Names103 ==================104 105 By default, `make install' installs the package's commands under106 `/usr/local/bin', include files under `/usr/local/include', etc. You107 can specify an installation prefix other than `/usr/local' by giving108 `configure' the option `--prefix=PREFIX'.109 110 You can specify separate installation prefixes for111 architecture-specific files and architecture-independent files. If you112 pass the option `--exec-prefix=PREFIX' to `configure', the package uses113 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 give117 options like `--bindir=DIR' to specify different values for particular118 kinds of files. Run `configure --help' for a list of the directories119 you can set and what kinds of files go in them.120 121 If the package supports it, you can cause programs to be installed122 with an extra prefix or suffix on their names by giving `configure' the123 option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.124 125 Optional Features126 =================127 128 Some packages pay attention to `--enable-FEATURE' options to129 `configure', where FEATURE indicates an optional part of the package.130 They may also pay attention to `--with-PACKAGE' options, where PACKAGE131 is something like `gnu-as' or `x' (for the X Window System). The132 `README' should mention any `--enable-' and `--with-' options that the133 package recognizes.134 135 For packages that use the X Window System, `configure' can usually136 find the X include and library files automatically, but if it doesn't,137 you can use the `configure' options `--x-includes=DIR' and138 `--x-libraries=DIR' to specify their locations.139 140 Specifying the System Type141 ==========================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 a147 message saying it cannot guess the machine type, give it the148 `--build=TYPE' option. TYPE can either be a short name for the system149 type, such as `sun4', or a canonical name which has the form:150 151 CPU-COMPANY-SYSTEM152 153 where SYSTEM can have one of these forms:154 155 OS KERNEL-OS156 157 See the file `config.sub' for the possible values of each field. If158 `config.sub' isn't included in this package, then this package doesn't159 need to know the machine type.160 161 If you are _building_ compiler tools for cross-compiling, you should162 use the option `--target=TYPE' to select the type of system they will163 produce code for.164 165 If you want to _use_ a cross compiler, that generates code for a166 platform different from the build platform, you should specify the167 "host" platform (i.e., that on which the generated programs will168 eventually be run) with `--host=TYPE'.169 170 Sharing Defaults171 ================172 173 If you want to set default values for `configure' scripts to share, you174 can create a site shell script called `config.site' that gives default175 values for variables like `CC', `cache_file', and `prefix'.176 `configure' looks for `PREFIX/share/config.site' if it exists, then177 `PREFIX/etc/config.site' if it exists. Or, you can set the178 `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 Variables182 ==================183 184 Variables not defined in a site shell script can be set in the185 environment passed to `configure'. However, some packages may run186 configure again during the build, and the customized values of these187 variables may be lost. In order to avoid this problem, you should set188 them in the `configure' command line, using `VAR=value'. For example:189 190 ./configure CC=/usr/local2/bin/gcc191 192 causes the specified `gcc' to be used as the C compiler (unless it is193 overridden in the site shell script). Here is a another example:194 195 /bin/bash ./configure CONFIG_SHELL=/bin/bash196 197 Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent198 configuration-related scripts to be executed by `/bin/bash'.199 200 `configure' Invocation201 ======================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' to217 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. To227 suppress all normal output, redirect it to `/dev/null' (any error228 messages will still be shown).229 230 `--srcdir=DIR'231 Look for the package's source code in directory DIR. Usually232 `configure' can determine that directory automatically.233 234 `configure' also accepts some other, not widely useful, options. Run235 `configure --help' for more details.236 -
/sources/src/alias.cc
r30 r20 33 33 */ 34 34 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> 40 37 41 38 const char * alias () -
/sources/src/bit2string.cc
r30 r20 41 41 #include <cstdlib> 42 42 #include <iostream> 43 #ifdef HAVE_CONFIG_H44 #include "config.h"45 #endif46 43 47 44 using namespace std; -
/sources/src/casc.h
r30 r20 48 48 EXTERN void simulate_1_cycle (void) 49 49 { 50 #ifdef C ONFIG_CHECK_FSM_RULES50 #ifdef CHECK_FSM_RULES 51 51 casc_fsm_step = TRANSITION; 52 52 #endif 53 53 transition (); 54 54 update (); 55 #ifdef C ONFIG_CHECK_FSM_RULES55 #ifdef CHECK_FSM_RULES 56 56 casc_fsm_step = GEN_MOORE; 57 57 #endif 58 58 moore_generation (); 59 #ifdef C ONFIG_CHECK_FSM_RULES59 #ifdef CHECK_FSM_RULES 60 60 casc_fsm_step = GEN_MEALY; 61 61 #endif 62 62 mealy_generation (); 63 #ifdef C ONFIG_CHECK_FSM_RULES63 #ifdef CHECK_FSM_RULES 64 64 casc_fsm_step = STIMULI; 65 65 #endif -
/sources/src/data_field.h
r30 r20 13 13 #define __DATA_FIELD_H__ 14 14 15 #include <endianness.h> 16 15 17 template<int WIDTH, 16 18 int PADDING, 17 19 typename data_type> 18 struct val_field { 20 struct val_field { /* try to work with little endianess */ 21 #if defined(little_endian) 22 /* little endian */ 23 // data_type pad:PADDING; 19 24 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 20 32 }; 21 33 -
/sources/src/dump_dot.cc
r30 r20 40 40 #include "simplify_string.h" 41 41 #include "sc_ver.h" // sc_version 42 #ifdef HAVE_CONFIG_H43 #include "config.h"44 #endif45 42 46 43 typedef std::list<sc_core::sc_port_base*> port_list_t; -
/sources/src/dump_used_env.cc
r30 r20 36 36 #include <cstdlib> 37 37 #include "dump_used_env.h" 38 #ifdef HAVE_CONFIG_H39 #include "config.h"40 #endif41 38 42 39 std::string -
/sources/src/dump_used_options.cc
r30 r20 35 35 36 36 #include "dump_used_options.h" 37 #ifdef HAVE_CONFIG_H38 #include "config.h"39 #endif40 37 41 38 namespace sc_core { … … 68 65 "DUMP_STAGE, " 69 66 #endif 70 #ifdef C ONFIG_CHECK_FSM_RULES71 "C ONFIG_CHECK_FSM_RULES, "67 #ifdef CHECK_FSM_RULES 68 "CHECK_FSM_RULES, " 72 69 #endif 73 70 #ifdef COMPIL_DEBUG 74 71 "COMPIL_DEBUG," 75 72 #endif 76 #ifdef CONFIG_DEBUG77 " CONFIG_DEBUG, "73 #ifdef DEBUG 74 "DEBUG, " 78 75 #endif 79 76 #ifdef UINT64 -
/sources/src/entity.cc
r30 r20 35 35 */ 36 36 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" 51 48 52 49 using namespace std; … … 178 175 typedef std::map<const tab_t *,equi_list_t::iterator,predic4tab_t2equi_t_t> tab_t2equi_it_t; 179 176 static tab_t2equi_it_t tab2equi_map; 180 assert(pointer != NULL);177 ASSERT(pointer != NULL); 181 178 182 179 // boost … … 243 240 { 244 241 equi_t::const_iterator top_iter = e.begin (); 245 #ifdef CONFIG_DEBUG242 #ifdef DEBUG 246 243 if (top_iter == e.end ()) { 247 244 cerr << "Internal error : no signal in " << e << endl; … … 360 357 } 361 358 362 #if defined(DUMP_SIGNAL _STATS)359 #if defined(DUMP_SIGNALS_STATS) 363 360 static unsigned int equi_real_size; 364 361 #endif … … 392 389 unsigned int table_size = get_sizeof_signals_table (); 393 390 equi_table = new tab_t[table_size]; //(0xCD); 394 #if defined(DUMP_SIGNAL _STATS)391 #if defined(DUMP_SIGNALS_STATS) 395 392 equi_real_size = table_size; 396 393 #endif … … 406 403 bind_equi_to_table (equi_t &e, tab_t * const pointer) 407 404 { 408 assert(pointer != NULL);405 ASSERT(pointer != NULL); 409 406 equi_t::iterator i; 410 407 for (i = e.begin (); i != e.end (); ++i) { … … 458 455 o << ")"; 459 456 #else 460 assert(e.object != NULL);457 ASSERT(e.object != NULL); 461 458 o << e.object->name (); 462 459 #endif … … 497 494 print_table_stats (ostream &o) 498 495 { 499 #if defined(DUMP_SIGNAL _STATS)496 #if defined(DUMP_SIGNALS_STATS) 500 497 int nb_reg = 0; 501 498 int nb_sig = 0; … … 540 537 } 541 538 const entity &ent = *(eq.begin ()); 542 #ifdef CONFIG_DEBUG539 #ifdef DEBUG 543 540 if (ent.type != sc_core::entity::SIGNAL) 544 541 exit(28); … … 547 544 const char *sig_name = ent.object->name (); 548 545 const char *sep = strchr (sig_name,'.'); 549 #ifdef CONFIG_DEBUG546 #ifdef DEBUG 550 547 if (sep == NULL) { 551 548 exit (30); … … 598 595 #endif 599 596 600 #if defined(DUMP_SIGNAL _STATS)597 #if defined(DUMP_SIGNALS_STATS) 601 598 static unsigned int equi_real_size; 602 599 #endif … … 606 603 { 607 604 #if 0 608 //defined( CONFIG_DEBUG)605 //defined(DEBUG) 609 606 equi_list_t::iterator x_equi = get_equi (x); 610 607 if ((x_equi != equi_list.end())) { … … 643 640 tbind (sc_port_base &x,T &y) 644 641 { 645 // assert(x.get_pointer () != NULL); // x pointer may be NULL646 // assert(y.get_pointer () != NULL); // y pointer may be NULL642 // ASSERT(x.get_pointer () != NULL); // x pointer may be NULL 643 // ASSERT(y.get_pointer () != NULL); // y pointer may be NULL 647 644 equi_list_t::iterator x_equi = get_equi (x); 648 645 equi_list_t::iterator y_equi = get_equi (y); -
/sources/src/entity.h
r30 r20 14 14 #define __ENTITY_H__ 15 15 16 #include 17 #include 18 #include 19 #include 20 #include 16 #include<iostream> 17 #include<list> 18 #include"sc_fwd.h" 19 #include"sc_port.h" 20 #include"sc_signal.h" 21 21 22 22 namespace sc_core { -
/sources/src/fsm_rules.h
r30 r20 13 13 #define __FSM_RULES_H__ 14 14 15 #ifdef HAVE_CONFIG_H 16 #include "config.h" 17 #endif 18 19 #ifdef CONFIG_CHECK_FSM_RULES 15 #ifdef CHECK_FSM_RULES 20 16 21 17 namespace sc_core { -
/sources/src/gen_code.cc
r30 r20 34 34 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 35 35 */ 36 #if defined(__linux__)36 #ifndef _WIN32 37 37 #include <linux/limits.h> 38 #el if defined(WIN32)38 #else 39 39 #include <windows.h> 40 40 #endif … … 45 45 #include<fstream> 46 46 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" 59 55 #else 60 56 #define fsm_check_flag 61 57 #endif 62 58 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 67 64 68 65 using namespace std; … … 94 91 << m.module->name() << "->" << m.name << "()\\n\");\n"; 95 92 o << " p.integer = " << func << ";\n"; 96 #if defCPP_CALL93 #if CPP_CALL 97 94 o << " (((sc_module*)(" << m.module << "))->*(p.pmf)) (); /* " 98 95 << m.module->name () << "->" << m.name << "() */\n"; … … 146 143 } 147 144 148 #ifdef CONFIG_DEBUG145 #ifdef DEBUG 149 146 cerr << "opened temporary filename : " << temp << "\n"; 150 147 #endif … … 271 268 272 269 o << "// generated by " << sc_version () << endl 273 << "#include 274 << "#include 275 // << "#include 270 << "#include<casc.h>\n\n" 271 << "#include<cstdio>\n\n" 272 // << "#include<iostream>\n\n" 276 273 << "namespace sc_core {\n" 277 274 << " typedef void (sc_module::*SC_ENTRY_FUNC)();\n" … … 332 329 333 330 o << "// generated by " << sc_version () << endl 334 << "#include 335 << "#include 336 // << "#include 331 << "#include<casc.h>\n\n" 332 << "#include<cstdio>\n\n" 333 // << "#include<iostream>\n\n" 337 334 << "namespace sc_core {\n" 338 335 << " typedef void (sc_module::*SC_ENTRY_FUNC)();\n" … … 380 377 // const char *target_arch = getenv ("TARGET_ARCH"); 381 378 const char *default_compiler = 382 #if defCPP_CALL379 #if CPP_CALL 383 380 "g++"; 384 381 #else … … 421 418 /* COMPILE */ 422 419 /* ******* */ 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); 428 439 #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 440 449 441 450 if (dump_stage) … … 452 461 sprintf (target_name, "%s.so", base_name); 453 462 454 #if def CONFIG_OS_LINUX463 #if defined(linux) 455 464 sprintf (source_name, "%s.lo", base_name); 456 465 sprintf(compil_str, "(cd %s ; pwd ; libtool --mode=link %s %s -shared -rdynamic -o %s %s)", /* -L. -L%s/lib-%s */ … … 551 560 for (i = 0; i < n; ++i) 552 561 { 553 #if 0 //defined( CONFIG_DEBUG)562 #if 0 //defined(DEBUG) 554 563 sc_module *m = (sc_module*)(fc.instance[i]); 555 564 cerr << m->name () << endl; … … 566 575 void static_simulate_1_cycle (void) 567 576 { 568 #ifdef C ONFIG_CHECK_FSM_RULES577 #ifdef CHECK_FSM_RULES 569 578 casc_fsm_step = TRANSITION; 570 579 #endif 571 580 call_functions (pf[0]); // transition 572 581 update (); 573 #ifdef C ONFIG_CHECK_FSM_RULES582 #ifdef CHECK_FSM_RULES 574 583 casc_fsm_step = GEN_MOORE; 575 584 #endif 576 585 call_functions (pf[1]); // moore generation 577 #ifdef C ONFIG_CHECK_FSM_RULES586 #ifdef CHECK_FSM_RULES 578 587 casc_fsm_step = GEN_MEALY; 579 588 #endif 580 589 call_functions (pf[2]); // mealy generation 581 #ifdef C ONFIG_CHECK_FSM_RULES590 #ifdef CHECK_FSM_RULES 582 591 casc_fsm_step = STIMULI; 583 592 #endif … … 625 634 void quasistatic_simulate_1_cycle (void) 626 635 { 627 #ifdef C ONFIG_CHECK_FSM_RULES636 #ifdef CHECK_FSM_RULES 628 637 casc_fsm_step = TRANSITION; 629 638 #endif … … 635 644 } 636 645 update (); 637 #ifdef C ONFIG_CHECK_FSM_RULES646 #ifdef CHECK_FSM_RULES 638 647 casc_fsm_step = GEN_MOORE; 639 648 #endif … … 643 652 Call (m); 644 653 } 645 #ifdef C ONFIG_CHECK_FSM_RULES654 #ifdef CHECK_FSM_RULES 646 655 casc_fsm_step = GEN_MEALY; 647 656 #endif 648 657 quasistatic_mealy_generation (); 649 #ifdef C ONFIG_CHECK_FSM_RULES658 #ifdef CHECK_FSM_RULES 650 659 casc_fsm_step = STIMULI; 651 660 #endif -
/sources/src/gen_code.h
r30 r20 14 14 #define __GEN_CODE_H__ 15 15 16 #include 17 #include 18 #include 19 #include 20 #include 21 #include 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" 22 22 23 23 //------------------------------------------------------------------- … … 105 105 internal_sc_cycle0( double duration ) // in default time units 106 106 { 107 #ifdef CONFIG_DEBUG107 #ifdef DEBUG 108 108 // Check dynamic linkage 109 109 if ((func_combinationals == NULL) || (func_simulate_1_cycle == NULL)) { … … 121 121 #endif 122 122 update (); 123 #ifdef C ONFIG_CHECK_FSM_RULES123 #ifdef CHECK_FSM_RULES 124 124 casc_fsm_step = GEN_MEALY; 125 125 #endif … … 132 132 if (is_posted_write ()) { 133 133 update (); 134 #ifdef C ONFIG_CHECK_FSM_RULES134 #ifdef CHECK_FSM_RULES 135 135 casc_fsm_step = GEN_MEALY; 136 136 #endif -
/sources/src/global_functions.cc
r30 r20 35 35 */ 36 36 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" 53 46 54 47 using namespace std; … … 225 218 226 219 char lib_absolutepath[256]; 227 #if defined( CONFIG_OS_DARWIN)220 #if defined(darwin) //macosx) 228 221 sprintf(lib_absolutepath, "/tmp/%s.so", base_name); 229 #elif defined( CONFIG_OS_LINUX)222 #elif defined(linux) 230 223 sprintf(lib_absolutepath, "/tmp/%s.so", base_name); 231 224 #else … … 262 255 } 263 256 // Init variables to be able to run combinational functions 264 #ifdef C ONFIG_CHECK_FSM_RULES257 #ifdef CHECK_FSM_RULES 265 258 casc_fsm_step = STIMULI; 266 259 #endif -
/sources/src/global_functions.h
r30 r20 13 13 #define __GLOBAL_FUNCTIONS_H__ 14 14 15 #include 16 #include 15 #include"sc_fwd.h" 16 #include"sc_time.h" 17 17 18 18 extern int sc_main(int, char **); -
/sources/src/graph.cc
r30 r20 113 113 #include "sc_module.h" 114 114 #include "sc_port.h" 115 #ifdef HAVE_CONFIG_H116 #include "config.h"117 #endif118 115 119 116 using namespace std; … … 157 154 { 158 155 Arc *a; 159 #ifdef CONFIG_DEBUG156 #ifdef DEBUG 160 157 if ((u == NULL) || (v == NULL)) 161 158 exit(29042004); -
/sources/src/graph_cass.cc
r30 r20 130 130 #include "simplify_string.h" // simplify_string 131 131 #include "sc_ver_ext.h" // sc_version for dumping to DOT 132 #ifdef HAVE_CONFIG_H133 #include "config.h"134 #endif135 132 136 133 using namespace std; -
/sources/src/graph_signals.cc
r30 r20 138 138 #include "sc_module.h" 139 139 #include "sc_port.h" 140 #ifdef HAVE_CONFIG_H141 #include "config.h"142 #endif143 140 144 141 using namespace std; -
/sources/src/hex2string.cc
r30 r20 41 41 #include <cstdlib> 42 42 #include <iostream> 43 #ifdef HAVE_CONFIG_H44 #include "config.h"45 #endif46 43 47 44 using namespace std; -
/sources/src/methodprocess_dependency.cc
r30 r20 34 34 */ 35 35 36 #include <cassert>36 #include "assert.h" 37 37 #include "methodprocess_dependency.h" 38 38 #include "simplify_string.h" … … 40 40 #include <iostream> 41 41 #include <fstream> 42 #ifdef HAVE_CONFIG_H43 #include "config.h"44 #endif45 42 46 43 using namespace std; … … 50 47 get_name (const method_process_t *method) 51 48 { 52 assert(method != NULL);49 ASSERT(method != NULL); 53 50 const sc_module *module = method->module; 54 assert(module != NULL);51 ASSERT(module != NULL); 55 52 const char *module_name = module->name (); 56 53 const char *function_name = method->name; … … 88 85 const SignalDependency &sd = *it; 89 86 const equi_t *source_equi = sd.source; 90 assert(source_equi != NULL);87 ASSERT(source_equi != NULL); 91 88 const method_process_t *source_method = table[source_equi]; 92 89 if (source_method == NULL) -
/sources/src/module_hierarchy.cc
r30 r20 36 36 #include "module_hierarchy.h" 37 37 #include "sc_module.h" 38 #include <cassert>38 #include "assert.h" 39 39 #include <map> 40 #ifdef HAVE_CONFIG_H41 #include "config.h"42 #endif43 40 #include <cstdlib> 44 41 #include <cstring> … … 76 73 return; //obj_list = &top_level_objects; 77 74 else { 78 assert(parent != &obj);75 ASSERT(parent != &obj); 79 76 const sc_object *pobj = (const sc_module *) parent; 80 77 obj_list = &(object2childs[pobj]); -
/sources/src/module_hierarchy2dot.cc
r30 r20 43 43 #include "sc_signal.h" 44 44 #include "entity.h" 45 #include <cassert>45 #include "assert.h" 46 46 #include "internal.h" 47 #ifdef HAVE_CONFIG_H48 #include "config.h"49 #endif50 47 51 48 using namespace std; … … 91 88 const entity &in_entity = *it; 92 89 sc_object *in_obj = in_entity.object; 93 assert(in_obj != NULL);90 ASSERT(in_obj != NULL); 94 91 const sc_module *in_parent = NULL; 95 92 switch (in_entity.type) { -
/sources/src/mouchard_scheduling.cc
r30 r20 45 45 #include "sc_module.h" 46 46 #include "sc_ver.h" 47 #ifdef HAVE_CONFIG_H48 #include "config.h"49 #endif50 47 51 48 using namespace std; -
/sources/src/port_dependency.cc
r30 r20 45 45 #include "sc_port.h" 46 46 #include "sc_ver_ext.h" 47 #ifdef HAVE_CONFIG_H48 #include "config.h"49 #endif50 47 51 48 using namespace std; … … 111 108 p.destination = &b; 112 109 aPortDependencyGraph.push_back (p); 113 #if defDUMP_PORT_DEPENDENCY110 #if DUMP_PORT_DEPENDENCY 114 111 if (a) { 115 112 cerr << "'" << ((sc_object&)b).name() -
/sources/src/process_dependency.cc
r30 r20 44 44 #include "sc_module.h" 45 45 #include "sc_ver.h" 46 #ifdef HAVE_CONFIG_H47 #include "config.h"48 #endif49 46 50 47 using namespace std; -
/sources/src/sc_bigint.h
r30 r20 22 22 // ---------------------------------------------------------------------------- 23 23 24 #include 24 #include"sc_nbdefs.h" 25 25 26 26 namespace sc_dt { -
/sources/src/sc_biguint.h
r30 r20 18 18 // ---------------------------------------------------------------------------- 19 19 20 #include 20 #include"sc_nbdefs.h" 21 21 22 22 namespace sc_dt { -
/sources/src/sc_bit.h
r30 r20 13 13 #define __SC_BIT_H__ 14 14 15 #include 16 #include 17 #include 18 #include 19 #include 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" 20 20 21 21 // ---------------------------------------------------------------------------- -
/sources/src/sc_bv.h
r30 r20 18 18 // ---------------------------------------------------------------------------- 19 19 20 #include 21 #include 22 #include 23 #include 24 #include 25 #include 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" 26 26 27 27 namespace sc_dt { -
/sources/src/sc_clock.cc
r30 r20 35 35 */ 36 36 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" 42 39 43 40 using namespace std; … … 72 69 { 73 70 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); 77 74 posedge_first = posedge_first_; 78 75 } … … 85 82 { 86 83 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); 90 87 posedge_first = posedge_first_; 91 88 } -
/sources/src/sc_clock.h
r30 r20 14 14 #define __SC_CLOCK_H__ 15 15 16 #include 16 #include"sc_clock_ext.h" 17 17 18 18 -
/sources/src/sc_event.cc
r30 r20 35 35 36 36 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" 44 41 45 42 using namespace std; -
/sources/src/sc_event.h
r30 r20 13 13 #define __SC_EVENT_H__ 14 14 15 #include "sc_fwd.h" 16 #include <iostream> 15 #include"sc_fwd.h" 17 16 #include<iostream> 18 17 -
/sources/src/sc_event_finder.cc
r30 r20 35 35 36 36 37 #include "sc_event_finder.h" 38 #ifdef HAVE_CONFIG_H 39 #include "config.h" 40 #endif 37 #include"sc_event_finder.h" 41 38 42 39 namespace sc_core { -
/sources/src/sc_event_finder.h
r30 r20 13 13 #define __SC_EVENT_FINDER_H__ 14 14 15 #include 15 #include"sc_fwd.h" 16 16 17 17 namespace sc_core { -
/sources/src/sc_int.h
r30 r20 18 18 #include <sc_logic.h> 19 19 #include <sc_bv.h> 20 #include <cstdlib>21 20 22 21 // ---------------------------------------------------------------------------- … … 29 28 // ---------------------------------------------------------------------------- 30 29 31 #include 30 #include"sc_nbdefs.h" 32 31 33 32 namespace sc_dt { … … 136 135 sc_int() { val = 0; } 137 136 // 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)); } 139 138 sc_int (unsigned short a){ val = 0; write (a); } 140 139 sc_int (short a) { val = 0; write (a); } … … 198 197 199 198 // 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; } 217 229 inline sc_int_bit_ref& operator [] (int v) 218 230 { return (vf.valW >> v) & 1; } -
/sources/src/sc_interface.cc
r30 r20 34 34 */ 35 35 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> 45 41 #include<cstdlib> //exit 46 42 … … 110 106 { 111 107 interface2infos_t::iterator i = interface2infos.find (this); 112 #ifdef CONFIG_DEBUG108 #ifdef DEBUG 113 109 if (i == interface2infos.end ()) { 114 110 cerr << "Internal error : can't find data size of " << this << "\n"; … … 123 119 { 124 120 interface2infos_t::iterator i = interface2infos.find (this); 125 #ifdef CONFIG_DEBUG121 #ifdef DEBUG 126 122 if (i == interface2infos.end ()) { 127 123 cerr << "Internal error : can't find default event of " << this << "\n"; -
/sources/src/sc_interface.h
r30 r20 13 13 #define __SC_INTERFACE_H__ 14 14 15 #include 16 #include 15 #include"sc_fwd.h" 16 #include"internal_ext.h" 17 17 18 18 namespace sc_core { -
/sources/src/sc_logic.cc
r30 r20 39 39 // ---------------------------------------------------------------------------- 40 40 41 #include "sc_logic.h" 42 #ifdef HAVE_CONFIG_H 43 #include "config.h" 44 #endif 41 #include"sc_logic.h" 45 42 46 43 namespace sc_dt { -
/sources/src/sc_logic.h
r30 r20 18 18 // ---------------------------------------------------------------------------- 19 19 20 #include 21 #include 20 #include"sc_nbdefs.h" 21 #include"sc_fwd.h" 22 22 23 23 namespace sc_dt { -
/sources/src/sc_lv.h
r30 r20 18 18 // ---------------------------------------------------------------------------- 19 19 20 #include 21 #include 22 #include 23 #include 24 #include 25 #include 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" 26 26 27 27 -
/sources/src/sc_main.cc
r30 r20 35 35 */ 36 36 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" 55 51 56 52 // … … 64 60 65 61 bool check_port_dependencies = false; 66 #ifdef CONFIG_DEFAULT_RUNTIME_COMPILATION67 bool dynamic_link_of_scheduling_code = true;68 #else69 62 bool dynamic_link_of_scheduling_code = false; 70 #endif71 63 bool dump_netlist_info = false; 72 64 bool dump_funclist_info = false; … … 116 108 switch (scheduling_method) { 117 109 case CASS_SCHEDULING : 118 assert(use_port_dependency == false);110 ASSERT(use_port_dependency == false); 119 111 break; 120 112 case BUCHMANN_SCHEDULING : … … 133 125 exit (33); 134 126 } 135 assert(use_port_dependency || use_sensitivity_list);127 ASSERT(use_port_dependency || use_sensitivity_list); 136 128 } 137 129 -
/sources/src/sc_module.cc
r30 r20 48 48 #include "sc_clock.h" // is_clock 49 49 #include "entity.h" 50 #include <cassert> 51 #ifdef HAVE_CONFIG_H 52 #include "config.h" 53 #endif 50 #include "assert.h" 54 51 55 52 // … … 163 160 sensitivity_list_t::iterator i; 164 161 for (i = sensitivity_list.begin (); i != sensitivity_list.end (); ++i) { 165 #if defined( CONFIG_DEBUG) && 0162 #if defined(_DEBUG) 166 163 if (i->get_interface() == NULL) 167 164 { … … 241 238 sensitive (this) 242 239 { 243 assert(nm != NULL);240 ASSERT(nm != NULL); 244 241 #if 0 245 242 cerr << "sc_module constructor with const char * parameter\n"; … … 501 498 if (m_pushed == false) 502 499 return; 503 assert(sc_core::module_name_stack.empty () == false);500 ASSERT(sc_core::module_name_stack.empty () == false); 504 501 sc_core::module_name_stack.pop_back (); 505 502 modules_stack.pop (); … … 507 504 cout << "~sc_module_name <- " << m_name << endl; 508 505 #endif 509 assert(temp_list.empty () == false);506 ASSERT(temp_list.empty () == false); 510 507 sc_module *last1 = temp_list.back(); 511 508 temp_list.pop_back(); … … 529 526 if (m.dont_initialize == false) 530 527 { 531 assert(m.module != NULL);532 #if def CONFIG_DEBUG528 ASSERT(m.module != NULL); 529 #if DEBUG 533 530 std::cerr << "Warning : SystemCASS doesn't perform SC_METHOD(S) initializations.\n" 534 531 << "Please turn off automatic initialization for '" << m.name -
/sources/src/sc_module.h
r30 r20 16 16 #include "sc_module_ext.h" 17 17 18 #include 19 #include 20 #include 21 #include 22 #include 23 #include 24 #include 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" 25 25 26 26 namespace sc_core { -
/sources/src/sc_module_ext.h
r30 r20 38 38 #define __SC_MODULE_EXT_H__ 39 39 40 #include 41 #include 42 #include 43 #include 44 #include 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" 45 45 46 46 namespace sc_core { -
/sources/src/sc_module_name.h
r30 r20 14 14 #define __SC_MODULE_NAME_H__ 15 15 16 #include 16 #include"sc_fwd.h" 17 17 18 18 namespace sc_core { -
/sources/src/sc_numrep.cc
r30 r20 36 36 #include <string> 37 37 #include "sc_numrep.h" 38 #ifdef HAVE_CONFIG_H39 #include "config.h"40 #endif41 38 42 39 namespace sc_dt { -
/sources/src/sc_object.cc
r30 r20 40 40 #include <map> 41 41 42 #include <cassert>42 #include "assert.h" 43 43 #include "sc_object.h" 44 44 //#include "sc_port.h" … … 46 46 #include "sc_signal.h" 47 47 #include "module_hierarchy.h" 48 #ifdef HAVE_CONFIG_H49 #include "config.h"50 #endif51 48 52 49 using namespace std; … … 74 71 // out += "."; 75 72 } 76 // assert(name != NULL);73 // ASSERT(name != NULL); 77 74 if (name) 78 75 out += name; … … 206 203 { 207 204 object2name_t::iterator i = object2fullname.find (this); 208 #ifdef CONFIG_DEBUG205 #ifdef DEBUG 209 206 if (i == object2fullname.end ()) { 210 207 cerr << "Internal error : can't find name of " << this << "\n"; … … 220 217 /* 221 218 object2name_t::iterator i = object2fullname.find (this); 222 #ifdef CONFIG_DEBUG219 #ifdef DEBUG 223 220 if (i == object2fullname.end ()) { 224 221 cerr << "Internal error : can't find name of " << this << "\n"; … … 238 235 string out; 239 236 sc_object* obj = *it; 240 assert(obj != NULL);237 ASSERT(obj != NULL); 241 238 build_full_name (out, *obj); 242 239 } … … 246 243 { 247 244 object2infos_t::iterator i = object2infos.find (this); 248 #ifdef CONFIG_DEBUG245 #ifdef DEBUG 249 246 if (i == object2infos.end ()) { 250 247 cerr << "Internal error : can't find kind of " << this << "\n"; -
/sources/src/sc_pat_trace.cc
r30 r20 36 36 37 37 38 #include 39 #include 40 #include 41 #include 38 #include"sc_trace.h" 39 #include"sc_pat_trace.h" 40 #include"sc_ver.h" 41 #include"internal.h" // notrace 42 42 43 #include <ctime> 44 #ifdef HAVE_CONFIG_H 45 #include "config.h" 46 #endif 43 #include<ctime> 47 44 48 #ifdef CONFIG_PAT_TRACE_FORMAT45 #ifdef PAT_TRACE_FORMAT 49 46 50 47 //----------------------------------------- -
/sources/src/sc_port.cc
r30 r20 36 36 37 37 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" 51 47 52 48 extern "C" { … … 58 54 using namespace std; 59 55 60 #ifdef C ONFIG_CHECK_FSM_RULES61 #include 56 #ifdef CHECK_FSM_RULES 57 #include"fsm_rules.h" 62 58 namespace sc_core { 63 59 casc_fsm_step_t casc_fsm_step = ELABORATION; … … 112 108 sc_port_base::init () 113 109 { 114 #ifdef CONFIG_DEBUG110 #ifdef DEBUG 115 111 if (modules_stack.empty ()) { 116 112 cerr << "Internal error : modules stack empty\n"; … … 237 233 #endif 238 234 #define iter (sc_core::pending_write_vector[i]) 239 #ifdef CONFIG_DEBUG235 #ifdef DEBUG 240 236 if (iter.pointer == NULL) { 241 237 cerr << "Internal error : trying to apply a posted write from an unassigned signal/port\n"; … … 259 255 cerr << "done.\n"; 260 256 #endif 261 #if defined(C ONFIG_CHECK_MULTIWRITING2REGISTER)257 #if defined(CHECK_MULTIWRITING2REGISTER) 262 258 sc_core::pending_writing2register_clear (); 263 259 #endif … … 314 310 { 315 311 const tab_t *pointer = port.get_pointer (); 316 // assert(pointer != NULL);312 //ASSERT(pointer != NULL); 317 313 if (pointer == NULL) 318 314 return false; // case : sc_in not bound … … 347 343 { 348 344 /*const*/ sc_port_base *port = i->first; 349 assert(port != NULL);345 ASSERT(port != NULL); 350 346 check_port (*port); 351 347 } … … 354 350 } 355 351 356 #if defined(C ONFIG_CHECK_MULTIWRITING2REGISTER)352 #if defined(CHECK_MULTIWRITING2REGISTER) 357 353 typedef set<const tab_t*> pending_writing2register_set_t; 358 354 pending_writing2register_set_t pending_writing2register_set; -
/sources/src/sc_port.h
r30 r20 14 14 #define __SC_PORT_H__ 15 15 16 #include 17 #include 18 //#include 16 #include"sc_port_ext.h" 17 #include"sc_fwd.h" 18 //#include"internal_ext.h" 19 19 20 20 #include <list> -
/sources/src/sc_port_ext.h
r30 r20 15 15 16 16 // Define registers writing method 17 #include 18 #include 19 #include 20 #include 21 //#include 22 #include 23 #include 24 #include 25 #include 26 #include 27 #include 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" 28 28 29 29 … … 54 54 ///////////////////// DEPRECATED 55 55 // C ANSI-only since it is needed to link with extern "C" 56 // this declaration is not in casc.h since the C ONFIG_CHECK_FSM_RULES macro56 // this declaration is not in casc.h since the CHECK_FSM_RULES macro 57 57 // is not defined. 58 58 … … 184 184 << " on signal " << name () << "\n"; 185 185 #endif 186 #ifdef C ONFIG_CHECK_FSM_RULES186 #ifdef CHECK_FSM_RULES 187 187 if (casc_fsm_step == GEN_MOORE) { 188 188 std::cerr << "FSM rules error : trying to read on input port '" … … 294 294 << " on signal " << name () << "\n"; 295 295 #endif 296 #ifdef C ONFIG_CHECK_FSM_RULES296 #ifdef CHECK_FSM_RULES 297 297 if (casc_fsm_step == GEN_MOORE) { 298 298 std::cerr << "FSM rules error : trying to read on input/output port " … … 316 316 << " on in/out port (writing into a signal) '" << name () << "'\n"; 317 317 #endif 318 #ifdef C ONFIG_CHECK_FSM_RULES318 #ifdef CHECK_FSM_RULES 319 319 if ((casc_fsm_step != GEN_MOORE) && ( casc_fsm_step != GEN_MEALY)) { 320 320 std::cerr << "FSM rules error : trying to write on output port " … … 325 325 #endif 326 326 // T& ref = *(T*)(get_pointer()); 327 #if defined(C ONFIG_CHECK_MULTIWRITING2PORT)327 #if defined(CHECK_MULTIWRITING2PORT) 328 328 check_multiwriting2port (); 329 329 #endif -
/sources/src/sc_sensitive.cc
r30 r20 35 35 36 36 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" 46 43 47 44 using namespace std; -
/sources/src/sc_sensitive.h
r30 r20 13 13 #define __SC_SENSITIVE_H__ 14 14 15 #include 16 #include 17 //#include 18 //#include 19 //#include 15 #include<list> 16 #include"sc_fwd.h" 17 //#include"sc_event.h" 18 //#include"sc_interface.h" 19 //#include"internal_ext.h" 20 20 21 21 namespace sc_core { -
/sources/src/sc_signal.h
r30 r20 15 15 16 16 // 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" 29 27 #include "fsm_rules.h" 30 #endif31 28 32 29 namespace sc_core { … … 45 42 ///////////////////// DEPRECATED 46 43 // C ANSI-only since it is needed to link with extern "C" 47 // this declaration is not in casc.h since the C ONFIG_CHECK_FSM_RULES macro44 // this declaration is not in casc.h since the CHECK_FSM_RULES macro 48 45 // is not defined. 49 46 … … 82 79 size_t size = (sizeof (T)-1) / sizeof (base_type); 83 80 size_t i = 0; 84 const base_type *pvalue = (const base_type*)( void*)(&value_);81 const base_type *pvalue = (const base_type*)(&value_); 85 82 do { 86 83 #if 0 … … 94 91 const T value_) 95 92 { 96 93 if (sizeof (T) > sizeof (base_type)) { 97 94 #if 0 98 std::cout << "sizeof (T) = " << sizeof (T)99 << " (base_type = " << sizeof(base_type) << "\n";100 #endif 101 102 103 #if defined( CONFIG_DEBUG)104 105 106 107 108 109 110 111 #endif // CONFIG_DEBUG112 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_; 113 110 // pending_write_vector[pending_write_vector_nb++].value = *(reinterpret_cast<const base_type*const>(&value_)); => bug ! 114 111 pending_write_vector[pending_write_vector_nb++].value = value_; // => bug avec blues ! 115 112 116 113 // -> fix to use user-defined struct in sc_signal/sc_in/sc_out/sc_inout … … 124 121 return; 125 122 #endif 126 123 }; 127 124 } 128 125 129 126 inline bool is_posted_write () 130 127 { 131 128 return pending_write_vector_nb > 0; 132 129 } 133 130 … … 142 139 class sc_signal_base : public sc_object, public sc_interface 143 140 { 144 145 141 ////// 142 // Internal 146 143 friend class sc_clock; 147 144 friend class sc_port_base; 148 145 void init (); 149 146 ////// 150 147 151 148 … … 161 158 sc_signal_base(const char* name_); 162 159 sc_signal_base(const char* name_, void*); 163 160 ~sc_signal_base(); 164 161 }; 165 162 … … 168 165 { 169 166 private: 170 171 typedef T 167 T val; 168 typedef T data_type; 172 169 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 (); 180 175 void check_writer (); 181 176 public: 182 177 // constructors, destructor 183 178 sc_signal () 184 179 { init (); } 185 180 explicit sc_signal (const char *name_): sc_signal_base(name_) 186 181 { init (); } 187 182 /*virtual */~ sc_signal () 188 183 {} … … 232 227 sc_signal<T>::init() 233 228 { 234 set_pointer ((tab_t*)(void*)&val);229 set_pointer ((tab_t*)&val); 235 230 set_kind (kind_string); 236 231 sc_interface::init (sizeof (data_type)); 237 232 val = 0; /* The simulator initializes the signal/register to 0. */ 238 233 /* However, hardware initialization still has to be done. */ … … 250 245 << " on signal " << name () << "\n"; 251 246 #endif 252 #ifdef C ONFIG_CHECK_FSM_RULES247 #ifdef CHECK_FSM_RULES 253 248 // we can read value from sc_signal type (used like a register) at any time 254 249 #endif … … 262 257 sc_signal<T>::write( const data_type& value_ ) 263 258 { 264 #ifdef C ONFIG_CHECK_FSM_RULES259 #ifdef CHECK_FSM_RULES 265 260 if ((casc_fsm_step != TRANSITION) 266 261 && ( casc_fsm_step != STIMULI)) { … … 271 266 } 272 267 #endif 273 #ifdef CONFIG_DEBUG268 #ifdef DEBUG 274 269 if (get_pointer() == NULL) 275 270 { … … 278 273 } 279 274 #endif 280 #ifdef C ONFIG_CHECK_MULTIWRITING2REGISTER275 #ifdef CHECK_MULTIWRITING2REGISTER 281 276 pending_writing2register_record_and_check (get_pointer ()); 282 277 #endif -
/sources/src/sc_time.cc
r30 r20 35 35 36 36 37 #include 37 #include"sc_time.h" 38 38 #include <ctime> 39 39 #include <sys/time.h> 40 40 #include <string> 41 41 #include <sstream> 42 #ifdef HAVE_CONFIG_H43 #include "config.h"44 #endif45 42 46 43 namespace sc_core { -
/sources/src/sc_trace.cc
r30 r20 41 41 #include "bit2string.h" 42 42 #include "hex2string.h" 43 44 #include <cassert> 43 #include "assert.h" 44 45 45 #include <list> 46 46 #include <cstdio> … … 48 48 #include <cstring> //strlen 49 49 50 #ifdef HAVE_CONFIG_H51 #include "config.h"52 #endif53 54 50 //----------------------------------------- 55 51 … … 57 53 58 54 //----------------------------------------- 59 #ifdef CONFIG_PAT_TRACE_FORMAT55 #ifdef PAT_TRACE_FORMAT 60 56 61 57 extern "C" { … … 67 63 #include <cstdio> 68 64 69 #endif // CONFIG_PAT_TRACE_FORMAT65 #endif // PAT_TRACE_FORMAT 70 66 //----------------------------------------- 71 67 … … 169 165 { 170 166 sc_trace_file *tf = *ptf; 171 assert(tf != NULL);167 ASSERT(tf != NULL); 172 168 trace (*tf, part); 173 169 } … … 177 173 } 178 174 179 #if def CONFIG_PAT_TRACE_FORMAT175 #if PAT_TRACE_FORMAT 180 176 static void 181 177 pat_set_value (char *buf, const signal2trace &s) … … 287 283 { 288 284 } 289 #endif // CONFIG_PAT_TRACE_FORMAT285 #endif // PAT_TRACE_FORMAT 290 286 291 287 static … … 418 414 else 419 415 vcd_signal_table = (tab_t*) malloc (sizeof (tab_t) * size); 420 #if def CONFIG_DEBUG416 #if DEBUG 421 417 if (vcd_signal_table == NULL) 422 418 { … … 490 486 vcd_trace_init (tf); 491 487 } else { 492 #if defined( CONFIG_DEBUG)488 #if defined(DEBUG) 493 489 if (vcd_signal_table == NULL) 494 490 { … … 584 580 &name) 585 581 { 586 #ifdef CONFIG_PAT_TRACE_FORMAT582 #ifdef PAT_TRACE_FORMAT 587 583 //exemple: 588 584 //DECLAR ("a", ":2", "X", IN, "3 downto 0", "" ); … … 634 630 #endif 635 631 DECLAR ((char*)(name.c_str ()), ":1", format, dir,(char *) downto.c_str(), "" ); 636 #endif // CONFIG_PAT_TRACE_FORMAT632 #endif // PAT_TRACE_FORMAT 637 633 } 638 634 -
/sources/src/sc_uint.h
r30 r20 25 25 // ---------------------------------------------------------------------------- 26 26 27 #include 27 #include"sc_nbdefs.h" 28 28 29 29 namespace sc_dt { … … 183 183 184 184 // 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; } 213 215 inline sc_uint_bit_ref operator [] (int v) 214 216 { return (vf.valW >> v) & 1; } -
/sources/src/sc_uint_subref_r.cc
r30 r20 36 36 #include <iostream> 37 37 #include "sc_uint.h" 38 #ifdef HAVE_CONFIG_H39 #include "config.h"40 #endif41 38 42 39 using namespace std; -
/sources/src/sc_unsigned.h
r30 r20 18 18 // ---------------------------------------------------------------------------- 19 19 20 #include 21 #include 20 #include"sc_nbdefs.h" 21 #include"sc_logic.h" 22 22 23 23 -
/sources/src/sc_vcd_trace.cc
r30 r20 36 36 37 37 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" 42 43 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> 50 46 51 47 //-----------------------------------------*/ … … 62 58 if (notrace) 63 59 return NULL; 64 assert(name != NULL);60 ASSERT(name != NULL); 65 61 string filename; 66 62 filename = name; -
/sources/src/sc_ver.cc
r30 r20 40 40 #include <cstdlib> //exit 41 41 42 #ifdef HAVE_CONFIG_H43 #include "config.h"44 #endif45 46 42 namespace sc_core { 47 43 … … 65 61 "\n" 66 62 " Cycle Accurate System Simulator\n" 67 #ifdef CONFIG_DEBUG63 #ifdef DEBUG 68 64 " DEBUG version\n" 69 65 #endif -
/sources/src/schedulers.cc
r30 r20 35 35 */ 36 36 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" 54 49 55 50 using namespace std; … … 100 95 const method_process_t *a2) 101 96 { 102 assert(a1 != NULL);103 assert(a2 != NULL);97 ASSERT(a1 != NULL); 98 ASSERT(a2 != NULL); 104 99 sc_module *m1 = a1->module; 105 100 sc_module *m2 = a2->module; … … 119 114 addr1.func = a1->func; 120 115 addr2.func = a2->func; 121 assert(addr1.addr_ll != addr2.addr_ll);116 ASSERT(addr1.addr_ll != addr2.addr_ll); 122 117 if ( sizeof(SC_ENTRY_FUNC) == 4 ) { 123 118 return (addr1.addr_l < addr2.addr_l); … … 135 130 const method_process_t *a2) 136 131 { 137 assert(a1 != NULL);138 assert(a2 != NULL);132 ASSERT(a1 != NULL); 133 ASSERT(a2 != NULL); 139 134 return (a1->module < a2->module); 140 135 } … … 145 140 const method_process_t *a2) 146 141 { 147 assert(a1 != NULL);148 assert(a2 != NULL);142 ASSERT(a1 != NULL); 143 ASSERT(a2 != NULL); 149 144 union { 150 145 SC_ENTRY_FUNC func; … … 242 237 { 243 238 SignalDependencyGraph *sig_graph = MakeAcyclicSignalDependencyGraph (); 244 assert(sig_graph != NULL);239 ASSERT(sig_graph != NULL); 245 240 // Create the process evaluation list 246 241 ProcessDependencyList* process_list = MakeMouchardScheduling (*sig_graph); 247 assert(process_list != NULL);242 ASSERT(process_list != NULL); 248 243 249 244 if (dump_all_graph) … … 289 284 // Uses port dependancies like Dr. Mouchard. 290 285 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); 295 288 break; 296 289 } … … 302 295 // and does not use an event-driven scheduler. 303 296 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); 308 299 break; 309 300 } … … 316 307 graph2dot("module_graph", *g); 317 308 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); 322 311 break; 323 312 } -
/sources/src/schedulers.h
r30 r20 13 13 #define __SCHEDULERS_H__ 14 14 15 #include 16 #include 15 #include"sc_fwd.h" 16 #include"sc_time.h" 17 17 18 18 namespace sc_core { -
/sources/src/serialization.cc
r30 r20 35 35 36 36 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 43 40 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" 52 48 53 49 using namespace std; … … 88 84 int bit_number) 89 85 { 90 assert(bit_number <= 64);86 ASSERT(bit_number <= 64); 91 87 if (bit_number == 1) { 92 88 bool v = *((const bool*) val); … … 144 140 save_fct_t1 fct) 145 141 { 146 // assert(fct != NULL);142 //ASSERT(fct != NULL); 147 143 //sc_module2save_fct_t1::value_type pair(&mod,fct); 148 144 //save_handler_table.insert (pair); … … 162 158 const sc_module *mod = it->first; 163 159 save_fct_t1 fct = it->second; 164 assert(mod != NULL);165 // assert(fct != NULL);160 ASSERT(mod != NULL); 161 // ASSERT(fct != NULL); 166 162 //o << mod->name () << endl; 167 163 fprintf (o,"module\n%s\n",mod->name ()); … … 189 185 file.close (); 190 186 FILE *f = fopen (filename, "a+"); 191 assert(f != NULL);187 ASSERT(f != NULL); 192 188 save_modules (f); 193 189 fclose (f); -
/sources/src/serialization.h
r30 r20 13 13 #define __SERIALIZATION_H__ 14 14 15 #include 16 #include 15 #include"serialization_ext.h" 16 #include"sc_fwd.h" 17 17 18 18 namespace sc_core { -
/sources/src/serialization_ext.h
r30 r20 37 37 #define __SERIALIZATION_EXT_H__ 38 38 39 #include 40 #include 39 #include<iostream> 40 #include"sc_fwd.h" 41 41 42 42 namespace sc_core { -
/sources/src/signal_dependency.cc
r30 r20 43 43 #include "sc_module.h" 44 44 #include "sc_ver_ext.h" 45 #ifdef HAVE_CONFIG_H46 #include "config.h"47 #endif48 45 49 46 using namespace std; -
/sources/src/simplify_string.cc
r30 r20 35 35 36 36 #include "simplify_string.h" 37 #ifdef HAVE_CONFIG_H38 #include "config.h"39 #endif40 37 41 38 using namespace std; -
/sources/src/systemc
r30 r20 29 29 #include"sc_vcd_trace.h" 30 30 #include"sc_pat_trace.h" 31 #include"endianness.h" 31 32 32 33 #endif -
/sources/test_regression/02052006/system.cpp
r30 r20 13 13 14 14 struct test : sc_module { 15 int 32_treg;15 int reg; 16 16 sc_signal<bool> reg_bool; 17 17 sc_signal<int> reg_int; … … 38 38 ASSERT(((unsigned int)reg) == reg_unsigned_int .read()); 39 39 ASSERT(((char) reg) == reg_char .read()); 40 #if 041 cout << (double)reg << " " << reg_double.read() << endl;42 cout << sizeof (double) << " " << sizeof (reg_double.read()) << endl;43 #endif44 40 ASSERT(((double)reg) == reg_double.read()); 45 41 ASSERT(((long) reg) == reg_long .read()); … … 52 48 ASSERT(((signed int) reg & 0xFFFFFFFF) == (signed int) (reg_i32 .read())); 53 49 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())); 55 51 reg = reg + 1; 56 52 reg_bool = reg & 1; … … 58 54 reg_unsigned_int = reg; 59 55 reg_char = reg; 60 reg_double .write(reg);56 reg_double = reg; 61 57 reg_long = reg; 62 58 reg_ui32 = reg; … … 84 80 85 81 SC_HAS_PROCESS(test); 86 82 test (sc_module_name n) : sc_module (n), 87 83 clk("clk") 88 84 { 89 90 85 SC_METHOD(trans); 86 sensitive << clk.pos(); 91 87 dont_initialize(); 92 88 }; 93 89 }; 94 90 95 91 int sc_main (int argc, char *argv[]) 96 92 { 97 93 sc_clock signal_clk("my_clock",1, 0.5); 98 94 sc_signal<bool> resetn("resetn"); 99 95 … … 102 98 test1.resetn (resetn); 103 99 104 105 100 // Init & run 101 sc_start (0); 106 102 107 103 resetn = false; 108 104 sc_start (4); 109 105 resetn = true; 110 106 sc_start (100); 111 107 112 108 return EXIT_SUCCESS; 113 109 } 114 110 -
/sources/test_regression/15042009/Makefile
r30 r20 1 1 include ../env.mk 2 2 3 SYSTEM = system.cpp system2.cpp system3.cpp3 SYSTEM = system.cpp 4 4 EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x) 5 5 EXE_SC = $(SYSTEM:.cpp=_systemc.x) … … 19 19 done 20 20 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} ; \23 21 # 24 22 -
/sources/test_regression/19042005/system.cpp
r30 r20 128 128 sc_trace(system_trace_file, signal_clk, "clk"); 129 129 130 bool 131 uint64_tl1 = 0;130 bool b1 = 0; 131 long l1 = 0; 132 132 133 133 #if 0 -
/sources/test_regression/19042005/system_systemcass.x-60_reference.vcd
r30 r20 7 7 $var wire 1 aaa clk $end 8 8 $var wire 1 aab b1 $end 9 $var wire 64 aac l1 [63:0] $end9 $var wire 32 aac l1 [31:0] $end 10 10 $var wire 1 aad test1.i1 $end 11 11 $var wire 8 aae test1.i2 [7:0] $end -
/sources/test_regression/28102005/system.cpp
r30 r20 27 27 check_time (int i) 28 28 { 29 29 const sc_time &t = sc_time_stamp (); 30 30 CERR(i); 31 31 CERR(t.to_double()); 32 #ifdef SYSTEMCASS_SPECIFIC33 ASSERT((int) (t.to_double ()) == i);34 #else35 32 ASSERT((int) (t.to_double ()) == i * 1000); 36 #endif37 33 CERR(t.to_seconds ()); 38 34 double seconds = t.to_seconds()*1000000000; … … 41 37 char s[256]; 42 38 const char *unit; 43 #ifdef SYSTEMCASS_SPECIFIC44 unit = "NS";45 #else46 39 if (i == 0) 47 40 unit = "s"; … … 50 43 else 51 44 unit = "ns"; 52 #endif53 45 sprintf (s, "%d %s", i,unit); 54 46 CERR(s); … … 63 55 64 56 check_time (0); 65 57 sc_start (0); 66 58 67 59 check_time (0); 68 60 sc_start (1); 69 61 check_time (1); 70 62 71 63 sc_start (15); 72 64 check_time (16); 73 65 74 66 sc_start (7); 75 67 check_time (23); 76 68 77 69 sc_start (100); 78 70 check_time (123); 79 71 80 72 sc_start (1000); 81 73 check_time (1123); 82 74 cerr << "Test OK.\n"; -
/sources/test_regression/env.mk
r30 r20 22 22 SYSTEMCASS_INC = $(SYSTEMCASS)/include 23 23 SYSTEMC_LIB = $(SYSTEMC)/lib-${TARGET_PLATFORM}-${TARGET_ARCH}/libsystemc.a 24 SYSTEMCASS_LIB = $(SYSTEMCASS)/lib -linux/libsystemc.a24 SYSTEMCASS_LIB = $(SYSTEMCASS)/lib/libsystemc_$(firstword $(CXX))-d.a 25 25 #CXX = g++ 26 26 #CXX = icc -w1
Note: See TracChangeset
for help on using the changeset viewer.