4 Replies Latest reply on Oct 20, 2011 3:13 PM by hoffman

    Using RCCE with ETI

    darence

      Hi there,

       

      I've been trying to get RCCE to work with the ETI Framework for baremetal, but no luck so far. Namely, I am trying to compile and run Hello World provided with the library, but linking fails. When I run

       

      gcc_scc -o hello -I/pathtorcce/include RCCE_hello.c /pathtorcce/bin/SCC_BAREMETAL/libRCCE_bigflags_nongory_nopwrmgmt.a
      

       

      what I get is

       

      /pathtorcce/bin/SCC_BAREMETAL/libRCCE_bigflags_nongory_nopwrmgmt.a(RCCE_admin.o): In function `writeLUT':
      RCCE_admin.c:(.text+0x565): undefined reference to `mmap'
      RCCE_admin.c:(.text+0x57b): undefined reference to `munmap'
      /pathtorcce/bin/SCC_BAREMETAL/libRCCE_bigflags_nongory_nopwrmgmt.a(RCCE_admin.o): In function `readLUT':
      RCCE_admin.c:(.text+0x603): undefined reference to `mmap'
      RCCE_admin.c:(.text+0x615): undefined reference to `munmap'
      /pathtorcce/bin/SCC_BAREMETAL/libRCCE_bigflags_nongory_nopwrmgmt.a(RCCE_admin.o): In function `getCOREID':
      RCCE_admin.c:(.text+0x682): undefined reference to `mmap'
      RCCE_admin.c:(.text+0x698): undefined reference to `munmap'
      /pathtorcce/bin/SCC_BAREMETAL/libRCCE_bigflags_nongory_nopwrmgmt.a(RCCE_synch.o): In function `RCCE_barrier':
      /pathtorcce/src/RCCE_synch.c:(.text+0x41): undefined reference to `stdout'
      /pathtorcce/src/RCCE_synch.c:(.text+0x142): undefined reference to `stdout'
      /pathtorcce/bin/SCC_BAREMETAL/libRCCE_bigflags_nongory_nopwrmgmt.a(RCCE_debug.o): In function `RCCE_error_return':
      /pathtorcce/src/RCCE_debug.c:(.text+0xc1): undefined reference to `stdout'
      collect2: ld returned 1 exit status
      
      

       

      Any suggestions?

        • 1. Re: Using RCCE with ETI
          tedk

          You are in uncharted territory here. In the early days RCCE has a baremetal build, but no one has worked on this version of RCCE for a while. If you get RCCE and baremetal working, please share your results here.

           

          The ETI Framework is an excellent environment for baremetal work. But note that RCCE  makes some OS calls that most likely are not supported in the ETI environment. In fact the map and unmap fucntions are OS calls to do memory-mapped I/O.

           

          I have essentially no experience with RCCE and baremetal, but what I did do was edit common/symbols.in under RCCE to take out the "hijacked shared memory" stuff. I was then able to do a ./configure SCC_BAREMETAL and a ./makeall successfully. I think the next step, though, would be to look through the RCCE code and find out what is happening inside a BAREMETAL build.

          1 of 1 people found this helpful
          • 2. Re: Using RCCE with ETI
            darence

            Compiling RCCE for baremetal works. However, the problem arises when I try to link it against my own code. With default settings I'm getting an error as described above. However, by examining the code I concluded that removing -DSHMADD from symbols.in removes most of those "nasty" references (mmap etc). By the way, I don't think I understand what SHMADD means. Could you please clarify?

             

            Right now I am able to link the library against my code, but it won't run, not even Hello World. I will keep trying for some time.

            • 3. Re: Using RCCE with ETI
              tedk

              -DSHMADD enables "highjacked shared memory."  There's a doc that describes this, http://communities.intel.com/docs/DOC-5644

              Highjacking was a hack for increasing shared memory. It's kept for legacy. There's another ifdef called SHMADD_CACHEABLE that makes the highjacked memory cacheable (but you have to have an SCC Linux with the new L2 flush routine; this Linux is not the default). This method is called highjacking because it increases shared memory by taking unused memory away from the OS. A RCCE improvement would be to ifdef highjacking under a "not baremetal."

               

              When I said I could build a baremetal RCCE by taking out the highjacking stuff I meant building without -DSHMADD and -DSHADD_CACHEABLE.

               

              I don't think anyone has ever tried RCCE with ETI. The ETI framework provides a lot of support for baremetal apps. I don't know if it provides everything that RCCE needs. I can tell you that in the early days RCCE (without ETI) could produce working baremetal apps. This was before my time, and much has changed since then. I'll see what I can find out that might aid you.

              1 of 1 people found this helpful
              • 4. Re: Using RCCE with ETI
                hoffman

                well, depending on your definition, you're in luck.

                 

                baremetal really means baremetal (no kernel, hence no system calls)

                 

                the calls to mmap are completely isomorphic to the memory region calls provided by

                eti (i.e., get my the virtual address I can use to talk to my lut, or that mpb, or these general

                purpose registers)

                 

                mmap is unnecessary here, in that we dont stick around after exit(), and its not actually

                reserving anything, just telling you where the resource was already mapped.

                 

                you will have to go in and change the relevant functions in rcce. let me know if you have specific

                questions