Lab 15 - FL13 - ECE 198 JL - University of Illinois - Engineering Wiki

Debugging the lc 3 repairing a broken

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: lab7 folder and try the direc tions above again. Debugging the LC-3: Repairing a Broken Microinstruction In this part of the lab, we will s how y ou how to navigate parts of the LC-3 arc hitec ture and s how y ou how to modify its c ontrol words (mic roins truc tions ). W e have written a program in the LC-3 arc hitec ture that ex ec utes the ins truc tion ADD R0, R6, 5. Sinc e R6 is firs t loaded with the value x 300D before we ex ec ute the ADD R0, R6, 5 ins truc tion, this ins truc tion s hould load R0 with the value x 3012. As y ou will s ee, this ins truc tion c ontains a bug. Star ting the simulation In Des ign Manager window y ou s hould s ee s everal c omponents in the lab7_lib library that c ompos e the LC-3 arc hitec ture. Loc ate the CPU c omponent. Feel free to open the c omponent and other c omponents to ex plore if y ou are c urious , but we will foc us on s imulating the CPU as a whole. Selec t the CPU c omponent Start the s imulator. If ModelSim won't s tart or if y ou get errors after y ou open ModelSim, pleas e s c roll to the bottom of the ins truc tions to the Troubles hooting s ec tion. Finding impor tant signals Onc e y ou s tart the s imulator, y ou will notic e that there a LOT of s ignals in the LC-3. Again, feel free to ex plore, but we will direc t y ou to the few s ignals that will help y ou unders tand what the LC-3 arc hitec ture is doing. In partic ular, y ou will loc ate the s y s tem c loc k (c lk ), the Control Addres s Regis ter (CARout), and the c ontents of the Regis ter File (RF/ram). The CARout tells us whic h s tate of the LC-3 s tate diagram the mac hine is c urrently in. The c ontents of the regis ter file will allow us to s ee how R0 and R6 res pond to the ADD R0, R6, 5 ins truc tion. In the W ork s pac e window (below) y ou s hould notic e that the c pu c omponent is c ompos ed of the three c omponents of the Von Neumann arc hitec ture: the c ontrol unit (c ontrol), the proc es s ing unit (datapath), and the memory (memory ). The s y s tem c loc k drives the CPU s o it c an be found in the c pu c omponent, the Control Addres s Regis ter is part of the c ontrol unit, an...
View Full Document

Ask a homework question - tutors are online