summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorn.ramanathan14 <n.ramanathan14@imperial.ac.uk>2020-09-07 19:12:31 +0000
committeroverleaf <overleaf@localhost>2020-09-07 19:45:15 +0000
commit6da231b6cc0bc1b0f734f1168d5657ae9aab1037 (patch)
treee9798dc09db3cede43a6b36a2a09bc3a395f8962
parent2e9db2456f8de13a6439d9f25ec7530b5533555c (diff)
downloadfccm21_esrhls-6da231b6cc0bc1b0f734f1168d5657ae9aab1037.tar.gz
fccm21_esrhls-6da231b6cc0bc1b0f734f1168d5657ae9aab1037.zip
Update on Overleaf.
-rw-r--r--method-new.tex7
-rw-r--r--tool-figure.tex3
2 files changed, 7 insertions, 3 deletions
diff --git a/method-new.tex b/method-new.tex
index c3de649..aaff34c 100644
--- a/method-new.tex
+++ b/method-new.tex
@@ -25,11 +25,12 @@ We present the following material in this section:
\subsubsection{What does CSmith offer?}
-Csmith is randomised code generator of C programs for compiler testing~\cite{yang11_findin_under_bugs_c_compil}.
-Csmith generates these programs based on features probabilities and safety requirements stipulated by users.
-
+Csmith is randomised code generator of C programs for compiler testing~\cite{yang11_findin_under_bugs_c_compil}, that has found more than 400 bugs in software compilers~\cite{csmith}.
+Csmith generates these programs based on features probabilities and safety requirements stipulated by users.
Table~\ref{??} shows the set of features and safety flags that we configure to generate HLS-friendly C programs for testing.
+
+
It is essential to have valid random C/C++ programs, as the software programs need to be correct to confirm that discrepancies in results are indeed introduced by HLS tools. Csmith became the best candidate for generating the random C/C++ programs. The bug-detecting ability of Csmith has already been proved. It has found more than 400 previously unknown compiler bugs \cite{csmith}. Programs generated by Csmith contains uniformed syntax, formatted function names and variable names, complex hashing functions, and a main that assembles all the sub-functions. It also provides a safe math wrapper function that avoids undefined behaviors in C, such as divided by 0 or mod by 0. As shown in \ref{?} (Fig of random program)\YH{It may take up too much space, as we are reusing Csmith it is probably also not necessary, better to have more space to focus on the experiments.}, Csmith creates a random program with the order of struct/union declarations, global variables, top-level function (func\underline{ }1)\YH{You can use \texttt{func\_1} to render them a bit nicer.}, sub-functions (func\underline{ }6), and main. Inside the main function, only function 1 is being called as it is the top-most function, which will be calling other sub-functions. The crc32\underline{ }gentab and transparent\underline{ }crc function are responsible for creating and processing a unique hash for every global variable. XOR and shift are the primary operations done by the hashing process, which ensures uniqueness. The final hash value is calculated by looping through every index of the global variable and perform hashing, which is saved in crc32\underline{ }context and displayed.
As programs are uniformly formatted, the later pre-processing step is eased since the overall program structure is predictable. It also facilitated the reduction process as it is easier to spot functions or variables with uniformed names. Furthermore, the bug-detecting efficiency is boosted by comparing the unique final hash value, which reflects all the changes made to the global variables.
diff --git a/tool-figure.tex b/tool-figure.tex
index 57f7230..8b450ed 100644
--- a/tool-figure.tex
+++ b/tool-figure.tex
@@ -18,6 +18,9 @@ block/.style={draw, minimum width=20mm, minimum height=8mm,align=center},
\draw[-latex] (hls) to [auto] node[inner sep=0] {Verilog program} (eq) ;
\draw[-latex,dashed,red] (eq) to [auto] node [red] {fail} (red) ;
\draw[-latex,dashed,red] (hls) to [auto] node [red] {crash} (red) ;
+ % marking the test harness
+ \node[] (label) at (3.7,1.75) {\strut Test harness} ;
+ \draw[-,dashed] (2.85,2) -- (2.85,-1.6) -- (5.2,-1.6) -- (5.2,-0.6) -- (7.1,0.3) -- (9.2,0.3) -- (9.2,2) -- (2.8,2) ;
%\draw[-latex] (pragma) [out=360-15,in=180+15] to (red);
%\node[] () at (4,-2) {C program};
\end{tikzpicture}