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

Subversion Repositories raptor64

[/] [raptor64/] [trunk/] [rtl/] [verilog/] [Raptor64_logic.v] - Blame information for rev 41

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 31 robfinch
`include "Raptor64_opcodes.v"
2
`timescale 1ns / 1ps
3
//=============================================================================
4
//        __
5
//   \\__/ o\    (C) 2012  Robert Finch
6
//    \  __ /    All rights reserved.
7
//     \/_//     robfinch<remove>@opencores.org
8
//       ||
9
//  
10
//      Raptor64_logic.v
11
//  - logical datapath operations
12
//
13
//  
14
// This source file is free software: you can redistribute it and/or modify 
15
// it under the terms of the GNU Lesser General Public License as published 
16
// by the Free Software Foundation, either version 3 of the License, or     
17
// (at your option) any later version.                                      
18
//                                                                          
19
// This source file is distributed in the hope that it will be useful,      
20
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
21
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
22
// GNU General Public License for more details.                             
23
//                                                                          
24
// You should have received a copy of the GNU General Public License        
25
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
26
//                                                                          
27
//
28
//=============================================================================
29
//
30
module Raptor64_logic(xIR, a, b, imm, o);
31 41 robfinch
input [31:0] xIR;
32 31 robfinch
input [63:0] a;
33
input [63:0] b;
34
input [63:0] imm;
35
output [63:0] o;
36
reg [63:0] o;
37
 
38 41 robfinch
wire [6:0] xOpcode = xIR[31:25];
39
wire [5:0] xFunc = xIR[5:0];
40 31 robfinch
 
41
always @(xOpcode or xFunc or a or b or imm)
42
case (xOpcode)
43
`RR:
44
        case(xFunc)
45
        `AND:   o = a & b;
46
        `OR:    o = a | b;
47
        `XOR:   o = a ^ b;
48
        `ANDC:  o = a & ~b;
49
        `NAND:  o = ~(a & b);
50
        `NOR:   o = ~(a | b);
51
        `XNOR:  o = ~(a ^ b);
52
        `ORC:   o = a | ~b;
53
        default:        o = 64'd0;
54
        endcase
55
`ANDI:  o = a & imm;
56
`ORI:   o = a | imm;
57
`XORI:  o = a ^ imm;
58
default:        o = 64'd0;
59
endcase
60
 
61
endmodule

powered by: WebSVN 2.1.0

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