Skip to content

Commit da728e7

Browse files
committed
slides: week 10
1 parent 3bc1b1e commit da728e7

1 file changed

Lines changed: 60 additions & 3 deletions

File tree

slides-agile/10_mixed.tex

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,21 @@
7878
\end{itemize}
7979
\end{frame}
8080

81+
\begin{frame}[fragile]{Parameterize Number of Ports}
82+
\begin{itemize}
83+
\item Use a \code{Vec}
84+
\begin{chisel}
85+
class Example(n: Int, w: Int) extends Module {
86+
val io = IO(new Bundle {
87+
val in = Input(Vec(n, UInt(w.W)))
88+
val out = Output(UInt(w.W))
89+
})
90+
\end{chisel}
91+
\end{itemize}
92+
\end{frame}
93+
94+
95+
8196
\begin{frame}[fragile]{Use Methods}
8297
\begin{itemize}
8398
\item Modules and Bundles are Scala classes
@@ -135,17 +150,30 @@
135150
\end{itemize}
136151
\end{frame}
137152

138-
\begin{frame}[fragile]{Queues}
153+
\begin{frame}[fragile]{FIFO Queue}
154+
\begin{figure}
155+
\centering
156+
\includegraphics[scale=\scale]{../figures/fifo}
157+
\caption{A writer, a FIFO buffer, and a reader.}
158+
\label{fig:fifo}
159+
\end{figure}
139160
\begin{itemize}
140161
\item FIFO style queues between a sender and a receiver
141-
\item Can \emph{even out} traffic
162+
\item The sender/write enqueues/writes into the Queue
163+
\item The receiver/reader dequeues/reads from the Queue
164+
\item Can \emph{even out} bursty traffic
165+
\end{itemize}
166+
\end{frame}
167+
168+
\begin{frame}[fragile]{Queues}
169+
\begin{itemize}
142170
\item Used when there is bursty traffic
143171
\begin{itemize}
144172
\item E.g., on a serial port
145173
\item Write faster from CPU send can send
146174
\item Receive data when CPU is busy with other stuff
147175
\end{itemize}
148-
\item But can fill up or drain empty
176+
\item But can fill up when the sender is \emph{faster}
149177
\item Showing implementation variations in the Chisel book
150178
\begin{itemize}
151179
\item Bubble FIFO (was proposed in lab 5)
@@ -154,6 +182,35 @@
154182
\end{itemize}
155183
\end{frame}
156184

185+
\begin{frame}[fragile]{Bubble FIFO Example}
186+
\begin{itemize}
187+
\item FIFO interface
188+
\shortlist{../code/fifo_io.txt}
189+
\item Abstract base class
190+
\shortlist{../code/fifo_abstract.txt}
191+
\item \href{https://github.com/schoeberl/chisel-book/blob/master/src/main/scala/fifo/fifo.scala}{FIFO code}
192+
\end{itemize}
193+
\end{frame}
194+
195+
\begin{frame}[fragile]{Bubble FIFO}
196+
\begin{itemize}
197+
\item Simple, easy to understand
198+
\item Uses minimal resources
199+
\item However, each buffer stage has to toggle between empty and full
200+
\item Maximum bandwidth is one word every two clock cycles
201+
\item When full, needs N cycles for a restart
202+
\begin{itemize}
203+
\item The free element \emph{bubbles} towards the input
204+
\end{itemize}
205+
\item Better solutions
206+
\begin{itemize}
207+
\item Double buffer
208+
\item Memory with read and write pointer
209+
\end{itemize}
210+
\item See Section 11.3 in the Chisel book
211+
\end{itemize}
212+
\end{frame}
213+
157214
\begin{frame}[fragile]{Chisel \code{Queue}}
158215
\begin{itemize}
159216
\item Chisel has a \code{Queue}

0 commit comments

Comments
 (0)