presentation.tex 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. \documentclass{beamer}
  2. \usetheme{Pittsburgh}
  3. \usecolortheme{rose}
  4. \usepackage{tabularx}
  5. \usepackage{xcolor}
  6. \addtobeamertemplate{navigation symbols}{}{%
  7. \usebeamerfont{footline}%
  8. \usebeamercolor[fg]{footline}%
  9. \hspace{1em}%
  10. \insertframenumber/\inserttotalframenumber
  11. }
  12. \newcommand*\ruleline[1]{\par\noindent\raisebox{.8ex}{\makebox[\linewidth]{\hrulefill\hspace{1ex}\raisebox{-.8ex}{#1}\hspace{1ex}\hrulefill}}}
  13. % color macros
  14. \definecolor{BrickRed}{HTML}{B6321C}
  15. \definecolor{OliveGreen}{HTML}{3C8031}
  16. \definecolor{RoyalBlue}{HTML}{0071BC}
  17. \definecolor{MidnightBlue}{HTML}{006795}
  18. \newcommand{\catSN}[0]{\textcolor{BrickRed}{SN} }
  19. \newcommand{\catEX}[0]{\textcolor{OliveGreen}{E} }
  20. \newcommand{\catPE}[0]{\textcolor{RoyalBlue}{PE} }
  21. \newcommand{\catCO}[0]{\textcolor{MidnightBlue}{C} }
  22. \title[fpgas] % (optional, only for long titles)
  23. {Exploring extensions for a basic RISC-V pipeline implementation to support the execution of an operating system}
  24. \subtitle{}
  25. \author[N. Tremurici]
  26. {N.~Tremurici}%\inst{1}}
  27. \institute[Universities Here and There] % (optional)
  28. {
  29. %\inst{1}%
  30. Institute of Computer Engineering\newline
  31. TU Wien
  32. }
  33. \date[BT 2023] % (optional)
  34. {Bachelor Thesis, 2023}
  35. \subject{Computer Engineering}
  36. \begin{document}
  37. \begin{frame}\titlepage\end{frame}
  38. \begin{frame}
  39. \frametitle{Outline}
  40. \ruleline{1 | Premise of Bachelor Thesis}
  41. \newline
  42. \ruleline{2 | Methodology}
  43. \newline
  44. \ruleline{3 | Pre-Implementation Considerations}
  45. \newline
  46. \ruleline{4 | Implementation}
  47. \newline
  48. \ruleline{5 | Results and Demo Applications}
  49. \newline
  50. \end{frame}
  51. \begin{frame}
  52. \frametitle{Premise}
  53. Current state of affairs for students:
  54. \newline
  55. \ruleline{MiRiV}
  56. \begin{columns}[c]
  57. \begin{column}{0.5\textwidth}
  58. \begin{itemize}
  59. \item{RV32I pipeline specified using VHDL}
  60. \item{Two FPGA targets (Terasic DE2-115 and DE0-Nano)}
  61. \item{Preconfigured environment and bootloader}
  62. \begin{itemize}
  63. \item{JTAG programming}
  64. \item{I/O devices (UART ...)}
  65. \end{itemize}
  66. \end{itemize}
  67. \end{column}
  68. \begin{column}{0.7\textwidth}
  69. \begin{figure}[ht]
  70. \begin{center}
  71. \includegraphics[width=\columnwidth]{../thesis/graphics/miriv-pipeline.png}
  72. \end{center}
  73. \end{figure}
  74. \end{column}
  75. \end{columns}
  76. %\centering
  77. \end{frame}
  78. \begin{frame}
  79. \frametitle{Premise}
  80. MiRiV exists for students to learn the basics of pipelining
  81. \newline
  82. \begin{itemize}
  83. \item{Is there potential for committed students to learn more?}
  84. \item{What are good potential target applications?}
  85. \item{What can be executed on this platform?}
  86. \item{Is the platform limited?}
  87. \item{Can this platform be extended?}
  88. \item{Can a different platform be adapted instead?}
  89. \end{itemize}
  90. %\vspace{1em}
  91. %\begin{itemize}
  92. %\item{If limited, can this platform be extended?}
  93. %\begin{itemize}
  94. %\item{e.g. OS execution}
  95. %\end{itemize}
  96. %\end{itemize}
  97. \end{frame}
  98. \begin{frame}
  99. \frametitle{Premise}
  100. A good target: operating systems
  101. \newline
  102. \begin{columns}[c]
  103. \begin{column}{0.5\textwidth}
  104. \begin{itemize}
  105. \item{Very flexible}
  106. \item{Reveals many abstraction layers}
  107. \end{itemize}
  108. \end{column}
  109. \begin{column}{0.5\textwidth}
  110. \begin{itemize}
  111. \item{Essential component of modern computer systems}
  112. \item{\textbf{Offers deep insights and learning opportunities}}
  113. \end{itemize}
  114. \end{column}
  115. \end{columns}
  116. \begin{figure}[ht]
  117. \begin{center}
  118. \includegraphics[width=\columnwidth]{graphics/abstraction-layers.pdf}
  119. \end{center}
  120. \end{figure}
  121. \end{frame}
  122. \begin{frame}
  123. \frametitle{Methodology}
  124. \ruleline{Step Plan}
  125. \newline
  126. \begin{itemize}
  127. \item{Step 1 | Categorize Hardware Extensions}
  128. \begin{itemize}
  129. \item{RISC-V specifications extensions, but also others}
  130. \end{itemize}
  131. \end{itemize}
  132. \vspace{1em}
  133. \begin{itemize}
  134. \item{Step 2 | Categorize Operating Systems}
  135. \begin{itemize}
  136. \item{Degree of RISC-V support according to documentation}
  137. \item{Use hardware extension categorization to judge effort}
  138. \end{itemize}
  139. \end{itemize}
  140. \vspace{1em}
  141. \begin{itemize}
  142. \item{Step 3 | Preliminary Selection}
  143. \begin{itemize}
  144. \item{Gather reduced operating system selection for subsequent analysis}
  145. \end{itemize}
  146. \end{itemize}
  147. \vspace{1em}
  148. \begin{itemize}
  149. \item{Step 4 | Operating System Analysis}
  150. \begin{itemize}
  151. \item{Gather precise set of requirements by compiling}
  152. \end{itemize}
  153. \end{itemize}
  154. \end{frame}
  155. \begin{frame}
  156. \frametitle{HW Side | Step 1}
  157. \ruleline{Categorize Extensions}
  158. \newline
  159. \newline
  160. \begin{columns}[c]
  161. \begin{column}{0.5\textwidth}
  162. \begin{itemize}
  163. \item{M Ext. (multiplication/division)}
  164. \item{A Ext. (atomics)}
  165. \item{Zifencei Ext. (fences)}
  166. \item{Zicsr Ext. (control-status reg.)}
  167. \item{Counters (time/perf.)}
  168. \item{F/D/Q Ext. (floating-point)}
  169. \item{C Ext. (compressed instr.)}
  170. \end{itemize}
  171. \end{column}
  172. \begin{column}{0.5\textwidth}
  173. \begin{itemize}
  174. \item{M-Mode (machine mode)}
  175. \item{S-Mode (supervisor mode)}
  176. \item{H-Mode (hypervisor mode)}
  177. \item{U-Mode (user mode)}
  178. \item{MMU (mem. management unit)}
  179. \end{itemize}
  180. \end{column}
  181. \end{columns}
  182. \end{frame}
  183. \begin{frame}
  184. \frametitle{OS Side | Step 2}
  185. \ruleline{Categorize Operating Systems}
  186. \newline
  187. \begin{columns}[t]
  188. \begin{column}{0.33\textwidth}
  189. \centering
  190. \textbf{Linux}
  191. \newline
  192. \begin{itemize}
  193. \item{embedded (buildroot)}
  194. \item{embedded (Yocto Project)}
  195. \item{Debian}
  196. \item{Ubuntu}
  197. \item{Fedora}
  198. \item{OpenSUSE}
  199. \item{Alpine}
  200. \end{itemize}
  201. \end{column}
  202. \begin{column}{0.33\textwidth}
  203. \centering
  204. \textbf{RTOSs}
  205. \newline
  206. \begin{itemize}
  207. \item{FreeRTOS}
  208. \item{Zephyr RTOS}
  209. \item{Huawei LiteOS}
  210. \item{Apache Mynewt}
  211. \end{itemize}
  212. \end{column}
  213. \begin{column}{0.33\textwidth}
  214. \centering
  215. \textbf{Specialized}
  216. \newline
  217. \begin{itemize}
  218. \item{seL4 microkernel}
  219. \item{Harvey OS}
  220. \item{HelenOS}
  221. \end{itemize}
  222. \end{column}
  223. \end{columns}
  224. \end{frame}
  225. \begin{frame}
  226. \frametitle{OS Side | Step 2}
  227. \ruleline{Categorize Operating Systems}
  228. \newline
  229. \begin{columns}[t]
  230. \begin{column}{0.33\textwidth}
  231. \centering
  232. \textbf{Linux}
  233. \newline
  234. \begin{itemize}
  235. \item{embedded (buildroot)}
  236. \end{itemize}
  237. \end{column}
  238. \begin{column}{0.33\textwidth}
  239. \centering
  240. \textbf{RTOSs}
  241. \newline
  242. \begin{itemize}
  243. \item{FreeRTOS}
  244. \item{Zephyr RTOS}
  245. \end{itemize}
  246. \end{column}
  247. \begin{column}{0.33\textwidth}
  248. \centering
  249. \textbf{Specialized}
  250. \newline
  251. \end{column}
  252. \end{columns}
  253. \end{frame}
  254. \begin{frame}
  255. \frametitle{Preliminary Selection | Step 3}
  256. %\ruleline{Preliminary Selection}
  257. \begin{table}[H]
  258. \centering
  259. \begin{tabularx}{\textwidth}{r|cccc}
  260. & & & buildroot & buildroot \\
  261. & & & 2022.08 & 2022.05 \\
  262. & & & Linux 5.17 & Linux 5.18 \\
  263. standard & & Zephyr & (glibc + & (uClibc + \\
  264. extensions & FreeRTOS & RTOS & busybox) & busybox) \\
  265. \hline
  266. M & \catPE & \catPE & \catPE & \catSN \\
  267. A & \catEX & \catEX & \catSN & \catSN \\
  268. Zifencei & \catEX & \catEX & \catSN & \catSN \\
  269. Zicsr & \catSN & \catSN & \catSN & \catSN \\
  270. Counters & \catEX & \catEX & \catSN & \catEX \\
  271. F, D, Q & \catEX & \catEX & \catSN & \catPE \\
  272. C & \catPE & \catPE & \catPE & \catPE \\
  273. \end{tabularx}
  274. \caption{\catSN = strictly necessary, \catPE = performance enhancing, \catEX = expendable}
  275. \end{table}
  276. \end{frame}
  277. \begin{frame}
  278. \frametitle{Preliminary Selection | Step 3}
  279. %\ruleline{Preliminary Selection}
  280. \begin{table}[h]
  281. \centering
  282. \begin{tabularx}{\textwidth}{r|cccc}
  283. & & & buildroot & buildroot \\
  284. & & & 2022.08 & 2022.05 \\
  285. & & & Linux 5.17 & Linux 5.18 \\
  286. privilege & & Zephyr & (glibc + & (uClibc + \\
  287. modes & FreeRTOS & RTOS & busybox) & busybox) \\
  288. \hline
  289. M-mode & \catSN & \catSN & \catSN & \catSN \\
  290. S-mode & \catEX & \catEX & \catSN & \catCO \\
  291. U-mode & \catEX & \catEX & \catEX & \catEX \\
  292. H-mode & \catEX & \catEX & \catEX & \catEX \\
  293. \hline
  294. MMU & \catEX & \catEX & \catSN & \catCO \\
  295. \end{tabularx}
  296. \caption{\catCO = convenient, \catSN = strictly necessary, \catEX = expendable}
  297. \end{table}
  298. \end{frame}
  299. \begin{frame}
  300. \frametitle{Requirements | Step 4}
  301. \ruleline{Operating System Analysis}
  302. \begin{columns}[c]
  303. \begin{column}{.35\textwidth}
  304. \begin{enumerate}
  305. \item{Compile builds}
  306. \item{Count instructions}
  307. \item{Get requirements}
  308. \item{Judge effort}
  309. \end{enumerate}
  310. \end{column}
  311. \begin{column}{.8\textwidth}
  312. \begin{figure}[ht]
  313. \begin{center}
  314. \includegraphics[width=0.9\columnwidth,keepaspectratio]{graphics/os-ext-histogram.png}
  315. \end{center}
  316. \end{figure}
  317. \end{column}
  318. \end{columns}
  319. \end{frame}
  320. \begin{frame}
  321. \frametitle{Analysis Results}
  322. Analysis has resulted in a clear preference for RTOSs.
  323. \newline
  324. \newline
  325. What changes does this entail for MiRiV?
  326. \newline
  327. \newline
  328. What kind of application can the extended MiRiV implementation run using an RTOS?
  329. \end{frame}
  330. \begin{frame}
  331. \frametitle{Overview of Changes}
  332. \begin{columns}[c]
  333. \begin{column}{1\textwidth}
  334. \begin{figure}[ht]
  335. \begin{center}
  336. \includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{graphics/miriv-change.pdf}
  337. \end{center}
  338. \end{figure}
  339. \end{column}
  340. \end{columns}
  341. \end{frame}
  342. \begin{frame}
  343. \frametitle{Extended MiRiV Pipeline}
  344. \begin{columns}[c]
  345. \begin{column}{1\textwidth}
  346. \begin{figure}[ht]
  347. \begin{center}
  348. \includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{../thesis/graphics/miriv-new-pipeline.pdf}
  349. \end{center}
  350. \end{figure}
  351. \end{column}
  352. \end{columns}
  353. \end{frame}
  354. \begin{frame}
  355. \frametitle{FreeRTOS Demo Applications}
  356. Target simple two task setup
  357. \newline
  358. \newline
  359. Two such demo applications implemented:
  360. \newline
  361. \newline
  362. \begin{columns}[b]
  363. \begin{column}{.5\textwidth}
  364. \centering
  365. \ruleline{Counter Demo}
  366. \newline
  367. \newline
  368. write task-internal, incrementing counter values to UART periodically at fixed rate
  369. \end{column}
  370. \begin{column}{.5\textwidth}
  371. \centering
  372. \ruleline{Scheduling Demo}
  373. \newline
  374. \newline
  375. run two previously used bare-metal tests as tasks to completion
  376. \end{column}
  377. \end{columns}
  378. \end{frame}
  379. \begin{frame}
  380. \begin{columns}[c]
  381. \begin{column}{\textwidth}
  382. \centering
  383. \ruleline{Counter Demo}
  384. \begin{figure}[ht]
  385. \begin{center}
  386. \includegraphics[height=0.84\textheight,keepaspectratio]{graphics/miriv-demo-counter.png}
  387. \end{center}
  388. \end{figure}
  389. \end{column}
  390. \end{columns}
  391. \end{frame}
  392. \begin{frame}
  393. \begin{columns}[c]
  394. \begin{column}{\textwidth}
  395. \centering
  396. \ruleline{Scheduling Demo}
  397. \begin{figure}[ht]
  398. \begin{center}
  399. \includegraphics[height=0.84\textheight,keepaspectratio]{graphics/miriv-demo-scheduling-1.png}
  400. \end{center}
  401. \end{figure}
  402. \end{column}
  403. \end{columns}
  404. \end{frame}
  405. \begin{frame}
  406. \begin{columns}[c]
  407. \begin{column}{\textwidth}
  408. \centering
  409. \ruleline{Scheduling Demo}
  410. \begin{figure}[ht]
  411. \begin{center}
  412. \includegraphics[height=0.84\textheight,keepaspectratio]{graphics/miriv-demo-scheduling-2.png}
  413. \end{center}
  414. \end{figure}
  415. \end{column}
  416. \end{columns}
  417. \end{frame}
  418. \begin{frame}
  419. \begin{columns}[c]
  420. \begin{column}{1\textwidth}
  421. \begin{figure}[ht]
  422. \begin{center}
  423. \includegraphics[width=\textwidth,height=0.95\textheight,keepaspectratio]{../thesis/graphics/de2-115-execution.jpg}
  424. \end{center}
  425. \end{figure}
  426. \end{column}
  427. \end{columns}
  428. \end{frame}
  429. \begin{frame}
  430. \frametitle{Future Work}
  431. \begin{itemize}
  432. \item{Currently low instruction and data memory available}
  433. \begin{itemize}
  434. \item{Implement support for on-board resources such as SDRAM}
  435. \item{Update address spaces}
  436. \end{itemize}
  437. \item{Only static FreeRTOS tasks implemented}
  438. \begin{itemize}
  439. \item{Code size restrictions limit FreeRTOS features}
  440. \item{Related to low instruction memory limitation}
  441. \end{itemize}
  442. \item{Currently just simple demo applications implemented}
  443. \begin{itemize}
  444. \item{Idea: sophisticated demo using additional I/O}
  445. \begin{itemize}
  446. \item{networking...}
  447. \item{graphics...}
  448. \item{buttons, keyboard, mouse...}
  449. \end{itemize}
  450. \item{Idea: simple shell implementing the \texttt{fork/exec -> exit} flow}
  451. \end{itemize}
  452. \item{Supporting other RTOSs}
  453. \item{Supporting (embedded) Linux}
  454. \begin{itemize}
  455. \item{Prohibitively time-consuming, big hardware changes still necessary}
  456. \end{itemize}
  457. \end{itemize}
  458. \end{frame}
  459. \begin{frame}
  460. \frametitle{Takeaways}
  461. \begin{itemize}
  462. \item{The current RISC-V ecosystem: rapidly evolving, not necessarily easy to survey landscape}
  463. \item{Structured approach is necessary to be unbiased in the decision process}
  464. \item{Dependencies are not easy to see, generating requirements was difficult}
  465. \item{Implementation and testing take a lot of time}
  466. \end{itemize}
  467. \end{frame}
  468. \begin{frame}
  469. \frametitle{Conclusion}
  470. We successfully...
  471. \newline
  472. \newline
  473. \begin{itemize}
  474. \item{... identified an appropriate operating system target}
  475. \item{... identified required hardware extensions}
  476. \item{... planned an implementation}
  477. \item{... implemented required hardware extensions}
  478. \item{... tested the implementation in simulations and on hardware}
  479. \item{... adapted FreeRTOS to run on the extended MiRiV implementation}
  480. \item{... realized two successful demos}
  481. \end{itemize}
  482. \end{frame}
  483. \begin{frame}
  484. \frametitle{Conclusion}
  485. %\centering
  486. An RTOS with RISC-V support is a realistic target within the scope of a bachelor thesis and the extensions can serve as continuative material.
  487. \newline
  488. \end{frame}
  489. \begin{frame}[c]
  490. \ruleline{\textbf{Thank you!}}
  491. \newline
  492. \ruleline{Further questions?}
  493. \end{frame}
  494. % etc
  495. \end{document}