Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
25b1149
Create work plan
arianaolson419 Oct 23, 2017
78bbf21
Implement and test rising and failling output edges
arianaolson419 Oct 23, 2017
f482684
Add makefile for easy compiling of files
arianaolson419 Oct 23, 2017
2b18f41
Write some noisy signals to the input pin
arianaolson419 Oct 24, 2017
1eee7f5
change build target label for clarity
arianaolson419 Oct 24, 2017
8cb88d5
input synchronization tests done
Oct 24, 2017
c34c3d3
Clean up debounce tests
arianaolson419 Oct 24, 2017
9aa057c
Merge branch 'master' of https://github.com/arianaolson419/Lab2 into …
arianaolson419 Oct 24, 2017
9e376a7
Add shiftregister files
arianaolson419 Oct 24, 2017
19504a5
finished shift register, basic tests complete
Oct 24, 2017
3eb036d
updated shiftregister.v and completed test bench
Oct 24, 2017
c580b54
top-level module for midpoint check-in
Oct 24, 2017
104f9ae
Ignore compiled verilog and gtkwave files
arianaolson419 Oct 24, 2017
aaa7215
Fix small format nit
arianaolson419 Oct 24, 2017
1ea09bf
Create FPGA wrapper module
arianaolson419 Oct 24, 2017
2557da2
Add build rules for midpointwrapper
arianaolson419 Oct 24, 2017
e9bd496
Change width of button input
arianaolson419 Oct 24, 2017
0cf82ad
shift register, test bench completed
Oct 24, 2017
203888d
Merge branch 'master' of https://github.com/arianaolson419/Lab2
arianaolson419 Oct 24, 2017
a7a9d19
Rename module
arianaolson419 Oct 25, 2017
fc9f8f2
finalized test bench
Oct 25, 2017
bc0cc6d
Ignore Vivado-related files
arianaolson419 Oct 25, 2017
1520a98
Change build rules for midpoint target
arianaolson419 Oct 25, 2017
0534ed9
Merge branch 'master' of https://github.com/arianaolson419/Lab2
arianaolson419 Oct 25, 2017
722b7ec
Add testing instructions for the midpoint checkin
arianaolson419 Oct 25, 2017
b5e8560
Added FSM and filter
Oct 29, 2017
ca50072
Merge branch 'master' of https://github.com/arianaolson419/Lab2
Oct 29, 2017
7427ffb
Create an 8 bit register for use as an address latch
arianaolson419 Oct 29, 2017
4d6b085
Create a D flip flop
arianaolson419 Oct 29, 2017
bf25d53
Add new modules to be built
arianaolson419 Oct 29, 2017
db56c14
Fix syntax errors
arianaolson419 Oct 29, 2017
35d10cc
completed spi memory, need to test
Oct 29, 2017
ccb0805
add build rule for spimemorytest
arianaolson419 Oct 29, 2017
4a790c9
Change name of module for continuity
arianaolson419 Oct 29, 2017
55c84e2
Create test module
arianaolson419 Oct 29, 2017
395a84d
Bug fixes
arianaolson419 Oct 30, 2017
23dc95f
Change tests
arianaolson419 Oct 30, 2017
9c54530
Play with clk input
arianaolson419 Oct 30, 2017
6e3da0d
fixed minor errors in fsm
Oct 31, 2017
fa78f02
fsm test bench, needs some polishing
Oct 31, 2017
ec4c9a4
Change test to adapt to waittime
arianaolson419 Oct 31, 2017
2a659e6
Merge branch 'debugging' of https://github.com/arianaolson419/Lab2 in…
arianaolson419 Oct 31, 2017
2947003
Current testing progress
arianaolson419 Nov 1, 2017
2625a6d
fixed fsm
Nov 1, 2017
6218ad5
fixed fsm w/ two read states
Nov 1, 2017
1616533
Continued debugging
arianaolson419 Nov 1, 2017
16093c9
Add comments and test cases.
arianaolson419 Nov 2, 2017
0af1539
Add comments
arianaolson419 Nov 2, 2017
f67c02c
Make small changes in tests
arianaolson419 Nov 2, 2017
daac80b
working fsm and spimemory test bench
Nov 2, 2017
ce8cf05
Add memory tests
arianaolson419 Nov 2, 2017
f7c966c
Merge branch 'debugging' of https://github.com/arianaolson419/Lab2 in…
arianaolson419 Nov 2, 2017
8a5d4bb
Add memory tests
arianaolson419 Nov 2, 2017
b3fa579
Finish cleaning up
arianaolson419 Nov 2, 2017
3c7904a
fixed fsm (once again)
Nov 3, 2017
7e96d38
fsm.filter
arianaolson419 Nov 3, 2017
f356c9d
Merge branch 'debugging' of https://github.com/arianaolson419/Lab2 in…
arianaolson419 Nov 3, 2017
05f262b
Add extra clk cycles
arianaolson419 Nov 3, 2017
9481167
almost done with spi memory test bench
Nov 3, 2017
e5802a4
almost done with spi memory test bench
Nov 3, 2017
b3e9cdf
finished test bench, added state cases
Nov 3, 2017
74ecc67
Add another state
arianaolson419 Nov 3, 2017
3ea65a8
Merge branch 'debugging' of https://github.com/arianaolson419/Lab2 in…
arianaolson419 Nov 3, 2017
aec517e
Final write-up for Lab2
Nov 3, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Ignore compiled binaries
*
!/**/
!*.*
!makefile

