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

Subversion Repositories wf3d

[/] [wf3d/] [trunk/] [scenario/] [3d/] [tb_instance_wb.v] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 specular
//=======================================================================
2
// Project Monophony
3
//   Wire-Frame 3D Graphics Accelerator IP Core
4
//
5
// File:
6
//  tb_instance_wb.v
7
//
8
// Abstract:
9
//   module instantiation
10
//
11
// Author:
12 9 specular
//   Kenji Ishimaru (info.info.wf3d@gmail.com)
13 2 specular
//
14
//======================================================================
15
//
16
// Copyright (c) 2015, 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
// 3D Core
43
parameter P_SEED = 'd0;
44
initial $display("P_SEED %d",P_SEED);
45
 
46
  // system
47
  reg         clk_core;
48
  reg         rst_x;
49
  wire        o_int;
50
  // register I/F
51
  reg         s_wb_stb_i;
52
  reg         s_wb_we_i;
53
  reg  [7:0]  s_wb_adr_i;
54
  reg        s_wb_ack_o;
55
  reg  [3:0]  s_wb_sel_i;
56
  reg  [31:0] s_wb_dat_i;
57
  reg [31:0] s_wb_dat_o;
58
  reg         s_wb_stb_i_d;
59
  reg         s_wb_we_i_d;
60
  reg  [7:0]  s_wb_adr_i_d;
61
  wire        s_wb_ack_o_d;
62
  reg  [3:0]  s_wb_sel_i_d;
63
  reg  [31:0] s_wb_dat_i_d;
64
  wire [31:0] s_wb_dat_o_d;
65
  // Master I/F
66
  wire        w_req_m;
67
  wire        w_wr_m;
68
  wire [31:2] w_adrs_m;
69
  wire [2:0]  w_len_m;
70
  wire        w_ack_m;
71
  wire [3:0]  w_be_m;
72
  wire [31:0] w_dbw_m;
73
  wire        w_strr_m;
74
  wire [31:0] w_dbr_m;
75
 
76
always @* begin
77
  s_wb_stb_i_d <= #1 s_wb_stb_i;
78
  s_wb_we_i_d <= #1 s_wb_we_i;
79
  s_wb_adr_i_d <= #1 s_wb_adr_i;
80
  s_wb_ack_o <= #1 s_wb_ack_o_d;
81
  s_wb_sel_i_d <= #1 s_wb_sel_i;
82
  s_wb_dat_i_d <= #1 s_wb_dat_i;
83
  s_wb_dat_o <= #1 s_wb_dat_o_d;
84
end
85
 
86
fm_3d_core u_3d_core (
87
  // system
88
  .clk_i(clk_core),
89
  .rst_i(~rst_x),
90
  .int_o(o_int),
91
  // register I/F
92
  .s_wb_stb_i(s_wb_stb_i_d),
93
  .s_wb_we_i(s_wb_we_i_d),
94
  .s_wb_adr_i(s_wb_adr_i_d[7:2]),
95
  .s_wb_ack_o(s_wb_ack_o_d),
96
  .s_wb_sel_i(s_wb_sel_i_d),
97
  .s_wb_dat_i(s_wb_dat_i_d),
98
  .s_wb_dat_o(s_wb_dat_o_d),
99
  // Master I/F
100
  .m_wb_stb_o(w_req_m),
101
  .m_wb_we_o(w_wr_m),
102
  .m_wb_adr_o(w_adrs_m),
103
  .m_wb_ack_i(w_ack_m),
104
  .m_wb_sel_o(w_be_m),
105
  .m_wb_dat_o(w_dbw_m),
106
  .m_wb_dat_i(w_dbr_m)
107
);
108
 
109
sram_slave_wb #(
110
  .P_ADRS_WIDTH(24),
111
  .P_BE_WIDTH(4),
112
  .P_DATA_WIDTH(32),
113
  .P_BLEN_WIDTH(3),
114
  .P_SEED(P_SEED)) u_sram_slave (
115
    .clk_core(clk_core),
116
    .rst_x(rst_x),
117
    .i_req(w_req_m),
118
    .i_adrs(w_adrs_m[25:2]),  // word address
119
    .i_wr(w_wr_m),
120
    .i_blen(3'd1),
121
    .o_ack(w_ack_m),
122
    .i_strw(w_req_m & w_wr_m),
123
    .i_be(w_be_m),
124
    .i_dbw(w_dbw_m),
125
    .o_ackw(),
126
    .o_strr(w_strr_m),
127
    .o_dbr(w_dbr_m)
128
 );

powered by: WebSVN 2.1.0

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