0
$\begingroup$

I am using the CPU-OS simulator by Besim Mustafa(https://www.merlot.org/merlot/viewMaterial.htm?id=476196) and I am studying Pipeline Stages. I have written a simple program and captured the metrics like CPU Clocks, CPI, Instruction Count, Speed Factor.

My question is what changes should I make to improve the CPI and Speed Factor.

$\endgroup$

2 Answers 2

1
$\begingroup$

To be able to improve CPI and the speed-up factor you need to enable the pipeline. The programmer can help improve CPI but it is best to leave that to an optimising compiler and clever CPU architecture. The simulator's built-in compiler offers some help in reducing the CPI, for example loop unrolling, constant folding, identifying code dependencies, etc. In pipelined architecture, the goal is to reduce/prevent hazards and the above optimisations help do that. In addition, the pipeline has a means of forwarding operands, i.e. prior to previous instructions updating registers in a later stage, that contributes to reducing the CPI. There is also the technique of jump predictions. All these are available in the simulator which you should explore.

$\endgroup$
0
$\begingroup$

If the simulator is good, the same way as with code running on an ordinary CPU. Read the manual for the CPU, read what increases CPI for example and try to avoid it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.