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

Subversion Repositories wf3d

[/] [wf3d/] [trunk/] [implement/] [rtl/] [axi_cmn/] [fm_cinterface.v] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 specular
//=======================================================================
2
// Project Monophony
3
//   Wire-Frame 3D Graphics Accelerator IP Core
4
//
5
// File:
6
//   fm_cinterface.v
7
//
8
// Abstract:
9
//   Memory Interconnect command interface
10
//
11
// Author:
12 9 specular
//   Kenji Ishimaru (info.info.wf3d@gmail.com)
13 5 specular
//
14
//======================================================================
15
//
16
// Copyright (c) 2016, Kenji Ishimaru
17
// All rights reserved.
18
//
19
// Redistribution and use in source and binary forms, with or without
20
// modification, are permitted provided that the following conditions are met:
21
//
22
//  -Redistributions of source code must retain the above copyright notice,
23
//   this list of conditions and the following disclaimer.
24
//  -Redistributions in binary form must reproduce the above copyright notice,
25
//   this list of conditions and the following disclaimer in the documentation
26
//   and/or other materials provided with the distribution.
27
//
28
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
30
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
31
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
32
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
33
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
35
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
36
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
37
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
38
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
//
40
// Revision History
41
 
42
module fm_cinterface (
43
  clk_core,
44
  rst_x,
45
  // bus side port
46
  i_bstr,
47
  i_bdata,
48
  o_back,
49
  // internal port
50
  o_istr,
51
  o_idata,
52
  i_iack
53
);
54
parameter P_WIDTH = 8;
55
 
56
////////////////////////////
57
// I/O definitions
58
////////////////////////////
59
input         i_bstr;         // input strobe
60
input  [P_WIDTH-1:0]
61
              i_bdata;        // input data
62
output        o_back;         // output acknowledge
63
 
64
output        o_istr;         // output strobe
65
output [P_WIDTH-1:0]
66
              o_idata;        // output data
67
input         i_iack;         // input acknowledge
68
 
69
input         clk_core;            // system clock
70
input         rst_x;          // system reset
71
 
72
/////////////////////////
73
//  register definition
74
/////////////////////////
75
// input register
76
reg           r_bstr;
77
reg    [P_WIDTH-1:0]
78
              r_bdata;
79
reg           r_back;
80
 
81
/////////////////////////
82
//  wire definition
83
/////////////////////////
84
wire          w_empty;
85
/////////////////////////
86
//  assign statement
87
/////////////////////////
88
assign o_istr = !w_empty;
89
assign o_back = r_back;
90
/////////////////////////
91
//  always statement
92
/////////////////////////
93
always @(posedge clk_core or negedge rst_x) begin
94
  if (~rst_x) begin
95
    r_bstr <= 1'b0;
96
  end else begin
97
    r_bstr <= i_bstr;
98
  end
99
end
100
 
101
always @(posedge clk_core or negedge rst_x) begin
102
  if (~rst_x) begin
103
    r_back <= 1'b0;
104
  end else begin
105
    r_back <= i_iack;
106
  end
107
end
108
 
109
always @(posedge clk_core) begin
110
  r_bdata <= i_bdata;
111
end
112
 
113
/////////////////////////
114
//  module instanciation
115
/////////////////////////
116
// input data fifo
117
fm_ififo #(P_WIDTH) fifo (
118
  .i_wstrobe(r_bstr),
119
  .i_dt(r_bdata),
120
  .o_full(),
121
  .i_renable(i_iack),
122
  .o_dt(o_idata),
123
  .o_empty(w_empty),
124
  .clk_core(clk_core),
125
  .rst_x(rst_x)
126
);
127
 
128
endmodule
129
 
130
 

powered by: WebSVN 2.1.0

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