

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The instructions for homework 1 in eecs 583, a course focused on compiler design. Students are required to implement an if-converter to convert branching code into sequential, predicated code using the algorithms discussed in class. Details on the setup, installation of the trimaran compiler system, and the steps to complete the assignment, including computing control dependences, creating predicates, constructing and inserting cmpps, and guarding all operations. Submission instructions and grading criteria are also provided.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Setup and install the Trimaran compiler system under Linux. You can do this either on your CAEN account or own system. Source code available on course webpage, this has some fixes for gcc 2.96, plus some code to get you started. If you have already installed trimaran from http://www.trimaran.org , then you should get the code from the course webpage and extract the following files, overwrite your files with these. trimaran/elcor/src/GNUmakefile, trimaran/elcor/src/Main/eecs583.cpp, trimaran/elcor/src/Main/process_function.cpp, trimaran/elcor/src/Main/el_driver_init.h and .cpp, trimaran/elcor/parms/DRIVER_DEFAULTS, trimaran/envrc
After untarring, modify first line of envrc appropriately, then add to your .cshrc, source …/trimaran/envrc. This sets all the enviroment variables that trimaran requires. Then, cd trimaran, run ./install (fix errors that come up ☺)
Implement an if-converter to convert branching code into sequential, predicated code using the algorithms discussed in class. Your if-converter will operate on a complete, acyclic procedure, converting it to straight-line, predicated code. You may assume the procedure has no loops or cycles of any sort. As a result, there is no need to do any backedge coalescing. The if-converter should convert the body of the procedure into a single basic block without any branches (except of course any subroutine calls (BRL) and the return from subroutine operation at the end of the procedure (RTS)). You may skip all the CMPP compaction stuff. So, essentially, you are to implement steps 2 and 3 of the if-conversion algorithm that was discussed in class.
Assumptions you can make:
You should submit the following to me via email ([email protected]) by 2/6/02. If you work with someone (see below), just submit one email with both persons names at the top.
Grading will be Pass/Fail. Bonus is worth an extra 20% for you homework score. Getting everything to work properly is obviously what you should be striving for, but I’m looking for effort and significant progress, so if you have both of those, you will Pass. To get the bonus, it must work.
You can work alone or in groups of 2, which ever you feel most comfortable. If you work together, each of you are responsible to understand the whole solution (i.e., both you and your partner’s code). So, you should be able to stand up in front of the class and explain your combined solution.
Gui, figure it out yourself. You want to generate BB code, with the standard settings. This is useful to learn, but is not necessary for this assignment.
Compiler manually, elcor –i test1.O_reb –o test1.O_el –Finput_format=rebel –Foutput_format=rebel
-Fdo_583_hw1=yes
Simulator manually (can run on O_reb file as well), Note host_layout_info.md must be in same directory as test1* files. codegen –el test1.O_el –o test1.c –Finput_format=rebel –Femulate_unscheduled=yes
–Femulate_virtual_regs=yes gcc –I/home/mahlke/trimaran/simu/src/Emulib –L/home/mahlke/trimaran/simu/lib *.c –lequals -lm ./a.out > output, diff output verses expected output