Cooperative group
Individual
Sessions out of
classroom
Student 1
Student 2
Student 3
STATEMENT:
My signature below indicates that I have (1) made equitable contribution to EX 4 as a member of the group, (2)
read and fully agree with the contents (i.e., results, conclusions, analyses, simulations) of this document, and (3)
acknowledged by name anyone outside this group who assisted this learning team or any individual member in
the completion of this document.
Active members
(1) ________________________________________
_______________
(2) _________________________________________
_______________
(3) _________________________________________
_______________
(1) _______________________
(2) _______________________
1.2
Abstract
Explain here the most significant developments, results or conclusions about the exercise. Use the remaining
space in this sheet (200 words maximum).
CONTENT
Designing a traffic light controller...................................................................................................................1
1.1
Cooperative group.....................................................................................................................................1
1.2
Abstract.....................................................................................................................................................1
1.3
Description................................................................................................................................................3
1.4
Topics........................................................................................................................................................3
1.5
Specifications............................................................................................................................................4
1.6
Block diagrams..........................................................................................................................................5
1.7
Project implementation.............................................................................................................................5
1.7.1
1.7.2
1.7.3
1.7.4
1.8
1.8.1
1.8.2
1.9
1.10
1.10.1
1.11
References.................................................................................................................................................8
1.12
1.13
1.14
Grading grid............................................................................................................................................10
1.15
1.3
Description
In this fourth exercise, a project is to be proposed. Cooperative groups will have to plan, develop, simulate,
implement and prototype a traffic light controller (or you may ask for other similar applications like the ones
listed in Section 1.6). The problem can be considered a complex design which includes multiple blocks and
components. However, in order to standardise the design methodology, it has to be conceived as a dedicated
processor consisting of a datapath (arithmetic logic unit plus data registers) and a control unit (FSM). In this
way, this project becomes a compilation of many previously designed components and structures.
Additionally, the meaningful concept of simulating a VHDL testbench is presented. This is an interesting and
powerful alternative to TCL macro or Proteus EasyHDL scripting which were used in previous exercises for both
functional and gate-level designs. Several references have been supplied on this topic [1], [2], [3], [4].
In Chapter 4, similar projects to these dedicated processors, which already become complex digital systems, will
be implemented using microcontrollers instead of FPGA or CPLD. Thus, we will be able to compare both design
alternatives figuring out their advantages and drawbacks of each approach.
Specify a project: the traffic light controller
Simulations using test benches
Part I: A basic controller
FSM (Chapter II)
FSM
Datapath
Input vectors
1.4
Topics
The following topics have been listed from the courses specific and cross-curricular learning objectives 1: #10,
#11, #12. After studying Chapter 3 and successfully completing all the assignments in this task, you will be able
to:
------------- Part 1 -------------
1 http://digsys.upc.es/ed//CSD/units/CSD_Guia_docent_esborrany.doc
1.
Explain the concept of a datapath consisting of an ALU, or other elements which generate or
process information and data, and registers or memory for the operands and results.
2.
Explain the concept of flags or operation indicators and list the most common flags.
3.
Explain the concept of control unit based in the application of a FSM, the processors brain, the
block that will generate control signals for the datapath block in order to execute an algorithm or a
sequence of operations.
4.
5.
Develop a complex project following the strategy of starting a simple machine and complicating it
step by step until all the project specifications are met.
6.
7.
Plan auxiliary analogue circuits for the project, for example, the proximity sensors (metal
detectors)
------------- Part 2 -------------
8.
9.
Automate a test bench simulation process by means of the ASSERT and REPORT statements.
10. Do an oral presentation consisting of a few slides to explain the project conception, development,
implementation and results.
1.5
Specifications
a) Study examples from our web ([6], [7]) and gather information about traffic light controllers. Revise the list
of specifications proposed below, or even add new ones if you like. Classify them accordingly the difficulty
of implementation or the number of resources involved.
1.6
A night mode of operation will turn off red and green lights while
keeping yellows flashing with at 2 Hz rate.
Night mode is set from a real time clock signal which is active every
day from 11 PM to 7 AM
If you like, you can propose us other applications of similar complexity like the ones listed below:
A programmable timer/counter. For example, the Timer0 from the Microchip PIC microcontroller.
A PWM generator.
PB
PB
Avenue A
PA
CA
CA
PA
BR
CONTROLLER
CA
CB
CA
CB
PA
PB
PA
PB
AG AY
AR
BY
AG
AY
AR
BG
BY
BR
BG
CB
CB
NIGHT
SYSTEM
Street B
Fig. 2 A sketch of the traffic lights at the cross road (note that this is not the
complete electrical schematic).
1.7
Block diagrams
b) Invent a block diagram for the traffic lights controller which consists of dedicated processor architecture.
See Fig. 3. Determine which components will be in the datapath.
1.8
Project implementation
Essentially, functional simulations are required to verify the project, but you can also prototype the project using
the laboratory training boards.
1.8.1 Phase I: Implement a simple light sequencer
c)
Consider only a few set of specifications and implement a simpler project without sensors or pushbuttons
for cars and pedestrians. This is simply a FSM to drive the traffic lights considering only the night mode ( N
switch). The frequency divider from the EX3 can be used or redesigned to suit this application. Run this
design from a 1 Hz CLK to speed simulations.
1.8.2 Phase II: Add sensors and pushbuttons and a fixed timer
d) Enhance the initial project complicating the state diagram if necessary, adding more states, or adding new
transition between states, as a consequence of interfacing the car sensors (CA and CB) and pedestrian
pushbuttons (PA and PB).
e)
Drive the system with a 200 Hz CLK. Design a digital timer to produce a 5 s signal to control all the light
sequencing. Note that adding these ideas means envisioning the system as a dedicated processor which is in
charge of the lights and other auxiliary subsystems like the timers. Your project will have to be able to
count real time in seconds.
1.8.3 Phase III: Design timers and the real time clock
f)
Design the programmable timer to set all the particular red and yellow lights times which is going to be
commanded by the FSM of the traffic light controller. And, for example, the 7-segment digits in the
prototyping board can be used to show the real-time timing in seconds.
g) (optional) Design the real time clock, an HH:MM:SS module, which activates the night mode signal.
1.9
Study the test bench entity and implement a simulation of a small component from the project. For
example, test the FSM from Section c. Compare and discuss the simulation procedures and the solution
with the ones obtained using TCL macros. Simulate both: (1) the hierarchical VHDL project (functional);
and (2) the synthesised circuit (gate-level) for a given CPLD or FPGA like the FLEX10K in the UP2 board.
Determine the worse case tpd and tco and the maximum frequency which can be applied at the CLK input.
j)
Improve the simulation automating it by means of the ASSERT and REPORT statements
Draw a simple 10 minutes long Power Point presentation consisting of a few slides. The idea is to explain
orally in group the project (plan, development and results) and the main concepts from this EX4.
10
Part 1 (ttol 3)
Si alguna indicaci o format no lacabeu dentendre b, pregunteu-nos-ho o aclariu els dubtes, per no
lliureu mai res que no compleixi aquestes indicacions perqu no us ho corregirem i perdreu el temps.
Afegiu aqu el vostre text (estil normal) encapalat amb ttols (Ttol 2 i 3 i 4), amb figures (estil llegenda o
epgrafe o caption segons l idioma del Word) i referncies creuades en el text com aquesta Fig. 4 (s una
referncia creuada a la llegenda, veureu que surt en color gris quan la cliqueu) a les figures que inseriu. Fixeuvos que la primera vegada que obrireu aquest document en Word 2007, no us sortir aquesta llegenda Fig., aix
que haureu de crear-ne una, i desprs, encara que la esborreu,ja us quedar la referncia. Veureu tamb que la
numeraci de les figures s un parmetre automtic. Si seleccioneu tot el document, i premeu F9 actualitzareu
tota la numeraci.
Tamb lndex de la pag. 2 s completament automtic. Es genera sol ( a partir de referncies, ndex de
continguts, Inseriu un ndex de continguts) i sactualitza sol a partir tamb de F9 havent seleccionat tot el text
de document. s possible que la primera vegada que lactualitzeu desaparegui. No passa res, simplement cal
tornar-lo a generar a partir del men referncies i taula de contingut.
Fixeu-vos en la Fig. 4. Les imatges han destar centrades i alineades amb el text. Si voleu posar un parell
dimatges a la mateixa lnia, inseriu primer una taula dun parell de columnes i tot seguit feu invisibles les vores.
El millor que podeu fer s cut & paste de la prpia taula que veieu, i, canviar les figures per les vostres.
Feu referncia tamb en el text a les fonts bibliogrfiques o de web que consulteu daquesta manera [1] (s una
referncia creuada a lelement numerat [1]). Expliqueu perqu les heu consultat i quina informaci til heu
trobat.
Per corregir la primera versi del vostre treball, no imprimiu ni lliureu des de les pgines 3 a la 5. s lenunciat
del problema. Sols cal que imprimiu les 2 primeres pgines que contenen els detalls personals, el resum i lndex,
i a partir daquesta mateixa pgina 6. Per feu-ho amb la numeraci correcta. s a dir, treballeu sempre sobre
aquest document, i en tot cas, importeu altres textos que tingueu cap a aquest mateix document i formateu-los
correctament.
Insistim sobre aix mateix: treballeu sempre sobre aquest mateix fitxer per preparar la vostra soluci.
Aix usareu tots els estils i formats que ja t predefinits aquest document.
Heu dinstallar els correctors ortogrfics en catal, espanyol i angls en el vostre paquet deines Office. I
sobretot, corregir qualsevol error mentre escriviu. Si treballeu aquests aspectes estalviareu molta feina als vostres
companys i instructors.
1.12 References
[1]
http://digsys.upc.es . Course wed page where to find a lot of resources for the course. Specially, materials
from previous editions. Find units on the topic of writing test benches in VHDL (Unit 3.4). [Retrieved
27/10/2010].
[2]
[3]
[4]
Zhang, W., VHDL Tutorial: Learn by Example, http://esd.cs.ucr.edu/labs/tutorial/ . A list of test benches
for many circuit components. [Retrieved 27/10/2010]
[5]
Hwang, E. O., Digital logic and microprocessor design with VHDL, CL-Engineering, 2005. Chapter 11:
Dedicated processors. [Retrieved 27/10/2010]
[6]
[7]
[8]
(Add your own references and modify the previous ones if necessary)
12
Establish a study plan, a task distribution scheme and other requirements to succeed in producing a good solution
when working cooperatively: flux diagrams, concept maps, schematics, tables, pictures, etc.
14
Topics
Activities
1.
2.
The concept
indicators.
3.
4.
a, c
5.
of
flags
in
Comments
b
or
operation
feasible
project
6.
7.
8.
9.
Use VHDL
REPORT
j, <k>
statements
Group
member
charge
d), e),
<g)>
ASSESS
and
f),
11.
Scores
Self-assessment
Part 1
Part 1
Part 2
Part 3
Concepts, plan
and design of the
first project
phase
Additional project
phases
Testbench for a
single
component
Oral presentation
a, b, c
i , j, <k>
2p
3p
3p
2p
Tota
l
Instructors
grades
2 Add more sheets if necessary to report your progress or comments though the exercise.