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

Subversion Repositories reedsolomon

[/] [reedsolomon/] [trunk/] [bluespec-source/] [GFTypes.bsv] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 abhiag
//----------------------------------------------------------------------//
2
// The MIT License
3
//
4
// Copyright (c) 2010 Abhinav Agarwal, Alfred Man Cheuk Ng
5
// Contact: abhiag@gmail.com
6
//
7
// Permission is hereby granted, free of charge, to any person
8
// obtaining a copy of this software and associated documentation
9
// files (the "Software"), to deal in the Software without
10
// restriction, including without limitation the rights to use,
11
// copy, modify, merge, publish, distribute, sublicense, and/or sell
12
// copies of the Software, and to permit persons to whom the
13
// Software is furnished to do so, subject to the following conditions:
14
//
15
// The above copyright notice and this permission notice shall be
16
// included in all copies or substantial portions of the Software.
17
//
18
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25
// OTHER DEALINGS IN THE SOFTWARE.
26
//----------------------------------------------------------------------//
27
 
28
//*************************************************************
29
// Type definitions for use in the Reed-Solomon modules
30
//-------------------------------------------------------------
31
 
32
import Vector::*;
33
 
34
typedef Bit#(8)   Byte;
35
typedef Byte      Polynomial;
36
typedef Vector#(n,Byte) Syndrome#(numeric type n);
37
 
38
typedef enum
39
{  NO_ERROR,
40
   CORRECTABLE,
41
   INCORRECTABLE
42
 } ErrInfo deriving (Bits, Eq);
43
 
44
`include "RSParameters.bsv"
45
 
46
typedef TMul#(T,2) TwoT;     // 2 * T
47
typedef TAdd#(T,2) TPlusTwo; // T + 2
48
typedef TDiv#(T,2) HalfT;    // T/2
49
 
50
// -----------------------------------------------------------
51
// The primitive polynomial defines the Galois field in which
52
// Reed-Solomon decoder operates, and all the following
53
// arithmetic operations are defined under.  Changing this
54
// value cause the whole Reed-Solomon decoder to operate
55
// under the new primitive polynomial.
56
// primitive_polynomial[i] = Coefficient of x**i for i = 0:7
57
 
58
// -----------------------------------------------------------
59
Byte    n_param = 8'd255;
60
Byte    t_param = fromInteger(valueOf(T));

powered by: WebSVN 2.1.0

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