\lstset{showstringspaces=false}
\lstset{basicstyle=\small}
-
-
-
+\newcommand{\shell}[1]{\texttt{#1}}
+\newcommand{\code}[1]{\texttt{#1}}
\begin{document}
This is a 32 bit floating point unit developed for JOP in VHDL.
I have been able to successfully compile it and the test program using GHDL\cite{ghdl}.
+Whilst there are constants (eg: \verb/FP_WIDTH = 32, EXP_WIDTH = 8, FRAC_WIDTH = 23/) defined, the actual implementation mostly uses magic numbers, so
+some investigation is needed into what, for example, the "52" bits used in the sqrt units are for.
+
+\section{GHDL\cite{ghdl}}
+
+GHDL is an open source GPL licensed VHDL compiler written in Ada. It had packages in debian up until wheezy when it was removed. However the sourceforge site still provides a \shell{deb} file for wheezy.
+
+This reference explains how to use the \shell{ghdl} compiler, but not the VHDL language itself.
+
+GHDL is capable of compiling a ``testbench'' - essentially an executable which simulates the design and ensures it meets test conditions.
+A common technique is using a text file to provide the inputs/outputs of the test. The testbench executable can be supplied an argument to save a \shell{vcd} file which can be viewed in \shell{gtkwave} to see timing diagrams.
+
+Sam has successfully compiled the VHDL design for an FPU in JOP\cite{jop} into a ``testbench'' executable which uses standard i/o instead of a regular file.
+Using unix domain sockets we can execute the FPU as a child process and communicate with it from our document viewing test software. This means we can potentially simulate alternate hardware designs for FPUs and witness the effect they will have on precision in the document viewer.
+
+Using \shell{ghdl} the testbench can also be linked as part a C/C++ program and run using a function; however there is still no way to communicate with it other than forking a child process and using a unix domain socket anyway. Also, compiling the VHDL FPU as part of our document viewer would clutter the code repository and probably be highly unportable. The VHDL FPU has been given a seperate repository.
+
+
% Back to software
\section{Basic Issues in Floating Point Arithmetic and Error Analysis\cite{demmel1996basic}}
howpublished = "\url{http://ghdl.free.fr/ghdl/}"
}
+% Look into as an alternative to using text files for FPU simulation?
+@misc{tang2000using,
+ title = "Using Binary Files in VHDL Test Benches",
+ author = "Stephen Tang",
+ year = "2000",
+ howpublished = "\url{http://www.ece.ualberta.ca/~elliott/ee552/studentAppNotes/2000_w/vhdl/BinaryFileTestbenching/binary.html}",
+ note = "Application Notes (webpage)"
+}
+
+
+
@article{demmel1996basic,
title = "Basic Issues in Floating Point Arithmetic and Error Analysis",
author = "Jim Demmel",
author = "Edvin Catovic",
howpublished = "\url{http://www.gaisler.com/doc/grfpu_dasia.pdf}"
}
+
+