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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [beta_1.2/] [rtl/] [TOP/] [Module_BusArbitrer.v] - Blame information for rev 92

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

Line No. Rev Author Line
1 76 diegovalve
`timescale 1ns / 1ps
2
`include "aDefinitions.v"
3
/**********************************************************************************
4
Theia, Ray Cast Programable graphic Processing Unit.
5
Copyright (C) 2010  Diego Valverde (diego.valverde.g@gmail.com)
6
 
7
This program is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License
9
as published by the Free Software Foundation; either version 2
10
of the License, or (at your option) any later version.
11
 
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
GNU General Public License for more details.
16
 
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
 
21
***********************************************************************************/
22
 
23
 
24
 
25
module Module_BusArbitrer
26
(
27
input wire Clock,
28
input wire Reset,
29
 
30
input wire [`MAX_CORES-1:0] iRequest,
31
output wire [`MAX_CORES-1:0] oGrant,
32
output wire [1:0] oBusSelect
33
);
34
 
35
 
36
 
37
 
38
 
39
wire wFFMS_connect;
40
wire wIncRR_pointer;
41
wire[3:0] wCurrentMasterMask;
42
reg[3:0] wCurrentBusMaster;
43
wire wCurrentRequest;
44
 
45
//Just one requester can have the bus at a given
46
//point in time, the mask makes sure this happens
47
assign oGrant[0] = iRequest[0] & wCurrentMasterMask[0];
48
assign oGrant[1] = iRequest[1] & wCurrentMasterMask[1];
49
assign oGrant[2] = iRequest[2] & wCurrentMasterMask[2];
50
assign oGrant[3] = iRequest[3] & wCurrentMasterMask[3];
51
 
52
 
53
//When a requester relinquishes the bus (by negating its [iRequest] signal),
54
//the switch is turned to the next position
55
//So while iRequest == 1 the ciruclar list will not move
56
CIRCULAR_SHIFTLEFT_POSEDGE_EX # (4) SHL_A
57
(
58
 .Clock( Clock ),
59
 .Enable( ~wCurrentRequest ),
60
 .Reset( Reset ),
61
 .Initial(4'b1),
62
 .O( wCurrentMasterMask )
63
 
64
);
65
 
66
assign oBusSelect = wCurrentBusMaster;
67
 
68
MUXFULLPARALELL_2SEL_GENERIC # ( 1 ) MUXA
69
 (
70
 .Sel(wCurrentBusMaster[1:0]),
71
  .I1(iRequest[0]),
72
  .I2(iRequest[1]),
73
  .I3(iRequest[2]),
74
  .I4(iRequest[3]),
75
  .O1( wCurrentRequest )
76
  );
77
 
78
always @ ( * )
79
begin
80
        case (wCurrentMasterMask)
81
                4'b0001: wCurrentBusMaster <= 0;
82
                4'b0010: wCurrentBusMaster <= 1;
83
                4'b0100: wCurrentBusMaster <= 2;
84
                4'b1000: wCurrentBusMaster <= 3;
85
                default: wCurrentBusMaster <= 0;
86
        endcase
87
end
88
 
89
endmodule

powered by: WebSVN 2.1.0

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