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

Subversion Repositories apb2spi

[/] [apb2spi/] [trunk/] [rtl/] [APB_SPI_Top.v] - Blame information for rev 5

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 vlnaran
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// APB- SPI 0.1 IP Core                                         ////
4
////                                                              ////
5
//// This file is part of the APB- SPI 0.1 IP Core project        ////
6
//// http://www.opencores.org/cores/APB- SPI 0.1 IP Core/         ////
7
////                                                              ////
8
//// Description                                                  ////
9
//// Implementation of XXX IP core according to                   ////
10
//// XXX IP core specification document.                          ////
11
////                                                              ////
12
//// To Do:                                                       ////
13
//// -                                                            ////
14
////                                                              ////
15
//// Author(s):                                                   ////
16
//// - Lakshmi Narayanan Vernugopal, email@opencores.org          ////
17
////                                                              ////
18
//////////////////////////////////////////////////////////////////////
19
////                                                              ////
20
//// Copyright (C) 2009 Authors and OPENCORES.ORG                 ////
21
////                                                              ////
22
//// This source file may be used and distributed without         ////
23
//// restriction provided that this copyright statement is not    ////
24
//// removed from the file and that any derivative work contains  ////
25
//// the original copyright notice and the associated disclaimer. ////
26
////                                                              ////
27
//// This source file is free software; you can redistribute it   ////
28
//// and/or modify it under the terms of the GNU Lesser General   ////
29
//// Public License as published by the Free Software Foundation; ////
30
//// either version 2.1 of the License, or (at your option) any   ////
31
//// later version.                                               ////
32
////                                                              ////
33
//// This source is distributed in the hope that it will be       ////
34
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
35
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
36
//// PURPOSE. See the GNU Lesser General Public License for more  ////
37
//// details.                                                     ////
38
////                                                              ////
39
//// You should have received a copy of the GNU Lesser General    ////
40
//// Public License along with this source; if not, download it   ////
41
//// from http://www.opencores.org/lgpl.shtml                     ////
42
////                                                              //// ///
43
///////////////////////////////////////////////////////////////////
44
`define APB_DATA_WIDTH  8
45
`define SPI_REG_WIDTH   8
46
`define APB_ADDR_WIDTH  3
47
//`define CLK_DIV_WIDTH 16
48
//`timescale 1ns/1ps
49
module APB_SPI_top
50
(
51
 // APB SLAVE PORT INTERFACE 
52
 input                         PCLK,
53
 input                         PRESETn,
54
 input [`APB_ADDR_WIDTH-1:0 ]  PADDR,
55
 input                         PWRITE,
56
 input                         PSEL,
57
 input                         PENABLE,
58
 input [`APB_DATA_WIDTH-1:0 ]  PWDATA,
59
 output [`APB_DATA_WIDTH-1:0 ] PRDATA,
60
 output                        PREADY,
61
 input                         TrFr,
62
 // SPI INTERFACE
63
 ////if Master/Slave Mode
64
 //inout                         SCLK,
65
 //inout                         MISO,
66
 //inout                         MOSI,
67
 //output                        SS,
68
 //if only Master Mode
69
 output                        SCLK,
70
 input                         MISO,
71
 output                        MOSI,
72
 output                        SS
73
 ////if only Slave Mode
74
 //input                         SCLK,
75
 //output                        MISO,
76
 //input                         MOSI,
77
 //input                         SS
78
 
79
);
80
 
81
 
82
  //APB Slave Interface Module
83
  APB_SLAVE APB_SL
84
  (
85
   .PCLK           (PCLK   ),
86
   .PRESETn        (PRESETn),
87
   .PADDR          (PADDR  ),
88
   .PWRITE         (PWRITE ),
89
   .PSEL           (PSEL   ),
90
   .PENABLE        (PENABLE),
91
   .PWDATA         (PWDATA ),
92
   .PRDATA         (PRDATA ),
93
   .PREADY         (PREADY ),
94
   .TrFr           (TrFr ),
95
 
96
   .SPI_CR_1       (),
97
   .SPI_CR_2       (),
98
   .SPI_BR_R       (),
99
   .SPI_ST_R       (),
100
   .SPI_DATA_Reg_1 (),
101
   .SPI_DATA_Reg_2 (),
102
   .SPI_DATA_Reg_3 (),
103
   .SPI_DATA_Reg_4 ()
104
 
105
  );
106
 
107
 
108
`ifdef ENABLED
109
  // SPI Master Definition
110
  SPI_Master SPI_M
111
  (
112
 
113
  );
114
 
115
 
116
  // SPI Slave Definition
117
  SPI_Slave SPI_S
118
  (
119
 
120
  );
121
 
122
 
123
 
124
  // Contains the register definiation of the 
125
  Register_Def Reg_Def
126
  (
127
 
128
  );
129
 
130
 
131
  // Baud Rate Generator for the SPI Speed of operation
132
  Clock_Gen CLK_Gen
133
  (
134
 
135
  );
136
 
137
 
138
  // Selection of the IO PAD type for the MISO and MOSI based on the Configuration of Registers
139
  IO_PAD_Instance IO_Pad
140
  (
141
 
142
  );
143
`endif
144
 
145
endmodule

powered by: WebSVN 2.1.0

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