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