# Ignore gtkwave files
*.vcd

# Ignore vivado-related files and directories
midpoint_testing
*vivado*
Binary file added Lab 2 Write-Up.pdf
Binary file not shown.
16 changes: 16 additions & 0 deletions MidpointTestSequence.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Midpoint Test Instructions


PIPO:
1. Press button 0 (parallelLoad) to load parallelDataIn (specified as 0xA5, or b10100101).
2. Press button 1 to display the least significant bits. An LED ‘on’ state represents when a bit is 1 (and when it is off, it represents when a bit is 0). LEDs 0 and 2 should be on and LEDs 1 and 3 should be off in order to represent least significant bits ‘0101’.
3. Press button 2 to display the most significant bits. LEDs 0 and 2 should be off and LEDs 1 and 3 should be on in order to represent the most significant bits ‘1010’.


SIPO:
1. Place switch 0 in the “low” position. This represents a 0 value bit. When switch 2 is toggled from low to high, the 0 bit will be serially loaded, and the bits in the shift register will shift up one degree from their previous places.
2. Press button 1. LEDs 0 and 2 will now be off, and LEDs 1 and 3 will be on.
3. Press button 2. LEDs 0, 1, and 3 will be off, and LED 2 will be on.
4. Place switch 0 in the high position, which represents a 1 value bit. Toggle switch 1 from low to high to serially load a 1 into the shift register.
5. Press button 1. LEDs 0 and 2 will now be on, and LEDs 1 and 3 will be of.
6. Press button 2. LEDs 1 and 2 will be off, and LEDs 0 and 4 will be on.
40 changes: 40 additions & 0 deletions Work Plan.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Prava Dhulipalla, Ariana Olson
Lab 2 Work Plan
October 23, 2017


