aboutsummaryrefslogtreecommitdiff
path: root/test/ppu-stm-integration-demo
diff options
context:
space:
mode:
Diffstat (limited to 'test/ppu-stm-integration-demo')
-rw-r--r--test/ppu-stm-integration-demo/data.h4
-rwxr-xr-xtest/ppu-stm-integration-demo/data2pputb.awk (renamed from test/ppu-stm-integration-demo/data2vhdltb.awk)0
-rwxr-xr-xtest/ppu-stm-integration-demo/data2spitb.awk20
-rw-r--r--test/ppu-stm-integration-demo/makefile9
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)