


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Over these three labs you will build a Multi-core processor. Labs 10 and 11 are intermediate labs and will only be tested to ensure progress. Lab 12 is when you must demonstrate the completed design. You should remove MMIO from your design for these labs. The following are to be completed throughout the course of labs 10 through 12.
Any evaluation turned in without block diagram(s) of the design will receive a grade of
Parallelize the merge sort algorithm in MIPS assembly and verify it functions correctly.
Connect two pipelines and two L1 cache (I+D) hierarchies to your coherence controller. Verify functionality in source.
Synthesize your multi-core processor. Verify the synthesized version of your multi-core is functional.
Verify your design works in hardware.
The multi-core processor will start a new project. You will want to create a project4 directory in the ece directory. You will need to setup this directory correctly. Re-read the lab1 handout if you need a reminder on how to run dirset. In these labs you will design a multi-core processor, using components you designed in previous labs. You will make a dual-core processor by taking your pipeline design and cache hierarchy, replicating them, and connecting them to a coherence controller. Your threading model will be very simple. Each processor will start at a predetermined address and start executing the thread located at that address. The lecture notes will serve as a excellent reference for using locking primitives and programming models. Be sure to use these when writing your sort algorithm.
Remember the top of the address space is 0x7ffc, and both processors must maintain their own separate stack.
2 Software
You are to write a parallel version of merge sort as discussed in lecture. They values may be divided up among the processors, and sorted. The merge must use locks or flags to correctly merge the data. The data will be provided so everyone has the same amount of information to sort. To simulate a dual-core design use the simulator program that you have used in lab3 to simulate your assembly files. The command to run the simulator in dual-core mode is as follows.
sim -m
3 Multi-core Design
In Figure 1 is a diagram of the basic dual-core design. The key part is the memory hierarchy. This hierarchy must be able to share data between the two processor’s Dcaches, as well as main memory. The component that controls the flow of information between the Dcaches and main memory is the coherence controller. This component will check the memory accesses made by each processor’s Dcache and determine where the data is and what action needs to occur to get the requested piece of data.
Your coherence controller will implement the MSI coherence protocol discussed in lecture. Your Dcache already keeps track of state with the valid and dirty bits. If a block is valid and dirty it is in modified state. If a block is valid and not dirty, it is in shared state. Finally, if a block is not valid, it is in the invalid state. Again, we are assuming you do not overwrite program code, or else you will need to add the Icache to the mix. Every time the processor reads or writes to the Dcache it must send the action, address, and data to the coher- ence controller. This controller will arbitrate which transaction to complete. It will then check the other processor’s Dcache to determine what action needs to occur. Refer to the MSI state diagram in the lecture notes for transac- tions. The coherence controller will take a memory access request, check if the data is in the other processor’s cache. If it is, it will signal the Dcache to take the appropriate action. If it is not in the other processor’s cache it will retrieve the value from main memory and have the requesting Dcache take the appropriate action. You will find it useful to arbitrate based on a priority. This priority can be processor ID, or in our case you pick one processor (call this P0) and if any simultaneous access requests are received by the coherence controller it will pick the processor with the highest priority (lowest pid) to win (in our case P0), then the transaction of the next requesting processor will process.
Snooping is what the coherence controller will do to determine what is in a Dcache. The coherence controller is looking for tag data and state when it snoops. In some cases it will need the actual data in the data ram. This snooping will tie up the Dcache data ram(it is assumed your tags are stored in the data ram), which means the processor does not get to use the Dcache while the coherence controller is snooping around. You will need to modify the Dcache to allow the coherence controller access to the data ram. When the co- herence controller is accessing the cache data ram the processor can not use the cache, thus it must generate a memwait on any professor read/write (lw/sw) accesses until it is done snooping.
This is the priority mux that decided which stage gets to access main memory that was used in the pipeline. It is modified slightly so that the coherence controller gets top priority. Then the first processor (P0) Icache followed by the second processor (P1) Icache. This order may be subject to change.
The two processors must start at different addresses. The first processor will start at address 0x0000 and the second processor will start at address 0x0200. These addresses are subject to change. The best way to do this is have a mux with both starting addresses and have a constant bit to set the PC to either 0x0000 or 0x0200 when you assert nreset.
4 Turning In
Again, to make sure your Makefile works, type the following from your project4 directory:
˜/ece437/project4> make clean ˜/ece437/project4> make lab
Lastly, from your project4 directory, type:
˜/ece437/project4> submit -p lab