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

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [vlog/] [amber25/] [a25_localparams.vh] - Blame information for rev 86

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 16 csantifort
//////////////////////////////////////////////////////////////////
2
//                                                              //
3
//  Parameters file for Amber 25 Core                           //
4
//                                                              //
5
//  This file is part of the Amber project                      //
6
//  http://www.opencores.org/project,amber                      //
7
//                                                              //
8
//  Description                                                 //
9
//  Holds general parameters that are used is several core      //
10
//  modules                                                     //
11
//                                                              //
12
//  Author(s):                                                  //
13
//      - Conor Santifort, csantifort.amber@gmail.com           //
14
//                                                              //
15
//////////////////////////////////////////////////////////////////
16
//                                                              //
17
// Copyright (C) 2011 Authors and OPENCORES.ORG                 //
18
//                                                              //
19
// This source file may be used and distributed without         //
20
// restriction provided that this copyright statement is not    //
21
// removed from the file and that any derivative work contains  //
22
// the original copyright notice and the associated disclaimer. //
23
//                                                              //
24
// This source file is free software; you can redistribute it   //
25
// and/or modify it under the terms of the GNU Lesser General   //
26
// Public License as published by the Free Software Foundation; //
27
// either version 2.1 of the License, or (at your option) any   //
28
// later version.                                               //
29
//                                                              //
30
// This source is distributed in the hope that it will be       //
31
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
32
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
33
// PURPOSE.  See the GNU Lesser General Public License for more //
34
// details.                                                     //
35
//                                                              //
36
// You should have received a copy of the GNU Lesser General    //
37
// Public License along with this source; if not, download it   //
38
// from http://www.opencores.org/lgpl.shtml                     //
39
//                                                              //
40
//////////////////////////////////////////////////////////////////
41
 
42
 
43
// Instruction Types
44
localparam [3:0]    REGOP       = 4'h0, // Data processing
45
                    MULT        = 4'h1, // Multiply
46
                    SWAP        = 4'h2, // Single Data Swap
47
                    TRANS       = 4'h3, // Single data transfer
48
                    MTRANS      = 4'h4, // Multi-word data transfer
49
                    BRANCH      = 4'h5, // Branch
50
                    CODTRANS    = 4'h6, // Co-processor data transfer
51
                    COREGOP     = 4'h7, // Co-processor data operation
52
                    CORTRANS    = 4'h8, // Co-processor register transfer
53
                    SWI         = 4'h9; // software interrupt
54
 
55
 
56
// Opcodes
57
localparam [3:0] AND = 4'h0,        // Logical AND
58
                 EOR = 4'h1,        // Logical Exclusive OR
59
                 SUB = 4'h2,        // Subtract
60
                 RSB = 4'h3,        // Reverse Subtract
61
                 ADD = 4'h4,        // Add
62
                 ADC = 4'h5,        // Add with Carry
63
                 SBC = 4'h6,        // Subtract with Carry
64
                 RSC = 4'h7,        // Reverse Subtract with Carry
65
                 TST = 4'h8,        // Test  (using AND operator)
66
                 TEQ = 4'h9,        // Test Equivalence (using EOR operator)
67
                 CMP = 4'ha,       // Compare (using Subtract operator)
68
                 CMN = 4'hb,       // Compare Negated
69
                 ORR = 4'hc,       // Logical OR
70
                 MOV = 4'hd,       // Move
71
                 BIC = 4'he,       // Bit Clear (using AND & NOT operators)
72
                 MVN = 4'hf;       // Move NOT
73
 
74
// Condition Encoding
75
localparam [3:0] EQ  = 4'h0,        // Equal            / Z set
76
                 NE  = 4'h1,        // Not equal        / Z clear
77
                 CS  = 4'h2,        // Carry set        / C set
78
                 CC  = 4'h3,        // Carry clear      / C clear
79
                 MI  = 4'h4,        // Minus            / N set
80
                 PL  = 4'h5,        // Plus             / N clear
81
                 VS  = 4'h6,        // Overflow         / V set
82
                 VC  = 4'h7,        // No overflow      / V clear
83
                 HI  = 4'h8,        // Unsigned higher  / C set and Z clear
84
                 LS  = 4'h9,        // Unsigned lower
85
                                    // or same          / C clear or Z set
86
                 GE  = 4'ha,        // Signed greater 
87
                                    // than or equal    / N == V
88
                 LT  = 4'hb,        // Signed less than / N != V
89
                 GT  = 4'hc,        // Signed greater
90
                                    // than             / Z == 0, N == V
91
                 LE  = 4'hd,        // Signed less than
92
                                    // or equal         / Z == 1, N != V
93
                 AL  = 4'he,        // Always
94
                 NV  = 4'hf;        // Never
95
 
96
// Any instruction with a condition field of 0b1111 is UNPREDICTABLE.                
97
 
98
// Shift Types
99
localparam [1:0] LSL = 2'h0,
100
                 LSR = 2'h1,
101
                 ASR = 2'h2,
102
                 RRX = 2'h3,
103
                 ROR = 2'h3;
104
 
105
// Modes
106
localparam [1:0] SVC  =  2'b11,  // Supervisor
107
                 IRQ  =  2'b10,  // Interrupt
108
                 FIRQ =  2'b01,  // Fast Interrupt
109
                 USR  =  2'b00;  // User
110
 
111
// One-Hot Mode encodings
112
localparam [5:0] OH_USR  = 0,
113
                 OH_IRQ  = 1,
114
                 OH_FIRQ = 2,
115
                 OH_SVC  = 3;
116
 
117
 

powered by: WebSVN 2.1.0

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