This commit is contained in:
Jörg Thalheim 2014-01-13 09:08:21 +01:00
parent e664c5e777
commit c72c930bc0
12 changed files with 397 additions and 239 deletions

83
.gitignore vendored Normal file
View File

@ -0,0 +1,83 @@
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
## Intermediate documents:
*.dvi
# these rules might exclude image files for figures etc.
*.ps
*.eps
*.pdf
## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.run.xml
## Build tool auxiliary files:
*.fdb_latexmk
*.synctex.gz
*.pdfsync
## Auxiliary and intermediate files from other packages:
# algorithms
*.alg
*.loa
# amsthm
*.thm
# beamer
*.nav
*.snm
*.vrb
# glossaries
*.acn
*.acr
*.glg
*.glo
*.gls
# hyperref
*.brf
# listings
*.lol
# makeidx
*.idx
*.ilg
*.ind
*.ist
# minitoc
*.maf
*.mtc
*.mtc0
# minted
*.pyg
# nomencl
*.nlo
# todonotes
*.tdo
# xindy
*.xdy
# verilog
*.vcd
/examples

View File

@ -2,18 +2,15 @@ C99?=c99
all: bericht check fsm_tb
bericht:
cd bericht && make
check: sqrt
./sqrt
sqrt: c/sqrt.c
$(C99) -lm -o sqrt c/sqrt.c
bericht/graph.pdf: bericht/graph.dot
cd bericht; dot -Tpdf graph.dot > graph.pdf
bericht: bericht/graph.pdf
latexmk -pdf bericht/bericht.tex;
fsm: verilog/heron_fsm.vcd
gtkwave verilog/heron_fsm.vcd
@ -28,3 +25,6 @@ ctrl_tb: verilog/heron_ctrl.vcd
%.vvp: %_tb.v %.v
iverilog -o $@ -Iverilog verilog/heron_{fsm,ctrl}.v
sync:
rsync -av --inplace --rsync-path=~/rsync-3.1.0/rsync -avHz -e ssh verilog/ eeets2:verilog

38
SQRT.v
View File

