Skip to content

Lab 3: Music Player
Part E: Datasheets and Report

Lab 3 will give you experience designing, implementing, testing, and prototyping combinational and sequential logic using the Verilog hardware description language. The lab will continue to leverage concepts from Topic 2: Combinational Logic, Topic 3: Boolean Algebra, and Topic 4: Combinational Building Blocks but will also leverage concepts from Topic 6: Sequential Logic, Topic 7: Finite-State Machines, and Topic 8: Sequential Building Blocks. More specifically, the lab will give students experience with: latches, flip-flops, and registers; Moore and Mealy FSMs; and counters. The lab will continue to reinforce three key abstraction principles: modularity, hierarchy, and regularity.

You will be implementing a music player that takes as input a song selection (via the switches) and a start song signal (via a push button). The music player will then play the chosen song by generating a square wave at appropriate note frequencies suitable for use with a piezoelectric buzzer. An idle signal is displayed using an LED so that the user knows when the player is ready to play a new song. The music player will make use of the adders and muxes from Lab 2. The song selection and the current note are both displayed using seven-segment displays from Lab 1. This lab also serves as a transition from lower-level gate-level (GL) modeling to higher-level register-transfer-level (RTL) modeling. Some of parts of your design will use explicit GL modeling, while other parts of your design will use RTL modeling. Students will have a chance to appreciate how RTL modeling can improve productivity but with less control over the final hardware implementation. The lab includes six parts:

  • Part A: Counters

    • Due 10/15 @ 11:59pm via GitHub
    • Students should work on Part A before, during, and after your assigned lab section during the week of 10/5
    • Pre-lab survey on Canvas is (roughly) due by end of lab section during the week of 10/5
  • Part B: Breadboard, FPGA, and Simulation

    • Due week of 10/5 during assigned lab section
    • Even though completed with a partner, every student must turn in their own paper check-off sheet in their lab section!
  • Part C: Music Player

    • Due 10/22 @ 11:59pm via GitHub
    • It is ok if students need a little more time to complete the music player and clock divider as long as they are pushed to GitHub by 10/25 @ 11:59pm
    • Plan to work on Part C after fall break and during the week of 10/19
  • Part D: FPGA Prototype v1

    • Due week of 10/19 during assigned lab section
    • This part will focus on prototyping the code developed in Part A
    • Even though completed with a partner, every student must turn in their own paper check-off sheet in their lab section!
  • Part E: FPGA Prototype v2

    • Due week of 10/26 during assigned lab section
    • This part will focus on prototyping the code developed in Part C
    • Even though completed with a partner, every student must turn in their own paper check-off sheet in their lab section!
  • Part F: Datasheets and Report

    • Due week of 10/26, three days after lab section @ 11:59pm via Canvas
    • Post-lab survey on Canvas is due at the same time as the report

This handout assumes both students have successfully completed Parts A-E.

What do we do if we did not finish Part D or E or forgot to collect some data?

Students can still complete Part F even they did not finish Part D or E. Students can use MS Remote Desktop to log into ecelinux and run Quartus. They can then analyze their design using Quartus including collecting data about area and timing as well as capturing various screenshots. Students will obviously not be able to configure the FPGA but they can still collect any data they need to complete Part F. See Tutorial 0 to learn more about how to use MS Remote desktop to log into ecelinux and run Quartus.

1. Datasheets

There are two separate Canvas assignments: one for the datasheets and one for the report. Both must be submitted in PDF format. To export your datasheets to PDF choose File > Download > PDF then be sure to choose Export: Workbook. You must include all datasheets in the PDF to receive full credit! Your PDF should also include the final overview table, chip planers, and area vs delay plot. You must try to make sure all diagrams and screenshots are readable.

How do we download the images from the datasheet?

You can download the images from your datasheet if you want to edit them (e.g., crop them to make them more readable). To do this you need to choose File > Download > OpenDocument. Then renable the file extension from .ods to .zip and unzip this archive. You will find a Pictures folder which has all the images from the datasheets.

1.1. Interface

For all datasheets, list the ports which make up the module's interface. For each port enter the name, bit width, and whether it is an input or output port.

1.2. Functionality

For all datasheets, briefly describe the high-level functionality of the module. Do not describe the detailed implementation. Instead focus on the high-level behavior.

For the multi-note player prototype datasheet, describe in detail how the multi-note player prototype works from the perspective of the user of the prototype (i.e., what the switches, buttons, displays, and LEDs actually do).

For the music player prototype datasheet, describe in detail how the music player prototype works from the perspective of the user of the prototype (i.e., what the switches, buttons, displays, and LEDs actually do).

1.3. Block Diagram

For the GL counter, use your GL block diagram. The block diagram should be clearly annotated with the critical path and the delays of each component along the critical path including the clock-to-q delay and the setup time.

For the RTL counter, use the technology map viewer. The block diagram should be clearly annotated to (1) the storage element that keeps track of the current count; (2) the storage element that keeps track of the finish value; (3) the logic that increments the count; (4) the logic that determines what should be the next stored count; (5) the logic that determines whether the counter is done.

For the multi-note and music player prototypes, the block diagrams are provided for you.

Always choose Insert > Insert image in cell from the menu when adding images to the datasheet.

1.4. Chip Planner

For all datasheets, use the cropped chip planner (just the rectangular view of the FPGA). Always choose Insert > Insert image in cell from the menu when adding images to the datasheet.

