6-results.tex 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. % !TeX root = index.tex
  2. \iffalse
  3. This chapter looks specifically at your results.
  4. * You measured some samples.
  5. What values did you measure?
  6. Present them in a table or graph?
  7. How did you test whether they were good measurements?
  8. Were you looking to improve something?
  9. Are your new samples better than the old ones?
  10. * You built a device;
  11. what tests did you run to make sure that it is running correctly?
  12. * You calculated something or developed a new theory about something.
  13. How do you know how well it predicts?
  14. What tests did you run?
  15. What comparisons with the literature did you make?
  16. * You coded or simulated something.
  17. What tests did you run to be sure it was working correctly?
  18. Describe what you want the reader to notice in the results.
  19. Give the facts, then give your analysis of the facts.
  20. Present your graphs, figures, tables, photos, and equations needed to show what you accomplished.
  21. Label everything clearly, using the recommendations given below in “Things to Look For”
  22. \fi
  23. \subsection{FPGA logic component composition}
  24. This subsection looks at test and its results to find how much FPGA logic components each processor takes and what is composition of each part.
  25. Test was performed with Quartus synthesis tool and viewing flow summary report. This report includes synthesised design metrics including total logic elements, registers, memory bits and other FPGA resources. Test will only look at logic elements and registers. Total number of logic elements was found out by synthesising full processors, then commenting relevant parts of code, re-synthesising and viewing changes in total logic elements. Such method may not be the most accurate, because during HDL synthesis circuit is optimised an unused connections removed. This means that more logic may be not synthesised than intended.
  26. There are four parts of each processor that will be tested:
  27. \begin{enumerate}
  28. \item \textbf{Common} - processor auxiliary logic that is used by both processors. It includes communication block with UART, RAM and PLL (Phase-Locked Loop, for master clock generation).
  29. \item \textbf{ALU} - as described in section \ref{subsec:alu}, both processors have slightly different implementation of ALU.
  30. \item \textbf{Memory} - processors memory management, including stack.
  31. \item \textbf{Other} - reminding logic of processor that was not analysed.
  32. \end{enumerate}
  33. \begin{colfigure}
  34. \centering
  35. \includegraphics[width=\linewidth]{../tests/fpga_comp.eps}
  36. \captionof{figure}{Bar graph of FPGA logic components taken by each processor.}
  37. \label{fig:fpga_comp}
  38. \end{colfigure}
  39. Results of a test are shown in figures \ref{fig:fpga_comp} and \ref{fig:fpga_reg_comp}. Common logic uses 293 logic elements and 170 registers. OISC uses 1705 logic elements, while RISC uses 3218. Excluding common logic, OISC takes 48.3\% of RISC's logic elements.
  40. \begin{colfigure}
  41. \centering
  42. \includegraphics[width=\linewidth]{../tests/fpga_reg_comp.eps}
  43. \captionof{figure}{Bar graph of FPGA register resources taken by each processor.}
  44. \label{fig:fpga_reg_comp}
  45. \end{colfigure}
  46. OISC uses 726 logic elements, while RISC uses 407. Excluding common logic, OISC uses 78.4\% more registers than RISC.
  47. Looking at composition, OISC ALU takes 30.2\% more logic gates. Looking at figure \ref{fig:fpga_reg_comp}, high number of OISC ALU registers can be observed which concludes, that higher resource usage is OISC ALU code include buffer logic.
  48. Memory logic elements composition of OISC is only 34.4\% of RISC's and 7\% lower for register resources, comparing to RISC. This indicate that by removing memory logic for RISC, synthesis tool may removed also other parts of processor, possibly part of control block because it mostly contains combinational logic.
  49. Other logic includes instruction decoding with ROM, register file, program counter. RISC exclusively has control block. Note that OISC uses only three ROM memory blocks whereas RISC uses four as explained in section \ref{subsec:memory}, however this should make a minimal difference as M9K memory blocks are not included in FPGA logic element or register count. Comparing both processors, OISC has only 37\% of other logic components to RISC, however it has 2.28 times more registers. This shows a logic component - register trade-off. OISC buffer and common registers logic that connects bus require many more registers whereas RISC uses combination logic in control block in order to control same data in datapath.
  50. Much higher logic components in RISC can be also explained more complicated register file, ROM memory logic and program counter. All of these components has some additional logic for timing correction or additional functionality required by these blocks integration into datapath.
  51. \subsection{Benchmark Programs}
  52. \colorbox{yellow}{\parbox{\columnwidth}{Description of each function in benchmark to be added.}}
  53. \subsubsection{Performance}
  54. \colorbox{yellow}{\parbox{\columnwidth}{Data of benchmark functions timings to be added.}}
  55. \subsubsection{Instruction composition}
  56. This test is performed to investigate instruction composition of each function to see how similar it is between RISC and OISC processors.
  57. \begin{description}
  58. \item[$\bullet$ MOVE] - All instructions that move data around internal processor registers.
  59. \item[$\bullet$ ALU] - Instructions that are used to perform ALU operation.
  60. \item[$\bullet$ MEMORY] - Instructions that are required to send/retrieve data from system memory, except stack.
  61. \item[$\bullet$ STACK] - Instructions that push/pop data from memory stack.
  62. \item[$\bullet$ COM] - Instruction(s) that send/receive data from communication block.
  63. \item[$\bullet$ BRANCH] - Instructions that are used to make program branching.
  64. \item[$\bullet$ OTHER] - Any other instructions.
  65. \end{description}
  66. \begin{blockpage}
  67. \arrayrulecolor{black}
  68. \begin{tabular}{| c | p{0.65\linewidth} |} \hline
  69. \rowcolor[rgb]{0.82,0.82,0.82}
  70. Name & Instructions \\\hline
  71. MOVE & \texttt{MOVE, CPY0, CPY1, CPY2, CPY3, CI0, CI1, CI2} \\\hline
  72. ALU & \texttt{%
  73. ADD, ADDI,
  74. SUB, SUBI,
  75. AND, ANDI,
  76. OR, ORI,
  77. XOR, XORI,
  78. DIV, MUL,
  79. ADDC, SUBC,
  80. INC, DEC,
  81. SLL, SRL,
  82. SRA, GETAH
  83. } \\\hline
  84. MEMORY & \texttt{LWLO, LWHI, SWLO, SWHI} \\\hline
  85. STACK & \texttt{PUSH, POP} \\\hline
  86. COM & \texttt{COM} \\\hline
  87. BRANCH & \texttt{BEQ, BGT, BGE, BZ, JUMP, CALL, RET} \\\hline
  88. \arrayrulecolor[rgb]{0,0,0}\hline
  89. \end{tabular}
  90. \captionof{table}{RISC processor instruction groups used in instruction composition test.}
  91. \label{tab:instr_groups_risc}
  92. \end{blockpage}
  93. \begin{blockpage}
  94. \arrayrulecolor{black}
  95. \begin{tabular}{| c | p{0.65\linewidth}|} \hline
  96. \rowcolor[rgb]{0.82,0.82,0.82}
  97. Name & Destination \\\hline
  98. \arrayrulecolor[rgb]{0.82,0.82,0.82}
  99. MOVE & \texttt{REG0, REG1} \\\hline
  100. ALU & \texttt{ALU0, ALU1} \\\hline
  101. MEMORY & \texttt{MEM0, MEM1, MEM2, MEMLO, MEMHI} \\\hline
  102. STACK & \texttt{STACK}\\\hline
  103. COM & \texttt{COMA, COMD}\\\hline
  104. BRANCH & \texttt{BR0, BR1, BRZ}\\\hline
  105. \arrayrulecolor[rgb]{0,0,0}\hline
  106. \end{tabular}
  107. \captionof{table}{OISC processor instruction desination groups used in instruction composition test}
  108. \label{tab:instr_groups_oisc_dst}
  109. \end{blockpage}
  110. \begin{blockpage}
  111. \arrayrulecolor{black}
  112. \begin{tabular}{| c | p{0.65\linewidth} |} \hline
  113. \rowcolor[rgb]{0.82,0.82,0.82}
  114. Name & Instructions \\\hline
  115. \arrayrulecolor[rgb]{0.82,0.82,0.82}
  116. MOVE & \texttt{ALU0, ALU1, REG0, REG1, PC0, PC1, NULL, IMMEDIATE} \\\hline
  117. ALU & \texttt{ADD, ADDC, SUB, SUBC,
  118. AND, OR, XOR, SLL,
  119. SRL, EQ, GT, GE, NE,
  120. LT, LE, MULLO, MULHI, DIV, MOD,
  121. ADC, SBC, ROL, ROR} \\\hline
  122. MEMORY & \texttt{MEM0, MEM1, MEM2, MEMLO, MEMHI} \\\hline
  123. STACK & \texttt{STACK} \\\hline
  124. COM & \texttt{COMA, COMD} \\\hline
  125. BRANCH & \texttt{BR0, BR1} \\\hline
  126. \arrayrulecolor[rgb]{0,0,0}\hline
  127. \end{tabular}
  128. \captionof{table}{OISC processor instruction source groups used in instruction composition test}
  129. \label{tab:instr_groups_oisc_src}
  130. \end{blockpage}
  131. Each function was ran on simulated processor, program counter and instruction been recorded into file at every cycle. File recording was done with SytemVerilog test bench, it started recording when program counter matched \texttt{.start} location and stopped when it matched \texttt{.done} location. Code shown in listings \ref{asmrisctest} and \ref{asm_oisc_test} enabled both location to be static, not depending on test function executed.
  132. \begin{blockpage}
  133. \begin{lstlisting}[frame=single, caption={RISC assembly frame for executring tests}, emph={setup,start,done} label=asmrisctest]
  134. setup:
  135. JUMP .start
  136. .done:
  137. JUMP .done
  138. .start:
  139. ; Setup values
  140. ; Call function
  141. JUMP .done
  142. \end{lstlisting}
  143. \end{blockpage}
  144. \begin{blockpage}
  145. \begin{lstlisting}[frame=single, caption={OISC assembly frame for executring tests}, emph={setup,start,done} label=asm_oisc_test]
  146. setup:
  147. BR1 .start @1
  148. BR0 .start @0
  149. BRZ 0x00
  150. .done:
  151. BRZ 0x00
  152. .start:
  153. ; Setup values
  154. ; Call function
  155. BR1 .done @1
  156. BR0 .done @0
  157. BRZ 0x00
  158. \end{lstlisting}
  159. \end{blockpage}
  160. Each function recorded file then was further analysed and each instruction was grouped. Recorded program counter was used to find effective program space. This has been achieved by calculating unique instances of program counter and summing up instruction size for each of them. In RISC, dynamic instruction size has been taken into account.
  161. Results or each function composition are represented in figure \ref{fig:instr_comp}.
  162. \begin{figure*}[t]
  163. \centering
  164. \includegraphics[width=\linewidth]{../tests/instr_comp.eps}
  165. \caption{Graph of instruction composition for every benchmark program.}
  166. \label{fig:instr_comp}
  167. \end{figure*}
  168. \subsubsection{Program space}
  169. Figure \ref{fig:program_size} represents effective program size for each test function. Effective program size only includes instruction that been executed depending on argument, meaning that it does not fully represent complete function. A specific argument might cause branching and skipping some function code which would not be added to effective program size. In this test, the main objective is to look difference in instruction size required to execute the same function, therefore not representing full program size is not relevant.
  170. \begin{colfigure}
  171. \centering
  172. \includegraphics[width=\linewidth]{../tests/program_size.eps}
  173. \captionof{figure}{Bar graph showing effective size in bits each benchmark function is taking in program memeory.}
  174. \label{fig:program_size}
  175. \end{colfigure}
  176. \subsection{Maximum clock frequency}
  177. \colorbox{yellow}{Description to be added.}