report.tex 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. \documentclass[a4paper,12pt]{article}
  2. \usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
  3. \usepackage[T1]{fontenc}
  4. \usepackage[utf8]{inputenc}
  5. \usepackage{newunicodechar}
  6. \usepackage{lmodern}
  7. \usepackage{textgreek}
  8. \usepackage{amsmath}
  9. \usepackage{mathtools}
  10. \usepackage{graphicx}
  11. \usepackage{pdflscape}
  12. \usepackage{svg}
  13. \usepackage{tabularx}
  14. \usepackage{blindtext}
  15. \usepackage{hyperref}
  16. \usepackage{pgfgantt}
  17. \usepackage{colortbl}
  18. \usepackage{pdfpages}
  19. \usepackage{setspace}
  20. \usepackage{subcaption}
  21. \usepackage{tikz}
  22. \usepackage{chngcntr}
  23. \usepackage{longtable}
  24. \usepackage{xcolor,colortbl}
  25. \usepackage{pdfpages}
  26. \counterwithin{figure}{subsection}
  27. \usepackage{multicol}
  28. \setcounter{tocdepth}{3}
  29. \usepackage[backend=bibtex]{biblatex}
  30. \addbibresource{references.bib}
  31. \begin{document}
  32. \begin{titlepage}
  33. \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
  34. \begin{tikzpicture}[remember picture, overlay]
  35. \node [anchor=north east, inner sep=0pt] at (current page.north east)
  36. {\includegraphics[width=21cm]{graphics/ucl-banner-dl-port-outline.eps}};
  37. \end{tikzpicture}\\[3cm]
  38. \center
  39. \textsc{\Large University College London}\\[0.5cm]
  40. \textsc{\large Department of Electronic and Electrical Engineering}\\[0.5cm]
  41. \HRule \\[0.4cm]
  42. \setstretch{1.5}
  43. { \huge \bfseries Performance characterisation of 8-bit RISC and OISC architectures}\\[0.4cm]
  44. \setstretch{1.0}
  45. \HRule \\[1.0cm]
  46. \begin{multicols}{3}
  47. \Large \emph{Author:}\\
  48. Mindaugas \textsc{Jarmolovicius}\\
  49. \href{mailto:zceemja@ucl.ac.uk}{zceemja@ucl.ac.uk}\\
  50. \columnbreak
  51. \Large \emph{Supervisor:}\\
  52. Prof. Robert \textsc{Killey}\\
  53. \href{mailto:r.killey@ucl.ac.uk}{r.killey@ucl.ac.uk}
  54. \columnbreak
  55. \Large \emph{Second Assessor:}\\
  56. Dr. Ed \\\textsc{Romans}\\
  57. \href{mailto:e.romans@ucl.ac.uk}{e.romans@ucl.ac.uk}
  58. \end{multicols}
  59. \vfill
  60. \setstretch{2.5}
  61. { \large \bfseries A BEng Project Interim Report}\\[1cm]
  62. \setstretch{1.0}
  63. {\large December 13, 2019}\\[2cm]
  64. \end{titlepage}
  65. \pagebreak
  66. \begin{multicols}{2}
  67. \section{Abstract}
  68. This project investigates area / performance / power / complexity benefits and trade-offs of One Instruction Set Computer (OISC) comparing to traditional Reduced Instruction Set Computer (RISC) architectures in general computing application. It is shown that \texttt{SUBLEQ} OISC performs better in special cases, however there is lack of research in more complicated OISC architectures designed for general computing. At this point project is mainly following schedule with mainly benchmark being behind the schedule.
  69. \section{Introduction}
  70. Since 80s there been a raise of many processor architectures that try to fulfil specific performance and power application constraints. One of noticeable cases is ARM RISC architecture being used in mobile devices instead of more popular and robust x86 CISC (Complex Instruction Set Computer) architecture in favour of simplicity, cost and lower power consumption \autocite{jamil_1995,blem_menon_sankaralingam_2013}. Its been shown that in low power applications such as IoTs (Internet of Things), OISC\footnote{Also known as URISC (Ultimate Reduced Instruction Set Computer)} (One Instruction Set Computer) implementation can be superior in power and data throughput comparing to traditional RISC architectures \autocite{yokota_saso_hara-azumi_2017, ahmed_sakamoto_anderson_hara-azumi_2015}. This project proposes to compare two novel RISC and OISC architectures and compare their performance, design complexity and efficiency.
  71. Project is split into 3 main objectives:\\
  72. $\bullet$ Design and build a RISC based processor. As it is aimed for low power and performance applications this will be 8bit data size processor with 4 general purpose registers.\\
  73. $\bullet$ Design and build an OISC based processor. There are multiple different implementations such as \texttt{SUBLEQ} or one proposed in chapter \ref{sec:theory}.\\
  74. $\bullet$ Design a fair benchmark that both processors could execute. Benchmark may include different algorithms that are commonly used in controllers, IoT devices or similar low power microprocessor applications.
  75. Following chapters will describe the estimated project outcome, project schedule and work done so far.
  76. \section{The Work Performed to Date}
  77. \subsection{Supporting Theory} \label{sec:theory}
  78. This section explains the theory and predictions of RISC and OISC architectures.
  79. Figure \ref{fig:simple_blocks} represents simplified diagrams of RISC and OISC architectures. In RISC and CISC architecture, program data travels from program memory to control block where instruction is decoded and further decided where what data is directed in datapath block which is described in section \ref{sec:datapath}. Such structure requires complicated control block and additional data routing blocks. In order to increase performance of such processor one would need to add pipelining or add multiple cores. Both methods bring big disadvantages - multicore processor requires software adjustments and each core doubles the control and datapath substantially increasing die area; pipelinig allow operation at higher frequencies however it brings design complications such as complicated hazard prevention logic and instruction lookup. RISC architecture is mainly based on theory in \autocite{harris_harris_2013}. Simplicity of OISC architecture overcomes these disadvantages:
  80. \\
  81. Pipelining can be done by individual blocks and programmibly waiting for results, this is represented in figure \ref{fig:oisc_simple} Adder and Multiply vertical blocks, multicore can be simulated by adding more data and instruction buses, hazards can be prevented with software or/and integrated into address registers.
  82. \\
  83. ALU and any other processor component can be divided by adding different address registers thus allowing to utilise multiple components at the same time given that multiple data buses are used. This is represented in figure \ref{fig:oisc_simple} Arithmetic Unit horizontal blocks. Assuming 4 data and instructions buses are used, \textbf{AND} and \textbf{OR} blocks sources A and B can be all written during one cycle utilising both blocks at the same time.
  84. \\
  85. These principal functions should allow OISC architecture to have advantage in performance and power consumption while having lower transistor count and this is the main motivation behind project. This expectation is supported mainly by following papers:
  86. \\
  87. $\bullet$ Using OISC \texttt{SUBLEQ} as a coprocessor for MIPS-ISA processor to emulate the functionality of different classes shows desirable area/performance/power trade-offs \autocite{ahmed_sakamoto_anderson_hara-azumi_2015}.
  88. \\
  89. $\bullet$ Comparing OISC \texttt{SUBLEQ} multicore to RISC achieves better performance and lower energy for streaming data processing \autocite{yokota_saso_hara-azumi_2017}.
  90. \\
  91. There is a lack of research investigating and comparing more general purpose OISC non-\texttt{SUBLEQ} processor. The main theory for OISC used in this project will be based on \autocite{ong_ang_seng_2010,gilreath_laplante_2003,kong_ang_seng_adejo_2010,dharshana_balasubramanian_arun_2016}.
  92. \columnbreak
  93. \end{multicols}
  94. \begin{figure}[t!]
  95. \centering
  96. \begin{subfigure}[b]{1\textwidth}
  97. \includegraphics[width=\linewidth]{graphics/risc.eps}
  98. \caption{RISC microarchitecture diagram}
  99. \label{fig:risc_simple}
  100. \end{subfigure}
  101. \begin{subfigure}[b]{1\textwidth}
  102. \includegraphics[width=\linewidth]{graphics/oisc.eps}
  103. \caption{Single data bus OISC microarchitecture diagram}
  104. \label{fig:oisc_simple}
  105. \end{subfigure}
  106. \caption{Simplified diagrams of both architectures. Blue lines indicate control/instruction buses and black - data buses}
  107. \label{fig:simple_blocks}
  108. \end{figure}
  109. \newpage
  110. \begin{landscape}
  111. \subsection{Project Scheduling}
  112. As it can be seen in table \ref{table:time} below, project is mainly split into Term 1 which is dedicated for RISC and Term 2 which is dedicated for OISC implementation. Approximately 3 weeks are left until final report to have enough spare time to finish all tests and complete poster \& report itself. It is also expected to have a lot of coursework around this time. Currently mainly benchmark development is behind schedule, more information in section \ref{sec:benchmark_issues}.
  113. \begin{table}[h!]
  114. \centering
  115. \begin{ganttchart}[
  116. y unit title=0.4cm,
  117. y unit chart=0.5cm,
  118. x unit=1.1mm,
  119. hgrid,
  120. today=2019-12-13,
  121. today label node/.append style={below=12pt},
  122. today label font=\itshape\color{blue},
  123. today rule/.style={draw=blue, ultra thick},
  124. title height=1,
  125. bar/.append style={fill=blue!50},
  126. bar incomplete/.append style={fill=gray!50},
  127. progress label text={$\displaystyle{#1\%}$},
  128. time slot format=isodate
  129. ]{2019-10-01}{2020-03-31}
  130. \gantttitlecalendar{year, month=shortname} \\
  131. \gantttitle{40}{6}
  132. \gantttitlelist{41,...,52}{7}
  133. \gantttitlelist{1,...,13}{7}
  134. \gantttitle{}{2} \\
  135. \ganttbar[progress=100]{RISC implementation}{2019-10-01}{2019-10-27}\\
  136. \ganttbar[progress=90]{RISC Optimisations}{2019-10-27}{2019-11-25}\\
  137. \ganttbar[progress=100]{UART and I/O}{2019-10-21}{2019-10-27}
  138. \ganttbar[progress=100]{}{2019-11-25}{2019-12-08} \\
  139. \ganttbar[progress=100]{RISC Assembler}{2019-10-14}{2019-11-11}\\
  140. \ganttbar[progress=20]{Developing benchmark}{2019-11-11}{2019-12-13}
  141. \ganttbar[progress=0]{}{2020-02-23}{2020-03-07} \\
  142. \ganttbar[progress=10]{OISC Implementation}{2019-12-02}{2019-12-13}
  143. \ganttbar[progress=0]{}{2020-01-13}{2020-02-02}\\
  144. \ganttbar[progress=0]{OISC Optimisations}{2020-02-02}{2020-02-23}\\
  145. \ganttbar[progress=0]{OISC Assembler}{2020-01-20}{2020-02-09}\\
  146. \ganttbar[progress=0]{OISC Compiler}{2020-02-09}{2020-03-01}\\
  147. \ganttmilestone{Project Proposal finalised}{2019-10-14}\\
  148. \ganttmilestone{Progress Report \#1}{2019-11-04}\\
  149. \ganttmilestone{Progress Report \#2}{2019-11-25}\\
  150. \ganttmilestone{December Interim Report}{2019-12-13}\\
  151. \ganttmilestone{Progress Report \#3}{2020-01-20}\\
  152. \ganttmilestone{Progress Report \#4}{2020-02-14}\\
  153. \ganttmilestone{Progress Report \#5}{2020-03-02}\\
  154. \ganttmilestone{Poster Presentation}{2020-03-18}\\
  155. \ganttmilestone{Final Report}{2020-03-30}
  156. \ganttvrule{Reading Week}{2019-11-03}
  157. \ganttvrule{}{2019-11-10}
  158. \ganttvrule[vrule label node/.append style={anchor=north west}]{Holidays}{2019-12-13}
  159. \ganttvrule{}{2020-01-12}
  160. \ganttvrule{Reading Week}{2020-02-17}
  161. \ganttvrule{}{2020-02-23}
  162. \end{ganttchart}
  163. \caption{Project schedule Grantt chart}
  164. \label{table:time}
  165. \end{table}
  166. \end{landscape}
  167. \pagebreak
  168. \begin{multicols}{2}
  169. \subsection{Progress to Date}
  170. This section mainly includes progress on RISC processor and its components.
  171. \subsubsection{Memory} \label{sec:memory}
  172. Initial plan was to use 32MiB 16bit SDRAM chip located at FPGA board. After successfully simulating most of processor functions, next step was to synthesise and run it on FPGA which brought 2 problems:
  173. (1) Uploading program into ROM is not simple as generic Verilog unpacked register array cannot be initialised from file. Solution to this problem was solved by using FPGA built-in M9K memory that allows flexible RAM/ROM configuration. In addition, M9K memory can be read from/written to via JTAG connection without affecting FPGA operation which enabled quick method to upload programs without need to resynthesising processor code.
  174. (2) Timing of SDRAM memory controller runs at much higher frequency than processor (at 100MHz versus 1MHz), initial implementation of interface between them was multiple 1-word length FIFO registers which caused memory read operation take 2 processor cycles. 3 possible solutions were considered - suspend processor clock while memory data is read which would harm performance; remove FIFO registers and rely on SDRAM clock being much greater than processor clock which is not ideal if higher processor clocks are intended to be used; use M9K. Last option was chosen due to ease of implementation and ability to read RAM content via JTAG for debugging purposes.
  175. \subsubsection{Instructions}\label{sec:instr}
  176. Table \ref{table:risc_instr} below represents RISC processor instructions that been implemented so far. In this processor design, instructions are 8 bit size, where 5th and 6th bits points to register 1 address and 7th and 8th bits to register 2 address. Instructions are separated in 3 groups:\\\\
  177. $\bullet$ 2 register - uses both registers,\\
  178. $\bullet$ 1 register - uses only register 1,\\
  179. $\bullet$ 0 register - do not use registers.\\\\
  180. Such grouping allowed to encode more instructions in 8 bits. At every processor cycle 4 bytes of instructions are fetched, first byte encodes instruction, last 3 may encode immediate value. This allows jump and conditional branch instructions to use 16bit jump address. Memory instructions \texttt{LWHI}, \texttt{SWHI}, \texttt{LWLO} and \texttt{SWLO} can use 24bit address that allows to access all addresses of SDRAM chip that been described in section \ref{sec:memory}. \texttt{MOVE} instruction is special case, if register 1 and 2 are different data will be copied from register 2 to 1. If these register values are the same, value from immediate will be copied to register 1.
  181. \end{multicols}
  182. \arrayrulecolor{black}
  183. \begin{longtable}[h!]{| l | p{.60\textwidth} | c | c |}
  184. \caption{Instruction set for RISC processor}
  185. \label{table:risc_instr}\\
  186. \hline
  187. \rowcolor[rgb]{0.82,0.82,0.82}
  188. Instr. & Description & I-size\footnote{Required immediate size in bytes} & Completed \\\hline
  189. \endhead
  190. \arrayrulecolor{black}\hline
  191. \endfoot
  192. \multicolumn{4}{|c|}{
  193. \cellcolor[rgb]{0.7,0.7,1}\textit{2 register instructions}} \\\hline
  194. \arrayrulecolor[rgb]{0.82,0.82,0.82}
  195. MOVE & Copy intimidate or register & 1 or 0 & x \\\hline
  196. ADD & Arithmetical addition & 0 & x \\
  197. SUB & Arithmetical subtraction & 0 & x \\
  198. AND & Logical AND & 0 & x \\
  199. OR & Logical OR & 0 & x \\
  200. XOR & Logical XOR & 0 & x \\
  201. MUL & Arithmetical multiplication & 0 & x \\
  202. DIV & Arithmetical division (inc. modulus) & 0 & x \\
  203. \arrayrulecolor{black}\hline
  204. \multicolumn{4}{|c|}{
  205. \cellcolor[rgb]{0.7,0.7,1}\textit{1 register instructions}} \\
  206. \hline\arrayrulecolor[rgb]{0.82,0.82,0.82}
  207. CI0 & Replace intimidate value byte 0 for next instruction & 1 & x \\
  208. CI1 & Replace intimidate value byte 1 for next instruction & 1 & x \\
  209. CI2 & Replace intimidate value byte 2 for next instruction & 1 & x \\\hline
  210. SLL & Shift left logical & 1 & \\
  211. SRL & Shift right logical & 1 & \\
  212. SRA & Shift right arithmetical & 1 & \\\hline
  213. LWHI & Load word (high byte) & 3 & x \\
  214. SWHI & Store word (high byte, reg. only) & 0 & x \\
  215. LWLO & Load word (low byte) & 3 & x \\
  216. SWLO & Store word (low byte, stores high byte reg.) & 3 & x \\\hline
  217. INC & Increase by 1 & 0 & x \\
  218. DEC & Decrease by 1 & 0 & x \\
  219. GETAH& Get ALU high byte reg. (only for MUL \& DIV) & 0 & x \\
  220. GETIF& Get interrupt flags & 0 & x \\\hline
  221. PUSH & Push to stack & 0 & x \\
  222. POP & Pop from stack & 0 & x \\
  223. COM & Send/Receive to/from com. block & 1 & x \\\hline
  224. ADDI & Arithmetical addition with intimidate & 1 & x \\
  225. SUBI & Arithmetical subtraction with intimidate & 1 & x \\
  226. ANDI & Logical AND with intimidate & 1 & x \\
  227. ORI & Logical OR with intimidate & 1 & x \\
  228. XORI & Logical XOR with intimidate & 1 & x \\\hline
  229. BEQ & Branch on equal & 3 & x \\
  230. BGT & Branch on greater than & 3 & x \\
  231. BGE & Branch on greater equal than & 3 & x \\
  232. BZ & Branch on zero & 2 & x \\
  233. \arrayrulecolor{black}\hline
  234. \multicolumn{4}{|c|}{
  235. \cellcolor[rgb]{0.7,0.7,1}\textit{0 register instructions}
  236. } \\
  237. \hline\arrayrulecolor[rgb]{0.82,0.82,0.82}
  238. CALL & Call function, put return to stack & 2 & x \\
  239. RET & Return from function & 0 & x \\
  240. JUMP & Jump to address & 2 & x \\
  241. RJUMP& Relative jump & 2 & \\\hline
  242. RETI & Return from interrupt & 0 & x \\
  243. INTRE& Set interrupt entry pointer & 2 & x \\\hline
  244. CLC & Clear ALU carry-in & 0 & \\
  245. SETC & Set ALU carry-in & 0 & \\
  246. CLS & Clear ALU sign & 0 & \\
  247. SETS & Set ALU sign & 0 & \\
  248. SSETS& Enable ALU sign & 0 & \\
  249. CLN & Clear ALU negative & 0 & \\
  250. SETN & Set ALU negative & 0 & \\
  251. SSETN& Enable ALU negative & 0 & \\
  252. \end{longtable}
  253. \begin{multicols}{2}
  254. \subsubsection{Program Counter} \label{sec:pc}
  255. Figure \ref{fig:program_counter} represents digital diagram for program counter. There are few key features about this design: it can take values from memory for stack pointer for \texttt{RET} instruction; immediate value (\textit{PC\_IMM2} is shifted by 1 byte to allow \texttt{BEQ}, \texttt{BGT}, \texttt{BGE} instructions as first immediate byte used as ALU source B); can jump to interrupt address; produces \textit{pc\_halted} signal when memory is read (\texttt{RET} instruction takes 2 cycles, because 1 takes to fetch address from stack and second to fetch instruction from instruction memory).
  256. \subsubsection{Immediate Override} \label{sec:imo}
  257. Due to limited amount of instructions available and processor data width being 1 byte comparing to 2 bytes for instruction address and 3 bytes for memory address, it is no easy way to operate program pointers that can be dynamically calculated which limits program flexibility. Solution to this is IMO (Immediate Override), which logic is represented in figure \ref{fig:imo}. This circuit is connected between instruction memory higher 3 bytes (immediate value, \textit{immr} bus) and immediate bus (\textit{imm}) at datapath. Override bytes can be written with \texttt{CI0}, \texttt{CI1} and \texttt{CI2} instructions. On \texttt{CI0} a flag for next clock cycle is enabled that replaces \textit{imm} value by ones stored in IMO registers. This circuit has two disadvantages: \\
  258. \\
  259. 1. Overriding immediate bytes take one or more clock cycles,\\
  260. 2. At override, \textit{immr} bytes are ignored there wasting instruction memory space.\\
  261. \\
  262. Point 2 can be resolved by designing circuit that would subtract amount of overridden IMO bytes from \textit{pc\_off} signal (program counter offset that is dependant on i-size value) at program counter, thus effectively saving instruction memory space. This solution however would introduce complication in assembler as additional checks would need to be done during compiling to check if IMO instruction are used.
  263. \end{multicols}
  264. \begin{figure*}[hb!]
  265. \centering
  266. \includegraphics[scale=0.4]{graphics/stack_diagram.eps}
  267. \caption{Digital diagram of RISC8 program counter}
  268. \label{fig:stack_pointer}
  269. \end{figure*}
  270. \pagebreak
  271. \begin{figure*}[ht!]
  272. \centering
  273. \includegraphics[width=\columnwidth]{graphics/program_counter.eps}
  274. \caption{Digital diagram of RISC8 program counter}
  275. \label{fig:program_counter}
  276. \end{figure*}
  277. \begin{multicols}{2}
  278. \subsubsection{Stack Pointer} \label{sec:sp}
  279. RISC processor implements stack pointer that is used in \texttt{PUSH}, \texttt{POP}, \texttt{CALL} and \texttt{RET} instructions. Stack initial address starts at highest memory address (\texttt{0xFFFF}) and subtracts 1 when data is put to stack. Figure \ref{fig:stack_pointer} represents digital diagram for stack pointer. Note that stack is only 16bit in size and most significant byte is set to \texttt{0xFF}. It also supports \textit{pc\_halted} signal from program counter to prevent stack pointer been added by 1 twice during \texttt{RET} instruction.
  280. One of the problems with current stack pointer implementation is 8bit data stored in 16bit memory address, wasting a byte. This can improved avoided by adding high byte register, however then it causes problems when 16bit program pointer is stored with \texttt{CALL} instruction. This can still be improved with more complicated circuit, or by using memory cache. Solution to this may be implemented in future.
  281. \end{multicols}
  282. \begin{figure}[h!]
  283. \centering
  284. \includegraphics[scale=0.35]{graphics/imo.eps}
  285. \caption{Digital diagram of RISC8 immediate override logic}
  286. \label{fig:imo}
  287. \end{figure}
  288. \begin{landscape}
  289. \subsubsection{Datapath} \label{sec:datapath}
  290. \begin{figure}[h!]
  291. \centering
  292. \includegraphics[width=\linewidth]{graphics/datapath.eps}
  293. \caption{Digital diagram of RISC8 datapath}
  294. \label{fig:datapath}
  295. \end{figure}
  296. Figure \ref{fig:datapath} above represents partial datapath. Program counter, Stack pointer and immediate override logics are represented in figures \ref{fig:program_counter}, \ref{fig:stack_pointer} and \ref{fig:imo} respectively. CDI (Control-Data Interface) is HDL concept that connects datapath and control unit. Immediate value to datapath is provided by IMO block described in section \ref{sec:imo}.\\
  297. Data to register file is selected and saved with \textit{MUX0}. This data is delayed 1 cycle with \textit{R2} to match timing that of data is taken from memory. If \texttt{LWLO} or \texttt{LWHI} is executed, \textit{MUX1} select high or low byte from memory to read. To compensate for timing as value written to register file is delayed by 1 cycle, register file has internal logic that outputs \textit{wr\_data} to \textit{rd\_data1} or/and \textit{rd\_data2} immediately if \textit{wr\_en} is high and \textit{rd\_addr1} or/and \textit{rd\_addr2} matches \textit{wr\_addr}.\\
  298. \end{landscape}
  299. \textit{MUX2} allows override ALU source B, \textit{R3} and \textit{MUX3} enables control unit to enable ALU carry in allowing multi-byte number addition/subtraction. This function is not fully implemented yet.\textit{MUX4} and \textit{MUX5} allows to send data to COM block with \texttt{COM} instruction, if other instruction performed 0 byte for COM address and data is sent indicating no action. Data is stored in memory only with \texttt{SWLO} instruction writing to high byte whatever is stored in \textit{R4} buffer. This buffer can be written to using \texttt{SWHI} instruction. \textit{MUX6} selects memory address value from \textit{imm} or stack pointer.
  300. \section{Summary of Difficulties and Issues}
  301. \begin{multicols}{2}
  302. This chapter focuses on any difficulties and issues that are hindering project from moving forward.
  303. \subsection{List of Difficulties}
  304. This subsection will list difficulties currently encountered:\\
  305. \\
  306. $\bullet$ Benchmark\\
  307. $\bullet$ Assembler/Compiler
  308. \subsubsection{Benchmark} \label{sec:benchmark_issues}
  309. One of the difficulties is to design an appropriate benchmark that could test scenarios used in actual such processor applications. Other issue comes with writing benchmark itself, for instance benchmark test to finding prime number may have used many different algorithms where one of the fastest and used in actual industry may be "Sieve of Atkin" algorithm \autocite{morain_1989}, however is it fairly complicated and time consuming especially when written in assembly.
  310. \subsubsection{Assembler/Compiler}
  311. In order to write more complicated code for benchmark, a proper compiler is required. Current assembler support definitions and labels, however not macros or imports from other files, nor linked libraries. Ideally, a common language compiler needs to be developed so that benchmark programs could be imported without need to completely rewrite them in assembly. However such compiler might take more time to develop than writing benchmarks in assembly. Therefore it needs to be decided which option to do.
  312. \subsection{Failure Assessment}
  313. This section describes likely possibilities of project failures:
  314. As of current schedule OISC processor will be implemented in Term 2, however due to personal schedule project will be given about twice less time than in Term 1 which may result in not finishing OISC processor or developing all benchmarks for it on time. Mitigation for this is to closely follow schedule and adjust OISC design in such way as it would take less time to implement benchmark.
  315. Another possible failure may be FPGA failure which would delay testing and benchmarking processors. This been already encountered, as JTAG caused errors while communicating with FPGA which indicated that FPGA chip is damaged. After long investigation its been discovered that problem was caused by bug in Linux JTAG Daemon service that needs to be simply restarted. Mitigation for any further issues is to have access to backup FPGA board.
  316. \subsection{Updated Safety Risk Assessment}
  317. There are no changes to Safety Risk Assessment.
  318. \end{multicols}
  319. \pagebreak
  320. \section{Appendix A: Safety Risk Assessment}
  321. RiskNet report is appended at the end of this document.
  322. \section{Appendix B: Computer Code}
  323. All code to HDL processor implementation and assembler are in git repository that can be accessed in \url{https://gogs.infcof.com/min/ucl_project_y3}
  324. \section{References}
  325. \printbibliography
  326. \includepdf[pages=-]{risknet.pdf}
  327. \end{document}