1.5. Area

For all datasheets, the number of logic gates should be the combinational ALUT usage for logic from the area report and the number of flip-flops should be the number of dedicated logic registers from the area report. The percent of chip used is automatically calculated for you.

1.6. Waveform

For the GL and RTL counters, you will need to run simulations on ecelinux to collect a waveform. For both counters, run the basic test case and open the resulting waveform in Surfer.

% cd ${HOME}/ece2300/groupXX/build
% make Counter_16b_GL-test
% ./Counter_16b_GL-test +test-case=1 +dump-vcd=waves-gl.vcd
% code waves-gl.vcd
% make Counter_16b_flat_RTL-test
% ./Counter_16b_flat_RTL-test +test-case=1 +dump-vcd=waves-rtl.vcd
% code waves-rtl.vcd

Display the following signals in Surfer:

  • clk
  • done
  • load
  • en
  • count
  • start
  • finish
  • incr

Include the entire waveform in your datasheet. Remember to always choose Insert > Insert image in cell from the menu when adding images to the datasheet.

For the Multi-Note and Music Player, you already collected Surfer and oscilloscope waveforms during Lab 3E and they should already be in your datasheets.

1.7. Timing

For the GL Counter, include just the critical path delay.

For the remaining datasheets, include the clock period, critical path delay, clock skew, and clock uncertainty. The slack will be calculated for you.

1.8. Critical Path

Use the timing report for the experiment with the smallest constraint which meets timing to show the delay of every gate along the critical path.

1.9. Overview Tab

Ensure the Overview tab includes the correct data and chip planners for all four designs.

2. Report

There are two separate Canvas assignments: one for the datasheets and one for the report. Both must be submitted in PDF format.

The lab report should have no more than two pages of text. There are should be no figures, tables, or diagrams in the report except for the worksheet which you should attach as an appendix. All figures, tables, and diagrams will be in your datasheets. There are no restrictions on font size, margins, or line spacing, but please make sure your report is readable. We recommend using 10pt Times or 10pt Palatino with 0.75in to 1in margins. Please make sure you include a title, your names, and your NetIDs at the top of the first page. Do not include a title page.

The lab report must include the following numbered sections. Please number your sections and use these specific titles. Please follow the guidelines on the number of paragraphs, the content of each paragraph, and which figures/tables to include. Some paragraphs might just be 2-3 sentences.

Sec 1. Introduction

  • This section should be one paragraph
  • Include 2-3 sentences explaining what the lab involves
  • Include one sentence explaining the purpose of this lab (why are students doing this lab?)
  • Include one sentence explicitly connecting the lab to one or more lecture topics; be specific on which lecture topics this lab reinforces with experiential learning

Sec 2. Gate-Level Counter Design

  • This section should be one paragraph
  • Include a sentence referencing your block diagram in your datasheet
  • Include 3+ sentences that describe how your counter works including how it loads in new counter values and how to implements the done signal

Sec 3. Gate-Level vs RTL Design

  • Paragraph 1: Analyzing the Gate-Level Counter

    • Include a sentence referencing the results in your datasheet
    • Include a sentence about where the critical path goes through the GL counter
    • Discuss the delay of the various components along the critical path (you must mention clock-to-q and setup time)
    • Explain why the GL counter does not meet timing and does not have any dedicated logic registers
  • Paragraph 2: Analyzing the RTL Counter

    • Include a sentence referencing the results in your datasheet, specifically the technology map block diagram
    • Discuss how the various Verilog constructs turn into specific low-level hardware in the FPGA; Be specific and discuss how each of these map into the technology map viewer: (1) the storage element that keeps track of the current count; (2) the storage element that keeps track of the finish value; (3) the logic that increments the count; (4) the logic that determines what should be the next stored count; (5) the logic that determines whether the counter is done
    • Discuss whether or not the number of dedicated logic registers in the RTL counter is expected; be specific and count registers in your Verilog and argue why the number of dedicated logic registers is in the counter
    • Include a sentence discussing the included critical path report

Sec 4: Note, Multi-Note, and Music Players

  • This section should be one paragraph
  • Describe the process you used to go from the FSM diagram to the final GL implementation of the note player
  • Describe the process you used to go from the FSM diagram to the final RTL implementation of the note player
  • Briefly reference your simulated waveforms and your oscilloscope waveforms for your multi-note player
  • Explain what note you tried, the expected note period, the measured note period in simulation, and the measured note period using the oscilloscope
  • Briefly reference your simulated waveforms and your oscilloscope waveforms for your music player
  • Explain which song you tried, the notes you see in simulation, and the notes you see using the oscilloscope

Sec 5: Conclusion

  • This section should be one paragraph
  • Include 2-3 sentences that summarizes all of the data and analysis in this lab assignment
  • Include 2-3 sentences about the connection between RTL and GL modeling
  • Include a sentence that draws a high-level conclusion; how will what you have learned impact your design work throughout the rest of the semester?

Appendix

  • Attach your Lab 3C worksheet which includes:
    • Note player FSM next state and output table
    • Note player FSM next state and output equations
    • Note player FSM gate-level implementation
    • Music player FSM next state and output table

3. Post-Lab Survey

Once you have finished all parts of this lab, complete the post-lab survey which is on Canvas. The post-lab survey includes questions on AI usage and workload distribution. The survey is due at the same time as the report. A student will not receive a grade for the lab unless the post-lab survey is completed.