This phase of the final project deals with MIPS code generation. (You should review the readings on "instruction tiling" and also review your knowledge of MIPS assembly.) It is intended to be a substantial (but not overlong) project. If properly implemented you should be able to test you compiler using SPIM. There is no specific due date, but you should aim to complete it sooner rather than later, so that time remains to implement the register allocator.
A great deal of code has been added since the previous project and you should take some time to read over the details of the new packages. Do not be intimidated by how much the compiler has grown; you can confine your work to just two files.
You will want to get particularly familiar with the Architecture interface, the architecture.mips package, and the assembly package. The latter defines "abstract assembly" language which your tiling program will create. I have supplied you with a "dummy allocator" that assumes that there are no general-purpose registers available, and spills all temporaries to memory.
To run the compiler, you now have a few options. You can run it as:
java main/Mainand it will take standard input as before. It will print to the screen both the Cflat intermediate code and the "raw assembly" just using temporaries and no registers. It will also output the "allocated" assembly (the final product, including the standard library) to a file called "output.s" in the folder above the calling folder (which should be the top-level folder for the project).
You can also run it with command line arguments:
java main/Main /Users/msiff/php--/factorial.php /Users/msiff/mips/factorial.s
You will want to begin by downloading the entire project.
You only need work in MipsInstructionTile and MipsCodeGen. The vast majority of the work will be in the former, where "TODO" comments are used to indicate the general where and what you need.
The stub project as available correctly compiles echo statements like:
<?php echo "Hello!"; ?>To get the rest of things working, you just need to generate abstract assembly for intermediate assignments (in their various forms) and conditionals.
You need not submit this portion of the assignment; it will just be essential for the final phase to work correctly.