From 636b375c4883bf7756e83427ca0007a07e4b88de Mon Sep 17 00:00:00 2001 From: dilanthi Date: Mon, 2 Jun 2025 17:36:27 -0700 Subject: [PATCH 1/2] added headers/ updated old ones --- design/audio/audio_buffer.sv | 9 +++++++++ design/audio/pwm.sv | 5 +++-- design/debouncer.sv | 8 ++++++++ design/low_freq_clock_gen.sv | 9 +++++++++ design/nexys_a7_top.sv | 7 +++++++ design/segment_display/display_anode_driver.sv | 14 +++++++++++++- design/segment_display/display_converter.sv | 6 ++++-- design/segment_display/seconds_display.sv | 3 ++- verification/segment_display/seconds_display_tb.sv | 8 ++++++++ 9 files changed, 63 insertions(+), 6 deletions(-) diff --git a/design/audio/audio_buffer.sv b/design/audio/audio_buffer.sv index 108e09f..0a7a6f7 100644 --- a/design/audio/audio_buffer.sv +++ b/design/audio/audio_buffer.sv @@ -1,6 +1,15 @@ +/**** + * audio_buffer.sv - holds a 2KiB audio buffer of 16-bit pcm audio + * samples (with pcm being the audio format we are using) + * + * @author: Waylon Cude, Dilanthi + * @date: 6/12/2025 + * + * */ `ifdef VERILATOR `include "sdvd_defs.sv" `endif + import sdvd_defs::SPEED; //this interfaces with block ram diff --git a/design/audio/pwm.sv b/design/audio/pwm.sv index c149600..98b5894 100644 --- a/design/audio/pwm.sv +++ b/design/audio/pwm.sv @@ -1,8 +1,9 @@ /**** - * pwm.sv - [must edit in future] + * pwm.sv - drives the pwm audio output on the FPGA given a single 16-bit + * sample. * * @author: Dilanthi Prentice, Waylon Cude - * @date: [not sure when due yet] + * @date: 6-12-2025 * * * */ diff --git a/design/debouncer.sv b/design/debouncer.sv index abd162c..895d699 100644 --- a/design/debouncer.sv +++ b/design/debouncer.sv @@ -1,3 +1,11 @@ +/*** + * debouncer.sv - generates a debounced button press and turns it inot + * a single pulse. + * + * @author: Waylon Cude, Dilanthi Prentice + * @date: 6-12-25 + * + * */ //NOTE: you should drive this with a slow clock to actually debounce input module debouncer(input logic clk, input reset, input source, output logic out); diff --git a/design/low_freq_clock_gen.sv b/design/low_freq_clock_gen.sv index 86363a7..377ac62 100644 --- a/design/low_freq_clock_gen.sv +++ b/design/low_freq_clock_gen.sv @@ -1,3 +1,12 @@ +/**** + * low_freq_clock_gen.sv - Generates different clock frequencies to drive + * different state machines and different parts of + * the design. + * + * @author: Waylon Cude, Dilanthi Prentice + * @date: 6/12/2025 + * */ + `ifdef VERILATOR `include "sdvd_defs.sv" `endif diff --git a/design/nexys_a7_top.sv b/design/nexys_a7_top.sv index 8537b0e..b8d3830 100644 --- a/design/nexys_a7_top.sv +++ b/design/nexys_a7_top.sv @@ -1,3 +1,10 @@ +/*** + * nexys_a7_top.sv - top level design module specific to Nexys A7100T. + * + * @author: Waylon Cude, Dilanthi Prentice + * @date: 6/12/2025 + * + * **/ `ifdef VERILATOR `include "sdvd_defs.sv" `endif diff --git a/design/segment_display/display_anode_driver.sv b/design/segment_display/display_anode_driver.sv index 90a2cd2..f92bc51 100644 --- a/design/segment_display/display_anode_driver.sv +++ b/design/segment_display/display_anode_driver.sv @@ -1,4 +1,16 @@ -// NOTE: This expects to be driven with a 100khz clock +/*** + * display_anode_driver.sv - Turns a single anode of a single digit at a time, + * rapidly rotating through all of them, generating + * a solid-looking display even though only one digit + * is on at a time. + * + * @author: Waylon Cude, Dilanthi Prentice + * @date: 6-12-2025 + * + * */ + +// NOTE: This expects to be driven with a 100khz clock but can be altered in +// the nexys_a7_top.sv file. module display_anode_driver( input logic clk, input logic reset, diff --git a/design/segment_display/display_converter.sv b/design/segment_display/display_converter.sv index 6ff207f..474240a 100644 --- a/design/segment_display/display_converter.sv +++ b/design/segment_display/display_converter.sv @@ -1,12 +1,12 @@ /** * display_converter.sv - decodes a 5 bit digit input into its seven segment * display equivalent using a lookup table. Display can -* do 0 - 9, A - F, individual segmentsm and special +* do 0 - 9, A - F, individual segments and special * characters. +* * @author: Dilanthi Prentice, Waylon Cude * @date: 6/12/25 * -* ****/ module display_converter( input logic [4:0] digit, @@ -16,6 +16,7 @@ module display_converter( localparam ROM_SIZE=32; //ROM lookup table for seven segment display +//blanks are unused space we could add characters to. localparam logic [6:0] segment_rom [0:ROM_SIZE-1] = '{ 7'b1111110, //0 7'b0000110, //1 @@ -54,6 +55,7 @@ localparam logic [6:0] segment_rom [0:ROM_SIZE-1] = '{ 7'b0000000, //blank 7'b0000000 //blank }; + //use digit input to index segment_rom lookup table. assign segment = segment_rom[digit]; diff --git a/design/segment_display/seconds_display.sv b/design/segment_display/seconds_display.sv index a112cb8..34915c2 100644 --- a/design/segment_display/seconds_display.sv +++ b/design/segment_display/seconds_display.sv @@ -1,10 +1,11 @@ /*** -* seconds_display.sv - convert a seconds counter to a seven segement display. +* seconds_display.sv - converts a five bit seconds counter to its seven segement display equivalent. * * @author: Dilanthi Prentice, Waylon Cude * @date: 6/12/25 * */ + module seconds_display ( input [$clog2(60)-1:0] seconds, diff --git a/verification/segment_display/seconds_display_tb.sv b/verification/segment_display/seconds_display_tb.sv index 493d0bb..5ba9332 100644 --- a/verification/segment_display/seconds_display_tb.sv +++ b/verification/segment_display/seconds_display_tb.sv @@ -1,3 +1,11 @@ +/**** + * seconds_display_tb.sv - testbench for the seconds_display module. + * + * @author: Waylon Cude, Dilanthi Prentice + * @date: 6/12/2025 + * + * */ + `timescale 1ns / 1ps module seconds_display_tb; int errors = 0; -- 2.43.7 From b9b6be7cbef859ef5fa0a1c745cc3d5439a37b3c Mon Sep 17 00:00:00 2001 From: Waylon Cude Date: Mon, 2 Jun 2025 17:47:35 -0700 Subject: [PATCH 2/2] Typo fixup --- design/debouncer.sv | 2 +- design/segment_display/display_anode_driver.sv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/design/debouncer.sv b/design/debouncer.sv index 895d699..06b96ff 100644 --- a/design/debouncer.sv +++ b/design/debouncer.sv @@ -1,5 +1,5 @@ /*** - * debouncer.sv - generates a debounced button press and turns it inot + * debouncer.sv - generates a debounced button press and turns it into * a single pulse. * * @author: Waylon Cude, Dilanthi Prentice diff --git a/design/segment_display/display_anode_driver.sv b/design/segment_display/display_anode_driver.sv index f92bc51..ee2c668 100644 --- a/design/segment_display/display_anode_driver.sv +++ b/design/segment_display/display_anode_driver.sv @@ -1,5 +1,5 @@ /*** - * display_anode_driver.sv - Turns a single anode of a single digit at a time, + * display_anode_driver.sv - Turns on a single anode of a single digit at a time, * rapidly rotating through all of them, generating * a solid-looking display even though only one digit * is on at a time. -- 2.43.7