Project

General

Profile

IP documentation » History » Version 30

Jean-Christophe Pellion, 28/02/2014 02:24 PM

1 10 Jean-Christophe Pellion
{{>toc}}
2 1 Jean-Christophe Pellion
3 11 Jean-Christophe Pellion
h1. IP Documentation
4 1 Jean-Christophe Pellion
5 15 Jean-Christophe Pellion
----
6
7 11 Jean-Christophe Pellion
h2. General Purpose
8 1 Jean-Christophe Pellion
9 15 Jean-Christophe Pellion
h3. Edge Detection
10 1 Jean-Christophe Pellion
11 15 Jean-Christophe Pellion
{{collapse(Edge_Detection)
12
EdgeDetection permit to detect the edge of the sin signal.
13
14
p=. !{width: 20%}edge_detection.png! 
15
16
<pre><code class="vhdl">
17
  COMPONENT lpp_edge_detection
18
    PORT (
19
      clk  : IN  STD_LOGIC;
20
      rstn : IN  STD_LOGIC;
21
      sin  : IN  STD_LOGIC;
22
      sout : OUT STD_LOGIC);
23
  END COMPONENT;
24
</code></pre>
25
26
|_.Signal      |_.Direction    |_.Size  |_.Function              |_. Active   |
27
|clk           |input          |1       |clock domain 1          |rising edge |
28
|rstn          |input          |1       |reset                   |low         |
29
|sin           |input          |1       |signal in               |            |
30
|sout          |ouput          |1       |signal out              |            |
31
32
}}
33
{{collapse(Edge_to_level)
34 20 Jean-Christophe Pellion
EdgeToLevel permit to transform the positive edge information into a level information.
35 15 Jean-Christophe Pellion
36 16 Jean-Christophe Pellion
p=. !{width: 20%}edge_to_level.png! 
37 15 Jean-Christophe Pellion
38
<pre><code class="vhdl">
39 17 Jean-Christophe Pellion
  COMPONENT lpp_edge_to_level
40 15 Jean-Christophe Pellion
    PORT (
41
      clk  : IN  STD_LOGIC;
42
      rstn : IN  STD_LOGIC;
43
      sin  : IN  STD_LOGIC;
44
      sout : OUT STD_LOGIC);
45
  END COMPONENT;
46
</code></pre>
47
48
|_.Signal      |_.Direction    |_.Size  |_.Function              |_. Active   |
49
|clk           |input          |1       |clock domain 1          |rising edge |
50
|rstn          |input          |1       |reset                   |low         |
51
|sin           |input          |1       |signal in               |            |
52
|sout          |ouput          |1       |signal out              |            |
53
54
}}
55
56 13 Jean-Christophe Pellion
h3. Synchronizer
57 8 Jean-Christophe Pellion
58
{{collapse(SYNC_FF)
59 19 Jean-Christophe Pellion
Sync_FF permit to synchronize a signal A in the clock domain clk. Normally, A signal should be the output of a FF cloked in an other domain. You shouldtn't have "logic" between the 2 domain.
60
You can configure the number FF use to synchronize (NB_FF_OF_SYNC). This number is depending of the MTBF(Mean Time Between Failure).
61 13 Jean-Christophe Pellion
62
p=. !{width: 15%}SYNC_FF.png!
63 8 Jean-Christophe Pellion
64
<pre><code class="vhdl">
65
  COMPONENT SYNC_FF_LPP_JCP
66
    GENERIC (
67
      NB_FF_OF_SYNC : INTEGER);
68
    PORT (
69
      clk    : IN  STD_LOGIC;
70
      rstn   : IN  STD_LOGIC;
71
      A      : IN  STD_LOGIC;
72
      A_sync : OUT STD_LOGIC);
73
  END COMPONENT;
74
</code></pre>
75
76
|_.Parameter   |_.Type         |_.Size  |_.Description         |_.Default   |
77 7 Jean-Christophe Pellion
|NB_FF_OF_SYNC |Integer        |        |Number of FF          |2            |
78 1 Jean-Christophe Pellion
|\5.|
79
|_.Signal      |_.Direction    |_.Size  |_.Function            |_. Active   |
80
|clk           |input          |1       |clock                 |rising edge |
81
|rstn          |input          |1       |reset                 |low         |
82 15 Jean-Christophe Pellion
|sin           |input          |1       |signal in             |            |
83
|sout          |ouput          |1       |signal synchronized   |            |
84 13 Jean-Christophe Pellion
85
}}
86
87 1 Jean-Christophe Pellion
{{collapse(SYNC_VALID_BIT)
88 14 Jean-Christophe Pellion
SYNC_VALID_BIT permit to synchronize a signal of validity from clock domain clk_in to clock domain clk_out. A validity bit is a signal set "high" only one cycle and zero others. To Synchronize this type of signal, a first stage detect the positive edge, a second synchronizes this signal, and a last transform the edge information to a validity bit.
89 19 Jean-Christophe Pellion
You can configure the FF number of the second stage (NB_FF_OF_SYNC).
90 14 Jean-Christophe Pellion
91 13 Jean-Christophe Pellion
p=. !{width: 20%}SYNC_VALID_BIT.png! 
92
93
<pre><code class="vhdl">
94
  COMPONENT SYNC_VALID_BIT_LPP_JCP
95
    GENERIC (
96
      NB_FF_OF_SYNC : INTEGER);
97
    PORT (
98
      clk_in  : IN  STD_LOGIC;
99
      clk_out : IN  STD_LOGIC;
100
      rstn    : IN  STD_LOGIC;
101
      sin     : IN  STD_LOGIC;
102
      sout    : OUT STD_LOGIC);
103
  END COMPONENT;
104
</code></pre>
105
106
|_.Parameter   |_.Type         |_.Size  |_.Description         |_.Default   |
107 1 Jean-Christophe Pellion
|NB_FF_OF_SYNC |Integer        |        |Number of FF          |2            |
108 13 Jean-Christophe Pellion
|\5.|
109 18 Jean-Christophe Pellion
|_.Signal      |_.Direction    |_.Size  |_.Function                   |_. Active   |
110
|clk_in        |input          |1       |clock domain 1               |rising edge |
111
|clk_out       |input          |1       |clock domain 1               |rising edge |
112
|rstn          |input          |1       |reset                        |low         |
113
|sin           |input          |1       |valid bit clocked in domain 1|            |
114
|sout          |output          |1      |valid bit clocked in domain 2|            |
115 2 Jean-Christophe Pellion
116
}}
117 21 Jean-Christophe Pellion
118
119
----
120
121
h2. SoC (System On Chip)
122
123
{{collapse(Leon3_Soc)
124
Leon3_SoC is an IP which integrate all the basic IP for using a Leon3 System. This System is configurable :
125
* activate the DSU, AHB uart, APB UART, IRQ manager and timer manager
126
* activate the FPU and select the type of IP using for (netlist or rtl)
127
128 23 Jean-Christophe Pellion
You can connect easily external AMBA IP. For example, if you have only one Leon3 and you want to add an AHB Master My_AHB_MST. You set NB_AHB_MASTER to 1 and connect My_AHB_MST_ahbmi signal to the input ahbi_m_ext and My_AHB_MST_ahbmo to ahbo_m_ext(1).
129 21 Jean-Christophe Pellion
130 24 Jean-Christophe Pellion
131
|_.Number            |_.NAME     |_.Enable Parameter |_.Address  |_.IRQ|
132
|\5=.AHB Master |
133
| 0 to NCPU-1        |leon3s     |                   |||
134
| NCPU+NB_AHBMASTER  |ahbuart    |ENABLE_AHB_UART    |||
135
|\5.|
136
|\5=.AHB Slave |
137
| 0                  |mctrl      |                   |0x00000000 |     |
138
| 1                  |apbctrl    |                   |0x80000000 |     |
139
| 2                  |dsu3       |ENABLE_DSU         |0x90000000 |0    |
140
|\5.|
141
|\5=.APB Slave |
142
| 0                  |mctrl      |                   |0x80000000 |     |
143
| 1                  |apbuart    |ENABLE_APB_UART    |0x80000100 |2    |
144
| 2                  |irqmp      |ENABLE_IRQMP       |0x80000200 |     |
145
| 3                  |gptimer    |ENABLE_GPT         |0x80000300 |8    |
146
| 4                  |ahbuart    |ENABLE_APB_UART    |0x80000400 |     |
147
148 28 Jean-Christophe Pellion
p=. !{width: 40%}leon3_SoC.png! 
149 25 Jean-Christophe Pellion
150 21 Jean-Christophe Pellion
<pre><code class="vhdl">
151
  COMPONENT leon3_soc_LPP_JCP
152
    GENERIC (
153
      fabtech         : INTEGER;
154
      memtech         : INTEGER;
155
      padtech         : INTEGER;
156
      clktech         : INTEGER;
157
      disas           : INTEGER;
158
      dbguart         : INTEGER;
159
      pclow           : INTEGER;
160
      clk_freq        : INTEGER;
161
      NB_CPU          : INTEGER;
162
      ENABLE_FPU      : INTEGER;
163
      FPU_NETLIST     : INTEGER;
164
      ENABLE_DSU      : INTEGER;
165
      ENABLE_AHB_UART : INTEGER;
166
      ENABLE_APB_UART : INTEGER;
167
      ENABLE_IRQMP    : INTEGER;
168
      ENABLE_GPT      : INTEGER;
169
      NB_AHB_MASTER   : INTEGER;
170
      NB_AHB_SLAVE    : INTEGER;
171
      NB_APB_SLAVE    : INTEGER);
172
    PORT (
173
      clk        : IN    STD_ULOGIC;
174
      rstn       : IN    STD_ULOGIC;
175
      errorn     : OUT   STD_ULOGIC;
176
      ahbrxd     : IN    STD_ULOGIC;
177
      ahbtxd     : OUT   STD_ULOGIC;
178
      urxd1      : IN    STD_ULOGIC;
179
      utxd1      : OUT   STD_ULOGIC;
180
      address    : OUT   STD_LOGIC_VECTOR(19 DOWNTO 0);
181
      data       : INOUT STD_LOGIC_VECTOR(31 DOWNTO 0);
182
      nSRAM_BE0  : OUT   STD_LOGIC;
183
      nSRAM_BE1  : OUT   STD_LOGIC;
184
      nSRAM_BE2  : OUT   STD_LOGIC;
185
      nSRAM_BE3  : OUT   STD_LOGIC;
186
      nSRAM_WE   : OUT   STD_LOGIC;
187
      nSRAM_CE   : OUT   STD_LOGIC;
188
      nSRAM_OE   : OUT   STD_LOGIC;
189
      apbi_ext   : OUT   apb_slv_in_type;
190
      apbo_ext   : IN    soc_apb_slv_out_vector(NB_APB_SLAVE-1+5 DOWNTO 5);
191
      ahbi_s_ext : OUT   ahb_slv_in_type;
192
      ahbo_s_ext : IN    soc_ahb_slv_out_vector(NB_AHB_SLAVE-1+3 DOWNTO 3);
193
      ahbi_m_ext : OUT   AHB_Mst_In_Type;
194
      ahbo_m_ext : IN    soc_ahb_mst_out_vector(NB_AHB_MASTER-1+NB_CPU DOWNTO NB_CPU));
195
  END COMPONENT;
196
</code></pre>
197
198
|_.Parameter     |_.Type       |_.Size  |_.Description         |_.Default   |
199
|fabtech         | INTEGER     |        |Target technologie                      |apa3e       |
200
|memtech         | INTEGER     |        |Memory Target technologie                      |apa3e       |
201
|padtech         | INTEGER     |        |Pad Target technologie                      |inferred    |
202
|clktech         | INTEGER     |        |Clock target technologie                      |inferred    |
203
|disas           | INTEGER     |        |Activate the disassembler  |0           |
204
|dbguart         | INTEGER     |        |Activate debug uart                      |0           |
205
|pclow           | INTEGER     |        |                      |2           |
206
|clk_freq        | INTEGER     |        |Clock input frequency (in kHz)                      |25000       |
207
|NB_CPU          | INTEGER     |        |Number of Leon3                      |1           |
208
|ENABLE_FPU      | INTEGER     |        |Enable the FPU                      |1           |
209
|FPU_NETLIST     | INTEGER     |        |Select the FPU Used (1=> NetList, 0=> RTL)   |1           |
210
|ENABLE_DSU      | INTEGER     |        |Enable the Debug System Unit                      |1           |
211
|ENABLE_AHB_UART | INTEGER     |        |Enable AHB UART                      |1           |
212
|ENABLE_APB_UART | INTEGER     |        |Enable APB UART                      |1           |
213
|ENABLE_IRQMP    | INTEGER     |        |Enable irq manager                      |1           |
214
|ENABLE_GPT      | INTEGER     |        |Enable the timer                      |1           |
215
|NB_AHB_MASTER   | INTEGER     |        |Number of AHB Master outside the SoC                      |0           |
216
|NB_AHB_SLAVE    | INTEGER     |        |Number of AHB Slave outside the SoC                      |0           |
217
|NB_APB_SLAVE    | INTEGER     |        |Number of APB Slave outside the SoC                      |0           |
218
|\5.|
219
|_.Signal   |_.Direction    |_.Size or Type |_.Function                   |_. Active   |
220
|clk        | input         |1              |clock                        |rising edge |
221
|rstn       | input         |1              |reset                        |low         |
222
|errorn     | output        |1              |leon 3 error signal          |            |
223
|ahbrxd     | input         |1              |AHB uart Rx Signal           |            |
224
|ahbtxd     | output        |1              |AHB uart Tx Signal           |            |
225
|urxd1      | input         |1              |APB uart Rx Signal           |            |
226
|utxd1      | output        |1              |APB uart Tx Signal           |            |
227
|address    | output        |20             |SRam  Address                |            |
228
|data       | inout         |32             |SRam Data                    |            |
229
|nSRAM_BE0  | output        |1              |SRam bankEnable  0           |            |
230
|nSRAM_BE1  | output        |1              |SRam bankEnable  1           |            |
231
|nSRAM_BE2  | output        |1              |SRam bankEnable  2           |            |
232
|nSRAM_BE3  | output        |1              |SRam bankEnable  3           |            |
233
|nSRAM_WE   | output        |1              |SRam WriteEnable             |            |
234
|nSRAM_CE   | output        |1              |SRam ChipEnable                             |            |
235
|nSRAM_OE   | output        |1              |SRam OutputEnable                             |            |
236
|apbi_ext   | output        |apb_slv_in_type|APB Slave bus input signal                             |            |
237
|apbo_ext   | input         |NB_APB_SLAVE of apb_slv_out_type|APB Slave bus output signal                            |            |
238
|ahbi_s_ext | output        |ahb_slv_in_type|AHB Slave bus input signal                              |            |
239
|ahbo_s_ext | input         |NB_AHB_SLAVE of ahb_slv_out_type |AHB Slave bus output signal                            |            |
240
|ahbi_m_ext | output        |ahb_mst_In_Type|AHB Master bus input signal                             |            |
241
|ahbo_m_ext | input         |NB_AHB_MASTER of ahb_mst_out_type|AHB Master bus output signal                              |            |
242
}}
243 22 Jean-Christophe Pellion
244 29 Jean-Christophe Pellion
245
----
246
247
h2. AMBA Peripherals
248
249 1 Jean-Christophe Pellion
250 30 Jean-Christophe Pellion
{{collapse(APB LFR Time Managment)
251
|_.VENDOR_ID |TBD   |
252
|_.DEVICE_ID |TBD   |
253
|\2.|
254
|_.APB_ADDRESS |_.Register Name   |_.Access |_.Description                               |\2.*Field*        |_.Reset Value |
255
|/2.0x00       |/2. CTRL          |/2.RW    |/2.Control register                         |0    | force_tick  |/2.0x0        |
256
                                                                                         |31-1 | Unused      |
257
|0x04          | COARSE_TIME_LOAD |RW       |CoarseTime to load after the next "tick"    |31-0 | Coarse_time |0x800000000   |
258
|0x08          | COARSE_TIME      |R       |Current CoarseTime                           |31-0 | Coarse_time |              |
259
|/2.0x0C       |/2. FINE_TIME     |/2.R    |/2.Current FineTime                          |15-0 | FineTime    |/2.        |
260
                                                                                         |31-16| Unused      |
261
<pre><code class="vhdl">
262
  COMPONENT apb_lfr_time_management_LPP_JCP IS
263
    GENERIC(
264
      pindex         : INTEGER := 0;
265
      paddr          : INTEGER := 0;
266
      pmask          : INTEGER := 16#fff#;
267
      pirq           : INTEGER := 0;
268
      nb_wait_period : INTEGER := 375
269
      );
270
    PORT (
271
      clk25MHz     : IN  STD_LOGIC;
272
      clk49_152MHz : IN  STD_LOGIC;
273
      resetn       : IN  STD_LOGIC;
274
      grspw_tick   : IN  STD_LOGIC;
275
      apbi         : IN  apb_slv_in_type;
276
      apbo         : OUT apb_slv_out_type;
277
      coarse_time  : OUT STD_LOGIC_VECTOR(31 DOWNTO 0);
278
      fine_time    : OUT STD_LOGIC_VECTOR(15 DOWNTO 0)
279
      );
280
  END COMPONENT;
281
</code></pre>
282 29 Jean-Christophe Pellion
}}
283
284 22 Jean-Christophe Pellion
----