From 48aa4692df50629d739cb53e45c3e0ee28bce5a2 Mon Sep 17 00:00:00 2001 From: Matthew Poremba Date: Fri, 4 Feb 2022 15:26:56 -0600 Subject: [PATCH] configs: Allow for no DMAs in Ruby GPU tester If there are no DMA devices, we should not create any tester threads, sequencers, or an IO crossbar. Change-Id: I5762a70a064df5310e3f30d41bffc7800b53eb0b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56451 Reviewed-by: Matt Sinclair Maintainer: Matt Sinclair Tested-by: kokoro --- configs/example/ruby_gpu_random_test.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/configs/example/ruby_gpu_random_test.py b/configs/example/ruby_gpu_random_test.py index a5d9a49bdf..0763454b41 100644 --- a/configs/example/ruby_gpu_random_test.py +++ b/configs/example/ruby_gpu_random_test.py @@ -234,11 +234,12 @@ args.num_cp = 0 # # Make generic DMA sequencer for Ruby to use # -dma_devices = [TesterDma()] * n_DMAs -system.piobus = IOXBar() -for _, dma_device in enumerate(dma_devices): - dma_device.pio = system.piobus.mem_side_ports -system.dma_devices = dma_devices +if n_DMAs > 0: + dma_devices = [TesterDma()] * n_DMAs + system.piobus = IOXBar() + for _, dma_device in enumerate(dma_devices): + dma_device.pio = system.piobus.mem_side_ports + system.dma_devices = dma_devices # # Create the Ruby system @@ -250,7 +251,8 @@ system.dma_devices = dma_devices # size of system.cpu cpu_list = [ system.cpu ] * args.num_cpus Ruby.create_system(args, full_system = False, - system = system, dma_ports = system.dma_devices, + system = system, + dma_ports = system.dma_devices if n_DMAs > 0 else [], cpus = cpu_list) # @@ -275,7 +277,10 @@ print("Attaching ruby ports to the tester") for i, ruby_port in enumerate(system.ruby._cpu_ports): ruby_port.no_retry_on_stall = True ruby_port.using_ruby_tester = True - ruby_port.mem_request_port = system.piobus.cpu_side_ports + + # piobus is only created if there are DMAs + if n_DMAs > 0: + ruby_port.mem_request_port = system.piobus.cpu_side_ports if i < n_CUs: tester.cu_vector_ports = ruby_port.in_ports