-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy path10_vending.tex
More file actions
286 lines (249 loc) · 8.3 KB
/
Copy path10_vending.tex
File metadata and controls
286 lines (249 loc) · 8.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
\input{common/slides_common}
\newif\ifbook
\input{../shared/chisel}
\title{The Vending Machine}
\author{Martin Schoeberl}
\date{\today}
\institute{Technical University of Denmark\\
Embedded Systems Engineering}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}[fragile]{Overview}
\begin{itemize}
\item Your final grade
\item Online exam
\item The Vending Machine project
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Your Final Grade}
\begin{enumerate}
\item Your lab work, the vending machine
\begin{itemize}
\item What is working (TA checks)
\item Your report
\item Basic functions is a 7, extra functions needed for a 10 or 12
\end{itemize}
\item Written exam
\begin{itemize}
\item Two-hour written exam
\end{itemize}
\end{enumerate}
\end{frame}
\begin{frame}[fragile]{Exam Topics and Questions}
\begin{itemize}
\item The pensum (reading list) is on the \href{http://www2.imm.dtu.dk/courses/02139/}{website}
\item Compute maximum frequency and delays of a given circuit
\item Given a Chisel description of a circuit, draw it
\item Given a circuit drawing, sketch the Chisel description
\item Basically, what we have done in the lab
\item No surprises (at least not too many ;-)
\item I have uploaded some in DTU Learn
\end{itemize}
\end{frame}
%\begin{frame}[fragile]{What is a Chip?}
%\begin{itemize}
%\item One mid-term question was: what is a chip?
%\item Answer in the new course ``Introduction to Chip Design''
%\item But can we look at it now?
%\item Could we even \emph{make} one?
%\item Watch \href{https://youtu.be/aBDJQ9NYTEU?si=0wg30kZCIr2Rx2_n}{Matt Venn at IHP} on chip production in a \emph{fab}
%\end{itemize}
%\end{frame}
%
%\begin{frame}[fragile]{Make Your Own Chip!}
%\begin{itemize}
%\item \href{https://tinytapeout.com/}{Tiny Tapeout} provides a service to get a packaged chip
%\begin{itemize}
%\item and an assembled \href{https://tinytapeout.com/specs/pcb/}{PCB}
%\item Just for \$ 300!
%\item A normal \href{https://efabless.com/open_shuttle_program}{MPW} costs around \$ 10000
%\end{itemize}
%\item Tool flow with open-source tools only
%\item Design synthesis runs as GitHub action
%\begin{itemize}
%\item No local tools installation
%\item Show it
%\end{itemize}
%\item Do a design, submit it, I pay ;-)
%\begin{itemize}
%\item Use the \href{https://github.com/schoeberl/tt06-chisel-template}{Chisel template}
%\end{itemize}
%\item Deadline is next week: this is a weekend project ;-)
%\item I will work on a project or two myself
%\end{itemize}
%\end{frame}
\begin{frame}[fragile]{A Vending Machine from 1952}
\begin{figure}
\centering
\href{https://en.wikipedia.org/wiki/File:CandiesVendingMachine1952.jpg}{\includegraphics[scale=0.4]{CandiesVendingMachine1952}}
\end{figure}
{\tiny Source: Minnesota Historical Society, \href{https://creativecommons.org/licenses/by-sa/2.0}{CC BY-SA 2.0}}
\end{frame}
\begin{frame}[fragile]{The Vending Machine}
\begin{itemize}
\item Final project is a vending machine
\item Description is on GitHub: \href{https://github.com/schoeberl/chisel-lab/tree/master/vending}{README.md}
\item Will repeat the overview now
\item Group work
\item Final version shall be run in an FPGA
\item A lot can be done with testing and simulation
\end{itemize}
\end{frame}
\begin{frame}[fragile]{The Vending Machine}
\begin{itemize}
\item Inputs: coins, buy
\item Display: price and current amount
\item Output: release can or error
\item Small challenge to multiplex the display
\item State machine with data path is the \emph{brain} of the VM
\item Guided step by step over several weeks
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Vending Machine Specification I}
\begin{itemize}
\item Sell 1 item and not return any money
\item Set price with 5 switches (1--31 kr.)
\item Display price on two 7-segment displays (hex.)
\item Accept 2 and 5 kr. (two push buttons)
\item Display sum on two 7-segment displays (hex.)
\begin{itemize}
\item Amount entered so far
\end{itemize}
\item Does not return money, left for the next purchase
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Vending Machine Specification II}
\begin{itemize}
\item Push button \emph{Buy}
\begin{itemize}
\item If not enough money, activate \emph{alarm} as long as buy is pressed
\item If enough money, activate \emph{release item} for as long as \emph{buy}
is pressed and reduce \emph{sum} by the price of the item
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Additional Features}
\begin{itemize}
\item Pick two or more for a 12
\item Supplement alarm by some visuals (e.g., blinking display)
\item Count coins and display an alarm when the compartment is full ($>$ 20 coins)
\item Have some text scrolling on the display
\item Supplement alarm with some audio
\item Connect a UART to your VM and send messages to your laptop
\item ...
\item Your ideas :-)
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Design and Implementation}
\begin{itemize}
\item Implementation shall be a state machine plus datapath
\item Design your datapath on a sheet of paper
\item Datapath
\begin{itemize}
\item Does add and subtract
\item Contains a register to hold the sum
\item Needs a multiplexer to operate
\end{itemize}
\item Display needs multiplexing
\begin{itemize}
\item Implemented with some counters and a multiplexer
\end{itemize}
\item Show each part of your design to a TA
\begin{itemize}
\item 7-segment decoder, 7-segment with a counter, display multiplexer, complete vending machine
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Draw Figures}
\begin{itemize}
\item Drawings/schematic is another language to describe (digital) circuits
\item Draw, draw, draw boxes and arrows!
\item Use drawing during development
\item If you cannot draw your circuit, you do not understand it
\item Use drawings to communicate with the TA
\item Have drawings in your report
\item You will \emph{for sure} need to draw circuits at the exam ;-)
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Vending Machine Design and Implementation Steps}
\begin{itemize}
\item We started in week 6 (now we are in week 10)
\item lab 6: Hexadecimal to 7-segment decoder and counter
\item lab 8: Multiplexed Seven-Segment Display
\item lab 10--13: Complete Vending Machine
\item lab 11: full ba day (4 hours)
\item \emph{Show your working design to a TA}
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Final Report}
\begin{itemize}
\item One report per group
\item A single PDF
\item No pictures or videos
\item Maximum size of the report is 2 MB
\item Your group number is part of the file name (e.g., group7.pdf)
\item Code as a listing in an appendix (no .zip files)
\item Hand in at DTU Inside
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Final Report Content}
\begin{itemize}
\item Abstract
\item Preface (Who did what)
\end{itemize}
\begin{enumerate}
\item Introduction and Problem Formulation
\item Analysis and Design
\item Implementation
\item Testing
\item Results
\item Discussion
\item Conclusion
\end{enumerate}
\begin{itemize}
\item List of References
\item Appendix: Chisel code
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Material on the Lab GitHub}
\begin{itemize}
\item A top-level component
\item XDC file for Basys pins and frequency
\item A start of a tester generating waveforms
\item A simulation of the board
\item Show it (in VSC with Surfer)
\end{itemize}
\end{frame}
\begin{frame}[fragile]{An Optional Lab}
\begin{itemize}
\item Testing the Vending Machine
\item Black box testing (you don't see the implementation)
\item I give you two implementations
\item One is OK, one is broken
\item Which one is broken, and what is the error?
\item Issue is that you need Verilator and a C compiler to run the tests
\item WSL (with Linux Ubuntu) will make it relatively easy to use Verilator (and other tools)
\item Icarus Verilog could be easier?
\item Therefore, only if you really, really want to do it
\item \href{https://github.com/schoeberl/chisel-lab/tree/master/lab10}{Lab 10}
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Questions on Final Project?}
\end{frame}
\begin{frame}[fragile]{Summary}
\begin{itemize}
\item Now you have four weeks for the Vending Machine
\item Should be plenty of time
\item Standard solution is good for a standard grade
\item Add features as you like
\item Have a good time with your Vending Machine construction
\end{itemize}
\end{frame}
\end{document}
%\begin{frame}[fragile]{xxx}
%\begin{itemize}
%\item yyy
%\end{itemize}
%\end{frame}