Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

Univeristy IP cores

I recently came across this website (http://www.terasic.com.tw/cgi-bin/page/archive.pl?language=english&categoryno=47&no=132#section) which list new IP cores set to release by altera/terasic. The site list that all the cores should be released. I was wondering if anyone had tried any of these cores. I am attempting to develope a system that records audio from the input jack of a DE2 board and has options to play back the audio.

I was looking at using the audio core however when I compiled the C program it would not build correctly.

# include <stdio.h># include <unistd.h># include "c:\Temp\new\alt_up_audio.h"

int main()

{

alt_u32 *buf=0;

int x;

unsigned len=32;

x=alt_up_audio_read_left_channel(buf, len);

//alt_up_audio_read_left_channel(buf, len);

usleep(1000000000);

x=alt_up_audio_write_left_channel(buf, len);

return 0;

}

This is the result of the build-all.

make -s all

Compiling hello_world_small.c...

Linking hello_world_small_0.elf...

obj/hello_world_small.o(.text+0x18): In function `main&#39;:

../hello_world_small.c:70: undefined reference to `alt_up_audio_read_left_channel&#39;

obj/hello_world_small.o(.text+0x30):../hello_world_small.c:73: undefined reference to `alt_up_audio_write_left_channel&#39;

collect2: ld returned 1 exit status

make: *** [hello_world_small_0.elf] Error 1

All .c and .h files are located within the project folder for Nios II IDE. I&#39;m not sure if this makes much sense as I am not real familiar with this stuff. I do have a fair amount of programming experience its just lack of experience with Nios II IDE.

Any help would be nice. Whether with this or with being able to record audio to the DE2 board and play it back.

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Since the toolchain is GCC, on top of Cygwin, I&#39;m pretty certain that your# include path of "c:\Temp\new\alt_up_audio.h" will not work.

    Also, it&#39;s better practice to limit this to something like

    # include "alt_up_audio.h"

    ...and then to add include paths to your project under the "C/C++ Build" options, if using the IDE.

    If you&#39;re using your own custom build environment, then you&#39;d need to (at a minimum) include a -I gcc command line switch.

    Cheers,

    - slacker
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The IP Cores developed by Altera/Terasic are still a Beta release. For the Beta release all C code has been created for and tested using the Altera Debug Client. The C code will not be fully integrated with the Nios II IDE until the full release (some time mid 2007). If you want to use the cores now, please use the Debug Client. If you want to use the Nios II IDE, you will have to copy the IP Core&#39;s drivers into your project manually, plus you may have to modify some of the code for it to work properly.

    Best Regards,

    - Blair

    P.S. The Altera Debug Client can be found at

    altera tutorials and exercises page (http://www.altera.com/education/univ/materials/manual/unv-lab-manual.html)

    altera debug client&#39;s installer (ftp://ftp.altera.com/up/pub/altera_debug_client_setup.zip)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for the help. I was able to get the thing to compile, well almost. I am using the Universiry IP core. The core I am using as mentioned before is the audio. When I compile now its telling me there is a variable that has not been defined. This variable is ALT_UP_AUDIO_BASE. Traditionally other parameters similar to this are assigned in the system.h file. However because of the nature of this core (being that it is beta) the system.h file is not up to date for this. If anyone knows what value this should be please let me know. Again any help is greatly appreciated.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The value of ALT_UP_AUDIO_BASE should be the base address of the audio device as set in SOPC Builder.

    - Blair
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by theguru@Jan 18 2007, 01:16 PM

    the value of alt_up_audio_base should be the base address of the audio device as set in sopc builder.

    - blair

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=20695)

    --- quote end ---

    --- Quote End ---

    Thanks, I thought thats what it was but wasn&#39;t sure. I did however find the correct system.h file eventually. The one that I actually wanted to inlcude was not created in the correct location and therefore the default one was used. Thanks again for the response.