@@ -0,0 +1,383 | |||
|
1 | VHDLIB=../.. | |
|
2 | SCRIPTSDIR=$(VHDLIB)/scripts/ | |
|
3 | ||
|
4 | GRLIB := $(shell sh $(VHDLIB)/scripts/lpp_relpath.sh) | |
|
5 | TOP=TB | |
|
6 | ||
|
7 | CMD_VLIB=vlib | |
|
8 | CMD_VMAP=vmap | |
|
9 | CMD_VCOM=@vcom -quiet -93 -work | |
|
10 | ||
|
11 | ################## project specific targets ########################## | |
|
12 | ||
|
13 | all: | |
|
14 | @echo "make vsim" | |
|
15 | @echo "make libs" | |
|
16 | @echo "make clean" | |
|
17 | @echo "make vcom_grlib vcom_lpp vcom_tb" | |
|
18 | ||
|
19 | run: | |
|
20 | @vsim work.TB -do run.do | |
|
21 | # @vsim work.TB | |
|
22 | # @vsim lpp.lpp_lfr_ms | |
|
23 | ||
|
24 | vsim: libs vcom run | |
|
25 | ||
|
26 | libs: | |
|
27 | @$(CMD_VLIB) modelsim | |
|
28 | @$(CMD_VMAP) modelsim modelsim | |
|
29 | @$(CMD_VLIB) modelsim/techmap | |
|
30 | @$(CMD_VMAP) techmap modelsim/techmap | |
|
31 | @$(CMD_VLIB) modelsim/grlib | |
|
32 | @$(CMD_VMAP) grlib modelsim/grlib | |
|
33 | @$(CMD_VLIB) modelsim/gaisler | |
|
34 | @$(CMD_VMAP) gaisler modelsim/gaisler | |
|
35 | @$(CMD_VLIB) modelsim/work | |
|
36 | @$(CMD_VMAP) work modelsim/work | |
|
37 | @$(CMD_VLIB) modelsim/lpp | |
|
38 | @$(CMD_VMAP) lpp modelsim/lpp | |
|
39 | @echo "libs done" | |
|
40 | ||
|
41 | ||
|
42 | clean: | |
|
43 | @rm -Rf modelsim | |
|
44 | @rm -Rf modelsim.ini | |
|
45 | @rm -Rf *~ | |
|
46 | @rm -Rf transcript | |
|
47 | @rm -Rf wlft* | |
|
48 | @rm -Rf *.wlf | |
|
49 | @rm -Rf vish_stacktrace.vstf | |
|
50 | @rm -Rf libs.do | |
|
51 | ||
|
52 | vcom: vcom_grlib vcom_techmap vcom_gaisler vcom_lpp vcom_tb | |
|
53 | ||
|
54 | ||
|
55 | vcom_tb: | |
|
56 | $(CMD_VCOM) lpp lpp_memory.vhd | |
|
57 | $(CMD_VCOM) lpp lppFIFOxN.vhd | |
|
58 | $(CMD_VCOM) lpp lpp_FIFO.vhd | |
|
59 | $(CMD_VCOM) lpp spectral_matrix_package.vhd | |
|
60 | $(CMD_VCOM) lpp spectral_matrix_switch_f0.vhd | |
|
61 | $(CMD_VCOM) lpp lpp_lfr_ms.vhd | |
|
62 | $(CMD_VCOM) work TB.vhd | |
|
63 | @echo "vcom done" | |
|
64 | ||
|
65 | vcom_grlib: | |
|
66 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/stdlib/version.vhd | |
|
67 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/stdlib/config_types.vhd | |
|
68 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/stdlib/config.vhd | |
|
69 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/stdlib/stdlib.vhd | |
|
70 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/stdlib/stdio.vhd | |
|
71 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/stdlib/testlib.vhd | |
|
72 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/ftlib/mtie_ftlib.vhd | |
|
73 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/util/util.vhd | |
|
74 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/sparc/sparc.vhd | |
|
75 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/sparc/sparc_disas.vhd | |
|
76 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/sparc/cpu_disas.vhd | |
|
77 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/modgen/multlib.vhd | |
|
78 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/modgen/leaves.vhd | |
|
79 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/amba/amba.vhd | |
|
80 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/amba/devices.vhd | |
|
81 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/amba/defmst.vhd | |
|
82 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/amba/apbctrl.vhd | |
|
83 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/amba/ahbctrl.vhd | |
|
84 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/amba/dma2ahb_pkg.vhd | |
|
85 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/amba/dma2ahb.vhd | |
|
86 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/amba/ahbmst.vhd | |
|
87 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/amba/ahbmon.vhd | |
|
88 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/amba/apbmon.vhd | |
|
89 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/amba/ambamon.vhd | |
|
90 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/amba/dma2ahb_tp.vhd | |
|
91 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/amba/amba_tp.vhd | |
|
92 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/atf/at_pkg.vhd | |
|
93 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/atf/at_ahb_mst_pkg.vhd | |
|
94 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/atf/at_ahb_slv_pkg.vhd | |
|
95 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/atf/at_util.vhd | |
|
96 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/atf/at_ahb_mst.vhd | |
|
97 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/atf/at_ahb_slv.vhd | |
|
98 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/atf/at_ahbs.vhd | |
|
99 | $(CMD_VCOM) grlib $(GRLIB)/lib/grlib/atf/at_ahb_ctrl.vhd | |
|
100 | @echo "vcom grlib done" | |
|
101 | ||
|
102 | vcom_gaisler: | |
|
103 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/arith/arith.vhd | |
|
104 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/arith/mul32.vhd | |
|
105 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/arith/div32.vhd | |
|
106 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/memctrl.vhd | |
|
107 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/sdctrl.vhd | |
|
108 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/sdctrl64.vhd | |
|
109 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/sdmctrl.vhd | |
|
110 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/srctrl.vhd | |
|
111 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/ssrctrl.vhd | |
|
112 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/ftsrctrlc.vhd | |
|
113 | # # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/ftsrctrl.vhd | |
|
114 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/ftsdctrl.vhd | |
|
115 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/ftsdmctrl.vhd | |
|
116 | # # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/ftmctrlc.vhd | |
|
117 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/ftsrctrl8.vhd | |
|
118 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/ftsdmctrlx.vhd | |
|
119 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/ftmctrlcx.vhd | |
|
120 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/ftmctrl.vhd | |
|
121 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/memctrl/ftsdctrl64.vhd | |
|
122 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/grlfpu/mtie_grlfpu.vhd | |
|
123 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/grlfpc/mtie_grlfpc.vhd | |
|
124 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/grlfpcft/mtie_grlfpcft.vhd | |
|
125 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/srmmu/mmuconf# ig.vhd | |
|
126 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/srmmu/mmuiface.vhd | |
|
127 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/srmmu/libmmu.vhd | |
|
128 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/srmmu/mmutlbcam.vhd | |
|
129 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/srmmu/mmulrue.vhd | |
|
130 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/srmmu/mmulru.vhd | |
|
131 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/srmmu/mmutlb.vhd | |
|
132 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/srmmu/mmutw.vhd | |
|
133 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/srmmu/mmu.vhd | |
|
134 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3/leon3.vhd | |
|
135 | # # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3/libiu.vhd | |
|
136 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3/libcache.vhd | |
|
137 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3/tbufmem.vhd | |
|
138 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3/dsu3x.vhd | |
|
139 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3/dsu3.vhd | |
|
140 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3/dsu3_2x.vhd | |
|
141 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3/clk2xsync.vhd | |
|
142 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3/clk2xqual.vhd | |
|
143 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3/grfpushwx.vhd | |
|
144 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/libproc3.vhd | |
|
145 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/cachemem.vhd | |
|
146 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/mmu_icache.vhd | |
|
147 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/mmu_dcache.vhd | |
|
148 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/mmu_acache.vhd | |
|
149 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/mmu_cache.vhd | |
|
150 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/iu3.vhd | |
|
151 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/grfpwx.vhd | |
|
152 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/mfpwx.vhd | |
|
153 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/grlfpwx.vhd | |
|
154 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/proc3.vhd | |
|
155 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/leon3s2x.vhd | |
|
156 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/leon3s.vhd | |
|
157 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/leon3cg.vhd | |
|
158 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/grfpwxsh.vhd | |
|
159 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3v1/leon3sh.vhd | |
|
160 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/leon3ftv2/mtie_leon3ftv2.vhd | |
|
161 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/irqmp/irqmp2x.vhd | |
|
162 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/irqmp/irqmp.vhd | |
|
163 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/irqmp/irqamp.vhd | |
|
164 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/irqmp/irqamp2x.vhd | |
|
165 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/can/can.vhd | |
|
166 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/can/can_mod.vhd | |
|
167 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/can/can_oc.vhd | |
|
168 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/can/can_mc.vhd | |
|
169 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/can/canmux.vhd | |
|
170 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/can/can_rd.vhd | |
|
171 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/can/can_oc_core.vhd | |
|
172 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/can/grcan.vhd | |
|
173 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/misc.vhd | |
|
174 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/rstgen.vhd | |
|
175 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/gptimer.vhd | |
|
176 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/ahbram.vhd | |
|
177 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/ahbdpram.vhd | |
|
178 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/ahbtrace.vhd | |
|
179 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/ahbtrace_mb.vhd | |
|
180 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/ahbtrace_mmb.vhd | |
|
181 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/grgpio.vhd | |
|
182 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/ftahbram.vhd | |
|
183 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/ftahbram2.vhd | |
|
184 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/ahbstat.vhd | |
|
185 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/logan.vhd | |
|
186 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/apbps2.vhd | |
|
187 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/charrom_package.vhd | |
|
188 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/charrom.vhd | |
|
189 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/apbvga.vhd | |
|
190 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/ahb2ahb.vhd | |
|
191 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/ahbbridge.vhd | |
|
192 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/svgactrl.vhd | |
|
193 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/grfifo.vhd | |
|
194 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/gradcdac.vhd | |
|
195 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/grsysmon.vhd | |
|
196 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/gracectrl.vhd | |
|
197 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/grgpreg.vhd | |
|
198 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/ahbmst2.vhd | |
|
199 | ## $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/memscrub.vhd | |
|
200 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/ahb_mst_iface.vhd | |
|
201 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/grgprbank.vhd | |
|
202 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/grclkgate.vhd | |
|
203 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/grclkgate2x.vhd | |
|
204 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/grtimer.vhd | |
|
205 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/grpulse.vhd | |
|
206 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/grversion.vhd | |
|
207 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/misc/ahbfrom.vhd | |
|
208 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/ambatest/ahbtbp.vhd | |
|
209 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/ambatest/ahbtbm.vhd | |
|
210 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/net/net.vhd | |
|
211 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/uart/uart.vhd | |
|
212 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/uart/libdcom.vhd | |
|
213 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/uart/apbuart.vhd | |
|
214 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/uart/dcom.vhd | |
|
215 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/uart/dcom_uart.vhd | |
|
216 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/uart/ahbuart.vhd | |
|
217 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/sim/sim.vhd | |
|
218 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/sim/sram.vhd | |
|
219 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/sim/sramft.vhd | |
|
220 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/sim/sram16.vhd | |
|
221 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/sim/phy.vhd | |
|
222 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/sim/ahbrep.vhd | |
|
223 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/sim/delay_wire.vhd | |
|
224 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/sim/pwm_check.vhd | |
|
225 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/sim/ramback.vhd | |
|
226 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/sim/zbtssram.vhd | |
|
227 | $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/sim/slavecheck.vhd | |
|
228 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/jtag/jtag.vhd | |
|
229 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/jtag/libjtagcom.vhd | |
|
230 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/jtag/jtagcom.vhd | |
|
231 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/jtag/ahbjtag.vhd | |
|
232 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/jtag/ahbjtag_bsd.vhd | |
|
233 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/jtag/bscanctrl.vhd | |
|
234 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/jtag/bscanregs.vhd | |
|
235 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/jtag/bscanregsbd.vhd | |
|
236 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/jtag/jtagtst.vhd | |
|
237 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/greth/ethernet_mac.vhd | |
|
238 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/greth/greth.vhd | |
|
239 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/greth/greth_mb.vhd | |
|
240 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/greth/greth_gbit.vhd | |
|
241 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/greth/greth_gbit_mb.vhd | |
|
242 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/greth/grethm.vhd | |
|
243 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/greth/rgmii.vhd | |
|
244 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/spacewire/spacewire.vhd | |
|
245 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/spacewire/grspw.vhd | |
|
246 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/spacewire/grspw2.vhd | |
|
247 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/spacewire/grspwm.vhd | |
|
248 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/spacewire/grspw2_phy.vhd | |
|
249 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/spacewire/grspw_phy.vhd | |
|
250 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/gr1553b/gr1553b_pkg.vhd | |
|
251 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/gr1553b/gr1553b_pads.vhd | |
|
252 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/gr1553b/simtrans1553.vhd | |
|
253 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/nand/nandpkg.vhd | |
|
254 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/nand/nandfctrlx.vhd | |
|
255 | # $(CMD_VCOM) gaisler $(GRLIB)/lib/gaisler/nand/nandfctrl.vhd | |
|
256 | @echo "vcom gaisler done" | |
|
257 | ||
|
258 | vcom_techmap: | |
|
259 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/gencomp/gencomp.vhd | |
|
260 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/gencomp/netcomp.vhd | |
|
261 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/inferred/memory_inferred.vhd | |
|
262 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/inferred/tap_inferred.vhd | |
|
263 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/inferred/ddr_inferred.vhd | |
|
264 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/inferred/mul_inferred.vhd | |
|
265 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/inferred/ddr_phy_inferred.vhd | |
|
266 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/inferred/ddrphy_datapath.vhd | |
|
267 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/inferred/sim_pll.vhd | |
|
268 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/proasic3e/buffer_apa3e.vhd | |
|
269 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/proasic3e/clkgen_proasic3e.vhd | |
|
270 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/proasic3e/ddr_proasic3e.vhd | |
|
271 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/proasic3e/memory_apa3e.vhd | |
|
272 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/proasic3e/pads_apa3e.vhd | |
|
273 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/proasic3e/tap_proasic3e.vhd | |
|
274 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/allclkgen.vhd | |
|
275 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/allddr.vhd | |
|
276 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/allmem.vhd | |
|
277 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/allmul.vhd | |
|
278 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/allpads.vhd | |
|
279 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/alltap.vhd | |
|
280 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/clkgen.vhd | |
|
281 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/clkmux.vhd | |
|
282 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/clkand.vhd | |
|
283 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/ddr_ireg.vhd | |
|
284 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/ddr_oreg.vhd | |
|
285 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/ddrphy.vhd | |
|
286 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/syncram.vhd | |
|
287 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/syncram64.vhd | |
|
288 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/syncram_2p.vhd | |
|
289 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/syncram_dp.vhd | |
|
290 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/syncfifo.vhd | |
|
291 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/regfile_3p.vhd | |
|
292 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/tap.vhd | |
|
293 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/techbuf.vhd | |
|
294 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/nandtree.vhd | |
|
295 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/clkpad.vhd | |
|
296 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/clkpad_ds.vhd | |
|
297 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/inpad.vhd | |
|
298 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/inpad_ds.vhd | |
|
299 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/iodpad.vhd | |
|
300 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/iopad.vhd | |
|
301 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/iopad_ds.vhd | |
|
302 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/lvds_combo.vhd | |
|
303 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/odpad.vhd | |
|
304 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/outpad.vhd | |
|
305 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/outpad_ds.vhd | |
|
306 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/toutpad.vhd | |
|
307 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/skew_outpad.vhd | |
|
308 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/grspwc_net.vhd | |
|
309 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/grspwc2_net.vhd | |
|
310 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/grlfpw_net.vhd | |
|
311 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/grlfpw4_net.vhd | |
|
312 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/grfpw_net.vhd | |
|
313 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/grfpw4_net.vhd | |
|
314 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/leon4_net.vhd | |
|
315 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/mul_61x61.vhd | |
|
316 | $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/cpu_disas_net.vhd | |
|
317 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/ringosc.vhd | |
|
318 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/corepcif_net.vhd | |
|
319 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/pci_arb_net.vhd | |
|
320 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/grpci2_phy_net.vhd | |
|
321 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/system_monitor.vhd | |
|
322 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/grgates.vhd | |
|
323 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/inpad_ddr.vhd | |
|
324 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/outpad_ddr.vhd | |
|
325 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/iopad_ddr.vhd | |
|
326 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/syncram128bw.vhd | |
|
327 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/syncram256bw.vhd | |
|
328 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/syncram128.vhd | |
|
329 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/syncram156bw.vhd | |
|
330 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/techmult.vhd | |
|
331 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/spictrl_net.vhd | |
|
332 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/scanreg.vhd | |
|
333 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/syncrambw.vhd | |
|
334 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/syncram_2pbw.vhd | |
|
335 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/obt1553_net.vhd | |
|
336 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/sdram_phy.vhd | |
|
337 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/from.vhd | |
|
338 | # $(CMD_VCOM) techmap $(GRLIB)/lib/techmap/maps/mtie_maps.vhd | |
|
339 | @echo "vcom techmap done" | |
|
340 | ||
|
341 | vcom_lpp: | |
|
342 | $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/./lpp_amba/lpp_amba.vhd | |
|
343 | $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/./dsp/iir_filter/iir_filter.vhd | |
|
344 | $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/./dsp/iir_filter/RAM_CEL.vhd | |
|
345 | $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/./dsp/lpp_fft/fft_components.vhd | |
|
346 | $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/./dsp/lpp_fft/lpp_fft.vhd | |
|
347 | $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/./dsp/lpp_fft/CoreFFT_simu.vhd | |
|
348 | @echo "vcom lpp done" | |
|
349 | ||
|
350 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/lpp_amba/apb_devices_list.vhd | |
|
351 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/general_purpose.vhd | |
|
352 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/ADDRcntr.vhd | |
|
353 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/ALU.vhd | |
|
354 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/Adder.vhd | |
|
355 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/Clk_Divider2.vhd | |
|
356 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/Clk_divider.vhd | |
|
357 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/MAC.vhd | |
|
358 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/MAC_CONTROLER.vhd | |
|
359 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/MAC_MUX.vhd | |
|
360 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/MAC_MUX2.vhd | |
|
361 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/MAC_REG.vhd | |
|
362 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/MUX2.vhd | |
|
363 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/MUXN.vhd | |
|
364 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/Multiplier.vhd | |
|
365 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/REG.vhd | |
|
366 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/SYNC_FF.vhd | |
|
367 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/Shifter.vhd | |
|
368 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/TwoComplementer.vhd | |
|
369 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/Clock_Divider.vhd | |
|
370 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/lpp_front_to_level.vhd | |
|
371 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/lpp_front_detection.vhd | |
|
372 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/lpp_front_positive_detection.vhd | |
|
373 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/SYNC_VALID_BIT.vhd | |
|
374 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/RR_Arbiter_4.vhd | |
|
375 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/general_purpose/general_counter.vhd | |
|
376 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/lfr_time_management/lpp_lfr_time_management.vhd | |
|
377 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/lfr_time_management/apb_lfr_time_management.vhd | |
|
378 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/lfr_time_management/lfr_time_management.vhd | |
|
379 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/lfr_time_management/fine_time_counter.vhd | |
|
380 | # $(CMD_VCOM) lpp $(VHDLIB)/lib/lpp/lfr_time_management/coarse_time_counter.vhd | |
|
381 | # @echo "vcom lpp done" | |
|
382 | ||
|
383 | #include Makefile_vcom_lpp |
@@ -0,0 +1,313 | |||
|
1 | ------------------------------------------------------------------------------ | |
|
2 | -- This file is a part of the LPP VHDL IP LIBRARY | |
|
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS | |
|
4 | -- | |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
|
6 | -- it under the terms of the GNU General Public License as published by | |
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |
|
8 | -- (at your option) any later version. | |
|
9 | -- | |
|
10 | -- This program is distributed in the hope that it will be useful, | |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
|
13 | -- GNU General Public License for more details. | |
|
14 | -- | |
|
15 | -- You should have received a copy of the GNU General Public License | |
|
16 | -- along with this program; if not, write to the Free Software | |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
|
18 | ------------------------------------------------------------------------------- | |
|
19 | -- Author : Jean-christophe Pellion | |
|
20 | -- Mail : jean-christophe.pellion@lpp.polytechnique.fr | |
|
21 | ------------------------------------------------------------------------------- | |
|
22 | ||
|
23 | LIBRARY IEEE; | |
|
24 | USE IEEE.STD_LOGIC_1164.ALL; | |
|
25 | USE IEEE.NUMERIC_STD.ALL; | |
|
26 | ||
|
27 | LIBRARY lpp; | |
|
28 | USE lpp.lpp_memory.ALL; | |
|
29 | USE lpp.iir_filter.ALL; | |
|
30 | USE lpp.spectral_matrix_package.ALL; | |
|
31 | use lpp.lpp_fft.all; | |
|
32 | use lpp.fft_components.all; | |
|
33 | ||
|
34 | ENTITY TB IS | |
|
35 | ||
|
36 | ||
|
37 | END TB; | |
|
38 | ||
|
39 | ||
|
40 | ARCHITECTURE beh OF TB IS | |
|
41 | ||
|
42 | COMPONENT lpp_lfr_ms | |
|
43 | GENERIC ( | |
|
44 | Mem_use : INTEGER); | |
|
45 | PORT ( | |
|
46 | clk : IN STD_LOGIC; | |
|
47 | rstn : IN STD_LOGIC; | |
|
48 | coarse_time : IN STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
49 | fine_time : IN STD_LOGIC_VECTOR(15 DOWNTO 0); | |
|
50 | sample_f0_wen : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
51 | sample_f0_wdata : IN STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
52 | sample_f1_wen : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
53 | sample_f1_wdata : IN STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
54 | sample_f2_wen : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
55 | sample_f2_wdata : IN STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
56 | dma_addr : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
57 | dma_data : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
58 | dma_valid : OUT STD_LOGIC; | |
|
59 | dma_valid_burst : OUT STD_LOGIC; | |
|
60 | dma_ren : IN STD_LOGIC; | |
|
61 | dma_done : IN STD_LOGIC; | |
|
62 | ready_matrix_f0_0 : OUT STD_LOGIC; | |
|
63 | ready_matrix_f0_1 : OUT STD_LOGIC; | |
|
64 | ready_matrix_f1 : OUT STD_LOGIC; | |
|
65 | ready_matrix_f2 : OUT STD_LOGIC; | |
|
66 | error_anticipating_empty_fifo : OUT STD_LOGIC; | |
|
67 | error_bad_component_error : OUT STD_LOGIC; | |
|
68 | debug_reg : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
69 | status_ready_matrix_f0_0 : IN STD_LOGIC; | |
|
70 | status_ready_matrix_f0_1 : IN STD_LOGIC; | |
|
71 | status_ready_matrix_f1 : IN STD_LOGIC; | |
|
72 | status_ready_matrix_f2 : IN STD_LOGIC; | |
|
73 | status_error_anticipating_empty_fifo : IN STD_LOGIC; | |
|
74 | status_error_bad_component_error : IN STD_LOGIC; | |
|
75 | config_active_interruption_onNewMatrix : IN STD_LOGIC; | |
|
76 | config_active_interruption_onError : IN STD_LOGIC; | |
|
77 | addr_matrix_f0_0 : IN STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
78 | addr_matrix_f0_1 : IN STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
79 | addr_matrix_f1 : IN STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
80 | addr_matrix_f2 : IN STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
81 | matrix_time_f0_0 : OUT STD_LOGIC_VECTOR(47 DOWNTO 0); | |
|
82 | matrix_time_f0_1 : OUT STD_LOGIC_VECTOR(47 DOWNTO 0); | |
|
83 | matrix_time_f1 : OUT STD_LOGIC_VECTOR(47 DOWNTO 0); | |
|
84 | matrix_time_f2 : OUT STD_LOGIC_VECTOR(47 DOWNTO 0)); | |
|
85 | END COMPONENT; | |
|
86 | ||
|
87 | ----------------------------------------------------------------------------- | |
|
88 | SIGNAL clk25MHz : STD_LOGIC := '0'; | |
|
89 | SIGNAL rstn : STD_LOGIC := '0'; | |
|
90 | ||
|
91 | ----------------------------------------------------------------------------- | |
|
92 | SIGNAL coarse_time : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
93 | SIGNAL fine_time : STD_LOGIC_VECTOR(15 DOWNTO 0); | |
|
94 | SIGNAL sample_f0_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
95 | SIGNAL sample_f0_wdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
96 | SIGNAL sample_f1_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
97 | SIGNAL sample_f1_wdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
98 | SIGNAL sample_f2_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
99 | SIGNAL sample_f2_wdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
100 | SIGNAL dma_addr : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
101 | SIGNAL dma_data : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
102 | SIGNAL dma_valid : STD_LOGIC; | |
|
103 | SIGNAL dma_valid_burst : STD_LOGIC; | |
|
104 | SIGNAL dma_ren : STD_LOGIC; | |
|
105 | SIGNAL dma_done : STD_LOGIC; | |
|
106 | SIGNAL ready_matrix_f0_0 : STD_LOGIC; | |
|
107 | SIGNAL ready_matrix_f0_1 : STD_LOGIC; | |
|
108 | SIGNAL ready_matrix_f1 : STD_LOGIC; | |
|
109 | SIGNAL ready_matrix_f2 : STD_LOGIC; | |
|
110 | SIGNAL error_anticipating_empty_fifo : STD_LOGIC; | |
|
111 | SIGNAL error_bad_component_error : STD_LOGIC; | |
|
112 | SIGNAL debug_reg : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
113 | SIGNAL status_ready_matrix_f0_0 : STD_LOGIC; | |
|
114 | SIGNAL status_ready_matrix_f0_1 : STD_LOGIC; | |
|
115 | SIGNAL status_ready_matrix_f1 : STD_LOGIC; | |
|
116 | SIGNAL status_ready_matrix_f2 : STD_LOGIC; | |
|
117 | SIGNAL status_error_anticipating_empty_fifo : STD_LOGIC; | |
|
118 | SIGNAL status_error_bad_component_error : STD_LOGIC; | |
|
119 | SIGNAL config_active_interruption_onNewMatrix : STD_LOGIC; | |
|
120 | SIGNAL config_active_interruption_onError : STD_LOGIC; | |
|
121 | SIGNAL addr_matrix_f0_0 : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
122 | SIGNAL addr_matrix_f0_1 : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
123 | SIGNAL addr_matrix_f1 : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
124 | SIGNAL addr_matrix_f2 : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
125 | SIGNAL matrix_time_f0_0 : STD_LOGIC_VECTOR(47 DOWNTO 0); | |
|
126 | SIGNAL matrix_time_f0_1 : STD_LOGIC_VECTOR(47 DOWNTO 0); | |
|
127 | SIGNAL matrix_time_f1 : STD_LOGIC_VECTOR(47 DOWNTO 0); | |
|
128 | SIGNAL matrix_time_f2 : STD_LOGIC_VECTOR(47 DOWNTO 0); | |
|
129 | ||
|
130 | ----------------------------------------------------------------------------- | |
|
131 | SIGNAL clk49_152MHz : STD_LOGIC := '0'; | |
|
132 | SIGNAL sample_counter_24k : INTEGER; | |
|
133 | SIGNAL s_24576Hz : STD_LOGIC; | |
|
134 | ||
|
135 | SIGNAL s_24_sync_reg_0 : STD_LOGIC; | |
|
136 | SIGNAL s_24_sync_reg_1 : STD_LOGIC; | |
|
137 | ||
|
138 | SIGNAL s_24576Hz_sync : STD_LOGIC; | |
|
139 | ||
|
140 | SIGNAL sample_counter_f1 : INTEGER; | |
|
141 | SIGNAL sample_counter_f2 : INTEGER; | |
|
142 | -- | |
|
143 | SIGNAL sample_f0_val : STD_LOGIC; | |
|
144 | SIGNAL sample_f1_val : STD_LOGIC; | |
|
145 | SIGNAL sample_f2_val : STD_LOGIC; | |
|
146 | ||
|
147 | BEGIN -- beh | |
|
148 | ||
|
149 | clk25MHz <= NOT clk25MHz AFTER 20 ns; | |
|
150 | clk25MHz <= NOT clk25MHz AFTER 20 ns; | |
|
151 | clk49_152MHz <= NOT clk49_152MHz AFTER 10173 ps; -- 49.152/2 MHz | |
|
152 | ||
|
153 | PROCESS | |
|
154 | BEGIN -- PROCESS | |
|
155 | WAIT UNTIL clk25MHz = '1'; | |
|
156 | WAIT UNTIL clk25MHz = '1'; | |
|
157 | WAIT UNTIL clk25MHz = '1'; | |
|
158 | rstn <= '1'; | |
|
159 | WAIT UNTIL clk25MHz = '1'; | |
|
160 | ||
|
161 | ||
|
162 | WAIT FOR 100 ms; | |
|
163 | ||
|
164 | REPORT "*** END simulation ***" SEVERITY failure; | |
|
165 | WAIT; | |
|
166 | ||
|
167 | END PROCESS; | |
|
168 | ||
|
169 | ||
|
170 | ----------------------------------------------------------------------------- | |
|
171 | PROCESS (clk49_152MHz, rstn) | |
|
172 | BEGIN -- PROCESS | |
|
173 | IF rstn = '0' THEN -- asynchronous reset (active low) | |
|
174 | sample_counter_24k <= 0; | |
|
175 | s_24576Hz <= '0'; | |
|
176 | ELSIF clk49_152MHz'event AND clk49_152MHz = '1' THEN -- rising clock edge | |
|
177 | IF sample_counter_24k = 0 THEN | |
|
178 | sample_counter_24k <= 2000; | |
|
179 | s_24576Hz <= NOT s_24576Hz; | |
|
180 | ELSE | |
|
181 | sample_counter_24k <= sample_counter_24k - 1; | |
|
182 | END IF; | |
|
183 | END IF; | |
|
184 | END PROCESS; | |
|
185 | ||
|
186 | PROCESS (clk25MHz, rstn) | |
|
187 | BEGIN -- PROCESS | |
|
188 | IF rstn = '0' THEN -- asynchronous reset (active low) | |
|
189 | s_24_sync_reg_0 <= '0'; | |
|
190 | s_24_sync_reg_1 <= '0'; | |
|
191 | s_24576Hz_sync <= '0'; | |
|
192 | ELSIF clk25MHz'event AND clk25MHz = '1' THEN -- rising clock edge | |
|
193 | s_24_sync_reg_0 <= s_24576Hz; | |
|
194 | s_24_sync_reg_1 <= s_24_sync_reg_0; | |
|
195 | s_24576Hz_sync <= s_24_sync_reg_0 XOR s_24_sync_reg_1; | |
|
196 | END IF; | |
|
197 | END PROCESS; | |
|
198 | ||
|
199 | PROCESS (clk25MHz, rstn) | |
|
200 | BEGIN -- PROCESS | |
|
201 | IF rstn = '0' THEN -- asynchronous reset (active low) | |
|
202 | sample_f0_val <= '0'; | |
|
203 | sample_f1_val <= '0'; | |
|
204 | sample_f2_val <= '0'; | |
|
205 | ||
|
206 | sample_counter_f1 <= 0; | |
|
207 | sample_counter_f2 <= 0; | |
|
208 | ELSIF clk25MHz'event AND clk25MHz = '1' THEN -- rising clock edge | |
|
209 | IF s_24576Hz_sync = '1' THEN | |
|
210 | sample_f0_val <= '1'; | |
|
211 | IF sample_counter_f1 = 0 THEN | |
|
212 | sample_f1_val <= '1'; | |
|
213 | sample_counter_f1 <= 5; | |
|
214 | ELSE | |
|
215 | sample_f1_val <= '0'; | |
|
216 | sample_counter_f1 <= sample_counter_f1 -1; | |
|
217 | END IF; | |
|
218 | IF sample_counter_f2 = 0 THEN | |
|
219 | sample_f2_val <= '1'; | |
|
220 | sample_counter_f2 <= 95; | |
|
221 | ELSE | |
|
222 | sample_f2_val <= '0'; | |
|
223 | sample_counter_f2 <= sample_counter_f2 -1; | |
|
224 | END IF; | |
|
225 | ELSE | |
|
226 | sample_f0_val <= '0'; | |
|
227 | sample_f1_val <= '0'; | |
|
228 | sample_f2_val <= '0'; | |
|
229 | END IF; | |
|
230 | END IF; | |
|
231 | END PROCESS; | |
|
232 | ||
|
233 | ||
|
234 | ||
|
235 | ----------------------------------------------------------------------------- | |
|
236 | coarse_time <= (OTHERS => '0'); | |
|
237 | fine_time <= (OTHERS => '0'); | |
|
238 | ||
|
239 | sample_f0_wdata <= X"A000" & X"A111" & X"A222" & X"A333" & X"A444"; | |
|
240 | sample_f1_wdata <= X"B000" & X"B111" & X"B222" & X"B333" & X"B444"; | |
|
241 | sample_f2_wdata <= X"C000" & X"C111" & X"C222" & X"C333" & X"C444"; | |
|
242 | ||
|
243 | sample_f0_wen <= NOT(sample_f0_val) & NOT(sample_f0_val) & NOT(sample_f0_val) & NOT(sample_f0_val) & NOT(sample_f0_val); | |
|
244 | sample_f1_wen <= NOT(sample_f1_val) & NOT(sample_f1_val) & NOT(sample_f1_val) & NOT(sample_f1_val) & NOT(sample_f1_val); | |
|
245 | sample_f2_wen <= NOT(sample_f2_val) & NOT(sample_f2_val) & NOT(sample_f2_val) & NOT(sample_f2_val) & NOT(sample_f2_val); | |
|
246 | ----------------------------------------------------------------------------- | |
|
247 | ||
|
248 | lpp_lfr_ms_1: ENTITY lpp.lpp_lfr_ms | |
|
249 | GENERIC MAP ( | |
|
250 | Mem_use => use_CEL) | |
|
251 | PORT MAP ( | |
|
252 | clk => clk25MHz, | |
|
253 | rstn => rstn, | |
|
254 | -- | |
|
255 | coarse_time => coarse_time, | |
|
256 | fine_time => fine_time, | |
|
257 | -- | |
|
258 | sample_f0_wen => sample_f0_wen, | |
|
259 | sample_f0_wdata => sample_f0_wdata, | |
|
260 | sample_f1_wen => sample_f1_wen, | |
|
261 | sample_f1_wdata => sample_f1_wdata, | |
|
262 | sample_f2_wen => sample_f2_wen, | |
|
263 | sample_f2_wdata => sample_f2_wdata, | |
|
264 | -- | |
|
265 | dma_addr => dma_addr, | |
|
266 | dma_data => dma_data, | |
|
267 | dma_valid => dma_valid, | |
|
268 | dma_valid_burst => dma_valid_burst, | |
|
269 | dma_ren => dma_ren, | |
|
270 | dma_done => dma_done, | |
|
271 | ready_matrix_f0_0 => ready_matrix_f0_0, | |
|
272 | ready_matrix_f0_1 => ready_matrix_f0_1, | |
|
273 | ready_matrix_f1 => ready_matrix_f1, | |
|
274 | ready_matrix_f2 => ready_matrix_f2, | |
|
275 | error_anticipating_empty_fifo => error_anticipating_empty_fifo, | |
|
276 | error_bad_component_error => error_bad_component_error, | |
|
277 | debug_reg => debug_reg, | |
|
278 | status_ready_matrix_f0_0 => status_ready_matrix_f0_0, | |
|
279 | status_ready_matrix_f0_1 => status_ready_matrix_f0_1, | |
|
280 | status_ready_matrix_f1 => status_ready_matrix_f1, | |
|
281 | status_ready_matrix_f2 => status_ready_matrix_f2, | |
|
282 | status_error_anticipating_empty_fifo => status_error_anticipating_empty_fifo, | |
|
283 | status_error_bad_component_error => status_error_bad_component_error, | |
|
284 | config_active_interruption_onNewMatrix => config_active_interruption_onNewMatrix, | |
|
285 | config_active_interruption_onError => config_active_interruption_onError, | |
|
286 | addr_matrix_f0_0 => addr_matrix_f0_0, | |
|
287 | addr_matrix_f0_1 => addr_matrix_f0_1, | |
|
288 | addr_matrix_f1 => addr_matrix_f1, | |
|
289 | addr_matrix_f2 => addr_matrix_f2, | |
|
290 | matrix_time_f0_0 => matrix_time_f0_0, | |
|
291 | matrix_time_f0_1 => matrix_time_f0_1, | |
|
292 | matrix_time_f1 => matrix_time_f1, | |
|
293 | matrix_time_f2 => matrix_time_f2); | |
|
294 | ||
|
295 | dma_ren <= '0'; | |
|
296 | dma_done <= '0'; | |
|
297 | ||
|
298 | status_ready_matrix_f0_0 <= '0'; | |
|
299 | status_ready_matrix_f0_1 <= '0'; | |
|
300 | status_ready_matrix_f1 <= '0'; | |
|
301 | status_ready_matrix_f2 <= '0'; | |
|
302 | status_error_anticipating_empty_fifo <= '0'; | |
|
303 | status_error_bad_component_error <= '0'; | |
|
304 | ||
|
305 | config_active_interruption_onNewMatrix <= '0'; | |
|
306 | config_active_interruption_onError <= '0'; | |
|
307 | addr_matrix_f0_0 <= (OTHERS => '0'); | |
|
308 | addr_matrix_f0_1 <= (OTHERS => '0'); | |
|
309 | addr_matrix_f1 <= (OTHERS => '0'); | |
|
310 | addr_matrix_f2 <= (OTHERS => '0'); | |
|
311 | ||
|
312 | END beh; | |
|
313 |
@@ -0,0 +1,70 | |||
|
1 | ------------------------------------------------------------------------------ | |
|
2 | -- This file is a part of the LPP VHDL IP LIBRARY | |
|
3 | -- Copyright (C) 2009 - 2012, Laboratory of Plasmas Physic - CNRS | |
|
4 | -- | |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
|
6 | -- it under the terms of the GNU General Public License as published by | |
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |
|
8 | -- (at your option) any later version. | |
|
9 | -- | |
|
10 | -- This program is distributed in the hope that it will be useful, | |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
|
13 | -- GNU General Public License for more details. | |
|
14 | -- | |
|
15 | -- You should have received a copy of the GNU General Public License | |
|
16 | -- along with this program; if not, write to the Free Software | |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
|
18 | ------------------------------------------------------------------------------ | |
|
19 | -- Author : Martin Morlot | |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |
|
21 | ------------------------------------------------------------------------------ | |
|
22 | library IEEE; | |
|
23 | use IEEE.std_logic_1164.all; | |
|
24 | use IEEE.numeric_std.all; | |
|
25 | library lpp; | |
|
26 | use lpp.lpp_memory.all; | |
|
27 | use lpp.iir_filter.all; | |
|
28 | library techmap; | |
|
29 | use techmap.gencomp.all; | |
|
30 | ||
|
31 | entity lppFIFOxN is | |
|
32 | generic( | |
|
33 | tech : integer := 0; | |
|
34 | Mem_use : integer := use_RAM; | |
|
35 | Data_sz : integer range 1 to 32 := 8; | |
|
36 | Addr_sz : integer range 2 to 12 := 8; | |
|
37 | FifoCnt : integer := 1; | |
|
38 | Enable_ReUse : std_logic := '0' | |
|
39 | ); | |
|
40 | port( | |
|
41 | rstn : in std_logic; | |
|
42 | wclk : in std_logic; | |
|
43 | rclk : in std_logic; | |
|
44 | ReUse : in std_logic_vector(FifoCnt-1 downto 0); | |
|
45 | wen : in std_logic_vector(FifoCnt-1 downto 0); | |
|
46 | ren : in std_logic_vector(FifoCnt-1 downto 0); | |
|
47 | wdata : in std_logic_vector((FifoCnt*Data_sz)-1 downto 0); | |
|
48 | rdata : out std_logic_vector((FifoCnt*Data_sz)-1 downto 0); | |
|
49 | full : out std_logic_vector(FifoCnt-1 downto 0); | |
|
50 | almost_full : out std_logic_vector(FifoCnt-1 downto 0); -- TODO | |
|
51 | empty : out std_logic_vector(FifoCnt-1 downto 0) | |
|
52 | ); | |
|
53 | end entity; | |
|
54 | ||
|
55 | ||
|
56 | architecture ar_lppFIFOxN of lppFIFOxN is | |
|
57 | ||
|
58 | begin | |
|
59 | ||
|
60 | fifos: for i in 0 to FifoCnt-1 generate | |
|
61 | FIFO0 : lpp_fifo | |
|
62 | generic map (tech,Mem_use,Enable_ReUse,Data_sz,Addr_sz) | |
|
63 | port map(rstn,ReUse(i), | |
|
64 | rclk, | |
|
65 | ren(i),rdata((i+1)*Data_sz-1 downto i*Data_sz),empty(i),open, | |
|
66 | wclk, | |
|
67 | wen(i),wdata((i+1)*Data_sz-1 downto i*Data_sz),full(i),almost_full(i),open); | |
|
68 | end generate; | |
|
69 | ||
|
70 | end architecture; |
@@ -0,0 +1,188 | |||
|
1 | ------------------------------------------------------------------------------ | |
|
2 | -- This file is a part of the LPP VHDL IP LIBRARY | |
|
3 | -- Copyright (C) 2009 - 2012, Laboratory of Plasmas Physic - CNRS | |
|
4 | -- | |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
|
6 | -- it under the terms of the GNU General Public License as published by | |
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |
|
8 | -- (at your option) any later version. | |
|
9 | -- | |
|
10 | -- This program is distributed in the hope that it will be useful, | |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
|
13 | -- GNU General Public License for more details. | |
|
14 | -- | |
|
15 | -- You should have received a copy of the GNU General Public License | |
|
16 | -- along with this program; if not, write to the Free Software | |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
|
18 | ------------------------------------------------------------------------------ | |
|
19 | -- Author : Martin Morlot | |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |
|
21 | ------------------------------------------------------------------------------ | |
|
22 | LIBRARY IEEE; | |
|
23 | USE IEEE.std_logic_1164.ALL; | |
|
24 | USE IEEE.numeric_std.ALL; | |
|
25 | LIBRARY lpp; | |
|
26 | USE lpp.lpp_memory.ALL; | |
|
27 | USE lpp.iir_filter.ALL; | |
|
28 | LIBRARY techmap; | |
|
29 | USE techmap.gencomp.ALL; | |
|
30 | ||
|
31 | ENTITY lpp_fifo IS | |
|
32 | GENERIC( | |
|
33 | tech : INTEGER := 0; | |
|
34 | Mem_use : INTEGER := use_RAM; | |
|
35 | Enable_ReUse : STD_LOGIC := '0'; | |
|
36 | DataSz : INTEGER RANGE 1 TO 32 := 8; | |
|
37 | AddrSz : INTEGER RANGE 2 TO 12 := 8 | |
|
38 | ); | |
|
39 | PORT( | |
|
40 | rstn : IN STD_LOGIC; | |
|
41 | ReUse : IN STD_LOGIC; | |
|
42 | rclk : IN STD_LOGIC; | |
|
43 | ren : IN STD_LOGIC; | |
|
44 | rdata : OUT STD_LOGIC_VECTOR(DataSz-1 DOWNTO 0); | |
|
45 | empty : OUT STD_LOGIC; | |
|
46 | raddr : OUT STD_LOGIC_VECTOR(AddrSz-1 DOWNTO 0); | |
|
47 | wclk : IN STD_LOGIC; | |
|
48 | wen : IN STD_LOGIC; | |
|
49 | wdata : IN STD_LOGIC_VECTOR(DataSz-1 DOWNTO 0); | |
|
50 | full : OUT STD_LOGIC; | |
|
51 | almost_full : OUT STD_LOGIC; -- TODO | |
|
52 | waddr : OUT STD_LOGIC_VECTOR(AddrSz-1 DOWNTO 0) | |
|
53 | ); | |
|
54 | END ENTITY; | |
|
55 | ||
|
56 | ||
|
57 | ARCHITECTURE ar_lpp_fifo OF lpp_fifo IS | |
|
58 | ||
|
59 | SIGNAL sFull : STD_LOGIC; | |
|
60 | SIGNAL sFull_s : STD_LOGIC; | |
|
61 | SIGNAL sEmpty_s : STD_LOGIC; | |
|
62 | ||
|
63 | SIGNAL sEmpty : STD_LOGIC; | |
|
64 | SIGNAL sREN : STD_LOGIC; | |
|
65 | SIGNAL sWEN : STD_LOGIC; | |
|
66 | SIGNAL sRE : STD_LOGIC; | |
|
67 | SIGNAL sWE : STD_LOGIC; | |
|
68 | ||
|
69 | SIGNAL Waddr_vect : STD_LOGIC_VECTOR(AddrSz-1 DOWNTO 0) := (OTHERS => '0'); | |
|
70 | SIGNAL Raddr_vect : STD_LOGIC_VECTOR(AddrSz-1 DOWNTO 0) := (OTHERS => '0'); | |
|
71 | SIGNAL Waddr_vect_s : STD_LOGIC_VECTOR(AddrSz-1 DOWNTO 0) := (OTHERS => '0'); | |
|
72 | SIGNAL Raddr_vect_s : STD_LOGIC_VECTOR(AddrSz-1 DOWNTO 0) := (OTHERS => '0'); | |
|
73 | ||
|
74 | SIGNAL almost_full_s : STD_LOGIC; | |
|
75 | SIGNAL almost_full_r : STD_LOGIC; | |
|
76 | BEGIN | |
|
77 | ||
|
78 | --================================================================================== | |
|
79 | -- /!\ syncram_2p Write et Read actif a l'�tat haut /!\ | |
|
80 | -- A l'inverse de RAM_CEL !!! | |
|
81 | --================================================================================== | |
|
82 | memRAM : IF Mem_use = use_RAM GENERATE | |
|
83 | SRAM : syncram_2p | |
|
84 | GENERIC MAP(tech, AddrSz, DataSz) | |
|
85 | PORT MAP(RCLK, sRE, Raddr_vect, rdata, WCLK, sWE, Waddr_vect, wdata); | |
|
86 | END GENERATE; | |
|
87 | --================================================================================== | |
|
88 | memCEL : IF Mem_use = use_CEL GENERATE | |
|
89 | CRAM : RAM_CEL | |
|
90 | GENERIC MAP(DataSz, AddrSz) | |
|
91 | PORT MAP(wdata, rdata, sWEN, sREN, Waddr_vect, Raddr_vect, WCLK, rstn); | |
|
92 | END GENERATE; | |
|
93 | --================================================================================== | |
|
94 | ||
|
95 | --============================= | |
|
96 | -- Read section | |
|
97 | --============================= | |
|
98 | sREN <= REN OR sEmpty; | |
|
99 | sRE <= NOT sREN; | |
|
100 | ||
|
101 | sEmpty_s <= '0' WHEN ReUse = '1' AND Enable_ReUse = '1' else | |
|
102 | '1' WHEN sEmpty = '1' AND Wen = '1' ELSE | |
|
103 | '1' WHEN sEmpty = '0' AND (Wen = '1' AND Ren = '0' AND Raddr_vect_s = Waddr_vect) ELSE | |
|
104 | '0'; | |
|
105 | ||
|
106 | Raddr_vect_s <= STD_LOGIC_VECTOR(UNSIGNED(Raddr_vect) +1); | |
|
107 | ||
|
108 | PROCESS (rclk, rstn) | |
|
109 | BEGIN | |
|
110 | IF(rstn = '0')then | |
|
111 | Raddr_vect <= (OTHERS => '0'); | |
|
112 | sempty <= '1'; | |
|
113 | ELSIF(rclk'EVENT AND rclk = '1')then | |
|
114 | sEmpty <= sempty_s; | |
|
115 | ||
|
116 | IF(sREN = '0' and sempty = '0')then | |
|
117 | Raddr_vect <= Raddr_vect_s; | |
|
118 | END IF; | |
|
119 | ||
|
120 | END IF; | |
|
121 | END PROCESS; | |
|
122 | ||
|
123 | --============================= | |
|
124 | -- Write section | |
|
125 | --============================= | |
|
126 | sWEN <= WEN OR sFull; | |
|
127 | sWE <= NOT sWEN; | |
|
128 | ||
|
129 | sFull_s <= '1' WHEN ReUse = '1' AND Enable_ReUse = '1' else | |
|
130 | '1' WHEN Waddr_vect_s = Raddr_vect AND REN = '1' AND WEN = '0' ELSE | |
|
131 | '1' WHEN sFull = '1' AND REN = '1' ELSE | |
|
132 | '0'; | |
|
133 | ||
|
134 | almost_full_s <= '1' WHEN STD_LOGIC_VECTOR(UNSIGNED(Waddr_vect) +2) = Raddr_vect AND REN = '1' AND WEN = '0' ELSE | |
|
135 | '1' WHEN almost_full_r = '1' AND WEN = REN ELSE | |
|
136 | '0'; | |
|
137 | ||
|
138 | Waddr_vect_s <= STD_LOGIC_VECTOR(UNSIGNED(Waddr_vect) +1); | |
|
139 | ||
|
140 | PROCESS (wclk, rstn) | |
|
141 | BEGIN | |
|
142 | IF(rstn = '0')then | |
|
143 | Waddr_vect <= (OTHERS => '0'); | |
|
144 | sfull <= '0'; | |
|
145 | almost_full_r <= '0'; | |
|
146 | ELSIF(wclk'EVENT AND wclk = '1')then | |
|
147 | sfull <= sfull_s; | |
|
148 | almost_full_r <= almost_full_s; | |
|
149 | ||
|
150 | IF(sWEN = '0' and sfull = '0')THEN | |
|
151 | Waddr_vect <= Waddr_vect_s; | |
|
152 | END IF; | |
|
153 | ||
|
154 | END IF; | |
|
155 | END PROCESS; | |
|
156 | ||
|
157 | almost_full <= almost_full_s; | |
|
158 | full <= sFull_s; | |
|
159 | empty <= sEmpty_s; | |
|
160 | waddr <= Waddr_vect; | |
|
161 | raddr <= Raddr_vect; | |
|
162 | ||
|
163 | END ARCHITECTURE; | |
|
164 | ||
|
165 | ||
|
166 | ||
|
167 | ||
|
168 | ||
|
169 | ||
|
170 | ||
|
171 | ||
|
172 | ||
|
173 | ||
|
174 | ||
|
175 | ||
|
176 | ||
|
177 | ||
|
178 | ||
|
179 | ||
|
180 | ||
|
181 | ||
|
182 | ||
|
183 | ||
|
184 | ||
|
185 | ||
|
186 | ||
|
187 | ||
|
188 |
This diff has been collapsed as it changes many lines, (527 lines changed) Show them Hide them | |||
@@ -0,0 +1,527 | |||
|
1 | LIBRARY ieee; | |
|
2 | USE ieee.std_logic_1164.ALL; | |
|
3 | ||
|
4 | ||
|
5 | LIBRARY lpp; | |
|
6 | USE lpp.lpp_memory.ALL; | |
|
7 | USE lpp.iir_filter.ALL; | |
|
8 | USE lpp.spectral_matrix_package.ALL; | |
|
9 | ||
|
10 | use lpp.lpp_fft.all; | |
|
11 | use lpp.fft_components.all; | |
|
12 | ||
|
13 | ENTITY lpp_lfr_ms IS | |
|
14 | GENERIC ( | |
|
15 | Mem_use : INTEGER := use_RAM | |
|
16 | ); | |
|
17 | PORT ( | |
|
18 | clk : IN STD_LOGIC; | |
|
19 | rstn : IN STD_LOGIC; | |
|
20 | ||
|
21 | --------------------------------------------------------------------------- | |
|
22 | -- DATA INPUT | |
|
23 | --------------------------------------------------------------------------- | |
|
24 | -- TIME | |
|
25 | coarse_time : IN STD_LOGIC_VECTOR(31 DOWNTO 0); -- todo | |
|
26 | fine_time : IN STD_LOGIC_VECTOR(15 DOWNTO 0); -- todo | |
|
27 | -- | |
|
28 | sample_f0_wen : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
29 | sample_f0_wdata : IN STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
30 | -- | |
|
31 | sample_f1_wen : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
32 | sample_f1_wdata : IN STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
33 | -- | |
|
34 | sample_f2_wen : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
35 | sample_f2_wdata : IN STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
36 | ||
|
37 | --------------------------------------------------------------------------- | |
|
38 | -- DMA | |
|
39 | --------------------------------------------------------------------------- | |
|
40 | dma_addr : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
41 | dma_data : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
42 | dma_valid : OUT STD_LOGIC; | |
|
43 | dma_valid_burst : OUT STD_LOGIC; | |
|
44 | dma_ren : IN STD_LOGIC; | |
|
45 | dma_done : IN STD_LOGIC; | |
|
46 | ||
|
47 | -- Reg out | |
|
48 | ready_matrix_f0_0 : OUT STD_LOGIC; | |
|
49 | ready_matrix_f0_1 : OUT STD_LOGIC; | |
|
50 | ready_matrix_f1 : OUT STD_LOGIC; | |
|
51 | ready_matrix_f2 : OUT STD_LOGIC; | |
|
52 | error_anticipating_empty_fifo : OUT STD_LOGIC; | |
|
53 | error_bad_component_error : OUT STD_LOGIC; | |
|
54 | debug_reg : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
55 | ||
|
56 | -- Reg In | |
|
57 | status_ready_matrix_f0_0 : IN STD_LOGIC; | |
|
58 | status_ready_matrix_f0_1 : IN STD_LOGIC; | |
|
59 | status_ready_matrix_f1 : IN STD_LOGIC; | |
|
60 | status_ready_matrix_f2 : IN STD_LOGIC; | |
|
61 | status_error_anticipating_empty_fifo : IN STD_LOGIC; | |
|
62 | status_error_bad_component_error : IN STD_LOGIC; | |
|
63 | ||
|
64 | config_active_interruption_onNewMatrix : IN STD_LOGIC; | |
|
65 | config_active_interruption_onError : IN STD_LOGIC; | |
|
66 | addr_matrix_f0_0 : IN STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
67 | addr_matrix_f0_1 : IN STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
68 | addr_matrix_f1 : IN STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
69 | addr_matrix_f2 : IN STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
70 | ||
|
71 | matrix_time_f0_0 : OUT STD_LOGIC_VECTOR(47 DOWNTO 0); | |
|
72 | matrix_time_f0_1 : OUT STD_LOGIC_VECTOR(47 DOWNTO 0); | |
|
73 | matrix_time_f1 : OUT STD_LOGIC_VECTOR(47 DOWNTO 0); | |
|
74 | matrix_time_f2 : OUT STD_LOGIC_VECTOR(47 DOWNTO 0) | |
|
75 | ||
|
76 | ); | |
|
77 | END; | |
|
78 | ||
|
79 | ARCHITECTURE Behavioral OF lpp_lfr_ms IS | |
|
80 | ||
|
81 | SIGNAL sample_f0_A_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
82 | SIGNAL sample_f0_A_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
83 | SIGNAL sample_f0_A_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
84 | SIGNAL sample_f0_A_full : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
85 | SIGNAL sample_f0_A_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
86 | ||
|
87 | SIGNAL sample_f0_B_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
88 | SIGNAL sample_f0_B_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
89 | SIGNAL sample_f0_B_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
90 | SIGNAL sample_f0_B_full : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
91 | SIGNAL sample_f0_B_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
92 | ||
|
93 | SIGNAL sample_f1_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
94 | SIGNAL sample_f1_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
95 | SIGNAL sample_f1_full : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
96 | SIGNAL sample_f1_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
97 | ||
|
98 | SIGNAL sample_f1_almost_full : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
99 | ||
|
100 | SIGNAL sample_f2_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
101 | SIGNAL sample_f2_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
102 | SIGNAL sample_f2_full : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
103 | SIGNAL sample_f2_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
104 | ||
|
105 | SIGNAL error_wen_f0 : STD_LOGIC; | |
|
106 | SIGNAL error_wen_f1 : STD_LOGIC; | |
|
107 | SIGNAL error_wen_f2 : STD_LOGIC; | |
|
108 | ||
|
109 | SIGNAL one_sample_f1_full : STD_LOGIC; | |
|
110 | SIGNAL one_sample_f1_wen : STD_LOGIC; | |
|
111 | SIGNAL one_sample_f2_full : STD_LOGIC; | |
|
112 | SIGNAL one_sample_f2_wen : STD_LOGIC; | |
|
113 | ||
|
114 | ----------------------------------------------------------------------------- | |
|
115 | -- FSM / SWITCH SELECT CHANNEL | |
|
116 | ----------------------------------------------------------------------------- | |
|
117 | TYPE fsm_select_channel IS (IDLE, SWITCH_F0_A, SWITCH_F0_B, SWITCH_F1, SWITCH_F2); | |
|
118 | SIGNAL state_fsm_select_channel : fsm_select_channel; | |
|
119 | ||
|
120 | SIGNAL sample_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
|
121 | SIGNAL sample_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
122 | SIGNAL sample_full : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
123 | SIGNAL sample_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
124 | ||
|
125 | ----------------------------------------------------------------------------- | |
|
126 | -- FSM LOAD FFT | |
|
127 | ----------------------------------------------------------------------------- | |
|
128 | TYPE fsm_load_FFT IS (IDLE, FIFO_1, FIFO_2, FIFO_3, FIFO_4, FIFO_5, FIFO_transition); | |
|
129 | SIGNAL state_fsm_load_FFT : fsm_load_FFT; | |
|
130 | SIGNAL next_state_fsm_load_FFT : fsm_load_FFT; | |
|
131 | ||
|
132 | SIGNAL sample_ren_s : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
133 | SIGNAL sample_load : STD_LOGIC; | |
|
134 | SIGNAL sample_valid : STD_LOGIC; | |
|
135 | SIGNAL sample_valid_r : STD_LOGIC; | |
|
136 | SIGNAL sample_data : STD_LOGIC_VECTOR(15 DOWNTO 0); | |
|
137 | ||
|
138 | ||
|
139 | ----------------------------------------------------------------------------- | |
|
140 | -- FFT | |
|
141 | ----------------------------------------------------------------------------- | |
|
142 | SIGNAL fft_read : STD_LOGIC; | |
|
143 | SIGNAL fft_pong : STD_LOGIC; | |
|
144 | SIGNAL fft_data_im : STD_LOGIC_VECTOR(15 DOWNTO 0); | |
|
145 | SIGNAL fft_data_re : STD_LOGIC_VECTOR(15 DOWNTO 0); | |
|
146 | SIGNAL fft_data_valid : STD_LOGIC; | |
|
147 | SIGNAL fft_ready : STD_LOGIC; | |
|
148 | ||
|
149 | BEGIN | |
|
150 | ||
|
151 | switch_f0_inst : spectral_matrix_switch_f0 | |
|
152 | PORT MAP ( | |
|
153 | clk => clk, | |
|
154 | rstn => rstn, | |
|
155 | ||
|
156 | sample_wen => sample_f0_wen, | |
|
157 | ||
|
158 | fifo_A_empty => sample_f0_A_empty, | |
|
159 | fifo_A_full => sample_f0_A_full, | |
|
160 | fifo_A_wen => sample_f0_A_wen, | |
|
161 | ||
|
162 | fifo_B_empty => sample_f0_B_empty, | |
|
163 | fifo_B_full => sample_f0_B_full, | |
|
164 | fifo_B_wen => sample_f0_B_wen, | |
|
165 | ||
|
166 | error_wen => error_wen_f0); -- TODO | |
|
167 | ||
|
168 | ----------------------------------------------------------------------------- | |
|
169 | -- FIFO IN | |
|
170 | ----------------------------------------------------------------------------- | |
|
171 | lppFIFOxN_f0_a : lppFIFOxN | |
|
172 | GENERIC MAP ( | |
|
173 | tech => 0, | |
|
174 | Mem_use => Mem_use, | |
|
175 | Data_sz => 16, | |
|
176 | Addr_sz => 8, | |
|
177 | FifoCnt => 5, | |
|
178 | Enable_ReUse => '0') | |
|
179 | PORT MAP ( | |
|
180 | rstn => rstn, | |
|
181 | wclk => clk, | |
|
182 | rclk => clk, | |
|
183 | ReUse => (OTHERS => '0'), | |
|
184 | ||
|
185 | wen => sample_f0_A_wen, -- IN in | |
|
186 | ren => sample_f0_A_ren, -- OUT in | |
|
187 | wdata => sample_f0_wdata, -- IN in | |
|
188 | rdata => sample_f0_A_rdata, -- OUT in | |
|
189 | full => sample_f0_A_full, -- IN out | |
|
190 | almost_full => OPEN, -- IN out | |
|
191 | empty => sample_f0_A_empty); -- OUT OUT | |
|
192 | ||
|
193 | lppFIFOxN_f0_b : lppFIFOxN | |
|
194 | GENERIC MAP ( | |
|
195 | tech => 0, | |
|
196 | Mem_use => Mem_use, | |
|
197 | Data_sz => 16, | |
|
198 | Addr_sz => 8, | |
|
199 | FifoCnt => 5, | |
|
200 | Enable_ReUse => '0') | |
|
201 | PORT MAP ( | |
|
202 | rstn => rstn, | |
|
203 | wclk => clk, | |
|
204 | rclk => clk, | |
|
205 | ReUse => (OTHERS => '0'), | |
|
206 | ||
|
207 | wen => sample_f0_B_wen, -- IN in | |
|
208 | ren => sample_f0_B_ren, -- OUT in | |
|
209 | wdata => sample_f0_wdata, -- IN in | |
|
210 | rdata => sample_f0_B_rdata, -- OUT in | |
|
211 | full => sample_f0_B_full, -- IN out | |
|
212 | almost_full => OPEN, -- IN out | |
|
213 | empty => sample_f0_B_empty); -- OUT OUT | |
|
214 | ||
|
215 | lppFIFOxN_f1 : lppFIFOxN | |
|
216 | GENERIC MAP ( | |
|
217 | tech => 0, | |
|
218 | Mem_use => Mem_use, | |
|
219 | Data_sz => 16, | |
|
220 | Addr_sz => 8, | |
|
221 | FifoCnt => 5, | |
|
222 | Enable_ReUse => '0') | |
|
223 | PORT MAP ( | |
|
224 | rstn => rstn, | |
|
225 | wclk => clk, | |
|
226 | rclk => clk, | |
|
227 | ReUse => (OTHERS => '0'), | |
|
228 | ||
|
229 | wen => sample_f1_wen, -- IN in | |
|
230 | ren => sample_f1_ren, -- OUT in | |
|
231 | wdata => sample_f1_wdata, -- IN in | |
|
232 | rdata => sample_f1_rdata, -- OUT in | |
|
233 | full => sample_f1_full, -- IN out | |
|
234 | almost_full => sample_f1_almost_full, -- IN out | |
|
235 | empty => sample_f1_empty); -- OUT OUT | |
|
236 | ||
|
237 | ||
|
238 | one_sample_f1_wen <= '0' WHEN sample_f1_wen = "11111" ELSE '1'; | |
|
239 | ||
|
240 | PROCESS (clk, rstn) | |
|
241 | BEGIN -- PROCESS | |
|
242 | IF rstn = '0' THEN -- asynchronous reset (active low) | |
|
243 | one_sample_f1_full <= '0'; | |
|
244 | error_wen_f1 <= '0'; | |
|
245 | ELSIF clk'event AND clk = '1' THEN -- rising clock edge | |
|
246 | IF sample_f1_full = "00000" THEN | |
|
247 | one_sample_f1_full <= '0'; | |
|
248 | ELSE | |
|
249 | one_sample_f1_full <= '1'; | |
|
250 | END IF; | |
|
251 | error_wen_f1 <= one_sample_f1_wen AND one_sample_f1_full; | |
|
252 | END IF; | |
|
253 | END PROCESS; | |
|
254 | ||
|
255 | ||
|
256 | lppFIFOxN_f2 : lppFIFOxN | |
|
257 | GENERIC MAP ( | |
|
258 | tech => 0, | |
|
259 | Mem_use => Mem_use, | |
|
260 | Data_sz => 16, | |
|
261 | Addr_sz => 8, | |
|
262 | FifoCnt => 5, | |
|
263 | Enable_ReUse => '0') | |
|
264 | PORT MAP ( | |
|
265 | rstn => rstn, | |
|
266 | wclk => clk, | |
|
267 | rclk => clk, | |
|
268 | ReUse => (OTHERS => '0'), | |
|
269 | ||
|
270 | wen => sample_f2_wen, -- IN in | |
|
271 | ren => sample_f2_ren, -- OUT in | |
|
272 | wdata => sample_f2_wdata, -- IN in | |
|
273 | rdata => sample_f2_rdata, -- OUT in | |
|
274 | full => sample_f2_full, -- IN out | |
|
275 | almost_full => OPEN, -- IN out | |
|
276 | empty => sample_f2_empty); -- OUT OUT | |
|
277 | ||
|
278 | ||
|
279 | one_sample_f2_wen <= '0' WHEN sample_f2_wen = "11111" ELSE '1'; | |
|
280 | ||
|
281 | PROCESS (clk, rstn) | |
|
282 | BEGIN -- PROCESS | |
|
283 | IF rstn = '0' THEN -- asynchronous reset (active low) | |
|
284 | one_sample_f2_full <= '0'; | |
|
285 | error_wen_f2 <= '0'; | |
|
286 | ELSIF clk'event AND clk = '1' THEN -- rising clock edge | |
|
287 | IF sample_f2_full = "00000" THEN | |
|
288 | one_sample_f2_full <= '0'; | |
|
289 | ELSE | |
|
290 | one_sample_f2_full <= '1'; | |
|
291 | END IF; | |
|
292 | error_wen_f2 <= one_sample_f2_wen AND one_sample_f2_full; | |
|
293 | END IF; | |
|
294 | END PROCESS; | |
|
295 | ||
|
296 | ----------------------------------------------------------------------------- | |
|
297 | -- FSM SELECT CHANNEL | |
|
298 | ----------------------------------------------------------------------------- | |
|
299 | PROCESS (clk, rstn) | |
|
300 | BEGIN | |
|
301 | IF rstn = '0' THEN | |
|
302 | state_fsm_select_channel <= IDLE; | |
|
303 | ELSIF clk'EVENT AND clk = '1' THEN | |
|
304 | CASE state_fsm_select_channel IS | |
|
305 | WHEN IDLE => | |
|
306 | IF sample_f1_full = "11111" THEN | |
|
307 | state_fsm_select_channel <= SWITCH_F1; | |
|
308 | ELSIF sample_f1_almost_full = "00000" THEN | |
|
309 | IF sample_f0_A_full = "11111" THEN | |
|
310 | state_fsm_select_channel <= SWITCH_F0_A; | |
|
311 | ELSIF sample_f0_B_full = "11111" THEN | |
|
312 | state_fsm_select_channel <= SWITCH_F0_B; | |
|
313 | ELSIF sample_f2_full = "11111" THEN | |
|
314 | state_fsm_select_channel <= SWITCH_F2; | |
|
315 | END IF; | |
|
316 | END IF; | |
|
317 | ||
|
318 | WHEN SWITCH_F0_A => | |
|
319 | IF sample_f0_A_empty = "11111" THEN | |
|
320 | state_fsm_select_channel <= IDLE; | |
|
321 | END IF; | |
|
322 | WHEN SWITCH_F0_B => | |
|
323 | IF sample_f0_B_empty = "11111" THEN | |
|
324 | state_fsm_select_channel <= IDLE; | |
|
325 | END IF; | |
|
326 | WHEN SWITCH_F1 => | |
|
327 | IF sample_f1_empty = "11111" THEN | |
|
328 | state_fsm_select_channel <= IDLE; | |
|
329 | END IF; | |
|
330 | WHEN SWITCH_F2 => | |
|
331 | IF sample_f2_empty = "11111" THEN | |
|
332 | state_fsm_select_channel <= IDLE; | |
|
333 | END IF; | |
|
334 | WHEN OTHERS => NULL; | |
|
335 | END CASE; | |
|
336 | ||
|
337 | END IF; | |
|
338 | END PROCESS; | |
|
339 | ||
|
340 | ||
|
341 | ||
|
342 | ----------------------------------------------------------------------------- | |
|
343 | -- SWITCH SELECT CHANNEL | |
|
344 | ----------------------------------------------------------------------------- | |
|
345 | sample_empty <= sample_f0_A_empty WHEN state_fsm_select_channel = SWITCH_F0_A ELSE | |
|
346 | sample_f0_B_empty WHEN state_fsm_select_channel = SWITCH_F0_B ELSE | |
|
347 | sample_f1_empty WHEN state_fsm_select_channel = SWITCH_F1 ELSE | |
|
348 | sample_f2_empty WHEN state_fsm_select_channel = SWITCH_F2 ELSE | |
|
349 | (OTHERS => '1'); | |
|
350 | ||
|
351 | sample_full <= sample_f0_A_full WHEN state_fsm_select_channel = SWITCH_F0_A ELSE | |
|
352 | sample_f0_B_full WHEN state_fsm_select_channel = SWITCH_F0_B ELSE | |
|
353 | sample_f1_full WHEN state_fsm_select_channel = SWITCH_F1 ELSE | |
|
354 | sample_f2_full WHEN state_fsm_select_channel = SWITCH_F2 ELSE | |
|
355 | (OTHERS => '0'); | |
|
356 | ||
|
357 | sample_rdata <= sample_f0_A_rdata WHEN state_fsm_select_channel = SWITCH_F0_A ELSE | |
|
358 | sample_f0_B_rdata WHEN state_fsm_select_channel = SWITCH_F0_B ELSE | |
|
359 | sample_f1_rdata WHEN state_fsm_select_channel = SWITCH_F1 ELSE | |
|
360 | sample_f2_rdata; -- WHEN state_fsm_select_channel = SWITCH_F2 ELSE | |
|
361 | ||
|
362 | ||
|
363 | sample_f0_A_ren <= sample_ren WHEN state_fsm_select_channel = SWITCH_F0_A ELSE (OTHERS => '1'); | |
|
364 | sample_f0_B_ren <= sample_ren WHEN state_fsm_select_channel = SWITCH_F0_B ELSE (OTHERS => '1'); | |
|
365 | sample_f1_ren <= sample_ren WHEN state_fsm_select_channel = SWITCH_F1 ELSE (OTHERS => '1'); | |
|
366 | sample_f2_ren <= sample_ren WHEN state_fsm_select_channel = SWITCH_F2 ELSE (OTHERS => '1'); | |
|
367 | ||
|
368 | ----------------------------------------------------------------------------- | |
|
369 | -- FSM LOAD FFT | |
|
370 | ----------------------------------------------------------------------------- | |
|
371 | ||
|
372 | sample_ren <= sample_ren_s;-- OR sample_empty; | |
|
373 | ||
|
374 | PROCESS (clk, rstn) | |
|
375 | BEGIN | |
|
376 | IF rstn = '0' THEN | |
|
377 | sample_ren_s <= (OTHERS => '1'); | |
|
378 | state_fsm_load_FFT <= IDLE; | |
|
379 | next_state_fsm_load_FFT <= IDLE; | |
|
380 | sample_valid <= '0'; | |
|
381 | ELSIF clk'event AND clk = '1' THEN | |
|
382 | CASE state_fsm_load_FFT IS | |
|
383 | WHEN IDLE => | |
|
384 | sample_valid <= '0'; | |
|
385 | sample_ren_s <= (OTHERS => '1'); | |
|
386 | IF sample_full = "11111" AND sample_load = '1' THEN | |
|
387 | state_fsm_load_FFT <= FIFO_1; | |
|
388 | END IF; | |
|
389 | WHEN FIFO_1 => | |
|
390 | sample_ren_s <= "1111" & NOT(sample_load); | |
|
391 | sample_valid <= '1'; | |
|
392 | IF sample_empty(0) = '1' THEN | |
|
393 | sample_valid <= '0'; | |
|
394 | sample_ren_s <= (OTHERS => '1'); | |
|
395 | state_fsm_load_FFT <= FIFO_transition; | |
|
396 | next_state_fsm_load_FFT <= FIFO_2; | |
|
397 | END IF; | |
|
398 | ||
|
399 | WHEN FIFO_transition => | |
|
400 | sample_valid <= '0'; | |
|
401 | sample_ren_s <= (OTHERS => '1'); | |
|
402 | state_fsm_load_FFT <= next_state_fsm_load_FFT; | |
|
403 | ||
|
404 | WHEN FIFO_2 => | |
|
405 | sample_ren_s <= "111" & NOT(sample_load) & '1'; | |
|
406 | sample_valid <= sample_load; | |
|
407 | IF sample_empty(1) = '1' THEN | |
|
408 | sample_valid <= '0'; | |
|
409 | sample_ren_s <= (OTHERS => '1'); | |
|
410 | state_fsm_load_FFT <= FIFO_transition; | |
|
411 | next_state_fsm_load_FFT <= FIFO_3; | |
|
412 | END IF; | |
|
413 | WHEN FIFO_3 => | |
|
414 | sample_ren_s <= "11" & NOT(sample_load) & "11"; | |
|
415 | sample_valid <= sample_load;--'1'; | |
|
416 | IF sample_empty(2) = '1' THEN | |
|
417 | sample_valid <= '0'; | |
|
418 | sample_ren_s <= (OTHERS => '1'); | |
|
419 | state_fsm_load_FFT <= FIFO_transition; | |
|
420 | next_state_fsm_load_FFT <= FIFO_4; | |
|
421 | END IF; | |
|
422 | WHEN FIFO_4 => | |
|
423 | sample_ren_s <= '1' & NOT(sample_load) & "111"; | |
|
424 | sample_valid <= sample_load;--'1'; | |
|
425 | IF sample_empty(3) = '1' THEN | |
|
426 | sample_valid <= '0'; | |
|
427 | sample_ren_s <= (OTHERS => '1'); | |
|
428 | state_fsm_load_FFT <= FIFO_transition; | |
|
429 | next_state_fsm_load_FFT <= FIFO_5; | |
|
430 | END IF; | |
|
431 | WHEN FIFO_5 => | |
|
432 | sample_ren_s <= NOT(sample_load) & "1111"; | |
|
433 | sample_valid <= sample_load;--'1'; | |
|
434 | IF sample_empty(4) = '1' THEN | |
|
435 | sample_valid <= '0'; | |
|
436 | sample_ren_s <= (OTHERS => '1'); | |
|
437 | state_fsm_load_FFT <= FIFO_transition; | |
|
438 | next_state_fsm_load_FFT <= IDLE; | |
|
439 | END IF; | |
|
440 | WHEN OTHERS => NULL; | |
|
441 | END CASE; | |
|
442 | END IF; | |
|
443 | END PROCESS; | |
|
444 | ||
|
445 | PROCESS (clk, rstn) | |
|
446 | BEGIN | |
|
447 | IF rstn = '0' THEN | |
|
448 | sample_valid_r <= '0'; | |
|
449 | ELSIF clk'event AND clk = '1' THEN | |
|
450 | sample_valid_r <= sample_valid AND sample_load; | |
|
451 | END IF; | |
|
452 | END PROCESS; | |
|
453 | ||
|
454 | sample_data <= sample_rdata(16*1-1 DOWNTO 16*0) WHEN state_fsm_load_FFT = FIFO_1 OR (state_fsm_load_FFT = FIFO_transition AND next_state_fsm_load_FFT = FIFO_2) ELSE | |
|
455 | sample_rdata(16*2-1 DOWNTO 16*1) WHEN state_fsm_load_FFT = FIFO_2 OR (state_fsm_load_FFT = FIFO_transition AND next_state_fsm_load_FFT = FIFO_3) ELSE | |
|
456 | sample_rdata(16*3-1 DOWNTO 16*2) WHEN state_fsm_load_FFT = FIFO_3 OR (state_fsm_load_FFT = FIFO_transition AND next_state_fsm_load_FFT = FIFO_4) ELSE | |
|
457 | sample_rdata(16*4-1 DOWNTO 16*3) WHEN state_fsm_load_FFT = FIFO_4 OR (state_fsm_load_FFT = FIFO_transition AND next_state_fsm_load_FFT = FIFO_5) ELSE | |
|
458 | sample_rdata(16*5-1 DOWNTO 16*4); --WHEN state_fsm_load_FFT = FIFO_5 ELSE | |
|
459 | ||
|
460 | ----------------------------------------------------------------------------- | |
|
461 | -- FFT | |
|
462 | ----------------------------------------------------------------------------- | |
|
463 | CoreFFT_1: CoreFFT | |
|
464 | GENERIC MAP ( | |
|
465 | LOGPTS => gLOGPTS, | |
|
466 | LOGLOGPTS => gLOGLOGPTS, | |
|
467 | WSIZE => gWSIZE, | |
|
468 | TWIDTH => gTWIDTH, | |
|
469 | DWIDTH => gDWIDTH, | |
|
470 | TDWIDTH => gTDWIDTH, | |
|
471 | RND_MODE => gRND_MODE, | |
|
472 | SCALE_MODE => gSCALE_MODE, | |
|
473 | PTS => gPTS, | |
|
474 | HALFPTS => gHALFPTS, | |
|
475 | inBuf_RWDLY => gInBuf_RWDLY) | |
|
476 | PORT MAP ( | |
|
477 | clk => clk, | |
|
478 | ifiStart => '1', | |
|
479 | ifiNreset => rstn, | |
|
480 | ||
|
481 | ifiD_valid => sample_valid_r, -- IN | |
|
482 | ifiRead_y => fft_read, | |
|
483 | ifiD_im => (OTHERS => '0'), -- IN | |
|
484 | ifiD_re => sample_data, -- IN | |
|
485 | ifoLoad => sample_load, -- IN | |
|
486 | ||
|
487 | ifoPong => fft_pong, | |
|
488 | ifoY_im => fft_data_im, | |
|
489 | ifoY_re => fft_data_re, | |
|
490 | ifoY_valid => fft_data_valid, | |
|
491 | ifoY_rdy => fft_ready); | |
|
492 | ||
|
493 | ----------------------------------------------------------------------------- | |
|
494 | -- | |
|
495 | ----------------------------------------------------------------------------- | |
|
496 | fft_read <= '1'; | |
|
497 | -- fft_read OUT | |
|
498 | -- fft_pong IN | |
|
499 | -- fft_data_im IN | |
|
500 | -- fft_data_re IN | |
|
501 | -- fft_data_valid IN | |
|
502 | -- fft_ready IN | |
|
503 | ||
|
504 | ----------------------------------------------------------------------------- | |
|
505 | -- | |
|
506 | ----------------------------------------------------------------------------- | |
|
507 | ||
|
508 | dma_addr <= (OTHERS => '0'); | |
|
509 | dma_data <= (OTHERS => '0'); | |
|
510 | dma_valid <= '0'; | |
|
511 | dma_valid_burst <= '0'; | |
|
512 | ||
|
513 | ready_matrix_f0_0 <= '0'; | |
|
514 | ready_matrix_f0_1 <= '0'; | |
|
515 | ready_matrix_f1 <= '0'; | |
|
516 | ready_matrix_f2 <= '0'; | |
|
517 | error_anticipating_empty_fifo <= '0'; | |
|
518 | error_bad_component_error <= '0'; | |
|
519 | debug_reg <= (OTHERS => '0'); | |
|
520 | ||
|
521 | matrix_time_f0_0 <= (OTHERS => '0'); | |
|
522 | matrix_time_f0_1 <= (OTHERS => '0'); | |
|
523 | matrix_time_f1 <= (OTHERS => '0'); | |
|
524 | matrix_time_f2 <= (OTHERS => '0'); | |
|
525 | ||
|
526 | ||
|
527 | END Behavioral; |
@@ -0,0 +1,199 | |||
|
1 | ------------------------------------------------------------------------------ | |
|
2 | -- This file is a part of the LPP VHDL IP LIBRARY | |
|
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS | |
|
4 | -- | |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
|
6 | -- it under the terms of the GNU General Public License as published by | |
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |
|
8 | -- (at your option) any later version. | |
|
9 | -- | |
|
10 | -- This program is distributed in the hope that it will be useful, | |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
|
13 | -- GNU General Public License for more details. | |
|
14 | -- | |
|
15 | -- You should have received a copy of the GNU General Public License | |
|
16 | -- along with this program; if not, write to the Free Software | |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
|
18 | ------------------------------------------------------------------------------ | |
|
19 | -- Author : Martin Morlot | |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |
|
21 | ------------------------------------------------------------------------------ | |
|
22 | library ieee; | |
|
23 | use ieee.std_logic_1164.all; | |
|
24 | library grlib; | |
|
25 | use grlib.amba.all; | |
|
26 | use std.textio.all; | |
|
27 | library lpp; | |
|
28 | use lpp.lpp_amba.all; | |
|
29 | use lpp.iir_filter.all; | |
|
30 | library gaisler; | |
|
31 | use gaisler.misc.all; | |
|
32 | use gaisler.memctrl.all; | |
|
33 | library techmap; | |
|
34 | use techmap.gencomp.all; | |
|
35 | ||
|
36 | --! Package contenant tous les programmes qui forment le composant int�gr� dans le l�on | |
|
37 | ||
|
38 | package lpp_memory is | |
|
39 | ||
|
40 | component APB_FIFO is | |
|
41 | generic ( | |
|
42 | tech : integer := apa3; | |
|
43 | pindex : integer := 0; | |
|
44 | paddr : integer := 0; | |
|
45 | pmask : integer := 16#fff#; | |
|
46 | pirq : integer := 0; | |
|
47 | abits : integer := 8; | |
|
48 | FifoCnt : integer := 2; | |
|
49 | Data_sz : integer := 16; | |
|
50 | Addr_sz : integer := 9; | |
|
51 | Enable_ReUse : std_logic := '0'; | |
|
52 | Mem_use : integer := use_RAM; | |
|
53 | R : integer := 1; | |
|
54 | W : integer := 1 | |
|
55 | ); | |
|
56 | port ( | |
|
57 | clk : in std_logic; --! Horloge du composant | |
|
58 | rst : in std_logic; --! Reset general du composant | |
|
59 | rclk : in std_logic; | |
|
60 | wclk : in std_logic; | |
|
61 | ReUse : in std_logic_vector(FifoCnt-1 downto 0); | |
|
62 | REN : in std_logic_vector(FifoCnt-1 downto 0); --! Instruction de lecture en m�moire | |
|
63 | WEN : in std_logic_vector(FifoCnt-1 downto 0); --! Instruction d'�criture en m�moire | |
|
64 | Empty : out std_logic_vector(FifoCnt-1 downto 0); --! Flag, M�moire vide | |
|
65 | Full : out std_logic_vector(FifoCnt-1 downto 0); --! Flag, M�moire pleine | |
|
66 | RDATA : out std_logic_vector((FifoCnt*Data_sz)-1 downto 0); --! Registre de donn�es en entr�e | |
|
67 | WDATA : in std_logic_vector((FifoCnt*Data_sz)-1 downto 0); --! Registre de donn�es en sortie | |
|
68 | WADDR : out std_logic_vector((FifoCnt*Addr_sz)-1 downto 0); --! Registre d'addresse (�criture) | |
|
69 | RADDR : out std_logic_vector((FifoCnt*Addr_sz)-1 downto 0); --! Registre d'addresse (lecture) | |
|
70 | apbi : in apb_slv_in_type; --! Registre de gestion des entr�es du bus | |
|
71 | apbo : out apb_slv_out_type --! Registre de gestion des sorties du bus | |
|
72 | ); | |
|
73 | end component; | |
|
74 | ||
|
75 | component FIFO_pipeline is | |
|
76 | generic( | |
|
77 | tech : integer := 0; | |
|
78 | Mem_use : integer := use_RAM; | |
|
79 | fifoCount : integer range 2 to 32 := 8; | |
|
80 | DataSz : integer range 1 to 32 := 8; | |
|
81 | abits : integer range 2 to 12 := 8 | |
|
82 | ); | |
|
83 | port( | |
|
84 | rstn : in std_logic; | |
|
85 | ReUse : in std_logic; | |
|
86 | rclk : in std_logic; | |
|
87 | ren : in std_logic; | |
|
88 | rdata : out std_logic_vector(DataSz-1 downto 0); | |
|
89 | empty : out std_logic; | |
|
90 | raddr : out std_logic_vector(abits-1 downto 0); | |
|
91 | wclk : in std_logic; | |
|
92 | wen : in std_logic; | |
|
93 | wdata : in std_logic_vector(DataSz-1 downto 0); | |
|
94 | full : out std_logic; | |
|
95 | waddr : out std_logic_vector(abits-1 downto 0) | |
|
96 | ); | |
|
97 | end component; | |
|
98 | ||
|
99 | component lpp_fifo is | |
|
100 | generic( | |
|
101 | tech : integer := 0; | |
|
102 | Mem_use : integer := use_RAM; | |
|
103 | Enable_ReUse : std_logic := '0'; | |
|
104 | DataSz : integer range 1 to 32 := 8; | |
|
105 | AddrSz : integer range 2 to 12 := 8 | |
|
106 | ); | |
|
107 | port( | |
|
108 | rstn : in std_logic; | |
|
109 | ReUse : in std_logic; --27/01/12 | |
|
110 | rclk : in std_logic; | |
|
111 | ren : in std_logic; | |
|
112 | rdata : out std_logic_vector(DataSz-1 downto 0); | |
|
113 | empty : out std_logic; | |
|
114 | raddr : out std_logic_vector(AddrSz-1 downto 0); | |
|
115 | wclk : in std_logic; | |
|
116 | wen : in std_logic; | |
|
117 | wdata : in std_logic_vector(DataSz-1 downto 0); | |
|
118 | full : out std_logic; | |
|
119 | almost_full : out std_logic; | |
|
120 | waddr : out std_logic_vector(AddrSz-1 downto 0) | |
|
121 | ); | |
|
122 | end component; | |
|
123 | ||
|
124 | ||
|
125 | component lppFIFOxN is | |
|
126 | generic( | |
|
127 | tech : integer := 0; | |
|
128 | Mem_use : integer := use_RAM; | |
|
129 | Data_sz : integer range 1 to 32 := 8; | |
|
130 | Addr_sz : integer range 1 to 32 := 8; | |
|
131 | FifoCnt : integer := 1; | |
|
132 | Enable_ReUse : std_logic := '0' | |
|
133 | ); | |
|
134 | port( | |
|
135 | rstn : in std_logic; | |
|
136 | wclk : in std_logic; | |
|
137 | rclk : in std_logic; | |
|
138 | ReUse : in std_logic_vector(FifoCnt-1 downto 0); | |
|
139 | wen : in std_logic_vector(FifoCnt-1 downto 0); | |
|
140 | ren : in std_logic_vector(FifoCnt-1 downto 0); | |
|
141 | wdata : in std_logic_vector((FifoCnt*Data_sz)-1 downto 0); | |
|
142 | rdata : out std_logic_vector((FifoCnt*Data_sz)-1 downto 0); | |
|
143 | full : out std_logic_vector(FifoCnt-1 downto 0); | |
|
144 | almost_full : out std_logic_vector(FifoCnt-1 downto 0); | |
|
145 | empty : out std_logic_vector(FifoCnt-1 downto 0) | |
|
146 | ); | |
|
147 | end component; | |
|
148 | ||
|
149 | component FillFifo is | |
|
150 | generic( | |
|
151 | Data_sz : integer range 1 to 32 := 16; | |
|
152 | Fifo_cnt : integer range 1 to 8 := 5 | |
|
153 | ); | |
|
154 | port( | |
|
155 | clk : in std_logic; | |
|
156 | raz : in std_logic; | |
|
157 | write : out std_logic_vector(Fifo_cnt-1 downto 0); | |
|
158 | reuse : out std_logic_vector(Fifo_cnt-1 downto 0); | |
|
159 | data : out std_logic_vector(Fifo_cnt*Data_sz-1 downto 0) | |
|
160 | ); | |
|
161 | end component; | |
|
162 | ||
|
163 | component Bridge is | |
|
164 | port( | |
|
165 | clk : in std_logic; | |
|
166 | raz : in std_logic; | |
|
167 | EmptyUp : in std_logic; | |
|
168 | FullDwn : in std_logic; | |
|
169 | WriteDwn : out std_logic; | |
|
170 | ReadUp : out std_logic | |
|
171 | ); | |
|
172 | end component; | |
|
173 | ||
|
174 | component ssram_plugin is | |
|
175 | generic (tech : integer := 0); | |
|
176 | port | |
|
177 | ( | |
|
178 | clk : in std_logic; | |
|
179 | mem_ctrlr_o : in memory_out_type; | |
|
180 | SSRAM_CLK : out std_logic; | |
|
181 | nBWa : out std_logic; | |
|
182 | nBWb : out std_logic; | |
|
183 | nBWc : out std_logic; | |
|
184 | nBWd : out std_logic; | |
|
185 | nBWE : out std_logic; | |
|
186 | nADSC : out std_logic; | |
|
187 | nADSP : out std_logic; | |
|
188 | nADV : out std_logic; | |
|
189 | nGW : out std_logic; | |
|
190 | nCE1 : out std_logic; | |
|
191 | CE2 : out std_logic; | |
|
192 | nCE3 : out std_logic; | |
|
193 | nOE : out std_logic; | |
|
194 | MODE : out std_logic; | |
|
195 | ZZ : out std_logic | |
|
196 | ); | |
|
197 | end component; | |
|
198 | ||
|
199 | end; |
@@ -0,0 +1,20 | |||
|
1 | LIBRARY ieee; | |
|
2 | USE ieee.std_logic_1164.ALL; | |
|
3 | ||
|
4 | PACKAGE spectral_matrix_package IS | |
|
5 | ||
|
6 | COMPONENT spectral_matrix_switch_f0 | |
|
7 | PORT ( | |
|
8 | clk : IN STD_LOGIC; | |
|
9 | rstn : IN STD_LOGIC; | |
|
10 | sample_wen : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
11 | fifo_A_empty : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
12 | fifo_A_full : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
13 | fifo_A_wen : OUT STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
14 | fifo_B_empty : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
15 | fifo_B_full : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
16 | fifo_B_wen : OUT STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
17 | error_wen : OUT STD_LOGIC); | |
|
18 | END COMPONENT; | |
|
19 | ||
|
20 | END spectral_matrix_package; |
@@ -0,0 +1,99 | |||
|
1 | LIBRARY ieee; | |
|
2 | USE ieee.std_logic_1164.ALL; | |
|
3 | ||
|
4 | ||
|
5 | ENTITY spectral_matrix_switch_f0 IS | |
|
6 | ||
|
7 | PORT ( | |
|
8 | clk : IN STD_LOGIC; | |
|
9 | rstn : IN STD_LOGIC; | |
|
10 | --INPUT | |
|
11 | sample_wen : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
12 | --OUTPUT A | |
|
13 | fifo_A_empty : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
14 | fifo_A_full : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
15 | fifo_A_wen : OUT STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
16 | --OUTPUT B | |
|
17 | fifo_B_empty : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
18 | fifo_B_full : IN STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
19 | fifo_B_wen : OUT STD_LOGIC_VECTOR(4 DOWNTO 0); | |
|
20 | --ERROR | |
|
21 | error_wen : OUT STD_LOGIC | |
|
22 | ); | |
|
23 | ||
|
24 | END spectral_matrix_switch_f0; | |
|
25 | ||
|
26 | ARCHITECTURE beh OF spectral_matrix_switch_f0 IS | |
|
27 | SIGNAL ALL_1_sample_wen : STD_LOGIC; | |
|
28 | ||
|
29 | SIGNAL ALL_1_fifo_A_empty : STD_LOGIC; | |
|
30 | SIGNAL ALL_1_fifo_A_full : STD_LOGIC; | |
|
31 | SIGNAL ALL_1_fifo_B_empty : STD_LOGIC; | |
|
32 | SIGNAL ALL_1_fifo_B_full : STD_LOGIC; | |
|
33 | ||
|
34 | TYPE state_fsm_switch_f0 IS (state_A,state_B,state_AtoB,state_BtoA); | |
|
35 | SIGNAL state_fsm : state_fsm_switch_f0; | |
|
36 | ||
|
37 | BEGIN -- beh | |
|
38 | ALL_1_sample_wen <= '1' WHEN sample_wen = "11111" ELSE '0'; | |
|
39 | ||
|
40 | ALL_1_fifo_A_empty <= '1' WHEN fifo_A_empty = "11111" ELSE '0'; | |
|
41 | ALL_1_fifo_A_full <= '1' WHEN fifo_A_full = "11111" ELSE '0'; | |
|
42 | ALL_1_fifo_B_empty <= '1' WHEN fifo_B_empty = "11111" ELSE '0'; | |
|
43 | ALL_1_fifo_B_full <= '1' WHEN fifo_B_full = "11111" ELSE '0'; | |
|
44 | ||
|
45 | fifo_A_wen <= sample_wen WHEN state_fsm = state_A ELSE (OTHERS => '1'); | |
|
46 | fifo_B_wen <= sample_wen WHEN state_fsm = state_B ELSE (OTHERS => '1'); | |
|
47 | ||
|
48 | PROCESS (clk, rstn) | |
|
49 | BEGIN | |
|
50 | IF rstn = '0' THEN | |
|
51 | state_fsm <= state_A; | |
|
52 | error_wen <= '0'; | |
|
53 | ||
|
54 | ELSIF clk'event AND clk = '1' THEN | |
|
55 | CASE state_fsm IS | |
|
56 | ||
|
57 | WHEN state_A => | |
|
58 | error_wen <= '0'; | |
|
59 | IF ALL_1_fifo_A_full = '1' THEN | |
|
60 | --error_wen <= NOT ALL_1_sample_wen; | |
|
61 | IF ALL_1_fifo_B_empty = '1' THEN | |
|
62 | state_fsm <= state_B; | |
|
63 | ELSE | |
|
64 | state_fsm <= state_AtoB; | |
|
65 | END IF; | |
|
66 | END IF; | |
|
67 | ||
|
68 | WHEN state_B => | |
|
69 | error_wen <= '0'; | |
|
70 | IF ALL_1_fifo_B_full = '1' THEN | |
|
71 | --error_wen <= NOT ALL_1_sample_wen; | |
|
72 | IF ALL_1_fifo_A_empty = '1' THEN | |
|
73 | state_fsm <= state_A; | |
|
74 | ELSE | |
|
75 | state_fsm <= state_BtoA; | |
|
76 | END IF; | |
|
77 | END IF; | |
|
78 | ||
|
79 | WHEN state_AtoB => | |
|
80 | error_wen <= NOT ALL_1_sample_wen; | |
|
81 | IF ALL_1_fifo_B_empty = '1' THEN | |
|
82 | state_fsm <= state_B; | |
|
83 | END IF; | |
|
84 | ||
|
85 | WHEN state_BtoA => | |
|
86 | error_wen <= NOT ALL_1_sample_wen; | |
|
87 | IF ALL_1_fifo_A_empty = '1' THEN | |
|
88 | state_fsm <= state_A; | |
|
89 | END IF; | |
|
90 | ||
|
91 | WHEN OTHERS => NULL; | |
|
92 | END CASE; | |
|
93 | ||
|
94 | ||
|
95 | END IF; | |
|
96 | END PROCESS; | |
|
97 | ||
|
98 | ||
|
99 | END beh; |
@@ -0,0 +1,64 | |||
|
1 | onerror {resume} | |
|
2 | quietly WaveActivateNextPane {} 0 | |
|
3 | add wave -noupdate /tb/lpp_lfr_ms_1/sample_f0_wen | |
|
4 | add wave -noupdate -radix hexadecimal /tb/lpp_lfr_ms_1/sample_f0_wdata | |
|
5 | add wave -noupdate /tb/lpp_lfr_ms_1/sample_f1_wen | |
|
6 | add wave -noupdate -radix hexadecimal /tb/lpp_lfr_ms_1/sample_f1_wdata | |
|
7 | add wave -noupdate /tb/lpp_lfr_ms_1/sample_f2_wen | |
|
8 | add wave -noupdate -radix hexadecimal /tb/lpp_lfr_ms_1/sample_f2_wdata | |
|
9 | add wave -noupdate -expand -group FIFO_f0_A /tb/lpp_lfr_ms_1/lppfifoxn_f0_a/wen | |
|
10 | add wave -noupdate -expand -group FIFO_f0_A /tb/lpp_lfr_ms_1/lppfifoxn_f0_a/full | |
|
11 | add wave -noupdate -expand -group FIFO_f0_A /tb/lpp_lfr_ms_1/lppfifoxn_f0_a/almost_full | |
|
12 | add wave -noupdate -expand -group FIFO_f0_A /tb/lpp_lfr_ms_1/lppfifoxn_f0_a/empty | |
|
13 | add wave -noupdate -expand -group FIFO_f0_A /tb/lpp_lfr_ms_1/lppfifoxn_f0_a/ren | |
|
14 | add wave -noupdate -expand -group FIFO_f0_B /tb/lpp_lfr_ms_1/lppfifoxn_f0_b/wen | |
|
15 | add wave -noupdate -expand -group FIFO_f0_B /tb/lpp_lfr_ms_1/lppfifoxn_f0_b/full | |
|
16 | add wave -noupdate -expand -group FIFO_f0_B /tb/lpp_lfr_ms_1/lppfifoxn_f0_b/almost_full | |
|
17 | add wave -noupdate -expand -group FIFO_f0_B /tb/lpp_lfr_ms_1/lppfifoxn_f0_b/empty | |
|
18 | add wave -noupdate -expand -group FIFO_f0_B /tb/lpp_lfr_ms_1/lppfifoxn_f0_b/ren | |
|
19 | add wave -noupdate -expand -group FIFO_f1 /tb/lpp_lfr_ms_1/lppfifoxn_f1/wen | |
|
20 | add wave -noupdate -expand -group FIFO_f1 /tb/lpp_lfr_ms_1/lppfifoxn_f1/full | |
|
21 | add wave -noupdate -expand -group FIFO_f1 /tb/lpp_lfr_ms_1/lppfifoxn_f1/almost_full | |
|
22 | add wave -noupdate -expand -group FIFO_f1 /tb/lpp_lfr_ms_1/lppfifoxn_f1/empty | |
|
23 | add wave -noupdate -expand -group FIFO_f1 /tb/lpp_lfr_ms_1/lppfifoxn_f1/ren | |
|
24 | add wave -noupdate -expand -group FIFO_f2 /tb/lpp_lfr_ms_1/lppfifoxn_f2/wen | |
|
25 | add wave -noupdate -expand -group FIFO_f2 /tb/lpp_lfr_ms_1/lppfifoxn_f2/full | |
|
26 | add wave -noupdate -expand -group FIFO_f2 /tb/lpp_lfr_ms_1/lppfifoxn_f2/almost_full | |
|
27 | add wave -noupdate -expand -group FIFO_f2 /tb/lpp_lfr_ms_1/lppfifoxn_f2/empty | |
|
28 | add wave -noupdate -expand -group FIFO_f2 /tb/lpp_lfr_ms_1/lppfifoxn_f2/ren | |
|
29 | add wave -noupdate /tb/lpp_lfr_ms_1/state_fsm_select_channel | |
|
30 | add wave -noupdate /tb/lpp_lfr_ms_1/state_fsm_load_fft | |
|
31 | add wave -noupdate /tb/lpp_lfr_ms_1/corefft_1/ifoload | |
|
32 | add wave -noupdate /tb/lpp_lfr_ms_1/corefft_1/ifid_im | |
|
33 | add wave -noupdate -radix hexadecimal /tb/lpp_lfr_ms_1/corefft_1/ifid_re | |
|
34 | add wave -noupdate /tb/lpp_lfr_ms_1/corefft_1/ifid_valid | |
|
35 | add wave -noupdate /tb/lpp_lfr_ms_1/corefft_1/ifinreset | |
|
36 | add wave -noupdate /tb/lpp_lfr_ms_1/corefft_1/ifistart | |
|
37 | add wave -noupdate -expand -group ERROR /tb/lpp_lfr_ms_1/error_wen_f0 | |
|
38 | add wave -noupdate -expand -group ERROR /tb/lpp_lfr_ms_1/error_wen_f1 | |
|
39 | add wave -noupdate -expand -group ERROR /tb/lpp_lfr_ms_1/error_wen_f2 | |
|
40 | add wave -noupdate -expand -group FFT_RESULT_INTERFACE /tb/lpp_lfr_ms_1/corefft_1/ifiread_y | |
|
41 | add wave -noupdate -expand -group FFT_RESULT_INTERFACE /tb/lpp_lfr_ms_1/corefft_1/ifopong | |
|
42 | add wave -noupdate -expand -group FFT_RESULT_INTERFACE /tb/lpp_lfr_ms_1/corefft_1/ifoy_rdy | |
|
43 | add wave -noupdate -expand -group FFT_RESULT_INTERFACE /tb/lpp_lfr_ms_1/corefft_1/ifoy_valid | |
|
44 | add wave -noupdate -expand -group FFT_RESULT_INTERFACE /tb/lpp_lfr_ms_1/corefft_1/ifoy_im | |
|
45 | add wave -noupdate -expand -group FFT_RESULT_INTERFACE /tb/lpp_lfr_ms_1/corefft_1/ifoy_re | |
|
46 | TreeUpdate [SetDefaultTree] | |
|
47 | WaveRestoreCursors {{Cursor 1} {189796403054 ps} 0} {{Cursor 2} {27617887437 ps} 0} {{Cursor 3} {10382020000 ps} 0} {{Cursor 4} {47317662811 ps} 0} {{Cursor 5} {95613018769 ps} 0} | |
|
48 | configure wave -namecolwidth 402 | |
|
49 | configure wave -valuecolwidth 199 | |
|
50 | configure wave -justifyvalue left | |
|
51 | configure wave -signalnamewidth 0 | |
|
52 | configure wave -snapdistance 10 | |
|
53 | configure wave -datasetprefix 0 | |
|
54 | configure wave -rowmargin 4 | |
|
55 | configure wave -childrowmargin 2 | |
|
56 | configure wave -gridoffset 0 | |
|
57 | configure wave -gridperiod 1 | |
|
58 | configure wave -griddelta 40 | |
|
59 | configure wave -timeline 0 | |
|
60 | configure wave -timelineunits ps | |
|
61 | update | |
|
62 | WaveRestoreZoom {10380205948 ps} {10383691010 ps} | |
|
63 | bookmark add wave bookmark0 {{61745287067 ps} {63754655343 ps}} 0 | |
|
64 | bookmark add wave bookmark1 {{61745287067 ps} {63754655343 ps}} 0 |
@@ -21,7 +21,7 set_io {address[15]} -pinname N1 -fixed | |||
|
21 | 21 | set_io {address[16]} -pinname R3 -fixed yes -DIRECTION Inout |
|
22 | 22 | set_io {address[17]} -pinname P4 -fixed yes -DIRECTION Inout |
|
23 | 23 | set_io {address[18]} -pinname N3 -fixed yes -DIRECTION Inout |
|
24 | set_io {address[19]} -pinname M7 -fixed yes -DIRECTION Inout | |
|
24 | set_io {address[19]} -pinname M7 -fixed yes -DIRECTION Inout | |
|
25 | 25 | |
|
26 | 26 | set_io {data[0]} -pinname P17 -fixed yes -DIRECTION Inout |
|
27 | 27 | set_io {data[1]} -pinname R18 -fixed yes -DIRECTION Inout |
@@ -426,7 +426,7 BEGIN -- beh | |||
|
426 | 426 | pirq_ms => 6, |
|
427 | 427 | pirq_wfp => 14, |
|
428 | 428 | hindex => 2, |
|
429 |
top_lfr_version => X"00010 |
|
|
429 | top_lfr_version => X"00010B") -- aa.bb.cc version | |
|
430 | 430 | PORT MAP ( |
|
431 | 431 | clk => clk_25, |
|
432 | 432 | rstn => reset, |
@@ -443,7 +443,7 BEGIN -- beh | |||
|
443 | 443 | observation_reg => observation_reg); |
|
444 | 444 | |
|
445 | 445 | all_sample: FOR I IN 7 DOWNTO 0 GENERATE |
|
446 | sample_s(I) <= sample(I) & '0' & '0'; | |
|
446 | sample_s(I) <= sample(I)(11 DOWNTO 0) & '0' & '0' & '0' & '0'; | |
|
447 | 447 | END GENERATE all_sample; |
|
448 | 448 | |
|
449 | 449 |
General Comments 0
You need to be logged in to leave comments.
Login now