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

Subversion Repositories systemc_rng

[/] [systemc_rng/] [trunk/] [rtl/] [systemc/] [rng.h] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 jcastillo
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  Random Number Generator Top Header                          ////
4
////                                                              ////
5
////  This file is part of the SystemC RNG project                ////
6
////                                                              ////
7
////  Description:                                                ////
8
////  Top file of random number generator                         ////
9
////                                                              ////
10
////  To Do:                                                      ////
11
////   - nothing                                                  ////
12
////                                                              ////
13
////  Author(s):                                                  ////
14
////      - Javier Castillo, jcastilo@opencores.org               ////
15
////                                                              ////
16
////  This core is provided by OpenSoc                            ////
17
////  http://www.opensocdesign.com                                ////
18
////                                                              ////
19
//////////////////////////////////////////////////////////////////////
20
////                                                              ////
21
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
22
////                                                              ////
23
//// This source file may be used and distributed without         ////
24
//// restriction provided that this copyright statement is not    ////
25
//// removed from the file and that any derivative work contains  ////
26
//// the original copyright notice and the associated disclaimer. ////
27
////                                                              ////
28
//// This source file is free software; you can redistribute it   ////
29
//// and/or modify it under the terms of the GNU Lesser General   ////
30
//// Public License as published by the Free Software Foundation; ////
31
//// either version 2.1 of the License, or (at your option) any   ////
32
//// later version.                                               ////
33
////                                                              ////
34
//// This source is distributed in the hope that it will be       ////
35
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
36
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
37
//// PURPOSE.  See the GNU Lesser General Public License for more ////
38
//// details.                                                     ////
39
////                                                              ////
40
//// You should have received a copy of the GNU Lesser General    ////
41
//// Public License along with this source; if not, download it   ////
42
//// from http://www.opencores.org/lgpl.shtml                     ////
43
////                                                              ////
44
//////////////////////////////////////////////////////////////////////
45
//
46
// CVS Revision History
47
//
48
// $Log: not supported by cvs2svn $
49
#include "systemc.h"
50
 
51
SC_MODULE(rng){
52
 
53
           sc_in<bool> clk;
54
           sc_in<bool> reset;
55
 
56
           sc_in<bool> loadseed_i;
57
           sc_in<sc_uint<32> > seed_i;
58
 
59
           sc_out<sc_uint<32> > number_o;
60
 
61
           sc_signal<sc_uint<43> > LFSR_reg;
62
           sc_signal<sc_uint<37> > CASR_reg;
63
 
64
           void CASR();
65
           void LFSR();
66
           void combinate();
67
 
68
           SC_CTOR(rng){
69
 
70
                   SC_METHOD(CASR);
71
                   sensitive_pos << clk;
72
                   sensitive_neg << reset;
73
 
74
                   SC_METHOD(LFSR);
75
                   sensitive_pos << clk;
76
                   sensitive_neg << reset;
77
 
78
                   SC_METHOD(combinate);
79
                   sensitive_pos << clk;
80
                   sensitive_neg << reset;
81
 
82
           }
83
   };

powered by: WebSVN 2.1.0

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