@@ -254,6 +254,7 @@ def __init__(self, platform):
254
254
swo_manchester = Signal ()
255
255
swo_nrz = Signal ()
256
256
swo_tpiu = Signal ()
257
+ swo_itm = Signal ()
257
258
258
259
self .comb += Case (self .input_format , {
259
260
0x01 : [
@@ -271,6 +272,7 @@ def __init__(self, platform):
271
272
0x10 : [
272
273
swo_active .eq (1 ),
273
274
swo_manchester .eq (1 ),
275
+ swo_itm .eq (1 ),
274
276
],
275
277
0x11 : [
276
278
swo_active .eq (1 ),
@@ -280,6 +282,7 @@ def __init__(self, platform):
280
282
0x12 : [
281
283
swo_active .eq (1 ),
282
284
swo_nrz .eq (1 ),
285
+ swo_itm .eq (1 ),
283
286
],
284
287
0x13 : [
285
288
swo_active .eq (1 ),
@@ -307,20 +310,11 @@ def __init__(self, platform):
307
310
trace_pipeline = [
308
311
phy := ClockDomainsRenamer ('trace' )(TracePHY (trace_pads )),
309
312
ClockDomainsRenamer ({'write' : 'trace' , 'read' : 'sys' })(AsyncFIFO ([('data' , 128 )], 4 )),
310
- ByteSwap (16 ),
311
- #injector := Injector(),
312
- #pv := PipeValid([('data', 128)]),
313
- #Converter(128, 8),
314
- tpiu .TPIUDemux (),
315
- cobs .ChecksumAppender (),
316
- cobs .COBSEncoder (),
317
- cobs .DelimiterAppender (),
318
- cobs .SuperFramer (7500000 , 65536 ),
319
313
]
320
314
321
315
#pv.comb += pv.source.last.eq(1)
322
316
323
- trace_stream = Endpoint ([('data' , 8 )])
317
+ trace_stream = Endpoint ([('data' , 128 )])
324
318
325
319
self .submodules += [* trace_pipeline , Pipeline (* trace_pipeline , trace_stream )]
326
320
@@ -370,7 +364,7 @@ def __init__(self, platform):
370
364
swo_stream_backend_source = Endpoint ([('data' , 8 )])
371
365
swo_pipeline_backend = [
372
366
ClockDomainsRenamer ({'write' : 'swo' , 'read' : 'sys' })(AsyncFIFO ([('data' , 8 )], 4 )),
373
- StreamFlush (7500000 ),
367
+ # StreamFlush(7500000),
374
368
]
375
369
self .submodules += [* swo_pipeline_backend , Pipeline (swo_stream_backend_sink , * swo_pipeline_backend , swo_stream_backend_source )]
376
370
@@ -393,18 +387,30 @@ def __init__(self, platform):
393
387
self .submodules .swo_overrun_indicator = Indicator (swo_monitor .lost , 7500000 )
394
388
self .submodules .swo_data_indicator = Indicator (swo_monitor .total , 7500000 )
395
389
396
- # Output mux and FIFO
397
- fifo = SyncFIFO ([('data' , 8 )], 8192 , buffered = True )
390
+ # Orbtag pipeline
391
+ orbtag_pipeline_sink = Endpoint ([('data' , 128 )])
392
+ orbtag_pipeline = [
393
+ ByteSwap (16 ),
394
+ tpiu_demux := tpiu .TPIUDemux (),
395
+ cobs .ChecksumAppender (),
396
+ cobs .COBSEncoder (),
397
+ cobs .DelimiterAppender (),
398
+ cobs .SuperFramer (7500000 , 65536 ),
399
+ SyncFIFO ([('data' , 8 )], 8192 , buffered = True ),
400
+ ]
401
+ self .submodules += [* orbtag_pipeline , Pipeline (orbtag_pipeline_sink , * orbtag_pipeline , source )]
402
+
403
+ self .submodules .swo_tpiu_sync = swo_tpiu_sync = tpiu .TPIUSync ()
398
404
405
+ # Output mux
399
406
self .comb += [
400
407
If (trace_active ,
401
- trace_stream .connect (fifo . sink ),
408
+ trace_stream .connect (orbtag_pipeline_sink ),
402
409
self .led_overrun .eq (self .overrun_indicator .out ),
403
410
self .led_data .eq (self .data_indicator .out ),
404
411
self .led_clk .eq (self .clk_indicator .out ),
405
412
),
406
413
If (swo_active ,
407
- swo_stream_backend_source .connect (fifo .sink ),
408
414
self .led_overrun .eq (self .swo_overrun_indicator .out ),
409
415
self .led_data .eq (self .swo_data_indicator .out ),
410
416
),
@@ -416,10 +422,15 @@ def __init__(self, platform):
416
422
swo_stream_frontend_source .connect (swo_stream_nrz_sink ),
417
423
swo_stream_nrz_source .connect (swo_stream_backend_sink ),
418
424
),
419
- fifo .source .connect (source ),
425
+ If (swo_tpiu ,
426
+ swo_stream_backend_source .connect (swo_tpiu_sync .sink ),
427
+ swo_tpiu_sync .source .connect (orbtag_pipeline_sink ),
428
+ ),
429
+ If (swo_itm ,
430
+ swo_stream_backend_source .connect (tpiu_demux .bypass_sink ),
431
+ tpiu_demux .bypass .eq (1 ),
432
+ ),
420
433
]
421
434
422
- self .submodules += fifo
423
-
424
435
# Add verilog sources.
425
436
platform .add_source ('verilog/traceIF.v' ) # TODO: make sure the path is correct
0 commit comments