forked from TinyTapeout/ttsky25a-tinyQV
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtb.v
More file actions
71 lines (59 loc) · 1.94 KB
/
Copy pathtb.v
File metadata and controls
71 lines (59 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
`default_nettype none `timescale 1ns / 100ps
/* This testbench just instantiates the module and makes some convenient wires
that can be driven / tested by the cocotb test.py.
*/
module tb ();
// Wire up the inputs and outputs:
reg clk;
reg rst_n;
reg ena;
reg [7:0] ui_in_base;
wire [7:0] ui_in;
reg [7:0] uio_in;
wire [7:0] uo_out;
wire [7:0] uio_out;
wire [7:0] uio_oe;
wire [3:0] qspi_data_in;
reg [2:0] latency_cfg;
assign {uio_in[5:4], uio_in[2:1]} = rst_n ? qspi_data_in : {1'b0, latency_cfg};
wire [3:0] qspi_data_out = {uio_out[5:4], uio_out[2:1]};
wire [3:0] qspi_data_oe = {uio_oe[5:4], uio_oe[2:1]};
wire qspi_clk_out = uio_out[3];
wire qspi_flash_select = uio_out[0];
wire qspi_ram_a_select = uio_out[6];
wire qspi_ram_b_select = uio_out[7];
wire spi_miso = ui_in_base[2];
wire spi_cs = uo_out[4];
wire spi_sck = uo_out[5];
wire spi_mosi = uo_out[3];
wire spi_dc = uo_out[2];
wire mhz_clk = ui_in_base[3];
wire game_latch = ui_in_base[4];
wire game_clk = ui_in_base[5];
wire game_data = ui_in_base[6];
wire uart_tx = uo_out[0];
wire uart_rts = uo_out[1];
wire debug_uart_tx = uo_out[6];
wire uart_rx = ui_in_base[7];
assign ui_in = {uart_rx, game_data, game_clk, game_latch, mhz_clk, spi_miso, ui_in_base[1:0]};
`ifdef GL_TEST
wire VPWR = 1'b1;
wire VGND = 1'b0;
`endif
// Replace tt_um_example with your module name:
tt_um_tt_tinyQV user_project (
// Include power ports for the Gate Level test:
`ifdef GL_TEST
.VPWR(VPWR),
.VGND(VGND),
`endif
.ui_in (ui_in), // Dedicated inputs
.uo_out (uo_out), // Dedicated outputs
.uio_in (uio_in), // IOs: Input path
.uio_out(uio_out), // IOs: Output path
.uio_oe (uio_oe), // IOs: Enable path (active high: 0=input, 1=output)
.ena (ena), // enable - goes high when design is selected
.clk (clk), // clock
.rst_n (rst_n) // not reset
);
endmodule