'Frequenty Asked Questions for Lab 1'
Q. For question 2, 3 and 4, do we have to implement and run them on a specific targt?
No. Actually you can complete these questions, using your favorite C compiler.
Q. I keep hearing I need to write a driver function to test this, what is a driver function?
It is a test program you will write and use to test your own code. It basically calls the functions for question 2, 3, 4 that you wrote and test them. Do NOT confuse this with device driver or 'modules' as they are called in linux. You will learn about device drivers in later lab(s).
Q. For question 2, 3 and 4, do we need to spawn a number of tasks and
then calculate it's C, T, D values and then calculate blah blah ... ?
No. You can create three seperate arrays in your test function and make up your C, T, D values and call your functions.
Q. For question 2, 3 and 4, can I assume the tasks in the array have priority order?
Yes. The *tid values can all have priorities starting with 1 and ending with Ntasks, from highest to lowest priority.
Q. This is how I have written the driver function, is it ok?
It doesn't really matter how you have written it, as the TA grading it will have his own driver to test it. As long as you follow the exact C function prototypes.
Note: Read quetions 8, 9, 10 and 11 before starting on 8, so you can design your fibbocacci function such that the execution time on it is easily computable. Use a large enough data type. Avoid using globals so that two different tasks can call the same fibbonacci function. Just a suggestion, you can implement it how ever you like. If a variable overflow happens, don't worry about it, it's the scheduling theory we are trying to understand using fibbonacci compuation, otherwise fib computation isn't that exciting.
Read up on taskSpawn, how and what type of parameters it allows to be passed in. Maybe you can use large enough global and pass a pointer to it to your fib task to compute? Again, implementation details, many ways to skin a cat.
Q. For question 8 and 9, I wrote a recursive Fibbonacci sequence function and I get weird behaviour. Sometimes the system reboots etc.
Do NOT use recursive function to compute the fibbonacci, use a for loop. Why? Because recursion uses stack, loads of it. What is the stack size of your task? (Hint: Check the parameters passed to taskSpawn) Remember, you don't have unlimited resources in real time.
Q. For question 8 and 9, do I need to save every number of the fibbonacci sequence?
No, absolutely not.
Q. Do I need to print out all the Fobbonacci Sequence?
No. In fact your fibbonacci computing function should not have nay printf(s) at all (unless you are trying to debug it). Because when you will be computing the 10/20 millisecond measurement, you want only the time it took for the computation, not any I/O time etc.
Q. After I stop my System Viewer, the trace does not pop up?
Most likely you have killed the target (congratulations). Either you were calculating too big of a number at a very high priority, or you didn't have enough buffer space. Try to learn the options in the System Viewer Configuration. What do the options under Upload Mode do? Change them to see if it helps.
Q. For question 9, I downloaded the code to the simulator, and my timings are inconsistant. Why?
Do NOT use the simulator for timing measurements in this or any of the following labs, use the lab targets. The timings are inconsistant because the simulator is running as a application on Windows, which is far from real time.
This page is last updated on September 16, 2008