Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
45 replies Latest Post - ‏2009-03-25T03:46:17Z by SystemAdmin
SystemAdmin
SystemAdmin
10114 Posts
ACCEPTED ANSWER

Pinned topic Discussion about the IBM Full-System Simulator for the CBE

‏2005-11-09T04:32:07Z |
On Wednesday, November 9th, we will be releasing a full-system simulator for the CBE.

[b]Please use this forum thread for discussing questions related to the simulator.[/b]

The system simulator is capable of running the latest Linux kernel with CBEA architecture extensions and runtime support. This simulated environment allows Cell programmers to develop and run Cell applications even without the access to a CBE hardware system.

Please see the alphaWorks Research Topic on CBE at http://www.ibm.com/alphaworks/topics/cell and developerWorks CBE resources at http://www.ibm.com/developerworks/power/cell
Updated on 2009-03-25T03:46:17Z at 2009-03-25T03:46:17Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    10114 Posts
    ACCEPTED ANSWER

    initrd and zImage handling

    ‏2005-11-14T10:41:18Z  in response to SystemAdmin
    I've been trying to get the Fedora rawhide kernel working on the sim, so I can do full system installs 'properly' and make sure the installer is working.

    However, the use of initrd seems to be problematic. I don't see a way to ask the sim to load an initrd -- it seems only to load the kernel. I tried a zImage containing both kernel and initrd, but that didn't work out of the box either.

    However, when I linked the zImage so that its load address and entry point were both 0x1000000 instead of the normal 0x400000, it did work.

    Please could we have initrd support in the sim? Failing that, could we please at least honour the load address and entry point of the loaded 'kernel'?

    On a vaguely related note, is the networking support expected to work in this version? If we compile mambonet into the cell kernel, is there documentation available on setting it up on the host side?
    • pbohrer@us.ibm.com
      pbohrer@us.ibm.com
      20 Posts
      ACCEPTED ANSWER

      Re: initrd and zImage handling

      ‏2005-11-14T14:38:50Z  in response to SystemAdmin
      Typically we use the zImage approach also for loading the initrd with the kernel. I am not aware of a problem with the loader not recognizing the entry location in the zImage executable. If you turn on "simdebug set elf_loader 1" before you load zImage, you should be able to see additional debug messages. I will try to use a zImage today to see if I can encounter any problems.
      • SystemAdmin
        SystemAdmin
        10114 Posts
        ACCEPTED ANSWER

        Re: initrd and zImage handling

        ‏2005-11-14T14:41:14Z  in response to pbohrer@us.ibm.com
        I'll try that when I get home. My experience was that the zImage was loaded to 0x1000000 and executed there, even when those weren't the load and entrypoint addresses. Just changing the zImage to match was sufficient to make it work for me.
      • SystemAdmin
        SystemAdmin
        10114 Posts
        ACCEPTED ANSWER

        Re: initrd and zImage handling

        ‏2005-11-14T21:52:25Z  in response to pbohrer@us.ibm.com
        The command 'simdebug set elf_loader 1' doesn't seem to make much difference. Having invoked the sim with '../run_gui' in the run/cell/linux/ directory, I then typed that at the 'systemsim %' prompt, and it replied 'ELF_LOADER = 1'.

        Then I clicked 'run' in the tk gui, and the same thing happens as before...

        systemsim % WARNING: 7: 0:0: Invalid/unsupported instr 0x00000000 PC(EA): 0x0000000000000000 PC(RA):0x0000000000000000 MSR: 0x1000000000000000 LR: 0x0000000000000000
        numInstructions = 7
        FATAL ERROR: 7: Stopping execution.
        7: ** Execution stopped: Mambo Error, **
        7: ** finished running 7 instructions **

        My kernel image is http://david.woodhou.se/zImage.2

        Single-stepping into it seems to show that it was loaded to the wrong address, and executed at that same address. The load and entrypoint addresses in the ELF file are ignored.
        • SystemAdmin
          SystemAdmin
          10114 Posts
          ACCEPTED ANSWER

          Re: initrd and zImage handling

          ‏2005-11-14T21:58:38Z  in response to SystemAdmin
          Aha. It had loaded the kernel already before I set the debugging option. If I use the GUI to make it reload the kernel, it does seem to work correctly...

          $ ../run_gui
          ==============================================================================
          THIS CELL BROADBAND ENGINE SYSTEM SIMULATOR, TOGETHER WITH ALL PERFORMANCE
          DATA RESULTING THEREFROM, IS PROVIDED BY IBM AND RECEIVED BY YOU ON AN "AS-IS"
          BASIS, WITHOUT WARRANTY OF ANY KIND. SEE THE APPLICABLE LICENSE FOR ADDITIONAL
          TERMS AND CONDITIONS.
          ==============================================================================
          GUI Enabled
          Licensed Materials - Property of IBM.
          (C) Copyright IBM Corporation 2001, 2005
          All Rights Reserved.
          GUI not initialized. Execute tcl command 'gui_init'.
          WARNING: 0: Closing gdb listener on port 2345, reopening on port 2345
          LOAD : Opening ELF image file: ../../../images/cell/vmlinux
          Elf text start address saved is 0x0000000001000000
          LOAD : ELF startup: PC=0x0000000001000000, msr=0x1000000000000000
          LOAD : gpr[1]=0x0000000007FFFF90, gpr[2]=0x0000000000000000
          building tree....
          clearing existing Openfirmware tree
          done building tree.
          systemsim % simdebug set elf_loader 1
          ELF_LOADER = 1
          systemsim % LOAD : Opening ELF image file: /home/dwmw2/systemsim-cell-release/images/cell/vmlinux
          DEBUG: 0: ELF_LOADER : Loading a 32-bit Elf File
          DEBUG: 0: ELF_LOADER : Class:01 Data:02 Version:01
          DEBUG: 0: ELF_LOADER : Type :02 Machine:20 Version:01
          DEBUG: 0: ELF_LOADER : Entry:0x00401BCC Flags:32768 Elf-Header Size:52 bytes
          DEBUG: 0: ELF_LOADER : Section that contains the String Table : 6
          DEBUG: 0: ELF_LOADER : Program Headers : (Offset:52,Entry-Size:32,Entries:4)
          DEBUG: 0: ELF_LOADER : Section Headers: (Offset:2269260,Entry-Size:40,Entries:9)DEBUG: 0: ELF_LOADER : Section 0 : (Type:00 NULL)
          Flags 0x00 :
          DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 0
          DEBUG: 0: ELF_LOADER : Size 00 : Link 00 : Info 0
          DEBUG: 0: ELF_LOADER : Addr Align 00 : Ent Size 00
          DEBUG: 0: ELF_LOADER : Section 1 : .text (Type:01 PROGBITS)
          Flags 0x06 : MEM-DURING-EXEC EXECUTABLE
          DEBUG: 0: ELF_LOADER : Address 0x00400000 : File Offset 65536
          DEBUG: 0: ELF_LOADER : Size 21280 : Link 00 : Info 0
          DEBUG: 0: ELF_LOADER : Addr Align 16 : Ent Size 00
          DEBUG: 0: ELF_LOADER : Copy 21280 bytes from file offset 65536 to memory 0x0000000000400000
          Elf text start address saved is 0x0000000000400000
          DEBUG: 0: ELF_LOADER : look for starting address at offset 0x0000000000001BCC in file
          DEBUG: 0: ELF_LOADER : starting address = 0x0000000048000005
          DEBUG: 0: ELF_LOADER : Section 2 : .data (Type:01 PROGBITS)
          Flags 0x03 : WRITABLE MEM-DURING-EXEC
          DEBUG: 0: ELF_LOADER : Address 0x00406000 : File Offset 90112
          DEBUG: 0: ELF_LOADER : Size 2840 : Link 00 : Info 0
          DEBUG: 0: ELF_LOADER : Addr Align 04 : Ent Size 00
          DEBUG: 0: ELF_LOADER : Copy 2840 bytes from file offset 90112 to memory 0x0000000000406000
          DEBUG: 0: ELF_LOADER : Section 3 : .kernel:vmlinux.strip (Type:01 PROGBITS)
          Flags 0x02 : MEM-DURING-EXEC
          DEBUG: 0: ELF_LOADER : Address 0x00407000 : File Offset 94208
          DEBUG: 0: ELF_LOADER : Size 2174570 : Link 00 : Info 0
          DEBUG: 0: ELF_LOADER : Addr Align 01 : Ent Size 00
          DEBUG: 0: ELF_LOADER : Copy 2174570 bytes from file offset 94208 to memory 0x0000000000407000
          DEBUG: 0: ELF_LOADER : Section 4 : .bss (Type:08 UNKNOWN TYPE)
          Flags 0x03 : WRITABLE MEM-DURING-EXEC
          DEBUG: 0: ELF_LOADER : Address 0x0061A000 : File Offset 2268778
          DEBUG: 0: ELF_LOADER : Size 48252 : Link 00 : Info 0
          DEBUG: 0: ELF_LOADER : Addr Align 04 : Ent Size 00
          DEBUG: 0: ELF_LOADER : Section 5 : .comment (Type:01 PROGBITS)
          Flags 0x00 :
          DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 2268778
          DEBUG: 0: ELF_LOADER : Size 405 : Link 00 : Info 0
          DEBUG: 0: ELF_LOADER : Addr Align 01 : Ent Size 00
          DEBUG: 0: ELF_LOADER : Section 6 : .shstrtab (Type:03 STRTAB)
          Flags 0x00 :
          DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 2269183
          DEBUG: 0: ELF_LOADER : Size 75 : Link 00 : Info 0
          DEBUG: 0: ELF_LOADER : Addr Align 01 : Ent Size 00
          DEBUG: 0: ELF_LOADER : Section 7 : .symtab (Type:02 SYMTAB)
          Flags 0x00 :
          DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 2269620
          DEBUG: 0: ELF_LOADER : Size 1536 : Link 08 : Info 31
          DEBUG: 0: ELF_LOADER : Addr Align 04 : Ent Size 16
          DEBUG: 0: ELF_LOADER : Section 8 : .strtab (Type:03 STRTAB)
          Flags 0x00 :
          DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 2271156
          DEBUG: 0: ELF_LOADER : Size 1050 : Link 00 : Info 0
          DEBUG: 0: ELF_LOADER : Addr Align 01 : Ent Size 00
          LOAD : ELF startup: PC=0x0000000000401BCC, msr=0x1000000000000000
          LOAD : gpr[1]=0x0000000007FFFF90, gpr[2]=0x0000000000000000
          • SystemAdmin
            SystemAdmin
            10114 Posts
            ACCEPTED ANSWER

            Re: initrd and zImage handling

            ‏2005-11-14T22:16:40Z  in response to SystemAdmin

            ELF Header:
            Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
            Class: ELF32
            Data: 2's complement, big endian
            Version: 1 (current)
            OS/ABI: UNIX - System V
            ABI Version: 0
            Type: EXEC (Executable file)
            Machine: PowerPC
            Version: 0x1
            Entry point address: 0x401bcc
            Start of program headers: 52 (bytes into file)
            Start of section headers: 2269260 (bytes into file)
            Flags: 0x8000, relocatable-lib
            Size of this header: 52 (bytes)
            Size of program headers: 32 (bytes)
            Number of program headers: 4
            Size of section headers: 40 (bytes)
            Number of section headers: 9
            Section header string table index: 6
            The problem is that you have a 32-bit image and the simulator wants a 64-bit image.
            • pbohrer@us.ibm.com
              pbohrer@us.ibm.com
              20 Posts
              ACCEPTED ANSWER

              Re: initrd and zImage handling

              ‏2005-11-14T22:23:24Z  in response to SystemAdmin
              The loader should handle either 32 or 64 bit.
              Thanks for pointing to the zImage in an earlier post.
              I will take a look at it this evening.
              Sorry I have been swamped today.
        • pbohrer@us.ibm.com
          pbohrer@us.ibm.com
          20 Posts
          ACCEPTED ANSWER

          Re: initrd and zImage handling

          ‏2005-11-15T22:38:33Z  in response to SystemAdmin
          Thanks for pointing me to the zImage. That was a big help.

          By default, the simulator will run whatever commands it finds in the local startup file called .systemsim.tcl unless it is told otherwise with the -f option.

          In run/cell/linux, I copied .systemsim.tcl to zimage.tcl and changed the vmlinux load command :
          mysim load vmlinux $imagefile 0x1000000
          to be:
          mysim load elf zImage.2

          and then ran ../run_gui -f zimage.tcl

          When I did this, your image booted up just fine.
          • SystemAdmin
            SystemAdmin
            10114 Posts
            ACCEPTED ANSWER

            Re: initrd and zImage handling

            ‏2005-11-15T22:50:34Z  in response to pbohrer@us.ibm.com
            Excellent; thanks. Is there an advantage to loading a kernel as 'vmlinux' instead of 'elf'? Should the default .systemsim.tcl be changed?

            Now, I'm trying to load yaboot the same way. It seems to load and run fine, but I can't interact with it. I have the xterm window in which I see this...

            /pci@fff7f09000/ide@1/hd@1:1,/etc/yaboot.conf: Unable to open file, Invalid device
            Can't open config file
            Welcome to yaboot version 1.3.13 (Red Hat 1.3.13-0.16)
            Enter "help" to get some basic usage information
            Default supplied on the command line: lpj=8000000 console=bogus0 root=/dev/mambobd0 rw init=/bin/bash
            boot:

            ... but I can't do anything. Is that expected?
  • SystemAdmin
    SystemAdmin
    10114 Posts
    ACCEPTED ANSWER

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-11-27T14:46:16Z  in response to SystemAdmin
    I know this is untested, I tried it nevertheless
    I try to run the cell full system simulator on a ia32e gentoo distribution, probably one of the worst possible combinations (no native fedora libs, no rpm, no/very few 32bit x86 libs/tools).
    I built the toolchain from scratch. I had to change some makefiles of the other parts (sdk, kernel, libspe) due to different paths. I built the sysroot_image by hand and run the simulator against the binary fedora libstdc++ (my multilib one didn't work).
    I can know boot linux in the simulator, but not everything seems to work as expected, my observations (everything in fast mode):

    I can run 32 bit binaries compiled in the simulator or on the host. I can neither run nor compile 64 bit binaries on the simulated system (due to a incomplete toolchain on the simulated system).

    run properly (second paragraph is from spu/bin):
    euler_scalar, euler_simd_aos, euler_simd_soa, audio, curve, fft_2d, gmath, image, intrinsics_si, intrinsics_vmx, math1, matrix, misc, noise, predicates_vmx, surface, vector
    hello, spe-cp, spe-sum, spu_interrupt, abi, audio, c, c_malloc, curve, fft_1d, fft_2d, gmath, image, intrinsics_si, intrinsics_spu, large_matrix, math1, math2, matrix, misc, mpm1, mpm2, mpm3, noise, surface, test_spu_ext, vector

    segfault:
    euler_multi_spe, euler_spe

    can't create thread (errno=22):
    atomic_op_sample, dma_sample, driver, mutex_sample, simple, simpleDMA, simple_cesof, cpex

    hang:
    cond_sample

    atomic_op_sample:
    fails the first 2 tests, passes the next 2 ones, fails the last one (cannot create thread errno=22)

    cannot locate SPU executable:
    ppu_add, ppu_sync_add

    So, all in all, for me it looks like if libspe doesn't work.
    Ideas?

    Oh, and I find it really impractical that the size of the virtual terminal changes when I start vi in the simulation.
    • SystemAdmin
      SystemAdmin
      10114 Posts
      ACCEPTED ANSWER

      Re: Gentoo

      ‏2005-12-02T18:39:15Z  in response to SystemAdmin
      I'm also working on setting up the systemsim in gentoo.

      Please have a look and/or post replies to the thread on the gentoo forums:
      http://forums.gentoo.org/viewtopic-t-407765.html
    • SystemAdmin
      SystemAdmin
      10114 Posts
      ACCEPTED ANSWER

      Re: Discussion about the IBM Full-System Simulator for the CBE

      ‏2005-12-08T15:48:08Z  in response to SystemAdmin
      hi,

      I didn't have a look at this for a while...
      first I strace'd the call to simple [1]. This didn't seem to be so helpful. Next I built libspe with -DDEBUG, when I now call simple, I get "invalid ELF header" as the initial problem [2]. Is this helpful?

      [1]:

      execve("opt/IBM/cell-sdk-1.0/bin/samples/simple", , [/* 12 vars */]) = 0
      brk(0) = 0x1815000
      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fe1000
      access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
      open("/etc/ld.so.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
      open("/lib/tls/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
      open("/lib/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
      open("/usr/lib/tls/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
      open("/usr/lib/libspe.so.1", O_RDONLY) = 3
      read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0A\214"..., 512) = 512
      fstat64(3, {st_mode=S_IFREG|0755, st_size=67943, ...}) = 0
      mmap(0x17d3000, 117920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x17d3000
      mprotect(0x17df000, 68768, PROT_NONE) = 0
      mmap(0x17ef000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x17ef000
      close(3) = 0
      open("/lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
      open("/lib/libc.so.6", O_RDONLY) = 3
      read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\273"..., 512) = 512
      fstat64(3, {st_mode=S_IFREG|0755, st_size=1603088, ...}) = 0
      mmap(0x1667000, 1422900, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1667000
      mprotect(0x17ac000, 91700, PROT_NONE) = 0
      mmap(0x17bb000, 20480, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x144000) = 0x17bb000
      mmap(0x17c0000, 9780, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x17c0000
      close(3) = 0
      open("/lib/tls/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
      open("/lib/libpthread.so.0", O_RDONLY) = 3
      read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0K\320"..., 512) = 512
      fstat64(3, {st_mode=S_IFREG|0755, st_size=113304, ...}) = 0
      mmap(0x1633000, 144808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1633000
      mprotect(0x1644000, 75176, PROT_NONE) = 0
      mmap(0x1653000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x1653000
      mmap(0x1655000, 5544, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1655000
      close(3) = 0
      open("/lib/tls/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
      open("/lib/librt.so.1", O_RDONLY) = 3
      read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\37"..., 512) = 512
      fstat64(3, {st_mode=S_IFREG|0755, st_size=54704, ...}) = 0
      mmap(0x1633000, 144808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1633000
      mprotect(0x1644000, 75176, PROT_NONE) = 0
      mmap(0x1653000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x1653000
      mmap(0x1655000, 5544, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1655000
      close(3) = 0
      open("/lib/tls/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
      open("/lib/librt.so.1", O_RDONLY) = 3
      read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\37"..., 512) = 512
      fstat64(3, {st_mode=S_IFREG|0755, st_size=54704, ...}) = 0
      mmap(0x15fe000, 148120, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x15fe000
      mprotect(0x1607000, 111256, PROT_NONE) = 0
      mmap(0x1616000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x1616000
      mmap(0x1618000, 41624, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1618000
      close(3) = 0
      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fe0000
      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fdf000
      mprotect(0x1616000, 4096, PROT_READ) = 0
      mprotect(0x1653000, 4096, PROT_READ) = 0
      mprotect(0x17bb000, 8192, PROT_READ) = 0
      mprotect(0xf800e000, 4096, PROT_READ) = 0
      set_tid_address(0xf7fdf068) = 322
      rt_sigaction(SIGRTMIN, {0x16376c0, [], SA_SIGINFO}, NULL, 8) = 0
      rt_sigaction(SIGRT_1, {0x1637790, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
      rt_sigprocmask(SIG_UNBLOCK, RTMIN RT_1, NULL, 8) = 0
      ugetrlimit(0x3, 0xffee3900) = 0
      _sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xffee3994, 35, (nil), 0}) = 0
      brk(0) = 0x1815000
      brk(0x1836000) = 0x1836000
      SYS_279(0xffee36b0, 0, 0x1c0, 0, 0x8000) = 3
      open("/spu/spethread-322-25251872/mem", O_RDWR|O_CREAT, 0600) = 4
      mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0) = 0xf7f9f000
      write(2, "Failed spu_create_thread(rc=0, e"..., 41Failed spu_create_thread(rc=0, errno=22)
      ) = 41
      exit_group(1)

      [2]:
      spe_create_thread((nil), 0x1814a98, (nil), (nil), 0xffffffff, 0x0)
      create /spu/spethread-342-25251872
      load_spe_elf(0x1814a98, 0xf7f9f000)
      load_spe_elf(0x17c9848, 0xf7f9f000)
      invalid ELF header.
      expected 0x7F454C4601020100 != 0xFBAD2887017C988F
      Load SPE ELF failed..
      spe_setup failed
      Failed spu_create_thread(rc=0, errno=22)
      • SystemAdmin
        SystemAdmin
        10114 Posts
        ACCEPTED ANSWER

        Re: Discussion about the IBM Full-System Simulator for the CBE

        ‏2005-12-09T17:56:34Z  in response to SystemAdmin
        hm, now I'm getting really confused. euler_spe and euler_multi_spe seem to have proper embedded spe programs, nevertheless they segfault...

        output of euler_spe:

        spe_create_thread((nil), 0x181491c, 0xffc83970, (nil), 0xffffffff, 0x0)
        create /spu/spethread-306-28852256
        load_spe_elf(0x181491c, 0xf7f9f000)
        load_spe_elf(0x3d6b0181, 0xf7f9f000)
        Segmentation fault

        strace euler_spe:

        execve("opt/IBM/cell-sdk-1.0/bin/samples/euler_spe", , [/* 12 vars */]) = 0
        brk(0) = 0x1b84000
        mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fe1000
        access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
        open("/etc/ld.so.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
        open("/lib/tls/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
        open("/lib/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
        open("/usr/lib/tls/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
        open("/usr/lib/libspe.so.1", O_RDONLY) = 3
        read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0Ht"..., 512) = 512
        fstat64(3, {st_mode=S_IFREG|0755, st_size=86484, ...}) = 0
        mmap(0x17df000, 69356, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x17df000
        mmap(0x17ef000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x17ef000
        close(3) = 0
        open("/lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
        open("/lib/libc.so.6", O_RDONLY) = 3
        read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\273"..., 512) = 512
        fstat64(3, {st_mode=S_IFREG|0755, st_size=1603088, ...}) = 0
        mmap(0x1673000, 1422900, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1673000
        mprotect(0x17b8000, 91700, PROT_NONE) = 0
        mmap(0x17c7000, 20480, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x144000) = 0x17c7000
        mmap(0x17cc000, 9780, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x17cc000
        close(3) = 0
        open("/lib/tls/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
        open("/lib/libpthread.so.0", O_RDONLY) = 3
        read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0K\320"..., 512) = 512
        fstat64(3, {st_mode=S_IFREG|0755, st_size=113304, ...}) = 0
        mmap(0x163f000, 144808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x163f000
        mprotect(0x1650000, 75176, PROT_NONE) = 0
        mmap(0x165f000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x165f000
        mmap(0x1661000, 5544, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1661000
        close(3) = 0
        open("/lib/tls/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
        open("/lib/librt.so.1", O_RDONLY) = 3
        read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\37"..., 512) = 512
        fstat64(3, {st_mode=S_IFREG|0755, st_size=54704, ...}) = 0
        mmap(0x160a000, 148120, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x160a000
        mprotect(0x1613000, 111256, PROT_NONE) = 0
        mmap(0x1622000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x1622000
        mmap(0x1624000, 41624, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1624000
        close(3) = 0
        mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fe0000
        mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fdf000
        mprotect(0x1622000, 4096, PROT_READ) = 0
        mprotect(0x165f000, 4096, PROT_READ) = 0
        mprotect(0x17c7000, 8192, PROT_READ) = 0
        mprotect(0xf800e000, 4096, PROT_READ) = 0
        set_tid_address(0xf7fdf068) = 329
        rt_sigaction(SIGRTMIN, {0x16436c0, [], SA_SIGINFO}, NULL, 8) = 0
        rt_sigaction(SIGRT_1, {0x1643790, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
        rt_sigprocmask(SIG_UNBLOCK, RTMIN RT_1, NULL, 8) = 0
        ugetrlimit(0x3, 0xffcb4900) = 0
        _sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xffcb4994, 35, (nil), 0}) = 0
        write(2, "spe_create_thread((nil), 0x18149"..., 72spe_create_thread((nil), 0x181491c, 0xffcb4990, (nil), 0xffffffff, 0x0)
        ) = 72
        brk(0) = 0x1b84000
        brk(0x1ba5000) = 0x1ba5000
        write(2, "create /spu/spethread-329-288522"..., 35create /spu/spethread-329-28852256
        ) = 35
        SYS_279(0xffcb46b0, 0, 0x1c0, 0x18, 0x8000) = 3
        open("/spu/spethread-329-28852256/mem", O_RDWR|O_CREAT, 0600) = 4
        mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0) = 0xf7f9f000
        write(2, "load_spe_elf(0x181491c, 0xf7f9f0"..., 36load_spe_elf(0x181491c, 0xf7f9f000)
        ) = 36
        write(2, "load_spe_elf(0x3d6b0181, 0xf7f9f"..., 37load_spe_elf(0x3d6b0181, 0xf7f9f000)
        ) = 37
        • SIGSEGV (Segmentation fault) @ 0 (0) ---
        + killed by SIGSEGV +
        • SystemAdmin
          SystemAdmin
          10114 Posts
          ACCEPTED ANSWER

          Re: Discussion about the IBM Full-System Simulator for the CBE

          ‏2005-12-10T22:04:36Z  in response to SystemAdmin
          I think I found the (one?) problem: all boils down to a non-working ppu-embedspu. I am not yet sure whether everything works, but I was at leat able to run a program comparable to simple.
    • SystemAdmin
      SystemAdmin
      10114 Posts
      ACCEPTED ANSWER

      Re: Discussion about the IBM Full-System Simulator for the CBE

      ‏2005-12-11T10:28:25Z  in response to SystemAdmin
      After using the binary version of ppu-embedspu, most programs run without errors.

      • euler_spe and euler_multi_spe don't segfault any longer
      • also run poperly now (couldn't create thread befor): atomic_op_sample, dma_sample, mutex_sample, simple, simpleDMA
      • report "Bus error": driver, simple_cesof, cpex
      • cond_sample doesn't hang any longer
      • ppu_add and ppu_sync_add behave as before
      • SystemAdmin
        SystemAdmin
        10114 Posts
        ACCEPTED ANSWER

        Re: Discussion about the IBM Full-System Simulator for the CBE

        ‏2005-12-12T15:39:35Z  in response to SystemAdmin
        You shouldn't use the "binary" version of the ppu-embedspu, if there is one.
        The CESOF object generated by the older embedspu should not work properly.
        The latest embedspu, which supports the latest CESOF, is done by invoking gas thru gcc.

        I don't know if you have given embedspu a right flag.
        Since the new script version supports both 32-bit and 64-bit binaries, for 32-environment, you need to specify -m32 (passed to gcc) to
        generate 32-bit CESOF object. Else, it will by default generate 64-bit object.

        You can also use the simple wrapping script for 32-bit object: /opt/sce/toolchain-2.3/ppu/bin/ppu32-embedspu.

        You can later use readelf to check the generated CESOF object to see if it is 64-bit or 32-bit.

        I suspect this is the problem. If not, please let me know. Thanks.
        • SystemAdmin
          SystemAdmin
          10114 Posts
          ACCEPTED ANSWER

          Re: Discussion about the IBM Full-System Simulator for the CBE

          ‏2005-12-12T15:53:10Z  in response to SystemAdmin
          I just noticed that your previous posts per running in gentoo environment.

          Since it links properly before, the flag might be ok, unless you are generating
          64-bit PPE binaries.

          Have you tried a ppu-readelf comparison between the CESOF file from a fedora version to a gentoo version?

          The different, if any, probably can tell if that is a runtime(libspe), a embedspu problem, or a build problem.

          Also, I believe that libspe runtime currently supports only 32-bit program.
          If you start a 64-bit binary, I don't know if it will work properly?

          Good luck!
          • SystemAdmin
            SystemAdmin
            10114 Posts
            ACCEPTED ANSWER

            Re: Discussion about the IBM Full-System Simulator for the CBE

            ‏2005-12-12T18:58:40Z  in response to SystemAdmin
            OK, finally even I got that embedspu is a script. But the script doesn't seem to work with my native toolchain. I currently run 32 bit programs on the cell. If I create the cesof with the embedspu using my native toolchain (with -m32 switch), the pointers seem to be crazy (causing my programs either segfaulting or aborting due to improper elf headers). And of course, there are difference between the libelf -a outputs:

            > diff non-working working
            13c13
            < Start of section headers: 12052 (bytes into file)
            ---
            > Start of section headers: 12176 (bytes into file)
            26,35c26,35
            < 2 .spuelf.simple_sp PROGBITS 00000000 000080 002e00 00 A 0 0 128
            < 3 .data PROGBITS 00000000 002e80 000000 00 WA 0 0 1
            < 4 .sdata PROGBITS 00000000 002e80 000004 00 WA 0 0 4
            < 5 .rela.sdata RELA 00000000 0030f4 00000c 0c 10 4 4
            < 6 .bss NOBITS 00000000 002e84 000000 00 WA 0 0 1
            < 7 .comment PROGBITS 00000000 002e84 00002a 00 0 0 1
            < 8 .note.GNU-stack NOTE 00000000 002eae 000000 00 X 0 0 1
            < 9 .shstrtab STRTAB 00000000 002eae 000064 00 0 0 1
            < 10 .symtab SYMTAB 00000000 003100 0000e0 10 11 13 4
            < 11 .strtab STRTAB 00000000 0031e0 000018 00 0 0 1
            ---
            > 2 .rodata.speelf PROGBITS 00000000 000080 002e00 00 A 0 0 128
            > 3 .data PROGBITS 00000000 002e80 00000c 00 WA 0 0 4
            > 4 .rela.data RELA 00000000 003170 000018 0c 10 3 4
            > 5 .data.spetoe PROGBITS 00000000 002f00 000000 00 WA 0 0 128
            > 6 .bss NOBITS 00000000 002f00 000000 00 WA 0 0 1
            > 7 .comment PROGBITS 00000000 002f00 00002a 00 0 0 1
            > 8 .note.GNU-stack NOTE 00000000 002f2a 000000 00 X 0 0 1
            > 9 .shstrtab STRTAB 00000000 002f2a 000066 00 0 0 1
            > 10 .symtab SYMTAB 00000000 003188 0000f0 10 11 14 4
            > 11 .strtab STRTAB 00000000 003278 000022 00 0 0 1
            45c45
            < Relocation section '.rela.sdata' at offset 0x30f4 contains 1 entries:
            ---
            > Relocation section '.rela.data' at offset 0x3170 contains 2 entries:
            47c47,48
            < 00000000 00000c01 R_PPC_ADDR32 00000000 __section__ + 0
            ---
            > 00000004 00000c01 R_PPC_ADDR32 00000000 __speelf__ + 0
            > 00000008 00000d01 R_PPC_ADDR32 00000000 __spetoe__ + 0
            51c52
            < Symbol table '.symtab' contains 14 entries:
            ---
            > Symbol table '.symtab' contains 15 entries:
            65,66c66,68
            < 12: 00000000 0 OBJECT LOCAL DEFAULT 2 __section__
            < 13: 00000000 4 OBJECT GLOBAL DEFAULT 4 simple_spu
            ---
            > 12: 00000000 0 OBJECT LOCAL DEFAULT 2 __speelf__
            > 13: 00000000 0 OBJECT LOCAL DEFAULT 5 __spetoe__
            > 14: 00000000 12 OBJECT GLOBAL DEFAULT 3 simple_spu
            • SystemAdmin
              SystemAdmin
              10114 Posts
              ACCEPTED ANSWER

              Re: Discussion about the IBM Full-System Simulator for the CBE

              ‏2005-12-13T03:11:14Z  in response to SystemAdmin
              Can you try to post the whole ppu-readelf -a listing of the non-working version directly?

              Thx.
              • SystemAdmin
                SystemAdmin
                10114 Posts
                ACCEPTED ANSWER

                Re: Discussion about the IBM Full-System Simulator for the CBE

                ‏2005-12-13T12:43:45Z  in response to SystemAdmin
                ELF Header:
                Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
                Class: ELF32
                Data: 2's complement, big endian
                Version: 1 (current)
                OS/ABI: UNIX - System V
                ABI Version: 0
                Type: REL (Relocatable file)
                Machine: PowerPC
                Version: 0x1
                Entry point address: 0x0
                Start of program headers: 0 (bytes into file)
                Start of section headers: 12052 (bytes into file)
                Flags: 0x0
                Size of this header: 52 (bytes)
                Size of program headers: 0 (bytes)
                Number of program headers: 0
                Size of section headers: 40 (bytes)
                Number of section headers: 12
                Section header string table index: 9

                Section Headers:
                Nr Name Type Addr Off Size ES Flg Lk Inf Al
                0 NULL 00000000 000000 000000 00 0 0 0
                1 .text PROGBITS 00000000 000034 000000 00 AX 0 0 1
                2 .spuelf.simple_sp PROGBITS 00000000 000080 002e00 00 A 0 0 128
                3 .data PROGBITS 00000000 002e80 000000 00 WA 0 0 1
                4 .sdata PROGBITS 00000000 002e80 000004 00 WA 0 0 4
                5 .rela.sdata RELA 00000000 0030f4 00000c 0c 10 4 4
                6 .bss NOBITS 00000000 002e84 000000 00 WA 0 0 1
                7 .comment PROGBITS 00000000 002e84 00002a 00 0 0 1
                8 .note.GNU-stack NOTE 00000000 002eae 000000 00 X 0 0 1
                9 .shstrtab STRTAB 00000000 002eae 000064 00 0 0 1
                10 .symtab SYMTAB 00000000 003100 0000e0 10 11 d 4
                11 .strtab STRTAB 00000000 0031e0 000018 00 0 0 1
                Key to Flags:
                W (write), A (alloc), X (execute), M (merge), S (strings)
                I (info), L (link order), G (group), x (unknown)
                O (extra OS processing required) o (OS specific), p (processor specific)

                There are no program headers in this file.

                Relocation section '.rela.sdata' at offset 0x30f4 contains 1 entries:
                Offset Info Type Sym.Value Sym. Name + Addend
                00000000 00000c01 R_PPC_ADDR32 00000000 __section__ + 0

                There are no unwind sections in this file.

                Symbol table '.symtab' contains 14 entries:
                Num: Value Size Type Bind Vis Ndx Name
                0: 00000000 0 NOTYPE LOCAL DEFAULT UND
                1: 00000000 0 SECTION LOCAL DEFAULT 1
                2: 00000000 0 SECTION LOCAL DEFAULT 2
                3: 00000000 0 SECTION LOCAL DEFAULT 3
                4: 00000000 0 SECTION LOCAL DEFAULT 4
                5: 00000000 0 SECTION LOCAL DEFAULT 5
                6: 00000000 0 SECTION LOCAL DEFAULT 6
                7: 00000000 0 SECTION LOCAL DEFAULT 7
                8: 00000000 0 SECTION LOCAL DEFAULT 8
                9: 00000000 0 SECTION LOCAL DEFAULT 9
                10: 00000000 0 SECTION LOCAL DEFAULT 10
                11: 00000000 0 SECTION LOCAL DEFAULT 11
                12: 00000000 0 OBJECT LOCAL DEFAULT 2 __section__
                13: 00000000 4 OBJECT GLOBAL DEFAULT 4 simple_spu

                No version information found in this file.
                • SystemAdmin
                  SystemAdmin
                  10114 Posts
                  ACCEPTED ANSWER

                  Re: Discussion about the IBM Full-System Simulator for the CBE

                  ‏2005-12-13T14:21:17Z  in response to SystemAdmin
                  This output is not from the latest embedspu script that put the spu elf image inside of the .rodata.speelf section. There should also be an empty .data.spetoe section.

                  Could you double check your environment to see if there is another embedspu hangin around? e.g. the "binary" version or an older version of the embedspu script?

                  In addition, you should also find two local symbol __speelf__ and __spetoe__ in the symbol table.

                  Though, in the future, a "binary" version should be the proper implementation, in the meantime, the dependencies on ppu-gcc, ppu-gas, and spu-readelf must be met.

                  Good luck!
                  Thx
                  • SystemAdmin
                    SystemAdmin
                    10114 Posts
                    ACCEPTED ANSWER

                    Re: Discussion about the IBM Full-System Simulator for the CBE

                    ‏2005-12-13T15:45:22Z  in response to SystemAdmin
                    I downloaded the toolchain sources from http://www.bsc.es/projects/deepcomputing/linuxoncell/.

                    To remove all confusion: the script from the binary toolchain is [1], the one from the source distrivution [2], readelf -a of the working embedded is [3], the broken one is [4].
                    [1]
                    #!/bin/sh

                    1. (C)Copyright
                    2. Sony Computer Entertainment, Inc.,
                    3. Toshiba Corporation,
                    4. International Business Machines Corporation,
                    5. 2005. All rights reserved.

                    #
                    1. Embed SPE ELF executable into PPE object file, and define a
                    2. global pointer variable refering to the embedded file.
                    #
                    1. Usage: embedspu flags symbol_name input_filename output_filename
                    #
                    1. input_filename: SPE ELF executable to be embedded
                    2. output_filename: Resulting PPE object file
                    3. symbol_name: Name of global pointer variable to be defined
                    4. flags: GCC flags defining PPE object file format
                    5. (e.g. -m32 or -m64)
                    #

                    1. Determine location of dependent utilities
                    file=`basename "$0"`
                    dir=`dirname "$0"`
                    && PREFIX=ppu-

                    PPU_GCC=${PREFIX}gcc
                    SPU_READELF=spu-readelf

                    which $PPU_GCC > /dev/null 2>&1
                    if $? -eq 0
                    then
                    :
                    elif -a ${dir}/$PPU_GCC
                    then
                    PPU_GCC=${dir}/$PPU_GCC
                    elif -a /opt/sce/ppu/bin/$PPU_GCC
                    then
                    PPU_GCC=/opt/sce/ppu/bin/$PPU_GCC
                    else
                    echo Cannot find $PPU_GCC.
                    exit 1
                    fi

                    which $SPU_READELF > /dev/null 2>&1
                    if $? -eq 0
                    then
                    :
                    elif http:// -a ${dir}/../../spu/bin/$SPU_READELF
                    then
                    SPU_READELF=${dir}/../../spu/bin/$SPU_READELF
                    elif -a /opt/sce/spu/bin/$SPU_READELF
                    then
                    SPU_READELF=/opt/sce/spu/bin/$SPU_READELF
                    else
                    echo Cannot find $SPU_READELF.
                    exit 1
                    fi

                    1. Argument parsing
                    SYMBOL=
                    INFILE=
                    OUTFILE=
                    FLAGS=

                    while ; do
                    case $1 in
                    -*) FLAGS="${FLAGS} $1"
                    shift ;;
                    *) if -z $SYMBOL ; then
                    SYMBOL=$1
                    elif -z $INFILE ; then
                    INFILE=$1
                    elif -z $OUTFILE ; then
                    OUTFILE=$1
                    fi
                    shift ;;
                    esac
                    done

                    if ; then
                    echo "Usage: $0 symbol_name input_filename output_filename"
                    exit 1
                    fi

                    if ; then
                    echo "${INFILE}: File not found"
                    exit 1
                    fi

                    1. Temp file names
                    TMPOBJ1=`mktemp emXXXXXX` || exit 1
                    TMPOBJ2=`mktemp emXXXXXX` || { rm -f $TMPOBJ1; exit 1; }

                    1. Build object file holding pointer to embedded section
                    ${PPU_GCC} ${FLAGS} -x c -c -o ${TMPOBJ1} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
                    static const unsigned char __speelf__[]
                    __attribute__((section(".rodata.speelf"), aligned(128))) = { };

                    static unsigned char __spetoe__[]
                    __attribute__((section(".data.spetoe"), aligned(128))) = { };

                    typedef struct spe_program_handle {
                    unsigned int handle_size;
                    const void *elf_image;
                    void *toe_shadow;
                    } spe_program_handle_t;

                    spe_program_handle_t ${SYMBOL} = { sizeof (spe_program_handle_t),
                    __speelf__, __spetoe__ };
                    EOF

                    1. Build object file holding embedded section itself
                    ${PPU_GCC} ${FLAGS} -x assembler-with-cpp -c -o ${TMPOBJ2} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
                    .section .rodata.speelf,"a",@progbits
                    .p2align 7
                    .incbin "${INFILE}"

                    .section .data.spetoe,"aw",@progbits
                    .p2align 7
                    `${SPU_READELF} -s ${INFILE} | egrep ' _EAR_' | sort -k 2 | awk \
                    '{ \
                    print "#ifdef _LP64"; \
                    print ".quad " substr($8, 6); \
                    print ".quad 0"; \
                    print "#else"; \
                    print ".int 0"; \
                    print ".int " substr($8, 6); \
                    print ".int 0"; \
                    print ".int 0"; \
                    print "#endif"; \
                    }'`
                    EOF

                    1. Link both object files together
                    ${PPU_GCC} ${FLAGS} -nostartfiles -nostdlib -Wl,-r -Wl,-x \
                    -o ${OUTFILE} ${TMPOBJ1} ${TMPOBJ2}

                    1. Clean up
                    rm -f ${TMPOBJ1} ${TMPOBJ2}
                    [2]
                    #!/bin/sh

                    1. (C)Copyright
                    2. Sony Computer Entertainment, Inc.,
                    3. Toshiba Corporation,
                    4. International Business Machines Corporation,
                    5. 2005. All rights reserved.

                    #
                    1. Embed SPE ELF executable into PPE object file, and define a
                    2. global pointer variable refering to the embedded file.
                    #
                    1. Usage: embedspu flags symbol_name input_filename output_filename
                    #
                    1. input_filename: SPE ELF executable to be embedded
                    2. output_filename: Resulting PPE object file
                    3. symbol_name: Name of global pointer variable to be defined
                    4. flags: GCC flags defining PPE object file format
                    5. (e.g. -m32 or -m64)
                    #

                    1. Argument parsing
                    SYMBOL=
                    INFILE=
                    OUTFILE=
                    FLAGS=

                    while ; do
                    case $1 in
                    -*) FLAGS="${FLAGS} $1"
                    shift ;;
                    *) if -z $SYMBOL ; then
                    SYMBOL=$1
                    elif -z $INFILE ; then
                    INFILE=$1
                    elif -z $OUTFILE ; then
                    OUTFILE=$1
                    fi
                    shift ;;
                    esac
                    done

                    file=`basename "$0"`
                    dir=`dirname "$0"`
                    && PREFIX=ppu-
                    && PREFIX="$dir/$PREFIX"

                    if ; then
                    echo "Usage: $0 symbol_name input_filename output_filename"
                    exit 1
                    fi

                    1. The section name as defined by the SPU ABI
                    SECTION=.spuelf.${INFILE}

                    1. Temp file names
                    TMPOBJ1=`mktemp emXXXXXX` || exit 1
                    TMPOBJ2=`mktemp emXXXXXX` || { rm -f $TMPOBJ1; exit 1; }

                    1. Build object file holding pointer to embedded section
                    ${PREFIX}gcc ${FLAGS} -x c -c -o ${TMPOBJ1} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
                    static const unsigned char __section__[]
                    __attribute__((section("${SECTION}"), aligned(128))) = { };
                    const void *${SYMBOL} = __section__;
                    EOF

                    1. Build object file holding embedded section itself
                    ${PREFIX}gcc ${FLAGS} -x assembler -c -o ${TMPOBJ2} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
                    .section ${SECTION},"a",@progbits
                    .p2align 7
                    .incbin "${INFILE}"
                    EOF

                    1. Link both object files together
                    ${PREFIX}gcc ${FLAGS} -nostartfiles -nostdlib -Wl,-r -Wl,-x \
                    -o ${OUTFILE} ${TMPOBJ1} ${TMPOBJ2}

                    1. Clean up
                    rm -f ${TMPOBJ1} ${TMPOBJ2}
                    [3]
                    ELF Header:
                    Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
                    Class: ELF32
                    Data: 2's complement, big endian
                    Version: 1 (current)
                    OS/ABI: UNIX - System V
                    ABI Version: 0
                    Type: REL (Relocatable file)
                    Machine: PowerPC
                    Version: 0x1
                    Entry point address: 0x0
                    Start of program headers: 0 (bytes into file)
                    Start of section headers: 226320 (bytes into file)
                    Flags: 0x0
                    Size of this header: 52 (bytes)
                    Size of program headers: 0 (bytes)
                    Number of program headers: 0
                    Size of section headers: 40 (bytes)
                    Number of section headers: 12
                    Section header string table index: 9

                    Section Headers:
                    Nr Name Type Addr Off Size ES Flg Lk Inf Al
                    0 NULL 00000000 000000 000000 00 0 0 0
                    1 .text PROGBITS 00000000 000034 000000 00 AX 0 0 1
                    2 .rodata.speelf PROGBITS 00000000 000080 037280 00 A 0 0 128
                    3 .data PROGBITS 00000000 037300 00000c 00 WA 0 0 4
                    4 .rela.data RELA 00000000 0375f0 000018 0c 10 3 4
                    5 .data.spetoe PROGBITS 00000000 037380 000000 00 WA 0 0 128
                    6 .bss NOBITS 00000000 037380 000000 00 WA 0 0 1
                    7 .comment PROGBITS 00000000 037380 00002a 00 0 0 1
                    8 .note.GNU-stack NOTE 00000000 0373aa 000000 00 X 0 0 1
                    9 .shstrtab STRTAB 00000000 0373aa 000066 00 0 0 1
                    10 .symtab SYMTAB 00000000 037608 0000f0 10 11 14 4
                    11 .strtab STRTAB 00000000 0376f8 000022 00 0 0 1
                    Key to Flags:
                    W (write), A (alloc), X (execute), M (merge), S (strings)
                    I (info), L (link order), G (group), x (unknown)
                    O (extra OS processing required) o (OS specific), p (processor specific)

                    There are no section groups in this file.

                    There are no program headers in this file.

                    Relocation section '.rela.data' at offset 0x375f0 contains 2 entries:
                    Offset Info Type Sym.Value Sym. Name + Addend
                    00000004 00000c01 R_PPC_ADDR32 00000000 __speelf__ + 0
                    00000008 00000d01 R_PPC_ADDR32 00000000 __spetoe__ + 0

                    There are no unwind sections in this file.

                    Symbol table '.symtab' contains 15 entries:
                    Num: Value Size Type Bind Vis Ndx Name
                    0: 00000000 0 NOTYPE LOCAL DEFAULT UND
                    1: 00000000 0 SECTION LOCAL DEFAULT 1
                    2: 00000000 0 SECTION LOCAL DEFAULT 2
                    3: 00000000 0 SECTION LOCAL DEFAULT 3
                    4: 00000000 0 SECTION LOCAL DEFAULT 4
                    5: 00000000 0 SECTION LOCAL DEFAULT 5
                    6: 00000000 0 SECTION LOCAL DEFAULT 6
                    7: 00000000 0 SECTION LOCAL DEFAULT 7
                    8: 00000000 0 SECTION LOCAL DEFAULT 8
                    9: 00000000 0 SECTION LOCAL DEFAULT 9
                    10: 00000000 0 SECTION LOCAL DEFAULT 10
                    11: 00000000 0 SECTION LOCAL DEFAULT 11
                    12: 00000000 0 OBJECT LOCAL DEFAULT 2 __speelf__
                    13: 00000000 0 OBJECT LOCAL DEFAULT 5 __spetoe__
                    14: 00000000 12 OBJECT GLOBAL DEFAULT 3 simple_spu

                    No version information found in this file.

                    [4]
                    ELF Header:
                    Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
                    Class: ELF32
                    Data: 2's complement, big endian
                    Version: 1 (current)
                    OS/ABI: UNIX - System V
                    ABI Version: 0
                    Type: REL (Relocatable file)
                    Machine: PowerPC
                    Version: 0x1
                    Entry point address: 0x0
                    Start of program headers: 0 (bytes into file)
                    Start of section headers: 226196 (bytes into file)
                    Flags: 0x0
                    Size of this header: 52 (bytes)
                    Size of program headers: 0 (bytes)
                    Number of program headers: 0
                    Size of section headers: 40 (bytes)
                    Number of section headers: 12
                    Section header string table index: 9

                    Section Headers:
                    Nr Name Type Addr Off Size ES Flg Lk Inf Al
                    0 NULL 00000000 000000 000000 00 0 0 0
                    1 .text PROGBITS 00000000 000034 000000 00 AX 0 0 1
                    2 .spuelf.simple_sp PROGBITS 00000000 000080 037280 00 A 0 0 128
                    3 .data PROGBITS 00000000 037300 000000 00 WA 0 0 1
                    4 .sdata PROGBITS 00000000 037300 000004 00 WA 0 0 4
                    5 .rela.sdata RELA 00000000 037574 00000c 0c 10 4 4
                    6 .bss NOBITS 00000000 037304 000000 00 WA 0 0 1
                    7 .comment PROGBITS 00000000 037304 00002a 00 0 0 1
                    8 .note.GNU-stack NOTE 00000000 03732e 000000 00 X 0 0 1
                    9 .shstrtab STRTAB 00000000 03732e 000064 00 0 0 1
                    10 .symtab SYMTAB 00000000 037580 0000e0 10 11 13 4
                    11 .strtab STRTAB 00000000 037660 000018 00 0 0 1
                    Key to Flags:
                    W (write), A (alloc), X (execute), M (merge), S (strings)
                    I (info), L (link order), G (group), x (unknown)
                    O (extra OS processing required) o (OS specific), p (processor specific)

                    There are no section groups in this file.

                    There are no program headers in this file.

                    Relocation section '.rela.sdata' at offset 0x37574 contains 1 entries:
                    Offset Info Type Sym.Value Sym. Name + Addend
                    00000000 00000c01 R_PPC_ADDR32 00000000 __section__ + 0

                    There are no unwind sections in this file.

                    Symbol table '.symtab' contains 14 entries:
                    Num: Value Size Type Bind Vis Ndx Name
                    0: 00000000 0 NOTYPE LOCAL DEFAULT UND
                    1: 00000000 0 SECTION LOCAL DEFAULT 1
                    2: 00000000 0 SECTION LOCAL DEFAULT 2
                    3: 00000000 0 SECTION LOCAL DEFAULT 3
                    4: 00000000 0 SECTION LOCAL DEFAULT 4
                    5: 00000000 0 SECTION LOCAL DEFAULT 5
                    6: 00000000 0 SECTION LOCAL DEFAULT 6
                    7: 00000000 0 SECTION LOCAL DEFAULT 7
                    8: 00000000 0 SECTION LOCAL DEFAULT 8
                    9: 00000000 0 SECTION LOCAL DEFAULT 9
                    10: 00000000 0 SECTION LOCAL DEFAULT 10
                    11: 00000000 0 SECTION LOCAL DEFAULT 11
                    12: 00000000 0 OBJECT LOCAL DEFAULT 2 __section__
                    13: 00000000 4 OBJECT GLOBAL DEFAULT 4 simple_spu

                    No version information found in this file.
                    • SystemAdmin
                      SystemAdmin
                      10114 Posts
                      ACCEPTED ANSWER

                      Re: Discussion about the IBM Full-System Simulator for the CBE

                      ‏2005-12-13T16:19:30Z  in response to SystemAdmin
                      [1] is the correct version.
                      [2] is from an older release. I doubt that you got the source distribution from an older version. For your cross-dev environment, please stay with the CBE SDK for x86 . I'll forward your post to our team...
                      [3] has the correct output.
                      [4] does not have correct structure and will not work.

                      Thx.
                    • SystemAdmin
                      SystemAdmin
                      10114 Posts
                      ACCEPTED ANSWER

                      Re: Discussion about the IBM Full-System Simulator for the CBE

                      ‏2005-12-14T19:50:51Z  in response to SystemAdmin
                      Thank you!

                      The difference that you pointed out has been confirmed by our team.
                      The toolchain source RPM containing the right patches is already available for the "native" environment.
                      The same patches are used to create the toolchain for the "cross" environment.

                      To make it easier, we are in the process of recreating the patch RPM for "cross" fedora 4/x86 environmen as well.
                      Once that is available, we will give a post on the forum.

                      Please read the detail response from our development team:
                      ==========================================================
                      there are four different packages to consider:
                      On the "x86 Hosted Environment for the Cell Broadband Engine" page:
                      - toolchain-2.3-i686.tar.bz2 the binary package
                      - toolchain-2.3+-src.tar.bz2 the (Sony) compiler source tarball

                      On the "Development Release" "GNU Toolchain" native page:
                      - spu-binutils-2.3-bsc2.1.ppc.rpm (the embedspu script is in the binutils binary RPM)
                      - spu-toolchain-2.3-bsc2.1.src.rpm (the source RPM package)
                      Now, the good news is that the two "binary" packages, both toolchain-2.3-i686.tar.bz2 (cross) and spu-binutils-2.3-bsc2.1.ppc.rpm (native) contain the exact same embedspu script, and this is the correct one supporting CESOF.

                      Unfortunately, this is not the case for the source packages: on the "native" page, we have a source RPM package that contains both the unmodified Sony tarball plus a set of patches that are to be applied on top of them. One of those patches transforms the old embedspu script provided as part of the Sony tarball into the new script with CESOF. So if you rebuild the binary RPM from the source RPM, everything is fine.

                      On the other side, on the "cross" SDK web page, the only source provided is the original Sony tarball itself, with the old embedspu script. People attempting to rebuild from that tarball will thus get the wrong script. Now, apparently when preparing the binary tarball you have applied the embedspu patch, as the binary tarball does contain the latest version. However, the patch isn't to be found on the web site, so people cannot rebuild the binary from source ...

                      == end of cut/paste section ==
    • SystemAdmin
      SystemAdmin
      10114 Posts
      ACCEPTED ANSWER

      Is this the hardware that is in the Play Station 3 that we are emulating?

      ‏2006-02-21T23:10:21Z  in response to SystemAdmin
      Is this the emulator for the Play Station 3, or is there anyone who knows where I get it? www.linuxplaystation.com
  • SystemAdmin
    SystemAdmin
    10114 Posts
    ACCEPTED ANSWER

    Is this the hardware that is in the Play Station 3 that we are emulating?

    ‏2006-02-21T23:12:26Z  in response to SystemAdmin
    Is this the emulator for the Play Station 3, or is there anyone who knows where I get it? www.linuxplaystation.com
    • SystemAdmin
      SystemAdmin
      10114 Posts
      ACCEPTED ANSWER

      Re: Is this the hardware that is in the Play Station 3 that we are emulating?

      ‏2006-02-21T23:50:57Z  in response to SystemAdmin
      This is the simulator for the Cell Broadband Engine processor that will be used in the PS3. It does not simulate the PS3 graphics subsystem and various PS3 support chips.
      • SystemAdmin
        SystemAdmin
        10114 Posts
        ACCEPTED ANSWER

        Re: Is this the hardware that is in the Play Station 3 that we are emulating?

        ‏2006-02-22T00:11:01Z  in response to SystemAdmin
        Well could someone out there point me in the right direction for a hardware simulator for the PS3 and drivers?
  • SystemAdmin
    SystemAdmin
    10114 Posts
    ACCEPTED ANSWER

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2006-09-13T15:11:03Z  in response to SystemAdmin
    Could anyone answer me if the simulator source code is available for downloading or not? thanks!
    • CellServ
      CellServ
      1346 Posts
      ACCEPTED ANSWER

      Re: Discussion about the IBM Full-System Simulator for the CBE

      ‏2006-09-13T18:30:19Z  in response to SystemAdmin
      No, the simulator source is not available for download.
      --
      IBM SDK Service Administrator
  • SystemAdmin
    SystemAdmin
    10114 Posts
    ACCEPTED ANSWER

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2008-02-16T19:03:15Z  in response to SystemAdmin
    Please consider the attached patch to be included in future releases of the cell system simulator.

    This is the problem I ran into while installing the simulator on Gentoo Linux:

    If I enter /opt/ibm/systemsim-cell/run/cell/linux/ and run ../run_gui it fails because users do not have write permission to the directory and so cannot create "sysroot_disk.cow*". I don't want to change that because "runtime data" like the cow disk don't belong in /opt IMHO. The attached patch checks if COWDISKNAME environment variable is set and uses it for the cow disk location then. If this variable is not set it uses the home directory of the current user (which the user should have write permissions to ;-) ).
    • mkistler
      mkistler
      551 Posts
      ACCEPTED ANSWER

      Re: Discussion about the IBM Full-System Simulator for the CBE

      ‏2008-02-16T21:36:55Z  in response to SystemAdmin
      Amazing how some things never die, no matter how hard you try to kill them.

      run_gui is not supported as a means for running the simulator. Do not use it. The proper and supported way to launch the simulator is with the systemsim command. This is documented in the Simulator User's Guide and the in SDK Programmer's Guide.

      The systemsim command is designed to work in any directory, precisely to eliminate the issue of the installation directories being read-only to non-root users.

      Mike Kistler
      • SystemAdmin
        SystemAdmin
        10114 Posts
        ACCEPTED ANSWER

        Re: Discussion about the IBM Full-System Simulator for the CBE

        ‏2008-02-21T20:16:03Z  in response to mkistler
        Thanks for the info. I went from 1.0 -> 2.1 -> 3.0 and never looked into the Programmer's Guide again.. Should have done so.

        Regards,

        Markus Rothe

        EDIT: Guess this was never in the manual...

        Message was edited by: markus-rothe
        Updated on 2008-02-21T20:16:03Z at 2008-02-21T20:16:03Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    10114 Posts
    ACCEPTED ANSWER

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2008-02-22T20:45:53Z  in response to SystemAdmin
    I know there has been a rpm for the ppc architecture for version 2.1 of the cell system simulator. With version 3.0 there are only x86, x86_64 and ppc64 rpms available. Is it possible to get a rpm for ppc?

    I guess it's not stable, too slow or some changes that came with 3.0 just have not been ported to ppc. Anyways, there is at least one user that asked me, if he can use the simulator on ppc.
    • mkistler
      mkistler
      551 Posts
      ACCEPTED ANSWER

      Re: Discussion about the IBM Full-System Simulator for the CBE

      ‏2008-02-22T23:59:13Z  in response to SystemAdmin
      We are phasing out the 32-bit versions of the simulator. They are significantly slower than the 64-bit versions. The ppc version was the first to go. At some point, we will probably also drop the i386 version. Simulating a 64-bit architecture (e.g. Cell) on a 32-bit system has inherent performance obstacles, and at some point it just doesn't make sense to continue support for this.

      Mike Kistler
  • SystemAdmin
    SystemAdmin
    10114 Posts
    ACCEPTED ANSWER

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2008-03-26T14:06:15Z  in response to SystemAdmin
    Hello again,

    now that tcl/tk has reached version 8.5 and is hitting the distributions I see me confronted with the following problem:

    $ systemsim
    /opt/ibm/systemsim-cell/bin/../bin/systemsim-cell: error while loading shared libraries: libtcl8.4.so: cannot open shared object file: No such file or directory

    Would it be possible to get a version that links against tcl 8.5?

    Regards,

    -markus
    • SystemAdmin
      SystemAdmin
      10114 Posts
      ACCEPTED ANSWER

      Re: Discussion about the IBM Full-System Simulator for the CBE

      ‏2008-04-06T12:52:32Z  in response to SystemAdmin
      c'mon.. Please release a new version that links against tcl/tk 8.5. Or at least say why you can't. Having a false statement is better than having no statement. ;-)
      • mkistler
        mkistler
        551 Posts
        ACCEPTED ANSWER

        Re: Discussion about the IBM Full-System Simulator for the CBE

        ‏2008-04-06T13:54:26Z  in response to SystemAdmin
        I guess I don't understand what is wrong here. The simulator is build on a system that has Tcl 8.4. I would think that Tcl 8.5 was compatable with Tcl 8.4, so it should run with Tcl 8.5 just fine. What is the symptom?

        Mike Kistler
        • SystemAdmin
          SystemAdmin
          10114 Posts
          ACCEPTED ANSWER

          Re: Discussion about the IBM Full-System Simulator for the CBE

          ‏2008-04-11T16:43:46Z  in response to mkistler
          mkistler wrote:
          What is the symptom?

          $ ldd /opt/ibm/systemsim-cell/bin/systemsim-cell
          linux-vdso.so.1 => (0x00007fffa87fe000)
          libtcl8.4.so => not found
          libtk8.4.so => not found
          ...

          you can't install tcl/tk 8.4 and 8.5 at the same time, because they both install files that block each other (for example /usr/include/tcl.h), so you have to decide whether you want 8.4 or 8.5. This isn't a big deal with open source software, because you just recompile it, when you update from 8.4 to 8.5. You get the point, we need systemsim-cell linked against 8.5 so we can move on.

          Message was edited by: markus-rothe
          Updated on 2008-04-11T16:43:46Z at 2008-04-11T16:43:46Z by SystemAdmin
          • mkistler
            mkistler
            551 Posts
            ACCEPTED ANSWER

            Re: Discussion about the IBM Full-System Simulator for the CBE

            ‏2008-04-19T03:42:48Z  in response to SystemAdmin
            Well, the problem is that if we link the simulator against Tcl 8.5, then it will force everyone with Tcl 8.4 to move up. That doesn't sound like a very good solution. The way it should work is that I can build / link with Tcl 8.4, and as long as Tcl 8.5 is backward compatable, you could just run with it. But it doesn't look like Tcl works that way. Why does Tcl force me to pick one version or the other?

            Mike Kistler
  • MGB
    MGB
    192 Posts
    ACCEPTED ANSWER

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2008-07-16T18:48:56Z  in response to SystemAdmin
    Hi all
    i heard that we can use simulator to do performance analysis on DMA , so what statistics does it collect and how can that be done,is there any doc on that

    thanks
    • mkistler
      mkistler
      551 Posts
      ACCEPTED ANSWER

      Re: Discussion about the IBM Full-System Simulator for the CBE

      ‏2008-07-16T19:43:26Z  in response to MGB
      Take a look at the document named "Performance Analysis Guide" that is located in the doc directory of the simualator install. This should answer most of your questions.

      Mike Kistler
  • SystemAdmin
    SystemAdmin
    10114 Posts
    ACCEPTED ANSWER

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2008-11-10T03:31:24Z  in response to SystemAdmin
    Systemsim Installe or exuectue error for SDK3.1 on FDR9

    GUI Enabled.But GUI Button don't show, why ?

    the following messeage:

    GUI Enabled
    Licensed Materials - Property of IBM.
    (C) Copyright IBM Corporation 2001, 2007
    All Rights Reserved.
    Using initial run script /opt/ibm/systemsim-cell/bin/../lib/cell/systemsim.tcl
    Warning: Tried to connect to session manager, Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
    GUI not initialized. Execute tcl command 'gui_init'.
    invalid command name "blt::treeview"
    while executing
    "blt::treeview $win.tree -tree myTree -separator "/" -autocreate true -scrollmode listbox -yscrollcommand "$win.scroll set""
    (procedure "treesim::init" line 8)
    invoked from within
    "treesim::init .mambo.simlist"
    (procedure "GUI::init_widgets" line 15)
    invoked from within
    "GUI::init_widgets"
    (procedure "GUI::init" line 12)
    invoked from within
    "GUI::init"
    (file "/opt/ibm/systemsim-cell/bin/../lib/cell/gui/gui.tcl" line 21)
    invoked from within
    "source /opt/ibm/systemsim-cell/bin/../lib/cell/gui/gui.tcl"
    (in namespace inscope "::" script line 1)
    invoked from within
    "namespace inscope :: source $fname "
    building tree....
    clearing existing Openfirmware tree
    done building tree.
    LOAD : Opening ELF image file: /opt/ibm/systemsim-cell/bin/../images/cell/vmlinux
    Elf text start address saved is 0x0000000001000000
    Elf_ReadImage: Opening ELF image file: /opt/ibm/systemsim-cell/images/cell/vmlinux
    Elf_ReadImage: alloc-ed 8784792 bytes for /opt/ibm/systemsim-cell/images/cell/vmlinux
    vmlinux_get_struct_info got errors: couldn't execute "/opt/ibm/systemsim-cell/bin/../bin/parse_dwarf.pl": no such file or directory
    LOAD : ELF startup: PC=0x0000000001000000, msr=0x1000000000000000
    LOAD : gpr[1]=0x000000000FFFFF90, gpr[2]=0x0000000000000000
    • SystemAdmin
      SystemAdmin
      10114 Posts
      ACCEPTED ANSWER

      Simulator 3.1, x86_64 no console window

      ‏2008-12-26T20:12:18Z  in response to SystemAdmin
      I notice your post has gone unanswered. I have the same thing. Console window never appears.

      I have a Fedora 7, 32 bit VM with 32 bit 3.0 Simulator on it and so I know I am executing the start commands correctly.

      I posted the Simulator boot/launch messages here:

      http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14179272#14179272

      all alf packages, everything is installed so this appears to be a bug within the 3.1 simulator. I even searched the scripts and saw no place where the simulator was set up to not launch a console window.

      I get no console window when running the simulator and while there is a way to call the simulator with a -n option to not open a console window, I've looked over some of the tcl scripts and I do not see where this is set. Note the warning on the mysim which might also be a hint.

      I have not modified any tcl file. the Simulator calls /opt/ibm/systemsim-cell/lib/cell/systemsim.tcl

      I need a console window to do the callthru.

      Fedora 10, x86_64, Simulator 3.1, systemsim-cell-3.1-8.f9.x86_64.rpm

      Here are the messages from these commands:

      $ulimit -s unlimited
      $systemsim -g
      systemsim -g
      ==============================================================================
      THIS CELL BROADBAND ENGINE SYSTEM SIMULATOR, TOGETHER WITH ALL PERFORMANCE
      DATA RESULTING THEREFROM, IS PROVIDED BY IBM AND RECEIVED BY YOU ON AN "AS-IS"
      BASIS, WITHOUT WARRANTY OF ANY KIND. SEE THE APPLICABLE LICENSE FOR ADDITIONAL
      TERMS AND CONDITIONS.
      ==============================================================================
      GUI Enabled
      Licensed Materials - Property of IBM.
      (C) Copyright IBM Corporation 2001, 2007
      All Rights Reserved.
      Using initial run script /opt/ibm/systemsim-cell/bin/../lib/cell/systemsim.tcl
      GUI not initialized. Execute tcl command 'gui_init'.
      building tree....
      clearing existing Openfirmware tree
      done building tree.
      LOAD : Opening ELF image file: /opt/ibm/systemsim-cell/bin/../images/cell/vmlinux
      Elf text start address saved is 0x0000000001000000
      Elf_ReadImage: Opening ELF image file: /opt/ibm/systemsim-cell/images/cell/vmlinux
      Elf_ReadImage: alloc-ed 8784792 bytes for /opt/ibm/systemsim-cell/images/cell/vmlinux
      vmlinux_get_struct_info got errors: couldn't execute "/opt/ibm/systemsim-cell/bin/../bin/parse_dwarf.pl": no such file or directory
      LOAD : ELF startup: PC=0x0000000001000000, msr=0x1000000000000000
      LOAD : gpr[1]=0x000000000FFFFF90, gpr[2]=0x0000000000000000
      systemsim % INFO: 0: (0): !!!!!! Simulator now in TURBO mode !!!!!!
      WARNING: 128159: (128157): write error: 5 on program, name=mysim info=xterm (fd=5)
      128159: (128157): OF stdout device is:
      131281: (131279): command line: lpj=8000000 console=hvc0 root=/dev/mambobd0 rw
      157153: (157151): memory layout at init:
      157881: (157879): alloc_bottom : 0000000001930000
      159035: (159033): alloc_top : 0000000010000000
      160189: (160187): alloc_top_hi : 0000000010000000
      161343: (161341): rmo_top : 0000000010000000
      162497: (162495): ram_top : 0000000010000000
      164408: (164406): Looking for displays
      186935: (186933): instantiating rtas at 0x000000000fff0000 ... done
      205155: (205153): 0000000000000000 : boot cpu 0000000000000000
      213645: (213643): copying OF device tree ...
      215415: (215413): Building dt strings...
      1303842: (1303840): Building dt structure...
      2567411: (2567409): Device tree strings 0x0000000001940000 -> 0x0000000001940864
      2569327: (2569325): Device tree struct 0x0000000001950000 -> 0x0000000001960000
      2571697: (2571695): Calling quiesce ...
      WARNING: 2572172: (2572170): Open Firmware: Unsupported service 'quiesce'
      2572679: (2572677): returning from prom_init
      9553699: (9553679): CPU maps initialized for 2 threads per core
      9570224: (9570195): Starting Linux PPC64 #1 SMP Fri Sep 12 11:44:36 CEST 2008
      9591371: (9591342):
      9610996: (9610967): ppc64_pft_size = 0x0
      9624388: (9624359): physicalMemorySize = 0x10000000
      9640279: (9640250): htab_address = 0xc00000000f800000
      9658878: (9658849): htab_hash_mask = 0x7fff
      9673394: (9673365): 9693005: (9692976): Initializing cgroup subsys cpuset
      9716554: (9716525): Linux version 2.6.25.14-108.20080910bsc.ppc64 (root@localhost.localdomain) (gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC) ) #1 SMP Fri Sep 12 11:44:36 CEST 2008
      9777984: (9777955): *** 0000 : CF000012

      9789074: (9789045): *** 0000 : Setup Arch
      9799695: (9799666): boot0012 Setup Arch
      21068544: (21068507): nvram: no node found in device-tree
      21083719: (21083682): Zone PFN ranges:
      21093391: (21093354): DMA 0 -> 4096
      21108391: (21108354): Normal 4096 -> 4096
      21123085: (21123048): Movable zone start PFN for each node
      21139906: (21139869): early_node_map[1] active PFN ranges
      21156104: (21156067): 0: 0 -> 4096
      21623614: (21623577): *** 0000 : CF000015

      21634704: (21634667): *** 0000 : Setup Done
      21645325: (21645288): boot0015 Setup Done
      21704125: (21704088): Built 1 zonelists in Node order, mobility grouping on. Total pages: 4093
      21732314: (21732277): Policy zone: DMA
      21744086: (21744049): Kernel command line: lpj=8000000 console=hvc0 root=/dev/mambobd0 rw
      24410665: (24410626): IIC for CPU 0 target id 0xe : /be@20000000000/interrupt-controller@508400
      24445058: (24445019): IIC for CPU 1 target id 0xf : /be@20000000000/interrupt-controller@508400
      24498251: (24498212): PID hash table entries: 1024 (order: 10, 8192 bytes)
      24549942: (24548903): clocksource: timebase multa000000 shift22 registered
      24614071: (24613019): Console: colour dummy device 80x25
      24636423: (24635371): console handover: boot udbg0 -> real hvc0
      24701537: (24700483): Dentry cache hash table entries: 32768 (order: 2, 262144 bytes)
      25012136: (25011082): Inode-cache hash table entries: 16384 (order: 1, 131072 bytes)
      25167089: (25166035): freeing bootmem node 0
      25638191: (25637137): Memory: 231040k/262144k available (6976k kernel code, 31104k reserved, 1024k data, 787k bss, 448k init)
      25884974: (25883918): SLUB: Genslabs=17, HWalign=128, Order=0-2, MinObjects=8, CPUs=2, Nodes=16
      26061061: (26060005): Calibrating delay loop (skipped)... 16000.00 BogoMIPS preset
      26242699: (26241643): Security Framework initialized
      26256618: (26255562): SELinux: Initializing.
      26281644: (26280588): selinux_register_security: Registering secondary module capability
      26308147: (26307091): Capability LSM initialized as secondary
      26332832: (26331776): Mount-cache hash table entries: 4096
      27551005: (27549945): Initializing cgroup subsys ns
      27565619: (27564559): Initializing cgroup subsys cpuacct
      28104828: (28195248): Processor 1 found.
      WARNING: 28111720: (28202140): 0:0:0: RTAS freeze-time-base
      WARNING: 28212678: (28309036): 0:0:0: RTAS thaw-time-base
      28218893: (28320781): Brought up 2 CPUs
      44299002: (45023853): net_namespace: 1016 bytes
      44621130: (45345981): NET: Registered protocol family 16
      44680066: (45416136): IBM eBus Device Driver
      45422611: (46282773): *** 0000 : Linux ppc64

      45435755: (46295917): *** 0000 : #1 SMP Fri Sep 12 11:44:36 CEST 2008
      45462385: (46322547): CPU Hotplug not supported by firmware - disabling.
      45524709: (46384869): iommu: disabled, direct DMA offset is 0x80000000
      45858600: (46752423): PCI: Probing PCI hardware
      50643861: (52060090): perfmon: version 2.8
      50678240: (52094469): perfmon: CPU hotplug support enabled
      51569071: (53137848): usbcore: registered new interface driver usbfs
      51636055: (53216053): usbcore: registered new interface driver hub
      51802572: (53413746): usbcore: registered new device driver usb
      63232547: (54446115): NetLabel: Initializing
      63243883: (54457451): NetLabel: domain hash size = 128
      63259055: (54472623): NetLabel: protocols = UNLABELED CIPSOv4
      63295247: (54508815): NetLabel: unlabeled traffic allowed by default
      64601252: (56022899): NET: Registered protocol family 2
      92066340: (56349715): IP route cache hash table entries: 8192 (order: 0, 65536 bytes)
      92435499: (56718874): TCP established hash table entries: 8192 (order: 1, 131072 bytes)
      92555914: (56839289): TCP bind hash table entries: 8192 (order: 1, 131072 bytes)
      92671171: (56954546): TCP: Hash tables configured (established 8192 bind 8192)
      92692799: (56976174): TCP reno registered
      102004395: (57569745): scan-log-dump not implemented on this system
      103497513: (59622351): audit: initializing netlink socket (disabled)
      103522068: (59646906): type=2000 audit(1024007219.024:1): initialized
      103839085: (60030825): Total HugeTLB memory allocated, 0
      110705350: (68273796): VFS: Disk quotas dquot_6.5.1
      110872701: (68464951): Dquot-cache hash table entries: 8192 (order 0, 65536 bytes)
      112204411: (70120745): Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
      112230795: (70147129): io scheduler noop registered
      112244437: (70160771): io scheduler anticipatory registered
      112260523: (70176857): io scheduler deadline registered
      112544202: (70517796): io scheduler cfq registered (default)
      112564547: (70538141): perfmon: added sampling format default
      112692454: (70737496): pci_hotplug: PCI Hot Plug PCI Core version: 0.5
      122039664: (82292160): Linux agpgart interface v0.103
      122199650: (82480578): Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
      122936943: (83397859): TX39/49 Serial driver version 1.11
      125173895: (86165571): brd: module loaded
      126210770: (87202512): systemsim bogus disk: compiled in with kernel
      142779256: (106987537): input: Macintosh mouse button emulation as /devices/virtual/input/input0
      143105438: (107440855): Uniform Multi-Platform E-IDE driver
      143124055: (107459491): ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
      157114500: (108730601): mice: PS/2 mouse device common for all mice
      166285623: (109669994): platform ppc-rtc.0: rtc core: registered ppc_md as rtc0
      166551723: (110016099): usbcore: registered new interface driver hiddev
      166715170: (110210392): usbcore: registered new interface driver usbhid
      166737540: (110232762): drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
      167623215: (111118437): TCP cubic registered
      167633614: (111128836): Initializing XFRM netlink socket
      167683217: (111178439): NET: Registered protocol family 1
      167712106: (111207328): NET: Registered protocol family 17
      167951528: (111518308): registered taskstats version 1
      168172849: (111765406): md: Autodetecting RAID arrays.
      168187074: (111779631): md: Scanned 0 and added 0 devices.
      168200974: (111793531): md: autorun ...
      168208982: (111801539): md: ... autorun DONE.
      169978454: (113598824): Initializing disk 0 with devsz 1843200
      172266542: (115958392): VFS: Mounted root (ext2 filesystem).
      173232905: (116924746): Freeing unused kernel memory: 448k freed
      252455810: (168046126): ^I^IWelcome to Fedora Fedora release 9 (Sulphur)
      258838473: (174766587): ^I^IPress 'I' to enter interactive startup.
      355618262: (250426317): eth0: bogus network driver initialization
      355637725: (250445780): No IRQ retreived
      425229028: (301979457): Starting login process
      440000000: 0:0:0: (PC:0xC00000000005C838) : 62.3 Mega-Inst/Sec : 102.4 Mega-Cycles/Sec 32 Zaps
      440000000: 0:0:1: (PC:0xC00000000005C838) : 9.9 Mega-Inst/Sec
      545341801: (347002439): ^[]0;root@(none):~^G^[[?1034hroot@(none) ~# 10087760000000: 0:0:0: (PC:0xC00000000005C838) : 52.0 Mega-Inst/Sec : 2521.7 Giga-Cycles/Sec
      10087760000000: 0:0:1: (PC:0xC00000000005C838) : 49.6 Mega-Inst/Sec
      22035820000000: 0:0:0: (PC:0xC00000000005C838) : 52.8 Mega-Inst/Sec : 2987.0 Giga-Cycles/Sec
      22035820000000: 0:0:1: (PC:0xC00000000005C838) : 54.8 Mega-Inst/Sec
      34121340000000: 0:0:0: (PC:0xC00000000005C838) : 52.5 Mega-Inst/Sec : 3021.2 Giga-Cycles/Sec
      34121340000000: 0:0:1: (PC:0xC00000000005C838) : 55.5 Mega-Inst/Sec
      46222800000000: 0:0:0: (PC:0xC00000000005C838) : 52.5 Mega-Inst/Sec : 3025.3
      546177307492502: ** Execution stopped: user (tcl), **
      546177307492502: ** finished running 19951442686 instructions **
      jobs : no job sig11_handler null
      jobs : No tsim_active_job (or _proxy). Segmentation fault on address 0x91
      FATAL ERROR: 546177307492502: (19951442686): jobs : Segmentation info> BP: 0x1, SP: 0x7fff49a3f4f0, IP: 0x3af04a369a
      jobs : Restored previous handler.
      jobs : If you continue from here, the original signal will be raised
      jobs : You might want to do things like
      jobs : handle 11 stop
      jobs : handle 11 print
      jobs : before you continue
      WARNING: 546177307492502: (19951442686): Caught TRAP Signal. Stopping Simulation
      Segmentation fault
      • SystemAdmin
        SystemAdmin
        10114 Posts
        ACCEPTED ANSWER

        Re: Simulator 3.1, x86_64 no console window

        ‏2009-03-25T03:46:17Z  in response to SystemAdmin
        I meet the same problem .Have you solve it?