{"id":1454,"date":"2013-08-12T10:07:32","date_gmt":"2013-08-12T17:07:32","guid":{"rendered":"http:\/\/aviral.lab.asu.edu\/?page_id=1454"},"modified":"2020-08-23T03:32:08","modified_gmt":"2020-08-23T03:32:08","slug":"ps3-linux-gcc-experimental-setup-for-smm","status":"publish","type":"page","link":"https:\/\/labs.engineering.asu.edu\/mps-lab\/software-managed-manycore-smm\/ps3-linux-gcc-experimental-setup-for-smm\/","title":{"rendered":"PS3-Linux-GCC: Experimental Setup for SMM"},"content":{"rendered":"<p>&nbsp;<\/p>\n<h3>Preparing\u00a0SPU-GCC toolchain<\/h3>\n<p>On Cell BE architecture, there are two different types of processor: PowerPC Processing Element (PPE), and\u00a0Synergistic Processing Elements (SPEs). The PPE can run standard PowerPC applications with the general GCC,\u00a0but the SPEs require a special compiler that supports SPE instruction set. In this section, we explore how to build a SPE\u00a0cross-toolchain that will enable you to compile programs for spu-elf architecture.<\/p>\n<p>Note: OS system should be Fedora 9 on i386 or i686.<\/p>\n<h4>binutils<\/h4>\n<p>Before we go to build the spu-gcc compiler, we\u00a0need to prepare binutils on the system.\u00a0Commands are as follows:<\/p>\n<p>===========================================================================<br \/>\n1. wget ftp:\/\/ftp.gnu.org\/pub\/gnu\/binutils\/binutils-2.18.tar.gz<br \/>\n2. tar zxvf binutils-2.18.tar.gz<br \/>\n3. mkdir build\/binutils<br \/>\n4. cd build\/binutils<br \/>\n5. ..\/..\/binutils-2.18\/configure &#8211;disable-werror &#8211;prefix=\/home\/your_account_name\/COMPILER\/ &#8211;program-prefix=spu-\u00a0&#8211;target=spu-elf<br \/>\n6. change the &#8220;makeinfo&#8221; path in the Makefile<br \/>\n7. make<br \/>\n8. make install<br \/>\n9. cd ..\/..<br \/>\n===========================================================================<\/p>\n<p>Note:<br \/>\na. You can define the installed directory\u00a0by specifying something like &#8220;&#8211;prefix=\/wherever_you_want&#8221;.<br \/>\nb. Now\u00a0add the installed\u00a0path to the\u00a0environment variable.<\/p>\n<p align=\"justify\">Finally, we can try assembling a SPU object:<\/p>\n<p>echo &#8216;frest 0,1&#8217; | spu-as &#8211;<\/p>\n<p>&#8211; this should complete with no error messages.<\/p>\n<h4>SPU-GCC<\/h4>\n<p>This compiler is a modified version of spu-gcc 4.1.1, which can automatically insert <span style=\"color: #000080\"><em>_fci, _fco, _p2s<\/em><\/span> and <em><span style=\"color: #000080\">_s2p<\/span><\/em> library function calls by using flag <em>-llm-manage<\/em>.<\/p>\n<p>1. Get spu-gcc-4.1.1_0.9\u00a0from here: <span style=\"color: #800000\"><a title=\"spu-gcc\" href=\"http:\/\/aviral.lab.asu.edu\/temp\/research\/LLM\/spu-gcc.zip\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color: #800000\"><strong>[<\/strong>SPU-GCC compiler<strong>]<\/strong><\/span><\/a><\/span><\/p>\n<p>2. Put the binary into your Fedora 9<\/p>\n<p>3. chmod +x spu-gcc<\/p>\n<h4>newlib<\/h4>\n<p>Now that you have a spu-compiler, we can compile newlib. The upstream version 1.15.0 version should work nicely.<\/p>\n<p>===========================================================================<\/p>\n<p align=\"justify\">1. wget ftp:\/\/sources.redhat.com\/pub\/newlib\/newlib-1.15.0.tar.gz<br \/>\n2. tar zxvf newlib-1.15.0.tar.gz<br \/>\n3. mkdir build\/newlib<br \/>\n4. cd build\/newlib<br \/>\n5. ..\/..\/newlib-1.15.0\/configure &#8211;target=spu &#8211;prefix=\/home\/your_account_name\/COMPILER\/<br \/>\n6. Modify Makefile, make sure the line &#8220;MAKEINFOR = &#8230;.&#8221;, the route is correct. In Fedora 10, it mostly like &#8220;\/usr\/bin\/makeinfo&#8221;. Or else, use command &#8220;locate makeinfo&#8221; to find the right path.<br \/>\n7. make<br \/>\n8. make install<br \/>\n===========================================================================<\/p>\n<p>To test, we can try a complete &#8216;hello world&#8217; program:<\/p>\n<p>echo -e &#8216;#include &lt;stdio.h&gt;\\nint main(void)&#8217; &#8216;{printf(&#8220;hello world!\\\\n&#8221;);return 0;}&#8217; | spu-gcc -Wall -o\/dev\/null\u00a0 -xc &#8211;<\/p>\n<p>&#8211; this should also complete with no error messages.<\/p>\n<h4>Runtime Library<\/h4>\n<p>The runtime library includes stack data management functions, <em>_fci <\/em>and<em> _fco<\/em>, heap data management functions, _<em>malloc<\/em> and _<em>free<\/em>, and pointer management functions _<em>p2s<\/em> and _<em>s2p<\/em>.<\/p>\n<p>It can be download from here: <span style=\"color: #800000\"><a title=\"libcode\" href=\"http:\/\/aviral.lab.asu.edu\/temp\/research\/LLM\/libCode.zip\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color: #800000\"><strong>[<\/strong>Library Code<strong>]<\/strong><\/span><\/a><\/span><\/p>\n<h4>Testsuit<\/h4>\n<p>Here are some benchmarks that we use in our experiments.<br \/>\nThey can be downloaded from here: <span style=\"color: #800000\"><a title=\"testsuit\" href=\"http:\/\/aviral.lab.asu.edu\/temp\/research\/LLM\/MST.zip\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color: #800000\"><strong>[<\/strong>TestSuit<strong>]<\/strong><\/span><\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Preparing\u00a0SPU-GCC toolchain On Cell BE architecture, there are two different types of processor: PowerPC Processing Element (PPE), and\u00a0Synergistic Processing Elements (SPEs). The PPE can run standard PowerPC applications with the general GCC,\u00a0but the SPEs [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1450,"menu_order":50,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-1454","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/labs.engineering.asu.edu\/mps-lab\/wp-json\/wp\/v2\/pages\/1454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labs.engineering.asu.edu\/mps-lab\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/labs.engineering.asu.edu\/mps-lab\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/labs.engineering.asu.edu\/mps-lab\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labs.engineering.asu.edu\/mps-lab\/wp-json\/wp\/v2\/comments?post=1454"}],"version-history":[{"count":0,"href":"https:\/\/labs.engineering.asu.edu\/mps-lab\/wp-json\/wp\/v2\/pages\/1454\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/labs.engineering.asu.edu\/mps-lab\/wp-json\/wp\/v2\/pages\/1450"}],"wp:attachment":[{"href":"https:\/\/labs.engineering.asu.edu\/mps-lab\/wp-json\/wp\/v2\/media?parent=1454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}