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

Subversion Repositories oc54x

[/] [oc54x/] [trunk/] [rtl/] [verilog/] [oc54_alu_defines.v] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 rherveille
/////////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  OpenCores54 DSP, ALU defines                               ////
4
////                                                             ////
5
////  Author: Richard Herveille                                  ////
6
////          richard@asics.ws                                   ////
7
////          www.asics.ws                                       ////
8
////                                                             ////
9
/////////////////////////////////////////////////////////////////////
10
////                                                             ////
11
//// Copyright (C) 2002 Richard Herveille                        ////
12
////                    richard@asics.ws                         ////
13
////                                                             ////
14
//// This source file may be used and distributed without        ////
15
//// restriction provided that this copyright statement is not   ////
16
//// removed from the file and that any derivative work contains ////
17
//// the original copyright notice and the associated disclaimer.////
18
////                                                             ////
19
////     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     ////
20
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   ////
21
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   ////
22
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      ////
23
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         ////
24
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    ////
25
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   ////
26
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        ////
27
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  ////
28
//// LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  ////
29
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  ////
30
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         ////
31
//// POSSIBILITY OF SUCH DAMAGE.                                 ////
32
////                                                             ////
33
/////////////////////////////////////////////////////////////////////
34
 
35
//  CVS Log                                                                                                                  
36
//                                                                                                                                   
37
//  $Id: oc54_alu_defines.v,v 1.1.1.1 2002-04-10 09:34:40 rherveille Exp $                                                                                                                   
38
//                                                                                                                                   
39
//  $Date: 2002-04-10 09:34:40 $                                                                                                                 
40
//  $Revision: 1.1.1.1 $                                                                                                         
41
//  $Author: rherveille $                                                                                                            
42
//  $Locker:  $                                                                                                      
43
//  $State: Exp $                                                                                                                
44
//                                                                                                                                   
45
// Change History:                                                                                                   
46
//               $Log: not supported by cvs2svn $                                                                                        
47
 
48
 
49
//
50
// Encoding: bit[6] always zero
51
//           bit[5:4] instuction type
52
//           - 00: (dual) arithmetic
53
//           - 01: logical (incl. shift)
54
//           - 10: bit-test & compare
55
//           - 11: reserved
56
// Leonardo-Spectrum seems to like the additional zero bit[6] in
57
// the encoding scheme. It produces the smallest and fastest code 
58
// like this. (Why ???)
59
//
60
 
61
//
62
// arithmetic instructions
63
//
64
`define ABS      7'b000_0000
65
`define NEG      7'b000_0001
66
`define ADD      7'b000_0010
67
`define SUB      7'b000_0011
68
`define MAX      7'b000_0100
69
`define SUBC     7'b000_0101
70
 
71
//
72
// dual arithmetic instructions
73
//
74
`define DADD     7'b000_1000
75
`define DSUB     7'b000_1100
76
`define DRSUB    7'b000_1101
77
`define DSUBADD  7'b000_1110
78
`define DADDSUB  7'b000_1001
79
 
80
//
81
// logical instructions
82
//
83
`define NOT      7'b001_0000
84
`define AND      7'b001_0001
85
`define OR       7'b001_0010
86
`define XOR      7'b001_0011
87
 
88
//
89
// shift instructions
90
//
91
`define ROL      7'b001_0100
92
`define ROLTC    7'b001_0101
93
`define ROR      7'b001_0110
94
`define SHFT_CMP 7'b001_0111
95
 
96
//
97
// bit test instructions
98
//
99
`define BITF     7'b010_0000
100
`define BTST     7'b010_0001
101
`define CMP_EQ   7'b010_0100
102
`define CMP_LT   7'b010_0101
103
`define CMP_GT   7'b010_0110
104
`define CMP_NEQ  7'b010_0111
105
 
106
//
107
// condition codes for CMP-test
108
//
109
`define EQ  2'b00
110
`define LT  2'b01
111
`define GT  2'b10
112
`define NEQ 2'b11
113
 

powered by: WebSVN 2.1.0

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