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

Subversion Repositories oms8051mini

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

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 25 dinesha
////   v0.0 - Dinesh A, 5th Jan 2017
20
////        1. Active edge of reset changed from High to Low
21
//////////////////////////////////////////////////////////////////////
22 2 dinesha
////                                                              ////
23
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
24
////                                                              ////
25
//// This source file may be used and distributed without         ////
26
//// restriction provided that this copyright statement is not    ////
27
//// removed from the file and that any derivative work contains  ////
28
//// the original copyright notice and the associated disclaimer. ////
29
////                                                              ////
30
//// This source file is free software; you can redistribute it   ////
31
//// and/or modify it under the terms of the GNU Lesser General   ////
32
//// Public License as published by the Free Software Foundation; ////
33
//// either version 2.1 of the License, or (at your option) any   ////
34
//// later version.                                               ////
35
////                                                              ////
36
//// This source is distributed in the hope that it will be       ////
37
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
38
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
39
//// PURPOSE.  See the GNU Lesser General Public License for more ////
40
//// details.                                                     ////
41
////                                                              ////
42
//// You should have received a copy of the GNU Lesser General    ////
43
//// Public License along with this source; if not, download it   ////
44
//// from http://www.opencores.org/lgpl.shtml                     ////
45
////                                                              ////
46
//////////////////////////////////////////////////////////////////////
47
//
48
// CVS Revision History
49
//
50
// $Log: not supported by cvs2svn $
51
// Revision 1.5  2003/05/05 10:34:27  simont
52
// registering outputs.
53
//
54
// Revision 1.4  2003/04/16 10:02:45  simont
55
// fix bug (cyc_o and stb_o)
56
//
57
// Revision 1.3  2003/04/03 19:19:02  simont
58
// change adr_i and adr_o length.
59
//
60
// Revision 1.2  2003/01/13 14:14:41  simont
61
// replace some modules
62
//
63
// Revision 1.1  2002/10/28 16:42:08  simont
64
// initial import
65
//
66
//
67
//
68
 
69
 
70 25 dinesha
module oc8051_wb_iinterface(resetn, clk,
71 2 dinesha
                  adr_i, dat_o, cyc_i, stb_i, ack_o,
72
                  adr_o, dat_i, cyc_o, stb_o, ack_i
73
                  );
74
//
75 25 dinesha
// resetn           (in)  reset - pin
76 2 dinesha
// clk           (in)  clock - pini
77 25 dinesha
input resetn, clk;
78 2 dinesha
 
79
//
80
// interface to oc8051 cpu
81
//
82
// adr_i    (in)  address
83
// dat_o    (out) data output
84
// stb_i    (in)  strobe
85
// ack_o    (out) acknowledge
86
// cyc_i    (in)  cycle
87
input         stb_i,
88
              cyc_i;
89
input  [15:0] adr_i;
90
output        ack_o;
91
output [31:0] dat_o;
92
 
93
//
94
// interface to instruction rom
95
//
96
// adr_o    (out) address
97
// dat_i    (in)  data input
98
// stb_o    (out) strobe
99
// ack_i    (in) acknowledge
100
// cyc_o    (out)  cycle
101
input         ack_i;
102
input  [31:0] dat_i;
103
output        stb_o,
104
              cyc_o;
105
output [15:0] adr_o;
106
 
107
//
108
// internal bufers and wires
109
//
110
reg [15:0] adr_o;
111
reg        stb_o;
112
 
113
assign ack_o = ack_i;
114
assign dat_o = dat_i;
115
//assign stb_o = stb_i || ack_i;
116
assign cyc_o = stb_o;
117
//assign adr_o = ack_i ? adr : adr_i;
118
 
119 25 dinesha
always @(posedge clk or negedge resetn)
120
  if (resetn == 1'b0) begin
121 2 dinesha
    stb_o <= #1 1'b0;
122
    adr_o <= #1 16'h0000;
123
  end else if (ack_i) begin
124
    stb_o <= #1 stb_i;
125
    adr_o <= #1 adr_i;
126
  end else if (!stb_o & stb_i) begin
127
    stb_o <= #1 1'b1;
128
    adr_o <= #1 adr_i;
129
  end
130
 
131
endmodule

powered by: WebSVN 2.1.0

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