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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [PCIe/] [syn/] [a10gx_riffa/] [a10gx_sys.sv] - Blame information for rev 49

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 49 qaztronic
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// Copyright (C) 2017 Authors and OPENCORES.ORG                 ////
4
////                                                              ////
5
//// This source file may be used and distributed without         ////
6
//// restriction provided that this copyright statement is not    ////
7
//// removed from the file and that any derivative work contains  ////
8
//// the original copyright notice and the associated disclaimer. ////
9
////                                                              ////
10
//// This source file is free software; you can redistribute it   ////
11
//// and/or modify it under the terms of the GNU Lesser General   ////
12
//// Public License as published by the Free Software Foundation; ////
13
//// either version 2.1 of the License, or (at your option) any   ////
14
//// later version.                                               ////
15
////                                                              ////
16
//// This source is distributed in the hope that it will be       ////
17
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
18
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
19
//// PURPOSE.  See the GNU Lesser General Public License for more ////
20
//// details.                                                     ////
21
////                                                              ////
22
//// You should have received a copy of the GNU Lesser General    ////
23
//// Public License along with this source; if not, download it   ////
24
//// from http://www.opencores.org/lgpl.shtml                     ////
25
////                                                              ////
26
//////////////////////////////////////////////////////////////////////
27
 
28
 
29
module
30
  a10gx_sys
31
  #(
32
    C_PCI_DATA_WIDTH,
33
    B,
34
    N = (C_PCI_DATA_WIDTH / 8), // width of the bus in bytes
35
    RW = (N/4), // width of the bus in 32 bit words
36
    RC = RW * B // number of available registers
37
  )
38
  (
39
    input          clk_50,             //1.8V - 50MHz
40
    input          cpu_resetn,         //1.8V    //CPU Reset Pushbutton (TR=0)
41
    output [ 7:0]  user_led_g,         //1.8V    //User LEDs
42
    output [ 7:0]  user_led_r,         //1.8V    //User LEDs
43
    input  [ 2:0]  user_pb,            //1.8V    //User Pushbuttons (TR=0)
44
    output         npor,
45
    input          pcie_perstn,         //1.8V    //PCIe Reset
46
    output         sys_aresetn,
47
 
48
    riffa_chnl_if chnl_bus,
49
    riffa_register_if r_if,
50
    input clk,
51
    input reset
52
  );
53
 
54
  // --------------------------------------------------------------------
55
  //
56
  wire clk_50mhz;
57
 
58
  sys_pll
59
    sys_pll_i
60
    (
61
      .rst(~user_pb[0]),
62
      .refclk(clk_50),
63
      .outclk_0(clk_50mhz),
64
      .locked(sys_aresetn)
65
    );
66
 
67
 
68
  // --------------------------------------------------------------------
69
  //
70
  riffa_register_file  #(.N(N), .B(B))
71
    riffa_register_file_i(.*);
72
 
73
 
74
  // --------------------------------------------------------------------
75
  //
76
  reg [31:0] fled_counter;
77
 
78
  always_ff @(posedge clk_50mhz)
79
    fled_counter <= fled_counter + 1;
80
 
81
 
82
  // --------------------------------------------------------------------
83
  //
84
  genvar j;
85
 
86
  generate
87
    for(j = 0; j < RC; j++)
88
    begin : registers
89
      assign r_if.register_in[j] = r_if.register_out[j];
90
    end
91
  endgenerate
92
 
93
 
94
  // --------------------------------------------------------------------
95
  //
96
  assign user_led_g[0] = fled_counter[23];
97
  assign user_led_g[7:1] = r_if.register_out[0][7:1];
98
  assign user_led_r = r_if.register_out[0][15:8];
99
  assign npor = pcie_perstn & sys_aresetn;
100
 
101
 
102
// --------------------------------------------------------------------
103
//
104
endmodule

powered by: WebSVN 2.1.0

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