ParaNut SystemC Model
A SystemC Model of the ParaNut architecture
lfsr.h
Go to the documentation of this file.
1 /*************************************************************************
2 
3  This file is part of the ParaNut project.
4 
5  Copyright (C) 2010-2022 Gundolf Kiefer <gundolf.kiefer@hs-augsburg.de>
6  Christian H. Meyer <christian.meyer@hs-augsburg.de>
7  Hochschule Augsburg, University of Applied Sciences
8 
9  Description:
10  Basic functions to simulate a linear feedback shift register (LFSR).
11 
12  Redistribution and use in source and binary forms, with or without modification,
13  are permitted provided that the following conditions are met:
14 
15  1. Redistributions of source code must retain the above copyright notice, this
16  list of conditions and the following disclaimer.
17 
18  2. Redistributions in binary form must reproduce the above copyright notice,
19  this list of conditions and the following disclaimer in the documentation and/or
20  other materials provided with the distribution.
21 
22  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
26  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
29  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33  *************************************************************************/
34 
35 
36 #ifndef _LFSR_
37 #define _LFSR_
38 
39 #include <systemc.h>
40 
41 #define MAXLFSR 32
42 
43 template <int W>
44 sc_uint<W> GetNextLfsrState (sc_uint<W> state);
45 unsigned int GetPrimePoly (int degree, int select);
46 
47 #endif
sc_uint< W > GetNextLfsrState(sc_uint< W > state)
Definition: lfsr.cpp:304
unsigned int GetPrimePoly(int degree, int select)
Definition: lfsr.cpp:296