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

Subversion Repositories 8051

[/] [8051/] [trunk/] [rtl/] [verilog/] [oc8051_wb_iinterface.v] - Blame information for rev 73

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

Line No. Rev Author Line
1 73 simont
//////////////////////////////////////////////////////////////////////
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/8051/                        ////
7
////                                                              ////
8
////  Description                                                 ////
9
////                                                              ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////    nothing                                                   ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Simon Teran, simont@opencores.org                     ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE.  See the GNU Lesser General Public License for more ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// CVS Revision History
45
//
46
// $Log: not supported by cvs2svn $
47
//
48
//
49
 
50
// synopsys translate_off
51
`include "oc8051_timescale.v"
52
// synopsys translate_on
53
 
54
 
55
module oc8051_wb_iinterface(rst, clk, adr_i, dat_o,stb_i, ack_o, cyc_i,
56
        dat_i, cyc_o, adr_o, ack_i, stb_o);
57
//
58
// rst           (in)  reset - pin
59
// clk           (in)  clock - pini
60
input rst, clk;
61
 
62
//
63
// interface to oc8051 cpu
64
//
65
// adr_i    (in)  address
66
// dat_o    (out) data output
67
// stb_i    (in)  strobe
68
// ack_o    (out) acknowledge
69
// cyc_i    (in)  cycle
70
input stb_i, cyc_i;
71
input [15:0] adr_i;
72
output ack_o;
73
output [31:0] dat_o;
74
 
75
//
76
// interface to instruction rom
77
//
78
// adr_o    (out) address
79
// dat_i    (in)  data input
80
// stb_o    (out) strobe
81
// ack_i    (in) acknowledge
82
// cyc_o    (out)  cycle
83
input ack_i;
84
input [31:0] dat_i;
85
output stb_o, cyc_o;
86
output [15:0] adr_o;
87
 
88
//
89
// internal bufers and wires
90
//
91
reg [15:0] adr;
92
reg stb;
93
 
94
assign ack_o = ack_i;
95
assign dat_o = dat_i;
96
assign stb_o = stb_i || ack_i;
97
assign cyc_o = stb_o;
98
assign adr_o = ack_i ? adr : adr_i;
99
 
100
always @(posedge clk or posedge rst)
101
  if (rst) begin
102
    stb <= #1 1'b0;
103
    adr <= #1 16'h0000;
104
  end else begin
105
    stb <= #1 stb_i;
106
    adr <= #1 adr_i;
107
  end
108
 
109
endmodule

powered by: WebSVN 2.1.0

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