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

Subversion Repositories ca_prng

[/] [ca_prng/] [trunk/] [doc/] [ca_prng_description.txt] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 joachim
#=======================================================================
2
#
3
# ca_prng_description.txt
4
# -----------------------
5
# README file for the ca_prng IP-core. The file
6
# contains a brief introduction to cellular automata based pattern
7
# generation, a description of the core and how to use the core.
8
#
9
#
10
# Author: Joachim Strömbergson
11
# Copyright (c) 2008, InformAsic AB
12
# All rights reserved.
13
#
14
# Redistribution and use in source and binary forms, with or without
15
# modification, are permitted provided that the following conditions
16
# are met:
17
#     * Redistributions of source code must retain the above copyright
18
#       notice, this list of conditions and the following disclaimer.
19
#
20
#     * Redistributions in binary form must reproduce the above
21
#       copyright notice, this list of conditions and the following
22
#       disclaimer in the documentation and/or other materials
23
#       provided with the distribution.
24
#
25
# THIS SOFTWARE IS PROVIDED BY InformAsic AB ''AS IS'' AND ANY EXPRESS
26
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28
# ARE DISCLAIMED. IN NO EVENT SHALL InformAsic AB BE LIABLE FOR ANY
29
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
#
37
#=======================================================================
38
 
39
 
40
1: Introduction
41
---------------
42 3 joachim
A cellular automata (CA) is a discrete model that consists of a grid
43
(1D, 2D, 3D ) with objects called cells. Each cell can be in one of a
44
given finite set of states (on and off, different colours etc). Each
45
cell has a set of cells in close proximity called neighbours. Given the
46
current internal state of a cell, the states of the cells in the close
47
proximity and a given set of update rules the next state of a cell can
48
be determined. For more information about cellular automata, se [1].
49 2 joachim
 
50
The ca_prng IP-core implements a 1D binary cellular automata with wrap
51
around at the edges (i.e. a ring). The update rules for a given
52
cell is based on the current state of the cell and the state of its
53
two nearest neighbours (left and right). The cell state for a given cell
54
(i), stored in the ca_state_reg register array can thus be given by
55
the state in cells (i-1), (i) and (i+1) as inputs to the update rule, se
56
figure 1.
57
 
58
                    ---------------------
59
    ca_state_reg:   |...|i-1| i |i+1|...|
60
                    ---------------------
61
                          \   |   /
62
                        (update_rule)
63
                              |
64
                    ---------------------
65
    ca_state_new:   |...|i-1| i |i+1|...|
66
                    ---------------------
67
 
68
  Figure 1: State update for a cell (i) based on neighbour cells
69
            and the update rule.
70
 
71
With a three input, binary state the update rule set consists of eight
72
possible bit updates. In total the ca_prng supports 256 update
73
rules. For different rules and possible patterns, see [2].
74
 
75
The default update rule used in the ca_prng is rule30. Rule30 is an
76 3 joachim
update rule that when applied to the CA will produce a class III,
77 2 joachim
aperiodic, chaotic behaviour. The rule was discovered by Stephen Wolfram
78
[3].
79
 
80
 
81
2: IP-core description
82
----------------------
83
The ca_prng is a CA with 32 cells, implemented as a 32 bit wide
84 3 joachim
register. Each register (cel) has separate update logic that looks at
85
the current state of the register and its two nearest neighbours (with
86
wrap around). The total state update latency for all cells is thus one
87
cycle.
88 2 joachim
 
89
The actual update of the registers is controlled by external control
90
signals that allows a user to set the register initial pattern
91
(state) and request generation of new pattern.
92
 
93
Loading of initial pattern is is accomplished by setting the
94 3 joachim
input_pattern_data port to the desired inital pattern and then
95 2 joachim
asserting the load_input_pattern port for one clock cycle.
96
 
97
Requesting a new pattern is accomplished by asserting the next_pattern
98
port.
99
 
100
After reset the ca_prng will use rule30 as the update rule. Changing the
101
rule is done by assigning the new rule to the update_rule port and then
102
asserting the load_update_rule for one clock cycle.
103
 
104
The generated pattern is available as a 32 bit value on the prng_data
105
port.
106
 
107
 
108
Figure 2 shows input and output ports of the ca_prng core.
109
 
110
 
111
                          ––––––––––-
112
    input_pattern_data   |           |
113
                -------->|           |
114
                         |           |
115
     load_init_pattern   |           |
116
                 ------->|           |  prng_data
117
                         |           |-------->
118
          next_pattern   |           |
119
                -------->|           |
120
                         |           |
121
           update_rule   |  ca_prng  |
122
                -------->|           |
123
                         |           |
124
       load_upate_rule   |           |
125
                 ------->|           |
126
                         |           |
127
                         |           |
128
                         |           |
129
                   clk   |           |
130
                -------->|           |
131
                         |           |
132
               reset_n   |           |
133
                -------->|           |
134
                         |––––––––––-|
135
 
136
  Figure 2: Input and output ports of the ca_prng core.
137
 
138
The ca_prng core is a positive edge triggered synchronous design. All
139
internal registers are equipped with a synhronous, active low reset.
140
 
141
 
142
3: IP-core delivery contents
143
----------------------------
144 3 joachim
The ca_prng core is provided as RTL source code written in Verilog 2001
145 2 joachim
compliant code. The ca_prng delivery also contains a testbench that
146
verifies the functionality. Finally the core contains a functional model
147
written in Python as well as documentation (this file).
148
 
149
The provided testbench has been used to verify the core using the
150
ModelSim as well as the Icarus Verilog simulators.
151
 
152
The ca_prng core has been implemented in FPGA tools from Altera and
153 3 joachim
Xilinx. The following table lists the area and speed achieved for the
154
ca_prng core as a stand alone core.
155 2 joachim
 
156
Altera Devices (implemented using Quartus 9.0)
157
Stratix II
158
---------
159
Device: EP2S15
160
ALUT:   106
161
Reg:    40
162
Mem:    0
163
DSP:    0
164
fmax:   300 MHz
165
 
166
Cyclone III
167
-----------
168
Device: EP3C5
169
LE:     234
170
Reg:    40
171
Mem:    0
172
Mult:   0
173
fmax:   250 MHz
174
 
175
 
176
Xilinx Devices (implemented using ISE 11.0)
177
Spartan 3A
178
----------
179
Device: xc3s50a-5
180
Slices: 93
181
Reg:    48 (replicated update_rule_reg)
182
Mem:    0
183
Mult:   0
184
fmax:   250 MHz
185
 
186
Virtex-5
187
--------
188
Device: xc5vlx30-3
189
Slices: 42
190
Reg:    40
191
Mem:    0
192
Mult:   0
193
fmax:   400 MHz
194
 
195
 
196
4: References
197
-------------
198
[1]     Wikipedia. Cellular Automaton. Web page. 2009.
199
        http://en.wikipedia.org/wiki/Cellular_automaton
200
 
201
[2]     Wolfram MathWorld. Elementary Cellular Automaton. Web
202
        page. 2009.
203
        http://mathworld.wolfram.com/ElementaryCellularAutomaton.html
204
 
205
[3]     Wikipedia. Rule 30 description. Web page. 2009.
206
        http://en.wikipedia.org/wiki/Rule_30
207
 
208
#=======================================================================
209
# EOF ca_prng_description.txt
210
#=======================================================================
211
 

powered by: WebSVN 2.1.0

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