Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single spi #4

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ddbf7e3
glitches
mattvenn Nov 15, 2018
4734746
savefile
mattvenn Nov 16, 2018
05b7d34
savefile
mattvenn Nov 16, 2018
e1f09eb
looking at null bytes
mattvenn Nov 16, 2018
067cc73
move gtkwave filters
Nov 18, 2018
f21638c
working with regular clock
Nov 18, 2018
9760a04
tidy up sspi dir
Nov 18, 2018
5a43d03
formal
Nov 18, 2018
696e225
formally verified with CDC
mattvenn Nov 19, 2018
e006d8e
assign spi_rdy and err high
mattvenn Nov 19, 2018
e229432
added more testbench support files
mattvenn Nov 20, 2018
a25d0c4
no_glitch localparam to turn on clock glitching
mattvenn Nov 20, 2018
ed19d85
testing spi comms and camera
mattvenn Nov 21, 2018
07048df
wait for acks properly by controlling cs pin manually
mattvenn Nov 21, 2018
332e583
add length and position to read and write routines
mattvenn Nov 21, 2018
a9efb1b
random write/read test
mattvenn Nov 21, 2018
1ae583a
kernel upload, run and readout works, but only with 128byte reads
mattvenn Nov 21, 2018
b67c8d5
fixed ACK: working with 1024 byte write/reads
mattvenn Nov 21, 2018
4575fe0
nicer formatting
mattvenn Nov 21, 2018
02e10bd
include spi client verilog
mattvenn Nov 26, 2018
1bbcbb3
pcf for lattice up5k dev board
mattvenn Nov 26, 2018
5a1619e
gtkwave config
mattvenn Nov 26, 2018
931fafa
Merge branch 'single_spi_reg_clock' of mattvenn.net:~/symbiotic_eda/m…
mattvenn Nov 26, 2018
443d1e4
change print for python2
mattvenn Nov 26, 2018
9f1006e
Merge branch 'single_spi_reg_clock' of mattvenn.net:~/symbiotic_eda/m…
mattvenn Nov 26, 2018
ed52c10
pinout
mattvenn Nov 26, 2018
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

no_glitch localparam to turn on clock glitching

  • Loading branch information
mattvenn committed Nov 20, 2018
commit a25d0c4f201c073512de1f7ce20aeedccecd306f
@@ -0,0 +1,57 @@
[*]
[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI
[*] Tue Nov 20 18:15:20 2018
[*]
[dumpfile] "/home/mattvenn/work/fpga/mlaccel/rtl/testbench.vcd"
[dumpfile_mtime] "Tue Nov 20 18:08:14 2018"
[dumpfile_size] 4888613
[savefile] "/home/mattvenn/work/fpga/mlaccel/rtl/spitest.gtkwave"
[timestart] 38200
[size] 1393 754
[pos] -1 -1
*-11.000000 44420 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[treeopen] testbench.
[treeopen] testbench.uut.
[sst_width] 263
[signals_width] 252
[sst_expanded] 1
[sst_vpaned_height] 209
@28
testbench.clock
@8022
testbench.cursor[31:0]
@22
testbench.xfer[7:0]
@28
testbench.xfer_wait_start
testbench.xfer_read_start
@200
-
@28
testbench.uut.spi.i_spi_clk
testbench.uut.spi.i_spi_cs_n
@200
-mosi
@28
testbench.uut.spi.i_mosi
@22
testbench.uut.spi.o_data_in_data[7:0]
@28
testbench.uut.spi.o_data_in_start
testbench.uut.spi.o_data_in_valid
@22
testbench.uut.din_data[7:0]
@200
-
-miso
@28
testbench.uut.spi.o_miso
@22
testbench.uut.spi.i_data_out_data[7:0]
@23
testbench.uut.dout_data[7:0]
@28
testbench.uut.spi.i_data_out_valid
testbench.uut.spi.o_data_out_ready
[pattern_trace] 1
[pattern_trace] 0
@@ -19,6 +19,8 @@
module testbench;
reg clock;
localparam spi_clock_period = 17;
localparam no_glitch = 1;
localparam num_tests = 64;

initial begin
$dumpfile("testbench.vcd");
@@ -54,15 +56,33 @@ module testbench;

task xfer_posedge;
begin
if ($random & 15 || no_glitch) begin
#spi_clock_period;
spi_clk = 1;
end else begin
#spi_clock_period;
spi_clk = 1;
#1;
spi_clk = 0;
#1;
spi_clk = 1;
end
end
endtask

task xfer_negedge;
begin
if ($random & 15 || no_glitch) begin
#spi_clock_period;
spi_clk = 0;
end else begin
#spi_clock_period;
spi_clk = 0;
#1;
spi_clk = 1;
#1;
spi_clk = 0;
end
end
endtask

@@ -220,7 +240,11 @@ module testbench;

task xfer_stop;
begin
if ($random & 3 || no_glitch) begin
xfer_negedge;
end else begin
#spi_clock_period;
end

xfer = 'bx;

@@ -233,7 +257,6 @@ module testbench;

integer cursor, len, i;

integer num_tests = 8;
initial begin
xfer_stop;

ProTip! Use n and p to navigate between commits in a pull request.