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

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64/] [rtl/] [common/] [FT64_FCU_Calc.v] - Blame information for rev 43

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 43 robfinch
// ============================================================================
2
//        __
3
//   \\__/ o\    (C) 2017-2018  Robert Finch, Waterloo
4
//    \  __ /    All rights reserved.
5
//     \/_//     robfinch<remove>@finitron.ca
6
//       ||
7
//
8
// FT64_FCU_Calc.v
9
// - FT64 flow control calcs
10
//
11
// This source file is free software: you can redistribute it and/or modify 
12
// it under the terms of the GNU Lesser General Public License as published 
13
// by the Free Software Foundation, either version 3 of the License, or     
14
// (at your option) any later version.                                      
15
//                                                                          
16
// This source file is distributed in the hope that it will be useful,      
17
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
18
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
19
// GNU General Public License for more details.                             
20
//                                                                          
21
// You should have received a copy of the GNU General Public License        
22
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
23
//
24
// ============================================================================
25
//
26
`include ".\FT64_defines.vh"
27
 
28
module FT64_FCU_Calc(ol, instr, tvec, a, i, pc, im, waitctr, bus);
29
parameter WID = 64;
30
parameter AMSB = 31;
31
input [2:0] ol;
32
input [31:0] instr;
33
input [WID-1:0] tvec;
34
input [WID-1:0] a;
35
input [WID-1:0] i;
36
input [AMSB:0] pc;
37
input [2:0] im;
38
input [WID-1:0] waitctr;
39
output reg [WID-1:0] bus;
40
 
41
always @*
42
begin
43
    casez(instr[`INSTRUCTION_OP])
44
    `BRK:   bus <= {{57{1'b1}},instr[12:6]};
45
    `BBc:   case(instr[19:17])
46
                `DBNZ:  bus <=  a - 64'd1;
47
                default:        bus <= 64'hCCCCCCCCCCCCCCCC;
48
                endcase
49
    `JAL:   bus <= pc + 32'd4;
50
    `CALL:      bus <= pc + 32'd4;
51
    `RET:       bus <= a + i;
52
    `REX:
53
        case(ol)
54
        `OL_USER:   bus <= 64'hCCCCCCCCCCCCCCCC;
55
        default:    bus <= (im < ~ol) ? tvec : pc + 32'd4;
56
        endcase
57
    `WAIT:  bus = waitctr==64'd1;
58
    default:    bus <= 64'hCCCCCCCCCCCCCCCC;
59
    endcase
60
end
61
 
62
endmodule
63
 

powered by: WebSVN 2.1.0

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