Exercise 3 - Creation, use and evaluation of a prototyping platform

General Information

Exercise Tips

Motivation

Objectives

This exercise will be divided into parts and, at the end of them, you should be able to:

Contextualization

Attention: All the files you need for this activity are available at / home / staff / rodolfo / mc723 / download.

Part 1 - Using a virtual platform

A virtual platform is software capable of simulating hardware with a good level of details. It is generally not necessary to modify programs that run on this virtual platform to run them on a real platform (hardware). Some components existing on real platforms do not appear in virtual versions so as not to affect performance. Other components come with very simplified versions. However, the software running on this virtual platform is unlikely to be able to notice this difference. Examples of these components that may appear differently are: caches (which may not exist), peripherals (which can only emulate what they should be doing), etc.

In this exercise, you will use the ARP package (ArchC Reference Platform) to manage platforms. It will be exactly the same package that you will use during the semester to carry out the other experiments. ARP is nothing more than a set of Makefiles and a directory structure to facilitate the development of larger projects. Each directory has a specific content:

Take the sample platform (arp.tgz), unzip it and browse the directories observing the content of each one. Although there is an unpacked version of the ARP in my homedir, I recommend that you start with the empty version indicated above. To run the platform, just use the commands:

make
make run

The first command compiles the platform and the second executes it. If it is necessary to compile the program, you must use the compiler installed in / l / archc / compilers / bin of the machine xaveco (the compiler is only there, you can run the programs compiled on any other machine, but the compilers for MIPS are only in xaveco). For ease, include the previous path in the PATH before executing the two commands above.

At the end of the execution, the simulator will indicate how many instructions per second it has been able to execute. Make a note of this number. What do you think of this speed? Is there any way to improve?

Can you run another program? Make a program (very simple) and put it to run on this platform. Is the simulation speed similar?

Part 2 - Using ArchC in isolation

The previously generated simulator was designed in ArchC. These processors can be used both on platforms and in isolated mode. When a platform is very simple, it is preferable to have the processor isolated. Take the file mips1-v0.7.8.tgz, which contains the MIPS model (practically identical to the one you used previously, and run the same program as in Part 1. To do this, you must unzip the file, use ArchC to generate the model in SystemC, compile the model and run it. Both ArchC and SystemC are installed in / home / staff / rodolfo / mc723, just use them.

acsim mips1.ac -abi
make -f Makefile.archc
mips1.x --load =

Update PATH accordingly before running these commands.

What was the simulation's performance now? Is the difference too big?

Optional challenge worth bonuses on the grade: Take all the necessary components for this simulation, recompile them using the best possible optimizations to generate the fastest simulator possible. At the time of execution of the program jpeg coder in instructions per second (as shown at the end of the execution report (do not use the time command). Everyone must use the ssh.students.ic.unicamp.br machine. best performance without modifying the ArchC source code will earn a bonus. The best performance by modifying little of the ArchC code will also earn a bonus (little = very few lines). The same student can win double bonuses if you make the two best results.The 3 best results in each category will have to demonstrate your modifications in one of the classes. The program to be used is available within from the mibench-mips1.tgz package, inside the consumer / jpeg / bin directory (cjpeg file). Use input_large as an input. See further instructions for use directly in the program directory. Are not compiled, you must use the compiled version available Check if the generated response is valid.

Part 3 - What is the best cache for each program?

Using one of the two simulators (from part 1 or part 2, choose freely), modify the code to list all accesses to memory during the execution of a program. Based on these accesses, you should evaluate five possible cache settings. Again, this is a collaborative activity where each student must do their part and put the result in wiki. However, the final report does not need to use all wiki data, only those available on the day of writing. Feel strongly encouraged to talk about the choice of programs and parameters in order to maximize the number of variations in the same program. Do not share any code.

The available programs are those of mibench_mips1.tgz (like all other files, available in my IC3 homedir at / home / staff / rodolfo / mc723 / download). Each program has a large and a small data entry version, you must choose one of them.

The cache settings to be evaluated are:

Use the first letter of each parameter to represent your configuration. Example: 1V2L1B = 1 way, 2 lines and 1 word block. Indicate the results for each run on the wiki, placing your RA next to your results. As a result, you should take the number of hits and missions. The number of missions must be divided into 3 categories (Compulsory, Capacity and Conflict). Use the results of a simulation to decide which parameters to evaluate (you should not decide the 5 settings before the simulations, but on demand).

To evaluate the caches, you can write a small external program, add some functionality in the simulator or even use a ready-made program and generate the entries for it. The three alternatives are fully valid. As a suggestion for a ready-made program, there is money. Again, you are not required to use the money.

In your report, comment on the results obtained for the program you chose. You don't need to comment for any other program, just yours. Explain how you calculated the hits and misses for the caches.

Delivery

Submit a report of at most 2 pages, describing the activity performed and the results obtained.