Session T1C A First Course in Digital Design Using VHDL and Programmable Logic
Session T1C A First Course in Digital Design Using VHDL and Programmable Logic
Session T1C A First Course in Digital Design Using VHDL and Programmable Logic
Shawki Areibi
AbstractPresent industry practice has created a high demand for systems designers with knowledge and experience in using programmable logic in the form of CPLDs and FPGAs in addition to hardware description languages. Many universities offer this type of training in advanced digital engineering courses. This paper describes our experience in integrating VHDL and programmable logic devices based on Xilinx Foundation tools and Altera into a rst course in logic design. In the main, student reaction to the course was positive. The course seems to have the right blend of being current (using VHDL and FPGAs) and being hands-on (using bread-boarding). We conclude by stating that in our experience, modeling using VHDL and mapping designs to FPGAs can be effectively integrated into a rst course in logic design. Index Terms Engineering Course, Digital Design, VLSI Design, FPGA, VHDL. Xilinx Foundation tools and/or Altera into a rst course in logic design. The paper is organized as follows: Section describes the main features of the Digital Design course and introduces texts and tools we considered for our course. Section describes the laboratory component used and the project assigned to the students. Section describes our experience running the course for the rst time and nally Section contains concluding remarks.
Digital Design
ENG241 is a course in Digital Logic offered annually 1 in the School of Engineering at the University of Guelph. The course extends over twelve weeks with three hours of lectures per week and eleven two hour laboratory sessions. Course prerequisites include CIS 1650 Introduction to Programming and CIS 1900 Discrete Structures. Topics include combinational circuits, sequential circuits, memories, programmable logic devices, data path and algorithmic state machines. This course is an introductory course in digital logic design, which is a basic course in most electrical and computer engineering programs. The main goals of the course are (1) to teach students the fundamental concepts in classical manual digital design and (2) to illustrate clearly the way in which digital circuits are designed today, using CAD tools and mapping the designs to programmable logic devices in the form of FPGAs and CPLDS. Throughout the course basic concepts are introduced by way of example that involve simple circuit design. The course rst introduces digital and computer systems and information representation. The course then introduces the following topics: logic gates, boolean algebra, Karnaugh maps, design hierarchy, combinational circuit analysis and design, sequential circuit concepts and design, random access memory and programmable logic, algorithmic state machines (ASM) for controlling operations. Introductions to the hardware description languages, VHDL and Verilog, are provided with the expectation that at most one of the languages will be covered. The course laboratory was based on 7 experiments some using bread-boarding, others using modeling in VHDL and Schematic Capture. Suitable Textbooks There are two main approaches to text book selection for a rst course in logic design using VHDL and FPGAs. The rst approach is to select two books, one that covers the logic design theory and the other that covers modeling in VHDL. The VHDL primers by Skahill[3] Yalamanchili[4] and Bhasker[5] would be suitable for the two text approach. The second is
Offered for the rst time in the fall 2000
Introduction
Digital hardware plays a prominent role in many electrical and computer engineering products today [1]. This is principally due to the rapid increase in transistor densities and speed of integrated circuits and steep decline in their cost caused by the advance in micro-electronic implementation technologies. This trend is likely to continue in the foreseeable future. The last decade has proved to be one of remarkable technological advances. The computer revolution has affected every aspect of society and many problems viewed as being intractable can now be solved. Unfortunetly, even with this advance in computer architecture the approach to teaching the fundamentals of digital logic remain almost the same as that which was used in the 70s and 80s. While this works ne in principle, it ignores the fact that the subject is no longer practiced as a stand-alone art. Modern digital design [2] relies on engineering groups made up of individuals that have an understanding of all aspects of the problem, from the top to the bottom in the hierarchical chain, with expertise in one or two areas. Present industry practice has created a high demand for systems designers with knowledge and experience in using programmable logic in the form of CPLDs and FPGAs in addition to hardware description languages. Many universities offer this type of training in advanced digital engineering courses. This paper describes our experience in integrating VHDL and programmable logic devices based on
S. Areibi is with the School of Engineerin, University of Guelph, Guelph, Ontario, Canada. E-mail:[email protected]. This work has been partially supported by a Natural Sciences and Engineering Research Council of Canada (NSERC) operating grant (OGP 43417).
0-7803-6669-7/01/$10.00 c 2001 IEEE October 1013, 2001 Reno, NV 31st ASEE/IEEE Frontiers in Education Conference T1C-19
Session T1C
to select a text that integrates the logic design theory with modeling in VHDL. The texts by Brown[6], Mano[7], and Wakerly[8] take this integrated approach. We chose Mano[7] for our course since it is based on a balanced treatment of logic design, digital system design and computer design basics. It also introduces both Verilog and VHDL. Two CDs for the Xilinx Student Edition 1.5 Foundation Series Software for Microsoft Windows are provided in support of several text objectives. The approach used in the introductions to VHDL and Verilog contrasts with that in the typical programming or description language text. In Mano[7] the introductions emphasize the vital tie of HDL descriptions to hardware, causing the reader to recognize clearly that a language description represents actual hardware with real cost rather than just program code to be stored in memory and executed. Further, the introductions are informal, permitting beginning students to be able to read and write in a limited, but powerful, subset of an HDL, while achieving a balance between language study and basic fundamentals appropriate for an introductory course. Xilinx vs Altera Design Entry Tools There are many factors that instructors teaching digital design have to consider when choosing between Xilinx Foundation tools and Altera MAX+plus II tools. We have learnt that both Xilinx and Altera tools are easy to use in addition to the University Program that both offer. We have also learnt that Altera is best for simplicity and schematic entry whereas Xilinx is best for VHDL entry. After a survey and detailed investigation we have chosen the Xilinx Foundation tools for the following reasons:
All the above mentioned factors played a big role in using the Xilinx Foundation tools over the Alter Max+plusII tools. Lab Environment The Digital Design course ENG241 and its laboratory teach the students plenty about digital hardware, its specication, design and implementation. More importantly however, is that it prepares the student for lower level hardware description languages (HDL) and their use in digital design. Students in the laboratory use Xilinx Student Edition 2.1 (see Figure 1), which includes the Xilinx Foundation Express tools,
Fig. 1.
A new web-based resource was being developed for Xilinx University Program (XUP) participants. This web site includes a collection of listings and links for teaching resources, laboratory experiments, students projects and help resources. To tie everything together, a strong on-line support system, with discussion forums, an email list-server (email reector) and postings of FAQs was being incorporated. XESS which provides the XS40 and Xtend boards provides excellent support and help for their products. I think XESS has the best web and support between the vendors of recongurable boards. They also maintain a design database where people can place their designs on a public database. Out of the three books we were considering as text books, Mano[7] and Wakerly[8] include Xilinx Foundation tools. Xilinx Foundation Tools provide an FPGA editor to allow students browse their device. If a student ever ran into something that was hard to explain, he/she could always open up the FPGA editor and see what the synthesis, and HDL code really gave them. In addition, Xilinx Tools have supported timing driven place and route which try to meet the timing. There is a step by step tutorial on setting the Xilinx Student Edition Software available at [9] plus FAQs and other information that may be of interest to many students.
including schematic capture, HDL synthesis, simulator, and FPGA place-and-route development tools. XSE also includes a textbook[10] that introduces digital design concepts through FPGA laboratory exercises. Each chapter begins with a discussion of the logic design principles that will be applied in that chapter. This is followed by an experimental section where you can build and test logic circuits that demonstrate those principles. Hardware Description Languages VHDL is an acronym for Very High Speed Integrated Circuit Hardware Description Language. VHDL is used to describe, model, and synthesis a circuit just as C is used to describe, model and implement a solution to a problem. Like Java, VHDL is device independent. That is, we can design a circuit before we know which type of device it will be implemented on. In the 1980s rapid advances in integrated circuit technology lead to efforts to develop standard design practices for digital circuits. VHDL was developed as a part of that effort. VHDL was originally intended to serve two main purposes. First, it was used as documentation language for describing the structure of complex digital circuits. As an ofcial IEEE standard, VHDL provided a common way of documenting circuits designed by numerous designers. Second, VHDL provided features for modeling the behavior of a digital circuit, which allowed it use as input to software programs that were then used to simulate the circuits operation.
October 1013, 2001 Reno, NV 0-7803-6669-7/01/$10.00 c 2001 IEEE 31st ASEE/IEEE Frontiers in Education Conference T1C-20
Session T1C
In recent years, in addition to its use for documentation and simulation, VHDL has also become popular for use in design entry in CAD systems. The CAD tools are used to synthesize the VHDL code into a hardware implementation of the described circuit. We have prepared a manual that serves as an introductory tutorial in VHDL for second year students taking ELE241 Digital Design and third year students taking Embedded Systems course at the School of Engineering. Initially, the manual contains only the introductory VHDL tutorial. The tutorial is followed by a series of exercises that are to be completed by the students. These exercises are intended to introduce all the concepts required to complete the ENG241 laboratory assignments and ENG381 (Embedded Systems) projects. Due to the complexity of the language we introduce only a subset of the language with emphasis on the following: The typical activity ow in top-down digital system design. Each level of the design hierarchy corresponds to a level of abstraction and has an associated set of activities and design tools that support the activities at this level. Hardware description languages such as VHDL are targeted for use throughout this design hierarchy and provide some degree of uniformity across the various levels. Differences between structural, behavioral and data ow representations. VHDL descriptions can be used to support two complementary processes found in digital system: simulation and synthesis. Teaching Digital Design With FPGAs The rst question that faculty members teaching digital design ask is Why build an undergraduate digital design course around FPGA based processors and systems?. The answer is quite simply because there is such value in the experience of building real hardware. So much of computer architecture is about making tradeoffs such as performance versus area versus cycle time versus power, etc. FPGAs would let the students write software-like hardware descriptions instead of cutting and clipping wires. From the instructors viewpoint, FPGAs lower laboratory operating costs since a single chip replaces a cabinet of TTL parts. And the time to clean-up laboratory stations between sessions is eliminated because the FPGA can be erased in seconds. A students design could even span multiple sessions since the FPGA design can be saved and recalled from disk as often as needed. These factors help to improve the size and challenge of designs that students can work on. XESS FPGA Boards The kit depends upon the recent emergence of low-cost FPGA development tools. Our XS40 boards are mounted inside something called Xtend boards as seen in Figure 2. These give extra capabilities to the XS40 board, including switches, more LEDs, 16 bit D/A and A/D conversion, a PS/2 keyboard connector, more SRAM, and a prototyping area. Note that because we use the Xtend boards, we no longer have direct access to any free I/O pins. The students will be using the various on-board functions of the Xtend board for most/all projects in this class. After a bit-stream has been down-loaded to the XS40 board, the students need some way to test the design. They will be using the switches and LEDs on the Xtend boards to input signals to the FPGA and see the result.
Fig. 2.
XS40 Board/XC4005XL FPGA The XS40 board (which is seen in Figure 3) is an XESS prototyping board, which includes an XC4005XL or XC4010XL FPGA, a 100 MHz programmable oscillator, 32-128 KB of RAM, 8031 MCU, parallel port, VGA port, keyboard/mouse port, as well as full documentation, tools to down-load FPGA designs and memory images to the board, and an excellent support mailing list.
Fig. 3.
October 1013, 2001 Reno, NV 0-7803-6669-7/01/$10.00 c 2001 IEEE 31st ASEE/IEEE Frontiers in Education Conference T1C-21
The XC4005XL-PC84C-3 is an FPGA device that has 14x14 array of congurable logic blocks (CLBs) and 61 I/O blocks (IOBs) in sea of programmable interconnect. Every CLB has two 4-input lookup tables (LUTs) and two ip-ops. Each LUT can implement any logic function of 4 inputs, or a 16x1-bit synchronous static RAM, or ROM. Each CLB
Session T1C
also has carry logic to help build fast, compact ripple-carry adders. Each IOB offers input and output buffers and ipops. The output buffer can be 3-stated for bidirectional I/O. The programmable interconnect routes CLB/IOB output signals to other CLB/IOB inputs. It also provides wide fanout low-skew clock lines, and horizontal em long lines which can be driven by 3-state buffers at each CLB. The XC400XL is ideal for implementing any digital circuit in general and could also be used to implement processors[11]. Just 8 CLBs can build a 16-bit adder/subtractor (using carry logic) or a logic unit. and debugging. Lab2: The main objectives of the laboratory was to teach the students the basics of the Xilinx Foundation tools design software:design entry, simulation and automatic synthesis. Part of the laboratory was to enter via schematic capture a boolean function of several variables and verify the design via simulation. Then the students had to implement the design using SSI logic using the bread-boarding. Finally, the concept of large scale programmable logic device (i.e XC4005) is introduced and the means of down-loading a circuit into the device is accomplished. By the end of the laboratory the students realize the difference between bread-boarding and mapping designs to FPGAs. Lab3: The main objectives of the laboratory is to introduce the concept of design ow of digital circuits and hierarchical design. Ultimately the students are asked to translate a given statement for designing a router for traveling salespeople into hardware. Lab4: By lab4 the students start to use VHDL and understand the advantages of using Hardware Descriptive Languages for design entry. They basically build several complex logic circuits and gain increased familiarity with the Xilinx foundation tools and VHDL language (circuits include a 7segment display and an adder). The laboratory emphasizes the concept of hierarchical design using VHDL. Lab5: The purpose of the laboratory is teach the students the basic operation of sequential logic by building them up from basic gates. They basically build a shift register from ip-ops and learn how to build complex designs via hierarchy. The also become familiar with state diagrams and basic sequential circuit design. Lab6: At this stage the students are quite familiar with the Xilinx Foundation tools and design entry and mapping to FPGAs. They basically design a data path by implementing an ALU of a simple CPU. We basically emphasize the importance of modular and hierarchical design. Lab7: This laboratory basically introduces the basic concepts and steps involved for designing Finite State Machines. The design of a trafc light controller is involved and students use a mixture of schematic capture and VHDL to accomplish their designs.
Optional Project The project is intended to allow the student to express his/her creativity by applying what they have learned in the Digital Design course to a project of his/her own choosing. The students are given the option to design and implement a 3-week project of their own choosing that uses digital logic in some creative way. They are allowed to use all of the parts available in the laboratory. An important part of the project is the creativity required to think up an interesting project, and then negotiate with a Teaching Assistant and/or instructor as to the nal form of the project.
October 1013, 2001 Reno, NV 0-7803-6669-7/01/$10.00 c 2001 IEEE 31st ASEE/IEEE Frontiers in Education Conference T1C-22
Session T1C
Experience
The goals of this project were to familiarize our students with state-of-the art equipment and modernize the laboratory component of our introductory logic design course by introducing system and component modeling using VHDL and FPGA programmable logic for mapping designs. Of course, the lessons of FPGA implementation will not directly apply to custom silicon implementation. But the method of systematically evaluating design alternatives and tradeoffs is the same regardless of the implementation technology. Laboratory Experience We basically decided to use a phased approach. Initially we had some bread-boarding experiments and some modeling experiments in VHDL. All lab experiments involved mapping the designs onto the FPGA modules. After the third laboratory session, it became apparent that the students preferred mapping their designs onto the XS40 boards over bread-boarding. We also found that even though the tutorials offered by the instructor and those available on the WEB were quite useful, there was quite a bit of confusion with respect to the usage of VHDL. Part of the problem was due to the fact that not enough time was spent on introducing all aspects of the VHDL language and the other reason was lack of experience of designing hardware modules using software! Student Feedback One of the biggest challenges in this course is to cover material and teach students concepts of VHDL in twelve weeks. Students have found that the VHDL document prepared for the course was extremely useful and to the point. Many tutorials (especially those links found on XESS company [12]) were extremely useful and helped the students accomplish many of their designs. Students were consulted on a regular basis (every two weeks) by asking them to ll in some type of evaluation of the course and laboratory. This feedback from the students helped the instructor and teaching assistants to further enhance the course and overcome the problems faced by most of the students. Most problems faced by the students were either posted on the a news group dedicated for the course or sent via email to the instructor. Most messages were compiled and summarized on the web page of the course. Extra tutorials were arranged to overcome these problems and students appreciated it immensely. Regular tutorials, assignments, and quizzes helped reinforce many of the concepts even further. VHDL coding, VHDL simulation, synthesis commands, mapping to recongurable computing platforms, and strategies together. In the main, student reaction to the course was positive. The course seems to have the right blend of being current (using VHDL and FPGAs) and being hands-on (using breadboarding). We conclude by stating that in our experience, modeling using VHDL and mapping designs to FPGAs can be effectively integrated into a rst course in logic design.
References
[1] Peter Walsh, Integrating vhdl into a rst course in logic design, in IEEE Canadian Conference on Electrical and Computer Engineering, Edmonton, Canada, 1999, pp. 15311534. [2] J. P. Uyemura, A First Course in Digital Systems Design, An Integrated Approach, Brooks/Cole Publishing Company, Toronto, Canada, 2000. [3] K. Skahill, VHDL for Programmable Logic, Addison Wesley, Reading, Massuchusetts, 1996. [4] S. Yalamanchili, Introductory VHDL From Simulation to Synthesis, Prentice Hall, Upper Saddle River, New Jersey, 2001. [5] J. Bhasker, A VHDL Primer, Prentice Hall, Upper Saddle River, New Jersey, 1999. [6] S. Brown and Z. Vranesic, Fundamentals of Digital Logic with VHDL Design, McGrawHill, Toronto, Canda, 2000. [7] M. Mano and C. Kime, Logic and Computer Design Fundamentals, Prentice Hall, Upper Saddle River, New Jersey, 2000. [8] J. Wakerly, Digital Design:Princples & Practices, Prentice Hall, Upper Saddle River, New Jersey, 2001. [9] Xilinx university program, Step by Step Tutorial available at http://xup.msu.edu/tutorials.htm. [10] D Vanden Bout, The Practical Xilinx Designer Lab Book, Prentice Hall, Upper Saddle River, New Jersey, 1998. [11] Jan Gray, Hands-on computer architecture: Teaching processor and integrated systems design with fpgas, in Workshop on Computer Architecture Education, Vancouver, BC, Canada, 2000. [12] Xess company, http:http://www.xess.com.
Conclusion
Teaching digital design systems with VHDL and synthesis presents an integrated approach to digital design principles, processes, and implementations to help the student design much more complex systems within a shorter design cycle. This is accomplished by introducing digital design concepts, 0-7803-6669-7/01/$10.00 c 2001 IEEE October 1013, 2001 Reno, NV 31st ASEE/IEEE Frontiers in Education Conference T1C-23