Compiling Metropolis with Cygwin

Metropolis can be use with Cygwin and SystemC-2.1. >p>At this time, we do not recommend running Metropolis models under Cygwin with SystemC-2.0.1, but Cygwin with SystemC-2.0.1 can be used to generate the code that is compiled under Microsoft Visual C.

Note that many of the SystemC-2.0.1 regression tests fail under Cygwin.

  • http://www.systemc.org/forum/forum.php?thread_id=1125&forum_id=15 - Cygwin port of SCV and TBSC
  • SystemC-2.1 Under Cygwin

    SystemC-2.1 can be built using pthreads by running make pthreads.

    Installation

    1. Obtain SystemC-2.1 from http://www.systemc.org
      In January, 2005, we downloaded SystemC_2.1_oct_12_2004.tgz which created a systemc_2_1.oct_12_2004.eta directory.
    2. Follow the instructions in the SystemC-2.1 INSTALL file.
      cd systemc_2_1.oct_12_2004.beta
      mkdir objdir
      cd objdir
      export CXX=g++
      ../configure
      make pthreads
      make install
      
    Then follow the installation instructions in $METRO/README.txt

    Tests

    Run the SystemC examples with:
    cd systemc_2_1.oct_12_2004.beta/objdir/examples
    make check
    

    SystemC Regression tests Under Cygwin

    To compile Metropolis, it is not necessary to run the SystemC regression test.

    However, you may want to run the SystemC regression test to verify your SystemC installation. Note that running the SystemC regression test may take a few hours.

    1. Download SystemC_2_1_tests.oct_12_2004.tgz from http://www.systemc.org and untar it
    2. Edit regtests-2.1beta11/scripts/verify.pl and change the Cygwin version check line to
          } elsif ($uname_s eq "CYGWIN_NT-5.1" ) {
      
    3. Set SYSTEMC_HOME to point to your systemc-2.1 directory. I did:
      export SYSTEMC_HOME=c:/cxh/src/systemc_2_1.oct_12_2004.beta
      
    4. Run a test with
      c:/cxh/src/systemc_2_1.oct_12_2004.tests/scripts/verify.pl fx
      
    5. To run all the tests, in theory
      c:/cxh/src/regtests-2.1beta11/scripts/verify.pl systemc
      
      
      will do it; but for us, that ran only one test. The problem seems to be that the cleanup Perl function is removing each test directory and then the rmdir command is failing. Thus, each time we run the above command, the number of remaining tests goes down by one.

      To skip cleaning up, run:

      c:/cxh/src/regtests-2.1beta11/scripts/verify.pl -no-cleanup -v systemc
      
      In fx, the 3 of 7 tests failed. The tests were:
                      diff                : systemc/datatypes/fx/constructors/files.f
                      diff                : systemc/datatypes/fx/fast_constructors/test.f
                      diff                : systemc/datatypes/fx/fast_limits/test.f
      
      See below for a better description.

      SystemC-2.1beta11 regression test case failures

      10 of 682 tests failed:
      1. diff                : systemc/datatypes/fx/constructors/files.f
        
        1033c1033
        < b[1] : 4294934528 : 0x0ffff8000
        ---
        > b[1] : 0 : 0x000000000
        1035c1035
        < b[2] : 4294934528 : 0x0ffff8000
        ---
        > b[2] : 0 : 0x000000000
        1037c1037
        < b[3] : 4294934528 : 0x0ffff8000
        ---
        > b[3] : 0 : 0x000000000
        
      2. diff                : systemc/datatypes/fx/fast_constructors/test.f
        
        1033c1033
        < b[1] : 4294934528 : 0x0ffff8000
        ---
        > b[1] : 0 : 0x000000000
        1035c1035
        < b[2] : 4294934528 : 0x0ffff8000
        ---
        > b[2] : 0 : 0x000000000
        1037c1037
        < b[3] : 4294934528 : 0x0ffff8000
        ---
        > b[3] : 0 : 0x000000000
        
      3. diff                : systemc/datatypes/fx/fast_limits/test.f
        
        1567c1567
        < long_min / double_max : 0x.8e-248
        ---
        > long_min / double_max : 0x.f7ffffffffffff8e-247
        1941c1941
        < int_min / double_max : 0x.8e-248
        ---
        > int_min / double_max : 0x.f7ffffffffffff8e-247
        
      4. diff                : systemc/kernel/dynamic_processes/test01/test01.cpp
        
        < Error: (E519) wait() is only allowed in SC_THREADs and SC_CTHREADs: < in SC_METHODs use next_trigger() instead < In file: --- > 260 ns: Top1.main_0.thread_p_11: void_function sees 1.2345 > > 260 ns: Top1.main_0.thread_p_12: ref_function sees 9.8765 > Returned int is 9 > > Done.
      5. running               : systemc/kernel/sc_module/test10/test10.cpp
        hangs
        
                     SystemC 2.1beta11 --- Jan  5 2005 16:32:33
                Copyright (c) 1996-2004 by all Contributors
                            ALL RIGHTS RESERVED
        SystemC Simulation
        
      6. diff                : systemc/misc/sim_tests/biquad/biquad1/biquad1.f
        diff                : systemc/misc/sim_tests/biquad/biquad3/biquad3.f
        diff                : systemc/misc/user_guide/chpt4.1/chpt4.1.f
        diff                : systemc/misc/user_guide/chpt4.2/chpt4.2.f
        diff                : systemc/misc/user_guide/chpt4.4/chpt4.4.f
        
        Rounding errors in the last decimal place, for example:
        < Result = 6570959918.812002
        ---
        > Result = 6570959918.812003
        

      SystemC-2.0.1 regression test case failures

      As of 2/04, with Systemc-2.01, 81 tests fail, 557 pass.

      Some of the failures are overflow errors, and are not that big a problem

      However, some of the failures are because we got an UNKNOWN EXCEPTION OCURRED message

      For example systemc/kernel/watching/test01/test01.log says:

      -------------------------------------------------------------------------------
        diff failed on 'systemc/kernel/watching/test01/test01.log'
      -------------------------------------------------------------------------------
      24,25c24,101
      < 
      < UNKNOWN EXCEPTION OCCURED
      ---
      > main_action
      > 1
      > 2
      > 3
      > 4
      > 5
      > 6
      
      Running the binary yields the following:
      bash-2.05b$ cd ~/src/regtests-2.0.1/systemc/kernel/watching/test01
      bash-2.05b$ ls
      systemc.exe
      test01
      test01.diff
      test01.log
      test01.log.stripped
      test01.o
      bash-2.05b$ ./systemc.exe
      
                   SystemC 2.0.1 --- Nov 13 2003 15:15:26
              Copyright (c) 1996-2004 by all Contributors
                          ALL RIGHTS RESERVED
      main_action
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      
      UNKNOWN EXCEPTION OCCURED
      bash-2.05b$ 
      
      The error message occurs at: systemc-2.0.1/src/systemc/kernel/sc_main.cpp:
      	      message_function( "UNKNOWN EXCEPTION OCCURED" );