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

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64v5/] [rtl/] [twoway/] [FT64_stomp.v] - Blame information for rev 52

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 robfinch
// ============================================================================
2
//        __
3
//   \\__/ o\    (C) 2017-2018  Robert Finch, Waterloo
4
//    \  __ /    All rights reserved.
5
//     \/_//     robfinch<remove>@finitron.ca
6
//       ||
7
//
8
//      FT64_stomp.v
9
//
10
// This source file is free software: you can redistribute it and/or modify 
11
// it under the terms of the GNU Lesser General Public License as published 
12
// by the Free Software Foundation, either version 3 of the License, or     
13
// (at your option) any later version.                                      
14
//                                                                          
15
// This source file is distributed in the hope that it will be useful,      
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
18
// GNU General Public License for more details.                             
19
//                                                                          
20
// You should have received a copy of the GNU General Public License        
21
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
22
//
23
// ============================================================================
24
//
25 52 robfinch
`include "FT64_config.vh"
26 48 robfinch
 
27
module FT64_stomp(branchmiss,branchmiss_thrd,missid,head0,thrd,iqentry_v,stomp);
28 52 robfinch
parameter QENTRIES = `QENTRIES;
29 48 robfinch
input branchmiss;
30
input branchmiss_thrd;
31
input [`QBITS] missid;
32
input [`QBITS] head0;
33
input [QENTRIES-1:0] thrd;
34
input [QENTRIES-1:0] iqentry_v;
35
output reg [QENTRIES-1:0] stomp;
36
 
37
// Stomp logic for branch miss.
38
 
39
integer n;
40
reg [QENTRIES-1:0] stomp2;
41
reg [`QBITS] contid;
42
always @*
43
if (branchmiss) begin
44 52 robfinch
    stomp2 = {QENTRIES{1'b0}};
45 48 robfinch
 
46
    // If missed at the head, all queue entries but the head are stomped on.
47
    if (head0==missid) begin
48
        for (n = 0; n < QENTRIES; n = n + 1)
49
            if (n!=missid) begin
50
                        if (thrd[n]==branchmiss_thrd)
51
                        stomp2[n] = iqentry_v[n];
52
            end
53
    end
54
    // If head0 is after the missid queue entries between the missid and
55
    // head0 are stomped on.
56
    else if (head0 > missid) begin
57
        for (n = 0; n < QENTRIES; n = n + 1)
58
            if (n > missid && n < head0) begin
59
                        if (thrd[n]==branchmiss_thrd)
60
                        stomp2[n] = iqentry_v[n];
61
            end
62
    end
63
    // Otherwise still queue entries between missid and head0 are stomped on
64
    // but the range 'wraps around'.
65
    else begin
66
        for (n = 0; n < QENTRIES; n = n + 1)
67
            if (n < head0) begin
68
                        if (thrd[n]==branchmiss_thrd)
69
                        stomp2[n] = iqentry_v[n];
70
            end
71
        for (n = 0; n < QENTRIES; n = n + 1)
72
            if (n >= missid + 1) begin
73
                        if (thrd[n]==branchmiss_thrd)
74
                        stomp2[n] = iqentry_v[n];
75
            end
76
    end
77
    stomp = stomp2;
78
end
79
else begin
80
    stomp = {QENTRIES{1'b0}};
81
end
82
 
83
endmodule

powered by: WebSVN 2.1.0

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