Input Conditioning (6 hours - Finish by 10/24/17)
* Complete inputconditioner.v (1 hour)
* Test bench demonstrates the 3 functions of the input conditioner (2.5 hours)
* Test script executes testbench and makes gtkwave file (0.75 hours)
* Circuit diagram (1 hour)
* Analysis of max input glitch length at 50MHz that will be suppressed by a waittime of 10 (0.75 hours)
Shift Register (4.25 hours - Finish by 10/24/17)
* Complete shiftregister.v (1.5 hours)
* Test bench demonstrating both modes of operation for shift register (2 hours)
* Description of test bench strategy (0.75 hours)
Midpoint Check-in (4 hours - Finish by 10/24/17)
* Top-level module of given structure (0.5 hours)
* Loading to FPGA (0.75 hours)
* Writing wrapper class (0.75 hours)
* Design a test sequence demonstrating successful operation of this portion of lab (1 hour)
* Write a short, written description (0.75 hours)
* Demonstrate to a Ninja (0.25 hours)
SPI Memory (3.5 hours - Finish by 10/27/17)
* Design and implement Finite State Machine (2.5 hours)
* Implement SPI memory meeting specifications defined by waveform (1 hour)
SPI Memory Testing (3.5 hours - Finish by 10/28/17)
* Create a test bench (2 hours)
* Have detailed analysis of testing strategy in report (1.5 hours)
* External testing with Arduino (optional) (+ 1.5 hours if we decide to pursue)
Debugging (4+ hours - Finish by 11/1/17)
* Make appointments with Ben and/or NINJAS
Make it Pretty (1.5 hours - Finish by 11/1/17)
* Makefile, run test script (0.5 hours)
* Clean code and comments (1 hours)
Final Report (0.25 hours - Finish by 11/2/17)
* All analysis and information requested in previous sections (should already be done)
* Reflection of work plan vs reality (0.25 hours)


Total time spent: 27.5 hours
25 changes: 25 additions & 0 deletions addresslatch.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//------------------------------------------------------------------------
// Address Latch
// Positive edge triggered
// If writeEnable is true, addressOut is equal to addressIn
// otherwise, addressOut holds its previous value
//------------------------------------------------------------------------

module addresslatch
#(
parameter width = 7
)
(
input [width-1:0] addressIn,
input writeEnable,
input clk,
output reg [width-1:0] addressOut
);

always @(posedge clk) begin
if(writeEnable) begin
addressOut[width-1:0] <= addressIn[width-1:0];
end
end

endmodule
2 changes: 1 addition & 1 deletion datamemory.v
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module datamemory
input [addresswidth-1:0] address,
input writeEnable,
input [width-1:0] dataIn
)
);


reg [width-1:0] memory [depth-1:0];
Expand Down
22 changes: 22 additions & 0 deletions dflipflop.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//------------------------------------------------------------------------
// D Flip Flop
// Positive edge triggered
// If writeEnable is true, q is equal to d
// otherwise, q holds its previous value
//------------------------------------------------------------------------

module dflipflop
(
input d,
input writeEnable,
input clk,
output reg q
);

always @(posedge clk) begin
if(writeEnable) begin
q <= d;
end
end

endmodule
8 changes: 8 additions & 0 deletions fsm.filter
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Filter file for GTKWave

000001 START
000010 RECEIVE
000100 WRITE
001000 READ0
010000 READ1
100000 END
130 changes: 130 additions & 0 deletions fsm.t.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
`timescale 1ns / 1ps

`include "fsm.v"

module fsm_test ();
reg sclk, chip_sel, shift_reg_out;
wire miso_buff, dm_we, addr_we, sr_we;

fsm dut (.sclk(sclk), .chip_sel(chip_sel), .shift_reg_out(shift_reg_out),
.miso_buff(miso_buff), .dm_we(dm_we), .addr_we(addr_we), .sr_we(sr_we));


always begin
#5 sclk = ~sclk;
end

initial begin
$dumpfile("fsm.vcd");
$dumpvars();

// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// chip_sel = 1; shift_reg_out = 1; #10
// $displayb("miso_buff: %b", miso_buff);
// $displayb("dm_we: %b", dm_we);
// $displayb("addr_we: %b", addr_we);
// $displayb("sr_we: %b", sr_we);

// chip_sel = 0;
// shift_reg_out = 0; #70
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// shift_reg_out = 0; #10
// sclk = 1; #5
// sclk = 0; #5

// shift_reg_out = 0; #80
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5

// chip_sel = 1; #5



sclk = 0;
chip_sel = 0;
shift_reg_out = 0; #80
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0;

shift_reg_out = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5
// sclk = 1; #5
// sclk = 0; #5

$displayb("miso_buff: %b", miso_buff);
$displayb("dm_we: %b", dm_we);
$displayb("addr_we: %b", addr_we);
$displayb("sr_we: %b", sr_we);

$finish();
end

endmodule
Loading