aboutsummaryrefslogtreecommitdiffstats
path: root/tests/read_only_mode_template.v
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2022-07-21 13:51:55 -0400
committerGravatar Peter McGoron 2022-07-21 13:52:51 -0400
commit34bb170241e1c2643cc8b6f3d5a2fee59d1226f2 (patch)
treeeea9ee1ec48e60084eabcb2d31b2b29aedf6b07f /tests/read_only_mode_template.v
parentautogenerate mode tests (diff)
add read only master with tests
Diffstat (limited to 'tests/read_only_mode_template.v')
-rw-r--r--tests/read_only_mode_template.v57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/read_only_mode_template.v b/tests/read_only_mode_template.v
new file mode 100644
index 0000000..cd10c7d
--- /dev/null
+++ b/tests/read_only_mode_template.v
@@ -0,0 +1,57 @@
+/* (c) Peter McGoron 2022
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v.2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
+ */
+
+module read_only_mode@MODE@ (
+ input clk,
+ input activate,
+ input ss,
+ input rdy,
+ output master_finished
+);
+
+wire miso;
+wire sck;
+wire ss_L = !ss;
+reg [23:0] from_slave_data;
+reg finished;
+reg err;
+
+spi_master_no_write
+#(
+ .POLARITY(@POLARITY@),
+ .PHASE(@PHASE@)
+) master (
+ .clk(clk),
+ .from_slave(from_slave_data),
+ .miso(miso),
+ .sck_wire(sck),
+ .finished(master_finished),
+ .arm(activate)
+);
+
+reg [23:0] to_master = 24'hF4325F;
+
+spi_slave_no_read
+#(
+ .POLARITY(@POLARITY@),
+ .PHASE(@PHASE@)
+) slave (
+ .clk(clk),
+ .sck(sck),
+ .ss_L(ss_L),
+ .to_master(to_master),
+ .miso(miso),
+ .finished(finished),
+ .rdy(rdy),
+ .err(finished)
+);
+
+initial begin
+ $dumpfile("read_only_mode@MODE@.vcd");
+ $dumpvars();
+end
+
+endmodule