summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eval_rewrite.tex28
-rw-r--r--intro.tex13
-rw-r--r--main.tex2
-rw-r--r--method-new.tex6
-rw-r--r--testing-system-new.tex6
5 files changed, 54 insertions, 1 deletions
diff --git a/eval_rewrite.tex b/eval_rewrite.tex
index b540dc5..55456d7 100644
--- a/eval_rewrite.tex
+++ b/eval_rewrite.tex
@@ -78,6 +78,34 @@ int main() {
}
\end{minted}
+Example 2
+
+\begin{minted}{c}
+#include <stdio.h>
+#include <stdint.h>
+
+volatile uint32_t g_2 = 0;
+uint32_t a[256] = {0};
+uint32_t c = 0;
+
+void d(uint8_t b) { c = (c & 4095) ^ a[(c ^ b) & 15]; }
+
+void e(uint64_t f) {
+ d(f); d(f >> 8); d(f >> 16);
+ d(f >> 24); d(f >> 32); d(f >> 40);
+ d(f >> 48);
+}
+
+int result() {
+ int i = 0;
+ for (; i < 56; i++) { a[i] = i; }
+ e(g_2);
+ e(-2L);
+ printf("checksum = %X\n", c);
+ return c;
+}
+\end{minted}
+
In the code above, \texttt{b} has value 1 when run in GCC, but has value 0 when run with LegUp 4.0. If the \texttt{volatile} keyword is removed from \texttt{a}, then the netlist contains the correct result. As \texttt{a} and \texttt{d} are constants, the if-statement should always produce go into the \texttt{true} branch, meaning \texttt{b} should never be set to 0.
\subsection{Bugs in Vivado HLS versions}
diff --git a/intro.tex b/intro.tex
index 33e963d..390c323 100644
--- a/intro.tex
+++ b/intro.tex
@@ -22,6 +22,19 @@ int result() {
\caption{Miscompilation bug found in Vivado 2018.3 and 2019.2 which returns \texttt{6535FF} instead of \texttt{46535FF} which is the correct result.}\label{fig:vivado_bug1}
\end{figure}
+\NR{
+Notes on program:
+\begin{itemize}
+ \item result is main
+ \item array a needs to be at least 6 elements
+ \item magic number as well
+ \item for loop at least two.
+ \item constant replacement fixes it too.
+ \item all three versions of Vivado.
+ \item
+\end{itemize}
+}
+
We have tested three widely used HLS tools: LegUp~\cite{canis13_legup}, Xilinx Vivado HLS~\cite{xilinx20_vivad_high_synth}, and the Intel HLS Compiler~\cite{?}. For all three tools, we were able to find valid C programs that cause crashes while compiling and valid C programs that cause wrong RTL to be generated. We have submitted a total of \ref{?} bug reports to the developers, \ref{?} of which have been confirmed and \ref{?} of which have now been fixed at the time of writing.
We hope that our work serves to stimulate efforts to improve the quality of HLS tools.
diff --git a/main.tex b/main.tex
index ab3d5cf..800a0f1 100644
--- a/main.tex
+++ b/main.tex
@@ -161,7 +161,7 @@ We have subjected three widely used HLS tools -- LegUp, Xilinx Vivado HLS, and t
\input{method-new}
-\input{testing-system}
+% \input{testing-system-new}
\input{eval_rewrite}
diff --git a/method-new.tex b/method-new.tex
index 77f72c0..7272a99 100644
--- a/method-new.tex
+++ b/method-new.tex
@@ -23,6 +23,12 @@ We present the following material in this section:
\subsection{Generating programs via CSmith}
\label{sec:method:csmith}
+\NR{
+Questions:
+\begin{itemize}
+ \item Do we use Csmith's hashing or our own hashing now? Is that what \texttt{transparent\_crc} is for?
+\end{itemize}
+}
\newcommand{\code}[1]{\texttt{#1}}
diff --git a/testing-system-new.tex b/testing-system-new.tex
new file mode 100644
index 0000000..a44a942
--- /dev/null
+++ b/testing-system-new.tex
@@ -0,0 +1,6 @@
+\section{Overview of the testing system}
+
+\NR{Trimming section down to interesting bits!}
+
+\NR{Paragraph on experimental setup}
+Vivado HLS version 2019.2, 2019.1, and 2018.3, as well as LegUp HLS version 4.0, are instructed under the Linux setting, so bash shell scripts are implemented to direct the testing flow. Since we failed to run \JW{Phrase this more positively, e.g.: `Since LegUp version 7.5 does not have command-line support...'} LegUp HLS version 7.5 through the command line, version 7.5 is installed on Windows and launched as GUI. Only test cases, which trigger discrepancies in results detected through version 4.0, have been run on version 7.5. Thus, the whole testing flow does not apply to LegUp version 7.5. Intel HLS is running under the Windows setting, so a batch script is written.