@ -1,38 +0,0 @@
module SQRT(A, Y, clk, reset);
parameter width = 31;
`define width 31
input [width:0] A;
reg [width:0] x;
reg [width:0] old_x;
output [width:0] Y;
always @(A)
begin
case(state)
WAIT: Y = 0;
CALC1:
x = CALC1
state = OUTPUT
CALC2:
if (old_x <= x) begin
state = OUTPUT
end
OUTPUT: Y = Y_t;
default: Y = 0;
endcase
end
initial begin : parameter_check
if (width < 1) begin
$display("ERROR: %m :\n Invalid value (%d) for parameter width (lower bound: 1)", width);
$finish;
end
if (width > 32) begin
$display("ERROR: %m :\n Invalid value (%d) for parameter width (upper bound: 32)", width);
$finish;
end
end
endmodule

11
bericht/Makefile Normal file
View File

@ -0,0 +1,11 @@
all: bericht
%.pdf: %.tex
latexmk -pdf $<
%.pdf: %.dot
dot -Tpdf $< > $@
bericht.pdf: graph.pdf
bericht: bericht.pdf

View File

@ -24,7 +24,7 @@
listoftables, % includes list of tables
listoflistings, % includes list of listings
abbrevations, % includes index of symbols and abbrevations
bibIfa, % citation style (IfA standard), alternatives: bibNumeric, bibHarvard
bibNumeric, % citation style (IfA standard), alternatives: bibNumeric, bibHarvard
langDE % define the language (default: langDE)
]{ifathesis}
\ifaThesis{Belegarbeit}
@ -36,6 +36,7 @@
\ifaKeywords{Praktikum, Schaltungsentwurf, Verilog} % Keywords included in pdf-file. Could be found e.g. by Windows file search.
\ifaTitleDE{Schaltkreis- und Systementwurf}
\ifaTitleEN{}
\bibliography{bibliography}
\ifaSupervisorA{Jens-Uwe Schlüßler}
\ifaProfessor{Prof. Dr.-Ing. habil. René Schüffny}
@ -46,99 +47,103 @@
\ifaAbstractEN{example_files/00_abstract_en__invalid}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{color}
\definecolor{mygreen}{rgb}{0,0.6,0}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mymauve}{rgb}{0.58,0,0.82}
\lstset{ %
backgroundcolor=\color{white}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
basicstyle=\footnotesize, % the size of the fonts that are used for the code
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
breaklines=true, % sets automatic line breaking
captionpos=b, % sets the caption-position to bottom
commentstyle=\color{mygreen}, % comment style
deletekeywords={...}, % if you want to delete keywords from the given language
escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
frame=single, % adds a frame around the code
keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
keywordstyle=\color{blue}, % keyword style
language=C, % the language of the code
morekeywords={*,...}, % if you want to add more keywords to the set
numbers=left, % where to put the line-numbers; possible values are (none, left, right)
numbersep=5pt, % how far the line-numbers are from the code
numberstyle=\tiny\color{mygray}, % the style that is used for the line-numbers
rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
showstringspaces=false, % underline spaces within strings only
showtabs=false, % show tabs within strings adding particular underscores
stepnumber=2, % the step between two line-numbers. If it's 1, each line will be numbered
stringstyle=\color{mymauve}, % string literal style
tabsize=2, % sets default tabsize to 2 spaces
title=\lstname % show the filename of files included with \lstinputlisting; also try caption instead of title
% Keine Kapitelnummerierung
\makeatletter
\renewcommand{\thesection}{
\ifnum\c@chapter<1 \@arabic\c@section
\else \thechapter.\@arabic\c@section
\fi
}
\makeatother
\begin{document}
\chapter{Einleitung}
TODO Kapitel 5.1 -> Aufgabenstellung
\section{Einleitung}
Aufgabe des Praktikums \emph{Schaltkreis- und Systementwurf} ist es einen integrierten Schaltkreis (ASIC) für
einen numerischen Algorithmus zu entwickeln. Der Schaltkreis ist mit der
Enwicklungsumgebung \emph{Cadence} zu erstellen. Dabei ist den Arbeitsschritten der Aufgabenstellung
\cite{aufgabenstellung} zu folgen. Die Schaltung ist durch Simulation zu verifizieren.
Der folgende Bericht enthält die geforderte Dokumentation nach Kapitel 5.1
\cite{dokumentation} der Aufgabenstellung.
\chapter{Beschreibung des Algorithmus}
\section{Beschreibung des Algorithmus}
Der hier selbst gewählte Algorithmus ist Ziehen der Quadratwurzel mithilfe des
Heronsche Näherungsverfahren (auch Babylonverfahren genannt). Es ist benannt
nach dem Altgriechen Heron von Alexandria, der es zum 1. Mal beschrieb. Es ist
vermutlich das älteste Nährungsverfahren für die Quadratwurzel. Wegen seines
einfachen Aufbaus, war es ein beliebter Algorithmus für die Implementierung in
Software bevor Hardwareimplementierung sich verbreitet haben.
Die Iterationsvorschrift des Verfahren lautet:
\begin{align}
x_{n+1}=\frac{x_n + \frac{a}{x_n}}{2}
x_{n+1} & =\frac{x_n + \frac{a}{x_n}}{2} \\
lim_{n \rightarrow \infty} x_n & = \sqrt{a}
\end{align}
\section{Implementierung in C}
\begin{lstlisting}
typedef uint32_t u32;
void heron_sqrt(u32 *mem) {
int i = mem[0];
while (i > 0) {
u32 s = mem[i];
if (s > 1) {
// x_0 = (s + 1) / 2
// without increment to avoid overflow for 0xffffffff
u32 x = s >> 1;
u32 old_x = x;
wobei $a$ der Ausgangswert ist, aus welchem die Wurzel berechnet werden soll und
$x_n$ der sich von Iterations zu Iterations an die Quadratwurzel annähernde
Wert.
while(1) {
// x_{n + 1} = (x_n + (s / x_n)) / 2
x = (x >> 1) + ((s/x) >> 1);
if (old_x <= x) {
break;
}
old_x = x;
}
mem[i] = x;
}
i--;
}
}
\end{lstlisting}
\subsection{Speicherbelegung}
Herleiten lässt sich die Folge aus dem Newton-Verfahren zur Bestimmung der
Nullstellen ($x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}$):
\begin{align}
x^2 &= a \\
f(x) &= x^2 - a \\
f'(x) &= 2x \\
x_{n + 1} &= x_n - \frac{f(x_n)}{f'(x_n)} \\
&= x_n - \frac{x_n^2 - a}{2x_n} \\
&= x_n - \frac{x_n - a/x_n}{2} \\
&= \frac{x_n + a/x_n}{2}
\end{align}
Wobei in diesem Praktikum die Quadratwurzel von mehreren hintereinander im
Speicher abgelegten Zahlen berechnet wird.
\section{Implementierung in C}
Der Prototyp des Algorithmus erfolgte in der Programmiersprache C nach dem
C99-Standard.
\ifalisting{Implementierung in C}{lst:implementierung}{c}{code/sqrt.c}{true}
Wie auch in der zu realisierenden Schaltung erwartet die Funktion im
Speicherfeld die Operanden für die Quadratwurzel-Berechnung. Wobei das 1. Feld
die Anzahl der Operanden angibt (siehe Speicherbelegung \ref{tbl:speicherbelegung}).
\subsection{Speicherbelegung und Zahlenformat}
Es wird angenommen, das jeder Speicherplatz 32 Bit breit ist.
Jedes Datenfeld wird als vorzeichenlose Festkommazahl interpretiert.
Die Anzahl der Nachkommastellen lässt sich sowohl in der Schaltung
(heron\_comma\_fix) als auch in
der C-Implementierung (siehe Zeile \ref{comma}) leicht anpassen, wobei
vorrausgesetzt wird, dass die Anzahl durch 2 teilbar sein muss. Für die
Verifikation wurden 8. Kommastellen festgesetzt.
\begin{table}
\begin{tabularx}{\textwidth}{X|X}
Speicherplatz & Beschreibung \\\hline
MEM[0] & Anzahl der Operanden (n) \\
MEM[0] & Anzahl der Operanden (N) \\
MEM[1] & 1. Operand \\
MEM[2] & 2. Operand \\
$\ldots$ & $\dots$ \\
MEM[N] & N. Operand
\end{tabularx}
\caption{Speicherbelegung}
\label{tbl:speicherbelegung}
\end{table}
\subsection{Datenflussgraph}
\begin{figure}[ht]
\centering
\includegraphics[width=0.3\textwidth]{graph.pdf}
\includegraphics[width=0.6\textwidth]{graph.pdf}
\label{fig1}
\end{figure}
\subsection{Datenpfad}
\end{document}
% vim:spelllang=de

View File

@ -1,11 +1,21 @@
%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/
%% Saved with string encoding Unicode (UTF-8)
#@misc{mda,
# Date-Added = {2010-01-09 12:34:49 +0100},
# Date-Modified = {2010-01-09 12:35:30 +0100},
# Title = {{Model Driven Architecture}},
# Url = {http://omg.org/mda}}
@inbook {aufgabenstellung,
Date-Added = {2013-01-11 13:00:00 +0100},
crossref = {einführung},
pages = "8"
}
@inbook {dokumentation,
Date-Added = {2013-01-11 13:00:00 +0100},
crossref = {einführung},
pages = "9"
}
@book{einführung,
Date-Added = {2013-01-11 13:00:00 +0100},
author = "Jens-Uwe Schlüßler",
title = "Einführung in die Anwendung des Entwurfssystems CADENCE für die
Lehrveranstaltung Schaltkreis- und Systementwurf",
year = "2013",
}

30
bericht/code/sqrt.c Normal file
View File

@ -0,0 +1,30 @@
typedef uint32_t u32;
// have to a multiply of 2
#define COMMA 8 @\label{comma}@
#define COMMA_FIX (COMMA >> 1)
void heron_sqrt(u32 *mem) {
int i = mem[0];
while (i > 0) {
u32 s = mem[i];
u32 x = s;
if (s > 1) {
// x_0 = (s + 1) / 2
// without increment to avoid overflow for 0xffffffff
x = x >> 1;
u32 old_x = x;
while(1) {
// x_{n + 1} = (x_n + (s / x_n)) / 2
x = (x >> 1) + ((s/x) >> 1);
if (old_x <= x) {
break;
}
old_x = x;
}
}
mem[i] = x << COMMA_FIX;
i--;
}
}

View File

@ -199,8 +199,8 @@
% Anpassung des Literaturverzeichnisses
\setlength{\bibitemsep}{10pt}
\defbibheading{bibliography}{
\chapter*{\@bibTitle}
\addcontentsline{toc}{chapter}{\@bibTitle}
\chapter*{\@bibTitle}
\addcontentsline{toc}{chapter}{\@bibTitle}
}
% Notwendig für Autovervollständigung der Zitate im Texnic Center
\renewcommand*{\bibliography}[1]{\addbibresource{#1.bib}}
@ -211,13 +211,13 @@
% Löst Probleme mit deutschen Umlauten in Listings
%-------------------------------------------------------------------------
\lstset{literate=%
{Ö}{{\"O}}1
{Ä}{{\"A}}1
{Ü}{{\"U}}1
{ß}{{\ss}}2
{ü}{{\"u}}1
{ä}{{\"a}}1
{ö}{{\"o}}1
{Ö}{{\"O}}1
{Ä}{{\"A}}1
{Ü}{{\"U}}1
{ß}{{\ss}}2
{ü}{{\"u}}1
{ä}{{\"a}}1
{ö}{{\"o}}1
}
%-------------------------------------------------------------------------
@ -225,56 +225,79 @@
%-------------------------------------------------------------------------
% Usage: \listing{<Caption>}{<Label>}{<[Dialect]Language>}{<Pfad>}{<float?>}
\newcommand*{\ifalisting}[6]{
\renewcommand{\lstlistingname}{\hspace{-0.6cm}Listing}
\ifthenelse{\equal{#6}{true}}{
\ifalistingFloat{#1}{#2}{#3}{#4}{#5}
}{
\ifalistingNoFloat{#1}{#2}{#3}{#4}{#5}
}
\vspace{4.5mm}
\newcommand*{\ifalisting}[5]{
\renewcommand{\lstlistingname}{\hspace{-0.6cm}Listing}
\ifthenelse{\equal{#5}{true}}{
\ifalistingFloat{#1}{#2}{#3}{#4}
}{
\ifalistingNoFloat{#1}{#2}{#3}{#4}
}
\vspace{4.5mm}
}
\newcommand*{\ifalistingFloat}[5]{%
\newcommand*{\ifalistingFloat}[4]{%
\begin{minipage}{0.96\textwidth}
\lstset{belowcaptionskip=2mm} % Abstand unterhalb der Beschriftung
\ifalistingRaw{#1}{#2}{#3}{#4}{#5}
\lstset{belowcaptionskip=2mm} % Abstand unterhalb der Beschriftung
\ifalistingRaw{#1}{#2}{#3}{#4}
\end{minipage}
}
% Thanks to Matthias Freund who provided the code to enables listings which are longer than one page.
%
\newcommand*{\ifalistingNoFloat}[5]{%
\begin{addmargin}[4mm]{1.5mm} % verändert den Abstand ohne Verwendung einer Minipage
\lstset{belowcaptionskip=2mm} % Abstand unterhalb der Beschriftung
\ifalistingRaw{#1}{#2}{#3}{#4}{#5}
\vspace{-1mm}
\begin{flushright}
\scriptsize
Listing \ref{#2}
\end{flushright}
\end{addmargin}
\newcommand*{\ifalistingNoFloat}[4]{%
\begin{addmargin}[4mm]{1.5mm} % verändert den Abstand ohne Verwendung einer Minipage
\lstset{belowcaptionskip=2mm} % Abstand unterhalb der Beschriftung
\ifalistingRaw{#1}{#2}{#3}{#4}
\vspace{-1mm}
\begin{flushright}
\scriptsize
Listing \ref{#2}
\end{flushright}
\end{addmargin}
}
\newcommand*{\ifalistingRaw}[5]{
\lstinputlisting[
caption={#1},
label={#2},
language={#3},
keywordstyle=\bfseries\color{blue},
identifierstyle=\bf,
stringstyle=\itshape\color{red},
basicstyle=\ttfamily\color{black}\footnotesize, % Schriftschnitt des Codes
showstringspaces=false, % Leerzeichen nicht markieren
commentstyle=\color{green}, % Schriftschnitt der Kommentare
tabsize=2, % Tabulatorengröße in Leerzeichen
breaklines=true, % zu lange Zeilen umbrechen
frame=tb, % Rahmen um das Listing
abovecaptionskip=3mm, % Abstand oberhalb der Beschriftung
captionpos=t, % Position der Beschriftung (b=bottom, t=top)
numbers=#4,
numbersep=5pt
]{#5}
\usepackage{color}
\definecolor{mygreen}{rgb}{0,0.6,0}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mymauve}{rgb}{0.58,0,0.82}
\newcommand*{\ifalistingRaw}[4]{
\lstinputlisting[
caption={#1},
label={#2},
language={#3},
showstringspaces=false, % Leerzeichen nicht markieren
tabsize=2, % Tabulatorengröße in Leerzeichen
breaklines=true, % zu lange Zeilen umbrechen
frame=tb, % Rahmen um das Listing
abovecaptionskip=3mm, % Abstand oberhalb der Beschriftung
captionpos=t, % Position der Beschriftung (b=bottom, t=top)
numbers=left,
numbersep=5pt,
commentstyle=\color{mygreen}, % comment style
deletekeywords={...}, % if you want to delete keywords from the given language
escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
escapechar=@,
extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
frame=single, % adds a frame around the code
keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
keywordstyle=\color{blue}, % keyword style
backgroundcolor=\color{white}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
basicstyle=\footnotesize, % the size of the fonts that are used for the code
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
breaklines=true, % sets automatic line breaking
captionpos=b, % sets the caption-position to bottom
morekeywords={*,...}, % if you want to add more keywords to the set
numberstyle=\tiny\color{mygray}, % the style that is used for the line-numbers
rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
showstringspaces=false, % underline spaces within strings only
showtabs=false, % show tabs within strings adding particular underscores
stepnumber=2, % the step between two line-numbers. If it's 1, each line will be numbered
stringstyle=\color{mymauve}, % string literal style
tabsize=2, % sets default tabsize to 2 spaces
]{#4}
}
% Erlaubt das Einfügen eines automatischen Symbolverzeichnisses
@ -504,7 +527,7 @@
\else
\markright{\@bibTitle}
\fi
\printbibliography
\printbibliography
\cleardoublepage
\automark[section]{chapter}
}{}
@ -516,16 +539,16 @@
\begin{center}
\thispagestyle{empty}
\vspace*{\fill}
{\sffamily\bf\huge\appendixpagename}
\vspace{\fill}
{\sffamily\bf\huge\appendixpagename}
\vspace{\fill}
\cleardoublepage
\end{center}
% Nun die Anhänge, ohne Titelseite (siehe \RequirePackage --> ohne page-Option)
\begin{appendices}
\ifthenelse{\equal{\@ifaBibliographyBeforeAppendix}{true}}{
\pagenumbering{Roman} % römische Nummerierung im Anhang
\setcounter{page}{1} % beginne wieder mit Seitenzahl 1
}{}
\pagenumbering{Roman} % römische Nummerierung im Anhang
\setcounter{page}{1} % beginne wieder mit Seitenzahl 1
}{}
\input{\@ifaAppendix}
\cleardoublepage
\end{appendices}
@ -538,7 +561,7 @@
\else
\markright{\@bibTitle}
\fi
\printbibliography
\printbibliography
\cleardoublepage
\automark[section]{chapter}
}{}
@ -560,14 +583,14 @@ Hiermit versichere ich, \@ifaAuthor, geboren am \@ifaAuthorBirthday~in
\emph{\@ifaTitleDE}
\end{center}
\end{quote}
ohne unzulässige Hilfe Dritter und ohne Benutzung anderer als der angegebenen Hilfsmittel angefertigt habe;
die aus fremden Quellen direkt oder indirekt übernommenen Gedanken sind als
solche kenntlich gemacht. Bei der Auswahl und Auswertung des Materials sowie
bei der Herstellung des Manuskripts habe ich Unterstützungsleistungen von folgenden Personen erhalten:
\begin{center}
\emph{\@ifaSupervisorA\IfStrEq{\@ifaSupervisorB}{}{}{, \@ifaSupervisorB}\IfStrEq{\@ifaSupervisorC}{}{}{, \@ifaSupervisorC}\IfStrEq{\@ifaSupervisorD}{}{}{, \@ifaSupervisorD}\IfStrEq{\@ifaSupervisorE}{}{}{, \@ifaSupervisorE}\IfStrEq{\@ifaAdditionalContributors}{}{}{, \@ifaAdditionalContributors}}
\end{center}
Weitere Personen waren an der geistigen Herstellung \ifthenelse{\not\equal{\@ifaThesis}{Forschungspraktikum}}{der vorliegenden \@ifaThesis}{des vorliegenden \@ifaThesis s}~nicht beteiligt. Mir ist bekannt, dass die Nichteinhaltung dieser Erklärung zum nachträglichen Entzug des Diplomabschlusses (Masterabschlusses) führen kann.
ohne unzulässige Hilfe Dritter und ohne Benutzung anderer als der angegebenen Hilfsmittel angefertigt habe;
die aus fremden Quellen direkt oder indirekt übernommenen Gedanken sind als
solche kenntlich gemacht. Bei der Auswahl und Auswertung des Materials sowie
bei der Herstellung des Manuskripts habe ich Unterstützungsleistungen von folgenden Personen erhalten:
\begin{center}
\emph{\@ifaSupervisorA\IfStrEq{\@ifaSupervisorB}{}{}{, \@ifaSupervisorB}\IfStrEq{\@ifaSupervisorC}{}{}{, \@ifaSupervisorC}\IfStrEq{\@ifaSupervisorD}{}{}{, \@ifaSupervisorD}\IfStrEq{\@ifaSupervisorE}{}{}{, \@ifaSupervisorE}\IfStrEq{\@ifaAdditionalContributors}{}{}{, \@ifaAdditionalContributors}}
\end{center}
Weitere Personen waren an der geistigen Herstellung \ifthenelse{\not\equal{\@ifaThesis}{Forschungspraktikum}}{der vorliegenden \@ifaThesis}{des vorliegenden \@ifaThesis s}~nicht beteiligt. Mir ist bekannt, dass die Nichteinhaltung dieser Erklärung zum nachträglichen Entzug des Diplomabschlusses (Masterabschlusses) führen kann.
\vspace{2cm}
\begin{flushright}
Dresden, den \@ifaDayOfSubmission \hfill \dotfill\\

View File

@ -31,7 +31,7 @@
\RequirePackage{pdfpages} % Zum einbinden von kompletten PDF-Seiten (z.B. Aufgabenstellung)
\RequirePackage{caption} % Paket zum Einbinden von Captions bei Nicht-Float-Objekten (hauptsächlich für Anhang)
\RequirePackage[ % Verwendung von biblatex für das Literaturverzeichnis
\RequirePackage[ % Verwendung von biblatex für das Literaturverzeichnis
backref=true,
natbib=true
]{biblatex}

View File

@ -2,12 +2,11 @@
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
typedef uint32_t u32;
// have to a multiply of 2
#define COMMA 10
#define COMMA 8
#define COMMA_FIX (COMMA >> 1)
void heron_sqrt(u32 *mem) {
@ -37,7 +36,7 @@ void heron_sqrt(u32 *mem) {
int main() {
float data[] = {
/0,
0,
//0.5,
1.0 / (1 << COMMA),
1.0 / (1 << (COMMA - 1)),

View File

@ -2,7 +2,7 @@
module heron_ctrl(
// data path
a_to_adr,
a_to_eab,
a_to_i,
a_to_old_x,
a_to_s,
@ -36,7 +36,7 @@ module heron_ctrl(
parameter PLUS = 1'b0;
// data path
output a_to_adr;
output a_to_eab;
output a_to_i;
output a_to_old_x;
output a_to_s;
@ -64,7 +64,7 @@ module heron_ctrl(
output ram_wr_en;
// data path
reg a_to_adr;
reg a_to_eab;
reg a_to_i;
reg a_to_old_x;
reg a_to_s;
@ -92,7 +92,7 @@ module heron_ctrl(
reg ram_wr_en;
always @(state) begin
a_to_adr = OFF;
a_to_eab = OFF;
a_to_i = OFF;
a_to_old_x = OFF;
a_to_s = OFF;
@ -124,7 +124,7 @@ module heron_ctrl(
end
`LD_N_1: begin
k0_to_a = ON;
a_to_adr = ON;
a_to_eab = ON;
edb_to_din = ON;
ram_rd_en = ON;
end
@ -141,7 +141,7 @@ module heron_ctrl(
`LD_S_1: begin
i_to_a = ON;
edb_to_din = ON;
a_to_adr = ON;
a_to_eab = ON;
ram_rd_en = ON;
end
`LD_S_2: begin

View File

@ -1,4 +1,39 @@
module heron_top_tb ( );
task assert;
input condition;
input [(20*8 - 1):0] message;
begin
if (condition !== 1'b1)
begin
$display("Assertion Failed: %s", message);
$finish(2);
end
end
endtask
parameter CYCLE = 50;
wire [31:0] edb;
wire [31:0] eab;
wire ready;
wire ram_wr_en;
wire ram_rd_en;
reg clk, reset;
reg load;
reg [31:0] ram [0:1023];
heron_top heron(
.eab(eab),
.edb(edb),
.clk(clk),
.reset(reset),
.ram_wr_en(ram_wr_en),
.ram_rd_en(ram_rd_en),
.ready(ready),
.load(load)
);
endmodule