Skip to content

Commit 96b17cf

Browse files
committed
add ILA python script and activate ILA
1 parent 518b550 commit 96b17cf

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

deca_mandelbrot.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
class MandelbrotAccelerator(Elaboratable):
2727
MAX_PACKET_SIZE = 256
28-
USE_ILA = False
28+
USE_ILA = True
2929
ILA_MAX_PACKET_SIZE = 512
3030

3131
def create_descriptors(self):
@@ -111,7 +111,7 @@ def elaborate(self, platform):
111111
m.submodules.command_fifo = command_fifo = AsyncFIFO(width=8, depth=32, w_domain="usb", r_domain="fast")
112112
m.submodules.result_fifo = result_fifo = AsyncFIFO(width=8+2, depth=4*self.MAX_PACKET_SIZE, w_domain="fast", r_domain="usb")
113113

114-
m.submodules.fractalmanager = fractalmanager = DomainRenamer("fast")(FractalManager(bitwidth=8*9, fraction_bits=8*8, no_cores=3))
114+
m.submodules.fractalmanager = fractalmanager = DomainRenamer("fast")(FractalManager(bitwidth=8*9, fraction_bits=8*8, no_cores=2))
115115

116116
# wire up USB via FIFOs to fractalmanager
117117
m.d.comb += [
@@ -144,7 +144,7 @@ def elaborate(self, platform):
144144
#ep1_out.stream.first,
145145
#ep1_out.stream.last,
146146
#ep1_out.stream.payload,
147-
usb_in_active,
147+
#usb_in_active,
148148
result_fifo.r_level,
149149
ep1_in.stream.ready,
150150
ep1_in.stream.valid,
@@ -154,13 +154,13 @@ def elaborate(self, platform):
154154
]
155155

156156
signals_bits = sum([s.width for s in signals])
157-
depth = 4 * 8 * 1024 #int(33*8*1024/signals_bits)
157+
depth = 1 * 8 * 1024 #int(33*8*1024/signals_bits)
158158
m.submodules.ila = ila = \
159159
StreamILA(
160160
signals=signals,
161161
sample_depth=depth,
162162
domain="usb", o_domain="usb",
163-
samples_pretrigger=1024)
163+
samples_pretrigger=128)
164164

165165
stream_ep = USBMultibyteStreamInEndpoint(
166166
endpoint_number=3, # EP 3 IN
@@ -171,7 +171,7 @@ def elaborate(self, platform):
171171

172172
m.d.comb += [
173173
stream_ep.stream.stream_eq(ila.stream),
174-
ila.trigger.eq(usb_in_active | ep1_in.stream.ready & ep1_in.stream.valid),
174+
ila.trigger.eq(ep1_in.stream.first),
175175
]
176176

177177
ILACoreParameters(ila).pickle()

ila.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env python3
2+
import usb
3+
from luna.gateware.usb.devices.ila import USBIntegratedLogicAnalyzerFrontend
4+
from luna.gateware.debug.ila import ILACoreParameters
5+
6+
7+
dev=usb.core.find(idVendor=0x1209, idProduct=0xDECA)
8+
print(dev)
9+
10+
frontend = USBIntegratedLogicAnalyzerFrontend(ila=ILACoreParameters.unpickle(), idVendor=0x1209, idProduct=0xDECA, endpoint_no=3)
11+
frontend.interactive_display()

0 commit comments

Comments
 (0)