Debian Codegraph @

examples/mipi.v

raw
1 /*
2 * Nothing meaningful is tested here other than compilation.
3 */
4 module top (
5 input clk,
6 input key_i,
7 input rst_i,
8 output [`LEDS_NR-1:0] led,
9 inout [1:0] mipi_in
10 );
11
12 wire rst = rst_i ^ `INV_BTN;
13 wire key = key_i ^ `INV_BTN;
14
15 wire term, ol, ob, hs_clk;
16
17 MIPI_IBUF mipi_ibuf_clk (
18 .OH(hs_clk),
19 .OL(ol),
20 .OB(ob),
21 .IO(mipi_in[0]),
22 .IOB(mipi_in[1]),
23 .I(1'b0),
24 .IB(1'b1),
25 .OEN(1'b1),
26 .OENB(1'b1),
27 .HSREN(term)
28 );
29
30 CLKDIV cd (
31 .CLKOUT(led[0]),
32 .CALIB(1'b0),
33 .HCLKIN(hs_clk),
34 .RESETN(!rst)
35 );
36 defparam cd.DIV_MODE="4";
37
38 assign term = (!(ol && ob)) ? 1'b1 : 1'b0;
39
40 endmodule