diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-03-30 17:00:05 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-03-30 17:00:05 +0200 |
commit | fa296fbc6fe1c423932189116bd0cb949de0beef (patch) | |
tree | fc7de2beb8c06e1e244caf0ca201d03c690b657e /test | |
parent | 6292c1101121bc8ba2db752cab3cbe41469b29d0 (diff) |
spi not working on hardware
Diffstat (limited to 'test')
-rw-r--r-- | test/ppu-stm-integration-demo/data.h | 4 | ||||
-rwxr-xr-x | test/ppu-stm-integration-demo/data2pputb.awk (renamed from test/ppu-stm-integration-demo/data2vhdltb.awk) | 0 | ||||
-rwxr-xr-x | test/ppu-stm-integration-demo/data2spitb.awk | 20 | ||||
-rw-r--r-- | test/ppu-stm-integration-demo/makefile | 9 |
4 files changed, 28 insertions, 5 deletions
diff --git a/test/ppu-stm-integration-demo/data.h b/test/ppu-stm-integration-demo/data.h index ac73e66..cdca4a5 100644 --- a/test/ppu-stm-integration-demo/data.h +++ b/test/ppu-stm-integration-demo/data.h @@ -1,5 +1,5 @@ #pragma once -// #include "test-image.h" -#include "test-background-color.h" +#include "test-image.h" +// #include "test-background-color.h" diff --git a/test/ppu-stm-integration-demo/data2vhdltb.awk b/test/ppu-stm-integration-demo/data2pputb.awk index db4b53f..db4b53f 100755 --- a/test/ppu-stm-integration-demo/data2vhdltb.awk +++ b/test/ppu-stm-integration-demo/data2pputb.awk diff --git a/test/ppu-stm-integration-demo/data2spitb.awk b/test/ppu-stm-integration-demo/data2spitb.awk new file mode 100755 index 0000000..6caf9a3 --- /dev/null +++ b/test/ppu-stm-integration-demo/data2spitb.awk @@ -0,0 +1,20 @@ +#!/bin/awk -f +BEGIN { } + +{ + data = strtonum("0x"$1$2) + print "-- 0x"$1": "$2 + + for (i = 0; i < 32; i++) { + print "SPI_DATA <= '"and(rshift(data, 31), 1)"';" + print "wait for 50 ns;" + print "SPI_CLK <= '1';" + print "wait for 50 ns;" + print "SPI_CLK <= '0';" + if (i == 15) print "--" + else print "" + data = lshift(data, 1) + } +} + +END { } diff --git a/test/ppu-stm-integration-demo/makefile b/test/ppu-stm-integration-demo/makefile index 2f4b6f4..853dd31 100644 --- a/test/ppu-stm-integration-demo/makefile +++ b/test/ppu-stm-integration-demo/makefile @@ -1,14 +1,17 @@ .PHONY: all clean -TARGETS := test-background-color.h test-image.h test-image.tb.vhd +TARGETS := test-background-color.h test-image.h test-image-spi.tb.vhd test-image-ppu.tb.vhd test-background-color-spi.tb.vhd all: $(TARGETS) %.h: %.txt ./data2test.awk tr -d ':' < $< | ./data2test.awk > $@ -test-%.tb.vhd: test-%.txt ./data2vhdltb.awk - tr -d ':' < $< | ./data2vhdltb.awk > $@ +test-%-ppu.tb.vhd: test-%.txt ./data2pputb.awk + tr -d ':' < $< | ./data2pputb.awk > $@ + +test-%-spi.tb.vhd: test-%.txt ./data2spitb.awk + (tr -d ':' < $<; echo "ffff ffff") | ./data2spitb.awk > $@ clean: $(RM) $(TARGETS) |