OpenCores
URL https://opencores.org/ocsvn/ssbcc/ssbcc/trunk

Subversion Repositories ssbcc

[/] [ssbcc/] [trunk/] [example/] [hello_world/] [Xilinx/] [SP601/] [sp601.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sinclairrf
/*******************************************************************************
2
 *
3
 * Copyright 2012, Sinclair R.F., Inc.
4
 *
5
 * Top-level module to demonstrate UART_Tx peripheral.
6
 *
7
 ******************************************************************************/
8
 
9
module sp601(
10
  // 200 MHz differential clock
11
  input  wire ip_sysclk_p,
12
  input  wire ip_sysclk_n,
13
  // UART Tx
14
  output wire op_usb_1_rx
15
);
16
 
17
/*
18
 * Generate a 100 MHz clock from the 200 MHz oscillator.
19
 */
20
 
21
wire s_sysclk;
22
IBUFGDS sysclk_inst(
23
  .I    (ip_sysclk_p),
24
  .IB   (ip_sysclk_n),
25
  .O    (s_sysclk)
26
);
27
 
28
wire s_divclk;
29
BUFIO2 bufio2_inst(
30
  .I            (s_sysclk),
31
  .IOCLK        (),
32
  .DIVCLK       (s_divclk),
33
  .SERDESSTROBE ()
34
);
35
defparam bufio2_inst.DIVIDE             = 2;
36
defparam bufio2_inst.DIVIDE_BYPASS      = "FALSE";
37
 
38
wire s_clk;
39
BUFG sclk_inst(
40
  .I    (s_divclk),
41
  .O    (s_clk)
42
);
43
 
44
/*
45
 * Generate a synchronous reset.
46
 */
47
 
48
reg [3:0] s_reset_count = 4'hF;
49
always @ (posedge s_clk)
50
  s_reset_count <= s_reset_count - 4'd1;
51
 
52
reg s_rst = 1'b1;
53
always @ (posedge s_clk)
54
  if (s_reset_count == 4'd0)
55
    s_rst <= 1'b0;
56
  else
57
    s_rst <= s_rst;
58
 
59
/*
60
 * Instantiate the micro controller.
61
 */
62
 
63
hello_world hw_inst(
64
  // synchronous reset and processor clock
65
  .i_rst        (s_rst),
66
  .i_clk        (s_clk),
67
  // Tx side of UART
68
  .o_UART_Tx    (op_usb_1_rx)
69
);
70
 
71
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.