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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [icarus_version/] [rtl/] [Module_HostWBM.v] - Blame information for rev 186

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

Line No. Rev Author Line
1 158 diegovalve
`timescale 1ns / 1ps
2
`include "aDefinitions.v"
3
 
4
//---------------------------------------------------------------
5
module WBMaster
6
(
7
        input wire Clock,
8
        input wire Reset,
9
        input wire iEnable,
10
        input wire iShortFlow,
11
        input wire [`WB_WIDTH-1:0]  iInitialReadAddr,
12
        input wire [`WB_WIDTH-1:0]  iWriteAddr,
13
        output wire [`WB_WIDTH-1:0] oReadAddress,
14
        input wire [`WB_WIDTH-1:0]  iReadData,
15
 
16
        output reg  STB_O,
17
        input wire   ACK_I,
18
        output wire  CYC_O,
19
        output wire [`WB_WIDTH-1:0] DAT_O,
20
        output wire [`WB_WIDTH-1:0] ADR_O,
21
        output wire oDone
22
);
23
 
24
        assign ADR_O = iWriteAddr;
25
        wire [3:0] wXYZSel_Long;
26
        wire [2:0] wXYZSel_Short;
27
 
28
        UPCOUNTER_POSEDGE # (`WB_WIDTH) WBM_O_READ_ADDRESS
29
        (
30
        .Clock(Clock),
31
        .Reset( Reset ),
32
        .Enable(iEnable & ACK_I),
33
        .Initial(iInitialReadAddr),
34
        .Q(oReadAddress)
35
        );
36
 
37
        CIRCULAR_SHIFTLEFT_POSEDGE #(4) SHL
38
        (
39
  .Clock(Clock),
40
  .Enable(ACK_I & iEnable),
41
  .Reset( Reset ),
42
  .Initial(4'b1),
43
  .O(wXYZSel_Long)
44
 
45
        );
46
        CIRCULAR_SHIFTLEFT_POSEDGE #(3) SHL2
47
        (
48
  .Clock(Clock),
49
  .Enable(ACK_I & iEnable),
50
  .Reset( Reset ),
51
  .Initial(3'b1),
52
  .O(wXYZSel_Short)
53
 
54
        );
55
 
56 174 diegovalve
        //`ifdef VERILATOR
57
                wire wDone = (iShortFlow) ? wXYZSel_Short[2] : wXYZSel_Long[3];
58
                //Adding FFD to break combinatorial loop.
59
                //Host::wShortCycle -> WBM::iShortCycle -> WBM::wDone -> Host::wWBMDone -> Host::always ->Host::oMemSelect -> Host::wShortCycle
60
                FFD_POSEDGE_SYNCRONOUS_RESET # ( 1 ) FFD_DONE
61
        (
62
              .Clock(Clock),
63
              .Reset(Reset),
64
              .Enable( 1'b1 ),
65
              .D(wDone),
66
              .Q(oDone)
67
        );
68
        //`else
69
        //      assign oDone = (iShortFlow) ? wXYZSel_Short[2] : wXYZSel_Long[3];
70
        //`endif        
71
 
72 158 diegovalve
        assign DAT_O = iReadData;
73
 
74
        assign CYC_O = iEnable;
75
 
76
        always @ (posedge Clock)
77
        begin
78
        if (iEnable )
79
                STB_O <= ~ACK_I;
80
        else
81
                STB_O <= 0;
82
        end
83
 
84
 
85
endmodule

powered by: WebSVN 2.1.0

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