|
OpenRisc ToolChain & Simulator
by s.saeed on Sep 2, 2010 |
s.saeed
Posts: 5 Joined: Jul 14, 2010 Last seen: Jan 3, 2012 |
||
|
Hi,
Can someone please provide a complete example of use of ucLinux OpenRisc Toolchain along with use of simulator? I have browsed through the forum posts, and there is mention of an example (e.g. in the post titled "Simulator ORC") but I cannot find that example. Also, Embecosm Application Note EAN2 is not much helpful since it describes for or1ksim-0.2.0 and not the latest version. Thanks and Regards, Sharjeel Saeed |
|||
|
RE: OpenRisc ToolChain & Simulator
by jeremybennett on Sep 2, 2010 |
jeremybennett
Posts: 689 Joined: May 29, 2008 Last seen: Feb 9, 2012 |
||
|
Hi,
Can someone please provide a complete example of use of ucLinux OpenRisc Toolchain along with use of simulator? I have browsed through the forum posts, and there is mention of an example (e.g. in the post titled "Simulator ORC") but I cannot find that example. Also, Embecosm Application Note EAN2 is not much helpful since it describes for or1ksim-0.2.0 and not the latest version. Thanks and Regards, Sharjeel Saeed Hi Sharjeel The tool chain install script will install and build all the tools, libraries and linux kernel and start up Linux running on Or1ksim. See the tool chain page for details of downloading and running this script for different machines. The Embecosm application note is for those running older versions of the tools, for whom the script is not suitable. A new version of the script, with updates for all tools is scheduled for release at the end of this month. HTH, Jeremy
-- |
|||
|
RE: OpenRisc ToolChain & Simulator
by s.saeed on Sep 2, 2010 |
s.saeed
Posts: 5 Joined: Jul 14, 2010 Last seen: Jan 3, 2012 |
||
|
Jeremy,
Actually I already have tools installed on the workstation. What I am looking for is some example code to compile on uclinux based toolset and run the executable on uclinux based simulator. To be more specific, I am looking for some example C-code, make-build environment for compiling that code, linker script and a configuration file. If the example uses uclinux and not the elf toolchain, that would be really helpful. Thanks and Regards, Sharjeel |
|||
|
RE: OpenRisc ToolChain & Simulator
by jeremybennett on Sep 2, 2010 |
jeremybennett
Posts: 689 Joined: May 29, 2008 Last seen: Feb 9, 2012 |
||
|
Hi Sharjeel, You can see some examples of standalone code in the Embecosm Application Note #1 Building a Loosely Timed SoC Model with OSCI TLM 2.0. Using the newlib library, building and running programs is very simple. or32-elf-gcc -mor32-newlib hello-world.c or32-elf-sim -m 8M a.out HTH At present this only works with the tools built from SVN (the GNU tool chain page gives details of how). It will become the standard tool chain with the new release at the end of this month. Jeremy |
|||
|
RE: OpenRisc ToolChain & Simulator
by s.saeed on Sep 7, 2010 |
s.saeed
Posts: 5 Joined: Jul 14, 2010 Last seen: Jan 3, 2012 |
||
|
Thanks Jeremy,
I however wasn't able to go through the installation as I don't have license for SystemC simulator. Are there any other examples available which don't need proprietary license? Secondly, can you tell me where I can find the library for function or1ksim_init (used during linking)? I have tried linking to libsim.a but to no avail. Thanks and Regards, Sharjeel |
|||
|
RE: OpenRisc ToolChain & Simulator
by wallento on Sep 7, 2010 |
wallento
Posts: 18 Joined: Jan 24, 2009 Last seen: Jan 28, 2012 |
||
|
Dear Sharjeel,
the SystemC license does not include any license fee. Instead it is open source, but not freely available. You need to provide your personal data to download it. In case that does not hinder you, you can easily get SystemC here: www.systemc.org Bye, Stefan |
|||
|
RE: OpenRisc ToolChain & Simulator
by jeremybennett on Sep 7, 2010 |
jeremybennett
Posts: 689 Joined: May 29, 2008 Last seen: Feb 9, 2012 |
||
|
I however wasn't able to go through the installation as I don't have license for SystemC simulator. Are there any other examples available which don't need proprietary license? Hi Sharjeel, As Stefan points out, it is freely available from the OSCI website in exchange for you registering. If you have problems downloading it, let us know. Its specification is IEEE 1666, which exceptionally for the IEEE is also free to download! Secondly, can you tell me where I can find the library for function or1ksim_init (used during linking)? I have tried linking to libsim.a but to no avail. This is in libsim.a. Are you sure you are picking up the latest version of Or1ksim? The interface has changed between 0.4.0 and SVN (what will be 0.5.0), so you need to look at how you are calling the function. See or1ksim.h for the prototype. HTH Jeremy |
|||
|
RE: OpenRisc ToolChain & Simulator
by jt_eaton on Sep 8, 2010 |
jt_eaton
Posts: 88 Joined: Aug 18, 2008 Last seen: Feb 9, 2012 |
||
|
As Stefan points out, it is freely available from the OSCI website in exchange for you registering. If you have problems downloading it, let us know. Its specification is IEEE 1666, which exceptionally for the IEEE is also free to download! ------------------------------------------------------------- I've been seeing that for several new standards. Someone must have figured out that if you want people to use them then the best way to do that is with a free copy. Besides how much does it cost to deliver a pdf that was written using volunteer labor? John Eaton |
|||
|
RE: OpenRisc ToolChain & Simulator
by s.saeed on Sep 8, 2010 |
s.saeed
Posts: 5 Joined: Jul 14, 2010 Last seen: Jan 3, 2012 |
||
|
Stefan and Jeremy, thank you guys for your responses.
As Stefan points out, it is freely available from the OSCI website in exchange for you registering. If you have problems downloading it, let us know. Its specification is IEEE 1666, which exceptionally for the IEEE is also free to download! I downloaded and installed SystemC. However, I still couldn't successfully configure for ESP#1. My workstations are 64-bit, so during the installation of System-C, the library that got installed was lib-linux64. It seems like Configure script searches for lib-linux only, and gave an error that SystemC library not found. I tried making a soft link of lib-linux which directs to lib-linux64. Configure was successful but make process failed. Sorry I cannot post the complete log file because my IT Security Officer would hit the roof. But below is the error that I get during make.
make[3]: Entering directory `/user/sharjeel/work/Lib/esp1-tlm2-or1ksim-examples-2.0/objdir/progs-or32'
/bin/sh ./libtool --tag=CC --mode=compile /user/sharjeel/work/Lib/esp1-tlm2-or1ksim-examples-2.0/compile -DHAVE_CONFIG_H -I. -I../../progs-or32 -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -MT bitutils.lo -MD -MP -MF .deps/bitutils.Tpo -c -o bitutils.lo ../../progs-or32/bitutils.c libtool: compile: /user/sharjeel/work/Lib/esp1-tlm2-or1ksim-examples-2.0/compile -DHAVE_CONFIG_H -I. -I../../progs-or32 -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -MT bitutils.lo -MD -MP -MF .deps/bitutils.Tpo -c ../../progs-or32/bitutils.c -fPIC -DPIC -o .libs/bitutils.o /user/sharjeel/work/Lib/esp1-tlm2-or1ksim-examples-2.0/compile: line 123: -DHAVE_CONFIG_H: command not found make[3]: *** [bitutils.lo] Error 1 This is in libsim.a. Are you sure you are picking up the latest version of Or1ksim? The interface has changed between 0.4.0 and SVN (what will be 0.5.0), so you need to look at how you are calling the function. See or1ksim.h for the prototype. Actually I am using the precompiled binary for Cygwin, the one that is currently available on the OpenRisc GNU Toolchain page. Below is the error that I get.
or32-elf-gcc -c lib-iftest.c
or32-elf-gcc --library libsim.a -Trc2000.ld lib-iftest.o lib-iftest.o: In function `_main': lib-iftest.c:(.text+0x34): undefined reference to `__impure_ptr' lib-iftest.c:(.text+0x150): undefined reference to `__impure_ptr' lib-iftest.c:(.text+0x1f0): undefined reference to `_or1ksim_init' lib-iftest.c:(.text+0x240): undefined reference to `_or1ksim_run' lib-iftest.c:(.text+0x2e4): undefined reference to `_or1ksim_set_time_point' lib-iftest.c:(.text+0x320): undefined reference to `_or1ksim_run' lib-iftest.c:(.text+0x3b0): undefined reference to `_or1ksim_get_time_period' lib-iftest.c:(.text+0x49c): undefined reference to `_or1ksim_is_le' lib-iftest.c:(.text+0x534): undefined reference to `_or1ksim_clock_rate' collect2: ld returned 1 exit status Thanks and Regards, Sharjeel |
|||
|
RE: OpenRisc ToolChain & Simulator
by jeremybennett on Sep 8, 2010 |
jeremybennett
Posts: 689 Joined: May 29, 2008 Last seen: Feb 9, 2012 |
||
|
I downloaded and installed SystemC. However, I still couldn't successfully configure for ESP#1. My workstations are 64-bit, so during the installation of System-C, the library that got installed was lib-linux64. It seems like Configure script searches for lib-linux only, and gave an error that SystemC library not found. I tried making a soft link of lib-linux which directs to lib-linux64. Configure was successful but make process failed. Sorry I cannot post the complete log file because my IT Security Officer would hit the roof. But below is the error that I get during make.
make[3]: Entering directory `/user/sharjeel/work/Lib/esp1-tlm2-or1ksim-examples-2.0/objdir/progs-or32'
/bin/sh ./libtool --tag=CC --mode=compile /user/sharjeel/work/Lib/esp1-tlm2-or1ksim-examples-2.0/compile -DHAVE_CONFIG_H -I. -I../../progs-or32 -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -MT bitutils.lo -MD -MP -MF .deps/bitutils.Tpo -c -o bitutils.lo ../../progs-or32/bitutils.c libtool: compile: /user/sharjeel/work/Lib/esp1-tlm2-or1ksim-examples-2.0/compile -DHAVE_CONFIG_H -I. -I../../progs-or32 -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -MT bitutils.lo -MD -MP -MF .deps/bitutils.Tpo -c ../../progs-or32/bitutils.c -fPIC -DPIC -o .libs/bitutils.o /user/sharjeel/work/Lib/esp1-tlm2-or1ksim-examples-2.0/compile: line 123: -DHAVE_CONFIG_H: command not found make[3]: *** [bitutils.lo] Error 1 Hi Sharjeel, I don't think this is anything to do with SystemC. I think you have forgotten to specify --target=or32-elf when configuring. See Appendix A, section A.1 in the app note. This is in libsim.a. Are you sure you are picking up the latest version of Or1ksim? The interface has changed between 0.4.0 and SVN (what will be 0.5.0), so you need to look at how you are calling the function. See or1ksim.h for the prototype. Actually I am using the precompiled binary for Cygwin, the one that is currently available on the OpenRisc GNU Toolchain page. Below is the error that I get. or32-elf-gcc -c lib-iftest.c or32-elf-gcc --library libsim.a -Trc2000.ld lib-iftest.o lib-iftest.o: In function `_main': lib-iftest.c:(.text+0x34): undefined reference to `__impure_ptr' lib-iftest.c:(.text+0x150): undefined reference to `__impure_ptr' lib-iftest.c:(.text+0x1f0): undefined reference to `_or1ksim_init' lib-iftest.c:(.text+0x240): undefined reference to `_or1ksim_run' lib-iftest.c:(.text+0x2e4): undefined reference to `_or1ksim_set_time_point' lib-iftest.c:(.text+0x320): undefined reference to `_or1ksim_run' lib-iftest.c:(.text+0x3b0): undefined reference to `_or1ksim_get_time_period' lib-iftest.c:(.text+0x49c): undefined reference to `_or1ksim_is_le' lib-iftest.c:(.text+0x534): undefined reference to `_or1ksim_clock_rate' collect2: ld returned 1 exit status OK. Looks like you have version 0.3.0. I don't think the pre-compiled versions have been updated. You should be able to confirm this with or32-elf-sim --version I believe Or1ksim 0.4.0 builds successfully on Cygwin, so you should download and build it from source. You'll see Or1ksim 0.5.0rc1 is also now available. However don't use it (yet) with the application note. The library interfaces have changed, and I need to update the application note. HTH Jeremy |
|||
|
RE: OpenRisc ToolChain & Simulator
by hardikshah on Oct 28, 2010 |
hardikshah
Posts: 4 Joined: Oct 8, 2009 Last seen: Oct 19, 2011 |
||
|
Hi All,
I am totaly new to this tool chain. I tried to run it as Jerremy has mentioned. or32-elf-gcc -mor32-newlib test.c or32-elf-sim a.out But this gives a lot of errors like: ... ERR: 8-bit program load out of memory area: 00008512 ERR: 8-bit program load out of memory area: 00008513 ERR: 8-bit program load out of memory area: 00008514 ERR: 8-bit program load out of memory area: 00008515 ERR: 8-bit program load out of memory area: 00008516 ... And one more question, when I tried to build the loosely timed system from Embecosm acoring to, mkdir build cd build ../esp1-tlm2-or1ksim-examples-2.0/configure options make I got it configured correctly. But "make" failed with the following responce: or32-elf-gcc -DHAVE_CONFIG_H -I. -I../../esp1-tlm2-or1ksim-examples-2.0/progs-or32 -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -MT hello.o -MD -MP -MF .deps/hello.Tpo -c -o hello.o ../../esp1-tlm2-or1ksim-examples-2.0/progs-or32/hello.c mv -f .deps/hello.Tpo .deps/hello.Po /bin/sh ./libtool --tag=CC --mode=link or32-elf-gcc -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -T../../esp1-tlm2-or1ksim-examples-2.0/progs-or32/default.ld -o hello hello.o ./libboot.la libtool: link: or32-elf-gcc -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -T../../esp1-tlm2-or1ksim-examples-2.0/progs-or32/default.ld -o hello hello.o ./.libs/libboot.a ./.libs/libboot.a(start.o): In function `_start': start.s:(.boot-text+0x110): undefined reference to `_main' collect2: ld returned 1 exit status make[3]: *** [hello] Error 1 make[3]: Leaving directory `/home/shah/projects/or1ksim/embecosm/build/progs-or32' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/shah/projects/or1ksim/embecosm/build/progs-or32' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/shah/projects/or1ksim/embecosm/build' make: *** [all] Error 2 At first I tried to intall the tool chain as in Embecosm EAN2, but GCC build failed because of overflow (somewhere I read that "sprintf" was the culprit). Then I followed "Toolchain installation by hand " from http://opencores.org/openrisc,gnu_toolchain . It does not include Linux. Can sombody help me out with this? Thank you and best regards, Hardik Shah |
|||
|
RE: OpenRisc ToolChain & Simulator
by jeremybennett on Oct 28, 2010 |
jeremybennett
Posts: 689 Joined: May 29, 2008 Last seen: Feb 9, 2012 |
||
|
Hi All,
I am totaly new to this tool chain. I tried to run it as Jerremy has mentioned. or32-elf-gcc -mor32-newlib test.c or32-elf-sim a.out But this gives a lot of errors like: ... ERR: 8-bit program load out of memory area: 00008512 ERR: 8-bit program load out of memory area: 00008513 ERR: 8-bit program load out of memory area: 00008514 ERR: 8-bit program load out of memory area: 00008515 ERR: 8-bit program load out of memory area: 00008516 ... Hi Hardik, You need to tell the simulator that it has some memory. Assuming you are using the latest release candidate version, try something like or32-elf-sim --memory=8M a.out That will give you 8 megabytes starting at location zero. More complex arrangements will need a configuration file as described in the Or1ksim user guide. And one more question, when I tried to build the loosely timed system from Embecosm acoring to, mkdir build cd build ../esp1-tlm2-or1ksim-examples-2.0/configure options make I got it configured correctly. But "make" failed with the following responce: or32-elf-gcc -DHAVE_CONFIG_H -I. -I../../esp1-tlm2-or1ksim-examples-2.0/progs-or32 -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -MT hello.o -MD -MP -MF .deps/hello.Tpo -c -o hello.o ../../esp1-tlm2-or1ksim-examples-2.0/progs-or32/hello.c mv -f .deps/hello.Tpo .deps/hello.Po /bin/sh ./libtool --tag=CC --mode=link or32-elf-gcc -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -T../../esp1-tlm2-or1ksim-examples-2.0/progs-or32/default.ld -o hello hello.o ./libboot.la libtool: link: or32-elf-gcc -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -T../../esp1-tlm2-or1ksim-examples-2.0/progs-or32/default.ld -o hello hello.o ./.libs/libboot.a ./.libs/libboot.a(start.o): In function `_start': start.s:(.boot-text+0x110): undefined reference to `_main' collect2: ld returned 1 exit status make[3]: *** [hello] Error 1 make[3]: Leaving directory `/home/shah/projects/or1ksim/embecosm/build/progs-or32' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/shah/projects/or1ksim/embecosm/build/progs-or32' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/shah/projects/or1ksim/embecosm/build' make: *** [all] Error 2 At first I tried to intall the tool chain as in Embecosm EAN2, but GCC build failed because of overflow (somewhere I read that "sprintf" was the culprit). Then I followed "Toolchain installation by hand " from http://opencores.org/openrisc,gnu_toolchain . It does not include Linux. Can sombody help me out with this? Thank you and best regards, Hardik Shah This is a bit harder. The Embecosm application note number 1 you are using predates the recent changes to the GCC compiler (I will update it later in the year for the new tool chain). One of the key changes is that the GCC compiler no longer inserts underscore before global symbols (not needed for ELF). The solution is edit start.s and replace l.jal _main with l.jal main. You should then rebuild the complete system. I haven't updated this application note for Or1ksim 0.5.0 (it uses 0.4.0). There are API changes, so the examples will not work. The solution is either to use Or1ksim 0.4.0 (available from the download page), or to modify the API calls (a useful learning exercise). HTH Jeremy |
|||
|
RE: OpenRisc ToolChain & Simulator
by hardikshah on Oct 29, 2010 |
hardikshah
Posts: 4 Joined: Oct 8, 2009 Last seen: Oct 19, 2011 |
||
|
Hi Jeremy,
Thanks for your help I can now build the loosely timed example as mentioned in the application note (logger test). Though, when I try to run it, following messages are displayed: Or1ksim 0.4.0 Building automata... done, num uncovered: 0/213. Parsing operands data... done. Resetting PIC. loadcode: filename progs-or32/logger-test startaddr=00000000 virtphy_transl=00000000 Not COFF file format ELF type: 0x0002 ELF machine: 0x005c ELF version: 0x00000001 ELF sec = 12 Section: .text, vaddr: 0x00000000, paddr: 0x0 offset: 0x00002000, size: 0x00001406 ERR: 8-bit program load out of memory area: 00000000 ERR: 8-bit program load out of memory area: 00000001 ERR: 8-bit program load out of memory area: 00000002 ERR: 8-bit program load out of memory area: 00000003 ERR: 8-bit program load out of memory area: 00000004 ERR: 8-bit program load out of memory area: 00000005 ....... It seems to me there is wrong in my simple.cfg file. It looks like: section generic enabled = 1 baseaddr = 0x90000000 size = 0x8 name = "External UART" byte_enabled = 1 hw_enabled = 1 word_enabled = 1 end Do I need to change some settings here? Best regards, Hardik |
|||
|
RE: OpenRisc ToolChain & Simulator
by hardikshah on Oct 29, 2010 |
hardikshah
Posts: 4 Joined: Oct 8, 2009 Last seen: Oct 19, 2011 |
||
|
Hi Jeremy,
Thanks for your help I can now build the loosely timed example as mentioned in the application note (logger test). Though, when I try to run it, following messages are displayed: Or1ksim 0.4.0 Building automata... done, num uncovered: 0/213. Parsing operands data... done. Resetting PIC. loadcode: filename progs-or32/logger-test startaddr=00000000 virtphy_transl=00000000 Not COFF file format ELF type: 0x0002 ELF machine: 0x005c ELF version: 0x00000001 ELF sec = 12 Section: .text, vaddr: 0x00000000, paddr: 0x0 offset: 0x00002000, size: 0x00001406 ERR: 8-bit program load out of memory area: 00000000 ERR: 8-bit program load out of memory area: 00000001 ERR: 8-bit program load out of memory area: 00000002 ERR: 8-bit program load out of memory area: 00000003 ERR: 8-bit program load out of memory area: 00000004 ERR: 8-bit program load out of memory area: 00000005 ....... It seems to me there is wrong in my simple.cfg file. It looks like: section generic enabled = 1 baseaddr = 0x90000000 size = 0x8 name = "External UART" byte_enabled = 1 hw_enabled = 1 word_enabled = 1 end Do I need to change some settings here? Best regards, Hardik |
|||
|
RE: OpenRisc ToolChain & Simulator
by hardikshah on Oct 29, 2010 |
hardikshah
Posts: 4 Joined: Oct 8, 2009 Last seen: Oct 19, 2011 |
||
|
Hi Jeremy,
Thanks for your help I can now build the loosely timed example as mentioned in the application note (logger test). Though, when I try to run it, following messages are displayed: Or1ksim 0.4.0 Building automata... done, num uncovered: 0/213. Parsing operands data... done. Resetting PIC. loadcode: filename progs-or32/logger-test startaddr=00000000 virtphy_transl=00000000 Not COFF file format ELF type: 0x0002 ELF machine: 0x005c ELF version: 0x00000001 ELF sec = 12 Section: .text, vaddr: 0x00000000, paddr: 0x0 offset: 0x00002000, size: 0x00001406 ERR: 8-bit program load out of memory area: 00000000 ERR: 8-bit program load out of memory area: 00000001 ERR: 8-bit program load out of memory area: 00000002 ERR: 8-bit program load out of memory area: 00000003 ERR: 8-bit program load out of memory area: 00000004 ERR: 8-bit program load out of memory area: 00000005 ....... It seems to me there is wrong in my simple.cfg file. It looks like: section generic enabled = 1 baseaddr = 0x90000000 size = 0x8 name = "External UART" byte_enabled = 1 hw_enabled = 1 word_enabled = 1 end Do I need to change some settings here? Best regards, Hardik |
|||

1/2 
