Chapter 2. The processor
18
2.2
Processor Implementation
The main goals for the implementation were efficiency in terms of speed and area con-
sumption. It is crucial at this point to mention that the goals set are solely for edu-
cational purposes and no actual research was done in order to determine the optimal
designing goals.
The first step is to choose the overall design method for the processor. A five stage
pipelined non-superscalar design was chosen. The five stages were chosen in order to
isolate time consuming components, such as the memory access and data processing.
After many experiments the five stage pipeline was found to be the most ideal choice.
The data and instruction memories as well as the shifting unit were the slowest com-
ponents and had to be isolated. Further increase in the number of pipeline stages was
unnecessary and would result in no gain, because the memory access and the shifting
unit operations could not be divided further. Thus, by isolating all the data processing
units, along with the shifting module, we achieved the best performance, than every
other number of pipeline stages. Since the project targets an FPGA board, area was of
utmost importance so the superscalar approach was ignored. Appendix A Figure
displays the RTL implementation of the PLX processor, using 5 pipeline stages.
2.3
The first pipeline stage
The first stage of the pipeline contains the program counter and the instruction memory.
The program counter is responsible for providing the proper address of the Instruction
Memory, that contains the next instruction to be fetched and executed by the processor.
Appendix A Figure
displays the RTL schematic of the program counter.
The module has seven ports, 6 input ports and 1 output which is the value of the
program counter. Table
shows the ports of the program counter module.
2.3.1
The Program Counter
Depending on the instruction, the program counter increments by 1, by the value ”Imm”
provided by the instruction or by the value stored in the Rd register. The value 1 is the