You will need to do type checking for arrays, and 20% of the assignment will be the ability of your compiler to perform register allocation.
java -jar MJPA7_groupname.jar InputFile.javaYou should also provide a register allocation option.
java -jar MJPA7_groupname.jar --regalloc InputFile.java
Your README needs a paragraph that describes how you did register allocation. We will be comparing the dynamic number of loads and stores in the code generated by your non-register allocating compiler to your register allocating code and there should be a definite reduction. MJSIM has been updated to print out the number of loads and stores that occurred during the simulation.
The input files can be any PA7 MeggyJava program. The PA7GameOfLife.java are possible test cases for MJPA7_groupname.jar. The output file named InputFile.java.s should be an AVR assembly program that uses the provided build process to run on the MeggyJr device. Additionally, the InputFile.java.s file must be such that we can run it through the AVR simulator MJSIM.jar (NOTE: this is a new version of MJSIM.jar updated for PA7).
We will be testing your register allocation by having the simulator count loads and stores when the generated code executes and checking that the number of loads and stores is noticeably less (at least 10%) than the code generated by the non-register allocation version of the your compiler without register allocation or the reference compiler.
EXTRA CREDIT: Any group who generates code that consistently executes fewer load and store instructions than the register-allocated code generated by the reference compiler will receive 5 points extra credit for PA7. The reference compiler for this piece will be posted here by April 22nd (The reference compiler MJ.jar is in ~cs453/public/).
[LINENUM,POSNUM] Array reference to non-array type
[LINENUM,POSNUM] Index expression type for array reference must be INT
[LINENUM,POSNUM] Operator length called on non-array type
[LINENUM,POSNUM] Invalid operand type for new array operator
[LINENUM,POSNUM] Invalid expression type assigned into array
where LINENUM is the line number for the symbol and POSNUM is the position number for the symbol.
To enable easier testing and grading do not change the phrasing of the error messages. Test against the reference type checkers in ~cs453/public/.
# Examples of each statement type are provided.
# Register numbers, constant values, and labels can change.
ldi r24,lo8(1)
ldi r25,hi8(0)
ldi r24,73
lds r24, Button_A
push r24
pop r24
call functionName
tst r24
cp r24, r25
breq MJ_L6
brne MJ_L7
jmp MJ_L6
LabelWithAnyName:
# top of a function declaration
.text
.global Cloudrain
.type Cloudrain, @function
Cloudrain:
# indirect stores and loads
std Y+1, r24
ldd r24, Y + 3
call malloc
call _Z10SetAuxLEDsh
For more details about the instructions see the 08-MeggyJrSimple-n-AVR.txt notes.
Notice that avrF.rtl.s already has an infinite loop at the end of main so that the program will always remain running on the Meggy Jr device even if there is no while loop in the MeggyJava program.
svn log
svn info
svnlook tree REPOSITORY_PATH
Note that svnlook must be issued on the machine where the repository resides.
~cs453/bin/checkin PA6 MJPA7_groupname.jar
// We will also run the test cases with different arg_opts files.
java -jar MJPA7_groupname.jar TestCase.java
java -jar MJSIM.jar -b -f TestCase.java.s > t1
javac TestCase.java
java TestCase > t2
diff t1 t2
// to get the README, subversion.txt, look at source files,
// and view any other required files
jar xf MJPA7_groupname.jar
// To test your register allocation, we will do the following:
java -jar MJPA7_groupname.jar TestCase.java
java -jar MJSIM.jar -b -f TestCase.java.s > t1
java -jar MJPA7_groupname.jar --regalloc TestCase.java
java -jar MJSIM.jar -b -f TestCase.java.s > t2
diff t1 t2
// The numbers of loads and stores for the register
// allocated code should be smaller. Other than that
// t1 and t2 should be the same.