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

Subversion Repositories oms8051mini

[/] [oms8051mini/] [trunk/] [rtl/] [8051/] [oc8051_wb_iinterface.v] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 dinesha
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  8051 wishbone interface to instruction rom                  ////
4
////                                                              ////
5
////  This file is part of the 8051 cores project                 ////
6
////  http://www.opencores.org/cores/oms8051mini/                 ////
7
////                                                              ////
8
////  Description                                                 ////
9
////                                                              ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////    nothing                                                   ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Simon Teran, simont@opencores.org                     ////
16
////      - Dinesh Annayya, dinesha@opencores.org                 ////
17
////                                                              ////
18
//////////////////////////////////////////////////////////////////////
19
////                                                              ////
20
//// Copyright (C) 2000 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
//
45
// CVS Revision History
46
//
47
// $Log: not supported by cvs2svn $
48
// Revision 1.5  2003/05/05 10:34:27  simont
49
// registering outputs.
50
//
51
// Revision 1.4  2003/04/16 10:02:45  simont
52
// fix bug (cyc_o and stb_o)
53
//
54
// Revision 1.3  2003/04/03 19:19:02  simont
55
// change adr_i and adr_o length.
56
//
57
// Revision 1.2  2003/01/13 14:14:41  simont
58
// replace some modules
59
//
60
// Revision 1.1  2002/10/28 16:42:08  simont
61
// initial import
62
//
63
//
64
//
65
 
66
 
67
module oc8051_wb_iinterface(rst, clk,
68
                  adr_i, dat_o, cyc_i, stb_i, ack_o,
69
                  adr_o, dat_i, cyc_o, stb_o, ack_i
70
                  );
71
//
72
// rst           (in)  reset - pin
73
// clk           (in)  clock - pini
74
input rst, clk;
75
 
76
//
77
// interface to oc8051 cpu
78
//
79
// adr_i    (in)  address
80
// dat_o    (out) data output
81
// stb_i    (in)  strobe
82
// ack_o    (out) acknowledge
83
// cyc_i    (in)  cycle
84
input         stb_i,
85
              cyc_i;
86
input  [15:0] adr_i;
87
output        ack_o;
88
output [31:0] dat_o;
89
 
90
//
91
// interface to instruction rom
92
//
93
// adr_o    (out) address
94
// dat_i    (in)  data input
95
// stb_o    (out) strobe
96
// ack_i    (in) acknowledge
97
// cyc_o    (out)  cycle
98
input         ack_i;
99
input  [31:0] dat_i;
100
output        stb_o,
101
              cyc_o;
102
output [15:0] adr_o;
103
 
104
//
105
// internal bufers and wires
106
//
107
reg [15:0] adr_o;
108
reg        stb_o;
109
 
110
assign ack_o = ack_i;
111
assign dat_o = dat_i;
112
//assign stb_o = stb_i || ack_i;
113
assign cyc_o = stb_o;
114
//assign adr_o = ack_i ? adr : adr_i;
115
 
116
always @(posedge clk or posedge rst)
117
  if (rst) begin
118
    stb_o <= #1 1'b0;
119
    adr_o <= #1 16'h0000;
120
  end else if (ack_i) begin
121
    stb_o <= #1 stb_i;
122
    adr_o <= #1 adr_i;
123
  end else if (!stb_o & stb_i) begin
124
    stb_o <= #1 1'b1;
125
    adr_o <= #1 adr_i;
126
  end
127
 
128
endmodule

powered by: WebSVN 2.1.0

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