Changeset 41
- Timestamp:
- Aug 24, 2009, 1:11:00 PM (16 years ago)
- Location:
- sources
- Files:
-
- 3 added
- 5 edited
-
INSTALL (modified) (8 diffs)
-
configure.ac (modified) (6 diffs)
-
src/Makefile.am (modified) (1 diff)
-
src/gen_code.cc (modified) (24 diffs)
-
test_regression/24082009 (added)
-
test_regression/24082009/Makefile (added)
-
test_regression/24082009/system.cpp (added)
-
test_regression/env.mk (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sources/INSTALL
r27 r41 2 2 ************************* 3 3 4 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free5 Software Foundation, Inc.4 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 5 2006, 2007 Free Software Foundation, Inc. 6 6 7 7 This file is free documentation; the Free Software Foundation gives … … 11 11 ================== 12 12 13 These are generic installation instructions. 13 Briefly, the shell commands `./configure; make; make install' should 14 configure, build, and install this package. The following 15 more-detailed instructions are generic; see the `README' file for 16 instructions specific to this package. 14 17 15 18 The `configure' shell script attempts to guess correct values for … … 24 27 It can also use an optional file (typically called `config.cache' 25 28 and enabled with `--cache-file=config.cache' or simply `-C') that saves 26 the results of its tests to speed up reconfiguring. (Caching is29 the results of its tests to speed up reconfiguring. Caching is 27 30 disabled by default to prevent problems with accidental use of stale 28 cache files. )31 cache files. 29 32 30 33 If you need to do unusual things to compile the package, please try … … 36 39 37 40 The file `configure.ac' (or `configure.in') is used to create 38 `configure' by a program called `autoconf'. You only need39 `configure.ac' if you want to change it or regenerate `configure' using 40 a newer versionof `autoconf'.41 `configure' by a program called `autoconf'. You need `configure.ac' if 42 you want to change it or regenerate `configure' using a newer version 43 of `autoconf'. 41 44 42 45 The simplest way to compile this package is: 43 46 44 47 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. 48 `./configure' to configure the package for your system. 49 50 Running `configure' might take a while. While running, it prints 51 some messages telling which features it is checking for. 52 52 53 53 2. Type `make' to compile the package. … … 68 68 with the distribution. 69 69 70 6. Often, you can also type `make uninstall' to remove the installed 71 files again. 72 70 73 Compilers and Options 71 74 ===================== … … 79 82 is an example: 80 83 81 ./configure CC=c 89 CFLAGS=-O2LIBS=-lposix84 ./configure CC=c99 CFLAGS=-g LIBS=-lposix 82 85 83 86 *Note Defining Variables::, for more details. … … 88 91 You can compile the package for more than one kind of computer at the 89 92 same time, by placing the object files for each architecture in their 90 own directory. To do this, you must use a version of `make' that 91 supports the `VPATH' variable, such as GNU `make'. `cd' to the 93 own directory. To do this, you can use GNU `make'. `cd' to the 92 94 directory where you want the object files and executables to go and run 93 95 the `configure' script. `configure' automatically checks for the 94 96 source code in the directory that `configure' is in and in `..'. 95 97 96 If you have to use a `make' that does not support the `VPATH' 97 variable, you have to compile the package for one architecture at a 98 time in the source code directory. After you have installed the 99 package for one architecture, use `make distclean' before reconfiguring 100 for another architecture. 98 With a non-GNU `make', it is safer to compile the package for one 99 architecture at a time in the source code directory. After you have 100 installed the package for one architecture, use `make distclean' before 101 reconfiguring for another architecture. 101 102 102 103 Installation Names … … 191 192 192 193 causes the specified `gcc' to be used as the C compiler (unless it is 193 overridden in the site shell script). Here is a another example:194 195 /bin/bash ./configure CONFIG_SHELL=/bin/bash 196 197 Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent 198 configuration-related scripts to be executed by `/bin/bash'. 194 overridden in the site shell script). 195 196 Unfortunately, this technique does not work for `CONFIG_SHELL' due to 197 an Autoconf bug. Until the bug is fixed you can use this workaround: 198 199 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash 199 200 200 201 `configure' Invocation -
sources/configure.ac
r39 r41 2 2 # Process this file with autoconf to produce a configure script. 3 3 4 AC_PREREQ(2.6 0)5 AC_INIT( SystemCASS, 1.0.0)4 AC_PREREQ(2.63) 5 AC_INIT([SystemCASS],[1.0.0]) 6 6 AC_CANONICAL_TARGET 7 7 … … 18 18 AC_PROG_MAKE_SET 19 19 AC_PROG_LIBTOOL 20 21 AC_CHECK_PROG(has_latex, latex, yes) 22 AC_CHECK_PROG(has_bibtex, bibtex, yes) 23 AC_CHECK_PROG(has_fig2dev, fig2dev, yes) 24 AC_CHECK_PROG(has_ps2pdf, ps2pdf, yes) 25 AC_CHECK_PROG(has_dvips, dvips, yes) 26 20 27 21 28 # User choices … … 39 46 # Also set -DNDEBUG when not debugging, this disables assert()s 40 47 AS_IF([test "x$do_debug" = "xyes"], [CXXFLAGS="-g" ], 41 [test "x$do_debug" != "xyes"], [CXXFLAGS="-O2 - NDEBUG"])48 [test "x$do_debug" != "xyes"], [CXXFLAGS="-O2 -DNDEBUG"]) 42 49 43 50 case $target_os in … … 63 70 # Checks for libraries. 64 71 AS_IF([test "x$with_pat" != "xno"], 65 saved_CFLAGS="$CFLAGS" 66 saved_LIBS="$LIBS" 67 LIBS="$LIBS -L$with_pat/lib" 68 CFLAGS="$CFLAGS -I$with_pat/include" 72 ALLIANCE_CFLAGS="-I$with_pat/include" 69 73 [AC_CHECK_HEADER([pat.h],, 70 74 [AC_MSG_ERROR([You asked for PAT trace format but no pat.h dnl … … 75 79 can be found. Try --with-pat=/search/dir/]), 76 80 [-lMut -lPpt -lPgn])] 77 ALLIANCE_CFLAGS="$CFLAGS"78 CFLAGS="$saved_CFLAGS"79 LIBS="$saved_LIBS"80 81 AC_SUBST(ALLIANCE_PATH, $withval) 81 82 AC_SUBST(ALLIANCE_CFLAGS) … … 91 92 AM_CONDITIONAL(HAS_SOCLIB, test x$with_soclib != xno) 92 93 93 AC_CHECK_PROG(has_latex, latex, yes) 94 AC_CHECK_PROG(has_bibtex, bibtex, yes) 95 AC_CHECK_PROG(has_fig2dev, fig2dev, yes) 96 AC_CHECK_PROG(has_ps2pdf, ps2pdf, yes) 97 AC_CHECK_PROG(has_dvips, dvips, yes) 94 # OpenMP 95 AC_OPENMP([C]) 98 96 99 97 AM_CONDITIONAL(BUILD_DOCS, -
sources/src/Makefile.am
r34 r41 38 38 39 39 libsystemc_la_LIBADD = libgen_code.la $(ALLIANCE_LIBS) 40 libsystemc_la_CXXFLAGS = @ALLIANCE_CFLAGS@ $(CXXFLAGS)40 libsystemc_la_CXXFLAGS = @ALLIANCE_CFLAGS@ @OPENMP_CFLAGS@ $(CXXFLAGS) 41 41 42 42 noinst_LTLIBRARIES = libgen_code.la 43 43 libgen_code_la_SOURCES = gen_code.cc 44 libgen_code_la_CXXFLAGS=-DGENERATED_MODULE_CFLAGS='"$(CXXFLAGS) -I$(prefix)/include"' 44 libgen_code_la_CXXFLAGS=-DGENERATED_MODULE_CFLAGS='"$(CXXFLAGS) -I$(prefix)/include"' @OPENMP_CFLAGS@ 45 45 46 46 include_HEADERS = alias.h casc.h data_field.h fsm_rules.h global_functions.h internal_ext.h module_hierarchy_ext.h port_dependency_ext.h sc_bigint.h sc_biguint.h sc_bit.h sc_bv.h sc_clock_ext.h sc_event.h sc_fwd.h sc_int.h sc_interface.h sc_localvar.h sc_logic.h sc_lv.h sc_module_ext.h sc_module_name.h sc_nbdefs.h sc_numrep.h sc_object.h sc_pat_trace.h sc_port_ext.h sc_sensitive.h sc_signal.h sc_signed.h sc_string.h sc_time.h sc_trace_ext.h sc_uint.h sc_unit.h sc_unsigned.h sc_vcd_trace.h sc_ver_ext.h serialization_ext.h systemc systemc.h systemcass_version_ext.h -
sources/src/gen_code.cc
r38 r41 54 54 #endif 55 55 56 #ifdef _OPENMP 57 #include <omp.h> 58 #endif 59 56 60 #ifdef CONFIG_CHECK_FSM_RULES 57 61 #include "fsm_rules.h" … … 107 111 const method_process_t &m) 108 112 { 109 SC_ENTRY_FUNC func = m.func;113 SC_ENTRY_FUNC func = m.func; 110 114 if (print_schedule) 111 115 o << " fprintf(stderr,\"evaluation de " 112 << m.module->name() << "->" << m.name << "()\\n\");\n";116 << m.module->name() << "->" << m.name << "()\\n\");\n"; 113 117 o << " p.integer = " << func << ";\n"; 114 118 #ifdef CPP_CALL 115 119 o << " (((sc_module*)(" << m.module << "))->*(p.pmf)) (); /* " 116 << m.module->name () << "->" << m.name << "() */\n";120 << m.module->name () << "->" << m.name << "() */\n"; 117 121 #else 118 122 o << " p.pf((void *)" 119 << m.module << "); /* "120 << m.module->name () << "->" << m.name << "() */\n";123 << m.module << "); /* " 124 << m.module->name () << "->" << m.name << "() */\n"; 121 125 #endif 122 126 } … … 145 149 void 146 150 open_temp (ofstream &o, 147 char *temp)151 char *temp) 148 152 { 149 153 /* 150 srand (time (NULL));151 int r = rand () % 1000;154 srand (time (NULL)); 155 int r = rand () % 1000; 152 156 */ 153 157 pid_t pid = getpid(); 154 158 int r = -1; 155 do {156 sprintf (temp, "%s/scheduling-%d-%x.cc", temporary_dir, pid, ++r);159 do { 160 sprintf (temp, "%s/scheduling-%d-%x.cc", temporary_dir, pid, ++r); 157 161 } while (is_exist (temp)); 158 162 159 163 o.open (temp,ios::out); 160 if (o.is_open () == false)164 if (o.is_open () == false) 161 165 { 162 cerr << "Error : Unable to open a file to write scheduling code.\n";166 cerr << "Error : Unable to open a file to write scheduling code.\n"; 163 167 exit (30032005); 164 168 } … … 176 180 method_process_list_t &transition_func_list) 177 181 { 178 // transitions182 // transitions 179 183 o << "\ninline void transition(void)\n{\n"; 180 184 if (transition_func_list.empty () == false) { 181 185 o << " /* fonctions de transition */\n" 182 << " register fct p;\n";183 method_process_list_t::iterator mm;186 << " register fct p;\n"; 187 method_process_list_t::iterator mm; 184 188 for( mm = transition_func_list.begin(); mm != transition_func_list.end(); ++mm) 185 189 { 186 190 PrintCall (o, **mm); 187 191 } 188 }192 } 189 193 o << "}\n"; 190 194 } … … 195 199 method_process_list_t &moore_func_list) 196 200 { 197 // Moore generations (sequential functions)201 // Moore generations (sequential functions) 198 202 o << "\ninline void moore_generation (void)\n{\n"; 199 if (moore_func_list.empty () == false) {200 o << " /* fonctions de generation de Moore */\n"201 << " register fct p;\n";202 method_process_list_t::reverse_iterator mm;203 if (moore_func_list.empty () == false) { 204 o << " /* fonctions de generation de Moore */\n" 205 << " register fct p;\n"; 206 method_process_list_t::reverse_iterator mm; 203 207 for( mm = moore_func_list.rbegin(); mm != moore_func_list.rend(); ++mm) 204 208 { … … 214 218 strong_component_list_t &strongcomponents) 215 219 { 216 // Mealy generations (combinational functions only)220 // Mealy generations (combinational functions only) 217 221 o << "\nextern void mealy_generation (void)\n{\n"; 218 if (strongcomponents.empty ())222 if (strongcomponents.empty ()) 219 223 return NULL; 220 o << " register fct p;\n"221 << "\n\n /* fonctions de mealy */\n";224 o << " register fct p;\n" 225 << "\n\n /* fonctions de mealy */\n"; 222 226 #ifdef NO_STATIC_SCHEDULE 223 227 o << "\n do {\n unstable = 0;\n"; … … 227 231 if ( (*ss)->size() == 1) { 228 232 /* un seul element dans le strong component */ 229 method_process_t *m = (method_process_t*)(*((*ss)->begin ()));233 method_process_t *m = (method_process_t*)(*((*ss)->begin ())); 230 234 PrintCall (o, *m); 231 235 continue; … … 237 241 component_list_t::reverse_iterator rev_mm; 238 242 for( rev_mm = (*ss)->rbegin(); rev_mm != (*ss)->rend(); ++rev_mm) { 239 method_process_t *m = (method_process_t*) *rev_mm;243 method_process_t *m = (method_process_t*) *rev_mm; 240 244 PrintCall (o, *m); 241 245 } … … 257 261 ProcessDependencyList &mealy_func_list) 258 262 { 259 // Mealy generations (combinational functions only)263 // Mealy generations (combinational functions only) 260 264 o << "\nextern void mealy_generation (void)\n{\n"; 261 265 o << " register fct p;\n" … … 301 305 << pmf_type 302 306 << " integer; SC_ENTRY_FUNC pmf; CASC_ENTRY_FUNC pf; } fct;\n"; 303 304 gen_transition (o, transition_func_list); 305 gen_moore (o, moore_func_list); 307 308 gen_transition (o, transition_func_list); 309 gen_moore (o, moore_func_list); 306 310 gen_mealy (o, strongcomponents); 307 311 … … 310 314 311 315 o.flush (); 312 o.close ();313 314 // add "cc" extension316 o.close (); 317 318 // add "cc" extension 315 319 char file_name[PATH_MAX]; 316 320 strncpy(file_name, base_name, PATH_MAX); … … 337 341 cerr << "Generating C code for scheduling...\n"; 338 342 339 // open temporary file340 ofstream o;343 // open temporary file 344 ofstream o; 341 345 char base_name[PATH_MAX]; 342 open_temp (o, base_name);346 open_temp (o, base_name); 343 347 344 if (! o.good ()) {348 if (! o.good ()) { 345 349 perror("scheduling: open file\n"); 346 350 exit(-1); … … 348 352 349 353 o << "// generated by " << sc_version () << endl 350 << "#include <casc.h>\n\n"351 << "#include <cstdio>\n\n"352 // << "#include <iostream>\n\n"353 << "namespace sc_core {\n"354 << "#include <casc.h>\n\n" 355 << "#include <cstdio>\n\n" 356 // << "#include <iostream>\n\n" 357 << "namespace sc_core {\n" 354 358 << " typedef void (sc_module::*SC_ENTRY_FUNC)();\n" 355 << " typedef void (*CASC_ENTRY_FUNC)(void *);\n"359 << " typedef void (*CASC_ENTRY_FUNC)(void *);\n" 356 360 << " typedef union { unsigned long long int integer; SC_ENTRY_FUNC pmf; CASC_ENTRY_FUNC pf; } fct;\n"; 357 358 gen_transition (o, transition_func_list); 359 gen_moore (o, moore_func_list); 361 362 gen_transition (o, transition_func_list); 363 gen_moore (o, moore_func_list); 360 364 gen_mealy (o, mealy_func_list); 361 365 … … 364 368 365 369 o.flush (); 366 o.close ();367 368 // add "cc" extension370 o.close (); 371 372 // add "cc" extension 369 373 char file_name[PATH_MAX]; 370 374 strncpy(file_name, base_name, PATH_MAX); … … 395 399 const char *systemc_dir = getenv ("SYSTEMCASS"); 396 400 // const char *target_arch = getenv ("TARGET_ARCH"); 397 const char *default_compiler =401 const char *default_compiler = 398 402 #ifdef CPP_CALL 399 "g++";403 "g++"; 400 404 #else 401 "gcc";405 "gcc"; 402 406 #endif 403 407 404 408 compiler = (compiler == NULL)?default_compiler:compiler; 405 if (systemc_dir == NULL) {409 if (systemc_dir == NULL) { 406 410 systemc_dir = getenv ("SYSTEMC"); 407 411 if (systemc_dir == NULL) { 408 cerr << "Error : set SYSTEMCASS or SYSTEMC environnement variable "412 cerr << "Error : set SYSTEMCASS or SYSTEMC environnement variable " 409 413 "to the SYSTEMCASS directory.\n"; 410 exit (-1);414 exit (-1); 411 415 } 412 }416 } 413 417 //target_arch = (target_arch == NULL)?"":target_arch; 414 418 … … 439 443 const char *commandline_template = 440 444 #if defined(CONFIG_OS_DARWIN) 441 "(cd %s ;" " %s %s -DSCHEDULING_BY_CASC -I%s/include -fno-common -dynamic -o %s -c %s)"445 "(cd %s ;" " %s %s -DSCHEDULING_BY_CASC -I%s/include -fno-common -dynamic -o %s -c %s)" 442 446 #elif defined(CONFIG_OS_LINUX) 443 "(cd %s ; libtool --mode=compile %s %s -DSCHEDULING_BY_CASC -I%s/include -shared -o %s -c %s)"447 "(cd %s ; libtool --mode=compile %s %s -DSCHEDULING_BY_CASC -I%s/include -shared -o %s -c %s)" 444 448 #else 445 "(cd %s ;" " %s %s -DSCHEDULING_BY_CASC -I%s/include -dynamiclib -o %s -c %s)"446 #endif 447 ;449 "(cd %s ;" " %s %s -DSCHEDULING_BY_CASC -I%s/include -dynamiclib -o %s -c %s)" 450 #endif 451 ; 448 452 449 453 string cflags = casc_cflags; … … 452 456 453 457 sprintf(compil_str, 454 commandline_template,455 temporary_dir,456 compiler,457 cflags.c_str(),458 systemc_dir,459 target_name,460 source_name);458 commandline_template, 459 temporary_dir, 460 compiler, 461 cflags.c_str(), 462 systemc_dir, 463 target_name, 464 source_name); 461 465 462 466 if (dump_stage) … … 476 480 sprintf (source_name, "%s.lo", base_name); 477 481 sprintf(compil_str, "(cd %s ; pwd ; libtool --mode=link %s %s -module -shared -o %s %s -rpath /tmp)", /* -L. -L%s/lib-%s */ 478 temporary_dir, compiler, casc_cflags, /*systemc_dir, target_arch,*/482 temporary_dir, compiler, casc_cflags, /*systemc_dir, target_arch,*/ 479 483 target_name, source_name); 480 484 #else 481 485 sprintf (source_name, "%s.o", base_name); 482 486 sprintf(compil_str, "(cd %s ; pwd ; libtool -dynamic -o %s %s)", 483 temporary_dir, target_name, source_name);487 temporary_dir, target_name, source_name); 484 488 #endif 485 489 … … 538 542 pf.function = (fct*) malloc (sizeof (fct) * pf.func_number); 539 543 pf.instance = (void**) malloc (sizeof (void*) * pf.func_number); 540 ProcessDependencyList::iterator it;544 ProcessDependencyList::iterator it; 541 545 int i; 542 for (i = 0, it = func_list.begin(); it != func_list.end(); ++it, ++i)543 {544 const method_process_t *mp = *it;546 for (i = 0, it = func_list.begin(); it != func_list.end(); ++it, ++i) 547 { 548 const method_process_t *mp = *it; 545 549 pf.function[i].pmf = (mp->func); 546 550 pf.instance[i] = (void*)(mp->module); … … 580 584 } 581 585 586 void 587 call_functions_in_parallel (function_call &fc) 588 { 589 int n = fc.func_number; 590 int i; 591 #pragma omp parallel for 592 for (i = 0; i < n; ++i) 593 { 594 #if 0 //defined(CONFIG_DEBUG) 595 sc_module *m = (sc_module*)(fc.instance[i]); 596 cerr << m->name () << endl; 597 cerr << "thread #" << omp_get_thread_num () << endl; 598 #endif 599 fc.function[i].pf (fc.instance[i]); 600 } 601 } 602 582 603 void static_mealy_generation () 583 604 { … … 595 616 casc_fsm_step = GEN_MOORE; 596 617 #endif 597 call_functions (pf[1]); // moore generation618 call_functions_in_parallel (pf[1]); // moore generation 598 619 #ifdef CONFIG_CHECK_FSM_RULES 599 620 casc_fsm_step = GEN_MEALY; … … 621 642 (mod->*func) (); 622 643 } 644 623 645 void quasistatic_mealy_generation () 624 646 { … … 627 649 if ( (*ss)->size() == 1) { 628 650 /* un seul element dans le strong component */ 629 method_process_t *m = (method_process_t*)(*((*ss)->begin ()));651 method_process_t *m = (method_process_t*)(*((*ss)->begin ())); 630 652 Call (*m); 631 653 continue; … … 636 658 component_list_t::reverse_iterator rev_mm; 637 659 for( rev_mm = (*ss)->rbegin(); rev_mm != (*ss)->rend(); ++rev_mm) { 638 method_process_t *m = (method_process_t*) *rev_mm;660 method_process_t *m = (method_process_t*) *rev_mm; 639 661 Call (*m); 640 662 } -
sources/test_regression/env.mk
r27 r41 33 33 CFLAGS = $(PROF) $(DEBUG) $(OPT) \ 34 34 -Wall \ 35 -fopenmp \ 35 36 -UENABLE_TRACE -UENABLE_PAT -I. \ 36 37 ${ENDIANESS_FLAG} 37 38 38 LFLAGS = $(PROF) $(BFD_LIBERTY) -ldl 39 LFLAGS = $(PROF) $(BFD_LIBERTY) -ldl -fopenmp 39 40 40 41 CFLAGS_SYSTEMC = $(CFLAGS) \
Note: See TracChangeset
for help on using the changeset viewer.
