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

Subversion Repositories thor

[/] [thor/] [trunk/] [rtl/] [verilog/] [Thor_P.v] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 robfinch
// ============================================================================
2
//        __
3
//   \\__/ o\    (C) 2015  Robert Finch, Stratford
4
//    \  __ /    All rights reserved.
5
//     \/_//     robfinch<remove>@finitron.ca
6
//       ||
7
//
8
// This source file is free software: you can redistribute it and/or modify 
9
// it under the terms of the GNU Lesser General Public License as published 
10
// by the Free Software Foundation, either version 3 of the License, or     
11
// (at your option) any later version.                                      
12
//                                                                          
13
// This source file is distributed in the hope that it will be useful,      
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
16
// GNU General Public License for more details.                             
17
//                                                                          
18
// You should have received a copy of the GNU General Public License        
19
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
20
//
21
//
22
// Thor SuperScaler
23
// ALU
24
//
25
// ============================================================================
26
//
27
`include "Thor_defines.v"
28
 
29
module Thor_P(fn, ra, rb, rt, pregs_i, pregs_o);
30
parameter DBW=64;
31
input [5:0] fn;
32
input [5:0] ra;
33
input [5:0] rb;
34
input [5:0] rt;
35
input [DBW-1:0] pregs_i;
36
output reg [DBW-1:0] pregs_o;
37
 
38
always @*
39
begin
40
pregs_o = pregs_i;
41
case (fn)
42
`PAND:  pregs_o[rt] = pregs_i[ra] & pregs_i[rb];
43
`POR:   pregs_o[rt] = pregs_i[ra] | pregs_i[rb];
44
`PEOR:  pregs_o[rt] = pregs_i[ra] ^ pregs_i[rb];
45
`PNAND: pregs_o[rt] = ~(pregs_i[ra] & pregs_i[rb]);
46
`PNOR:  pregs_o[rt] = ~(pregs_i[ra] | pregs_i[rb]);
47
`PENOR: pregs_o[rt] = ~(pregs_i[ra] ^ pregs_i[rb]);
48
`PANDC: pregs_o[rt] = pregs_i[ra] & ~pregs_i[rb];
49
`PORC:  pregs_o[rt] = pregs_i[ra] | ~pregs_i[rb];
50
default:    pregs_o = pregs_i;
51
endcase
52
end
53
endmodule

powered by: WebSVN 2.1.0

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