blob: 04a83f663894a881dd37ec64032d4001f3296e12 (
plain)
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
|
module top(
input clk,
inout pin_IO,
);
wire pin_I;
reg pin_O = 16'd0;
reg pin_OE = 1'd0;
reg state = 1'd0;
reg next_state;
always @(*) begin
pin_IO <= 16'd0;
next_state <= state;
case (state)
1'd1: begin
next_state <= 1'd0;
end
default: begin
pin_IO <= 1'd1;
next_state <= 1'd1;
end
endcase
end
always @(posedge clk) begin
state <= next_state;
end
TRELLIS_IO #(
.DIR("BIDIR")
) TRELLIS_IO (
.I(pin_O),
.T(pin_OE),
.B(pin_IO),
.O(pin_I)
);
endmodule
|