misc: Standardize the way create() constructs SimObjects.
authorGabe Black <gabeblack@google.com>
Wed, 7 Oct 2020 13:49:23 +0000 (06:49 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 14 Oct 2020 12:06:44 +0000 (12:06 +0000)
The create() method on Params structs usually instantiate SimObjects
using a constructor which takes the Params struct as a parameter
somehow. There has been a lot of needless variation in how that was
done, making it annoying to pass Params down to base classes. Some of
the different forms were:

const Params &
Params &
Params *
const Params *
Params const*

This change goes through and fixes up every constructor and every
create() method to use the const Params & form. We use a reference
because the Params struct should never be null. We use const because
neither the create method nor the consuming object should modify the
record of the parameters as they came in from the config. That would
make consuming them not idempotent, and make it impossible to tell what
the actual simulation configuration was since it would change from any
user visible form (config script, config.ini, dot pdf output).

Change-Id: I77453cba52fdcfd5f4eec92dfb0bddb5a9945f31
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35938
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
822 files changed:
src/arch/arm/fastmodel/CortexA76/cortex_a76.cc
src/arch/arm/fastmodel/CortexA76/evs.cc
src/arch/arm/fastmodel/CortexR52/cortex_r52.cc
src/arch/arm/fastmodel/CortexR52/cortex_r52.hh
src/arch/arm/fastmodel/CortexR52/evs.cc
src/arch/arm/fastmodel/GIC/gic.cc
src/arch/arm/fastmodel/amba_from_tlm_bridge.cc
src/arch/arm/fastmodel/amba_to_tlm_bridge.cc
src/arch/arm/fastmodel/iris/cpu.cc
src/arch/arm/fastmodel/iris/cpu.hh
src/arch/arm/fastmodel/iris/interrupts.cc
src/arch/arm/fastmodel/iris/interrupts.hh
src/arch/arm/fastmodel/iris/isa.cc
src/arch/arm/fastmodel/iris/isa.hh
src/arch/arm/fastmodel/iris/mmu.cc
src/arch/arm/fastmodel/iris/mmu.hh
src/arch/arm/fastmodel/iris/tlb.cc
src/arch/arm/fastmodel/iris/tlb.hh
src/arch/arm/freebsd/fs_workload.cc
src/arch/arm/freebsd/fs_workload.hh
src/arch/arm/freebsd/process.cc
src/arch/arm/freebsd/process.hh
src/arch/arm/fs_workload.cc
src/arch/arm/fs_workload.hh
src/arch/arm/interrupts.cc
src/arch/arm/interrupts.hh
src/arch/arm/isa.cc
src/arch/arm/isa.hh
src/arch/arm/kvm/arm_cpu.cc
src/arch/arm/kvm/arm_cpu.hh
src/arch/arm/kvm/armv8_cpu.cc
src/arch/arm/kvm/armv8_cpu.hh
src/arch/arm/kvm/base_cpu.cc
src/arch/arm/kvm/base_cpu.hh
src/arch/arm/kvm/gic.cc
src/arch/arm/kvm/gic.hh
src/arch/arm/linux/fs_workload.cc
src/arch/arm/linux/fs_workload.hh
src/arch/arm/linux/process.cc
src/arch/arm/linux/process.hh
src/arch/arm/mmu.cc
src/arch/arm/mmu.hh
src/arch/arm/nativetrace.cc
src/arch/arm/nativetrace.hh
src/arch/arm/pmu.cc
src/arch/arm/pmu.hh
src/arch/arm/process.cc
src/arch/arm/process.hh
src/arch/arm/semihosting.cc
src/arch/arm/semihosting.hh
src/arch/arm/stage2_mmu.cc
src/arch/arm/stage2_mmu.hh
src/arch/arm/system.cc
src/arch/arm/system.hh
src/arch/arm/table_walker.cc
src/arch/arm/table_walker.hh
src/arch/arm/tlb.cc
src/arch/arm/tlb.hh
src/arch/arm/tracers/tarmac_parser.cc
src/arch/arm/tracers/tarmac_parser.hh
src/arch/arm/tracers/tarmac_tracer.cc
src/arch/arm/tracers/tarmac_tracer.hh
src/arch/generic/interrupts.hh
src/arch/generic/mmu.hh
src/arch/generic/tlb.hh
src/arch/mips/interrupts.cc
src/arch/mips/interrupts.hh
src/arch/mips/isa.cc
src/arch/mips/isa.hh
src/arch/mips/linux/process.cc
src/arch/mips/linux/process.hh
src/arch/mips/mmu.cc
src/arch/mips/mmu.hh
src/arch/mips/process.cc
src/arch/mips/process.hh
src/arch/mips/tlb.cc
src/arch/mips/tlb.hh
src/arch/power/interrupts.cc
src/arch/power/interrupts.hh
src/arch/power/isa.cc
src/arch/power/isa.hh
src/arch/power/linux/process.cc
src/arch/power/linux/process.hh
src/arch/power/mmu.cc
src/arch/power/mmu.hh
src/arch/power/process.cc
src/arch/power/process.hh
src/arch/power/tlb.cc
src/arch/power/tlb.hh
src/arch/riscv/bare_metal/fs_workload.cc
src/arch/riscv/bare_metal/fs_workload.hh
src/arch/riscv/fs_workload.hh
src/arch/riscv/interrupts.cc
src/arch/riscv/interrupts.hh
src/arch/riscv/isa.cc
src/arch/riscv/isa.hh
src/arch/riscv/linux/process.cc
src/arch/riscv/linux/process.hh
src/arch/riscv/mmu.cc
src/arch/riscv/mmu.hh
src/arch/riscv/pagetable_walker.cc
src/arch/riscv/pagetable_walker.hh
src/arch/riscv/process.cc
src/arch/riscv/process.hh
src/arch/riscv/tlb.cc
src/arch/riscv/tlb.hh
src/arch/sparc/fs_workload.cc
src/arch/sparc/fs_workload.hh
src/arch/sparc/interrupts.cc
src/arch/sparc/interrupts.hh
src/arch/sparc/isa.cc
src/arch/sparc/isa.hh
src/arch/sparc/linux/process.cc
src/arch/sparc/linux/process.hh
src/arch/sparc/mmu.cc
src/arch/sparc/mmu.hh
src/arch/sparc/nativetrace.cc
src/arch/sparc/nativetrace.hh
src/arch/sparc/process.cc
src/arch/sparc/process.hh
src/arch/sparc/solaris/process.cc
src/arch/sparc/solaris/process.hh
src/arch/sparc/tlb.cc
src/arch/sparc/tlb.hh
src/arch/x86/bios/acpi.cc
src/arch/x86/bios/acpi.hh
src/arch/x86/bios/e820.cc
src/arch/x86/bios/e820.hh
src/arch/x86/bios/intelmp.cc
src/arch/x86/bios/intelmp.hh
src/arch/x86/bios/smbios.cc
src/arch/x86/bios/smbios.hh
src/arch/x86/fs_workload.cc
src/arch/x86/fs_workload.hh
src/arch/x86/interrupts.cc
src/arch/x86/interrupts.hh
src/arch/x86/isa.cc
src/arch/x86/isa.hh
src/arch/x86/linux/fs_workload.cc
src/arch/x86/linux/fs_workload.hh
src/arch/x86/linux/process.cc
src/arch/x86/mmu.cc
src/arch/x86/mmu.hh
src/arch/x86/nativetrace.cc
src/arch/x86/nativetrace.hh
src/arch/x86/pagetable_walker.cc
src/arch/x86/pagetable_walker.hh
src/arch/x86/process.cc
src/arch/x86/process.hh
src/arch/x86/tlb.cc
src/arch/x86/tlb.hh
src/base/filters/base.hh
src/base/filters/block_bloom_filter.cc
src/base/filters/block_bloom_filter.hh
src/base/filters/bulk_bloom_filter.cc
src/base/filters/bulk_bloom_filter.hh
src/base/filters/h3_bloom_filter.cc
src/base/filters/h3_bloom_filter.hh
src/base/filters/multi_bit_sel_bloom_filter.cc
src/base/filters/multi_bit_sel_bloom_filter.hh
src/base/filters/multi_bloom_filter.cc
src/base/filters/multi_bloom_filter.hh
src/base/filters/perfect_bloom_filter.cc
src/base/filters/perfect_bloom_filter.hh
src/base/vnc/vncinput.cc
src/base/vnc/vncinput.hh
src/base/vnc/vncserver.cc
src/base/vnc/vncserver.hh
src/cpu/base.cc
src/cpu/base.hh
src/cpu/checker/cpu.cc
src/cpu/checker/cpu.hh
src/cpu/dummy_checker.cc
src/cpu/dummy_checker.hh
src/cpu/exetrace.cc
src/cpu/exetrace.hh
src/cpu/func_unit.cc
src/cpu/func_unit.hh
src/cpu/inst_pb_trace.cc
src/cpu/inst_pb_trace.hh
src/cpu/inteltrace.cc
src/cpu/inteltrace.hh
src/cpu/intr_control.cc
src/cpu/intr_control.hh
src/cpu/intr_control_noisa.cc
src/cpu/kvm/base.cc
src/cpu/kvm/base.hh
src/cpu/kvm/vm.cc
src/cpu/kvm/vm.hh
src/cpu/kvm/x86_cpu.cc
src/cpu/kvm/x86_cpu.hh
src/cpu/minor/cpu.cc
src/cpu/minor/cpu.hh
src/cpu/minor/decode.cc
src/cpu/minor/decode.hh
src/cpu/minor/execute.cc
src/cpu/minor/execute.hh
src/cpu/minor/fetch1.cc
src/cpu/minor/fetch1.hh
src/cpu/minor/fetch2.cc
src/cpu/minor/fetch2.hh
src/cpu/minor/func_unit.cc
src/cpu/minor/func_unit.hh
src/cpu/minor/pipeline.cc
src/cpu/minor/pipeline.hh
src/cpu/nativetrace.cc
src/cpu/nativetrace.hh
src/cpu/o3/checker.cc
src/cpu/o3/checker.hh
src/cpu/o3/commit.hh
src/cpu/o3/commit_impl.hh
src/cpu/o3/cpu.cc
src/cpu/o3/cpu.hh
src/cpu/o3/decode.hh
src/cpu/o3/decode_impl.hh
src/cpu/o3/deriv.cc
src/cpu/o3/deriv.hh
src/cpu/o3/fetch.hh
src/cpu/o3/fetch_impl.hh
src/cpu/o3/fu_pool.cc
src/cpu/o3/fu_pool.hh
src/cpu/o3/iew.hh
src/cpu/o3/iew_impl.hh
src/cpu/o3/inst_queue.hh
src/cpu/o3/inst_queue_impl.hh
src/cpu/o3/lsq.hh
src/cpu/o3/lsq_impl.hh
src/cpu/o3/lsq_unit.hh
src/cpu/o3/lsq_unit_impl.hh
src/cpu/o3/mem_dep_unit.hh
src/cpu/o3/mem_dep_unit_impl.hh
src/cpu/o3/probe/elastic_trace.cc
src/cpu/o3/probe/elastic_trace.hh
src/cpu/o3/probe/simple_trace.cc
src/cpu/o3/probe/simple_trace.hh
src/cpu/o3/rename.hh
src/cpu/o3/rename_impl.hh
src/cpu/o3/rob.hh
src/cpu/o3/rob_impl.hh
src/cpu/pred/2bit_local.cc
src/cpu/pred/2bit_local.hh
src/cpu/pred/bi_mode.cc
src/cpu/pred/bi_mode.hh
src/cpu/pred/bpred_unit.cc
src/cpu/pred/bpred_unit.hh
src/cpu/pred/indirect.hh
src/cpu/pred/loop_predictor.cc
src/cpu/pred/loop_predictor.hh
src/cpu/pred/ltage.cc
src/cpu/pred/ltage.hh
src/cpu/pred/multiperspective_perceptron.cc
src/cpu/pred/multiperspective_perceptron.hh
src/cpu/pred/multiperspective_perceptron_64KB.cc
src/cpu/pred/multiperspective_perceptron_64KB.hh
src/cpu/pred/multiperspective_perceptron_8KB.cc
src/cpu/pred/multiperspective_perceptron_8KB.hh
src/cpu/pred/multiperspective_perceptron_tage.cc
src/cpu/pred/multiperspective_perceptron_tage.hh
src/cpu/pred/multiperspective_perceptron_tage_64KB.cc
src/cpu/pred/multiperspective_perceptron_tage_64KB.hh
src/cpu/pred/multiperspective_perceptron_tage_8KB.cc
src/cpu/pred/multiperspective_perceptron_tage_8KB.hh
src/cpu/pred/simple_indirect.cc
src/cpu/pred/simple_indirect.hh
src/cpu/pred/statistical_corrector.cc
src/cpu/pred/statistical_corrector.hh
src/cpu/pred/tage.cc
src/cpu/pred/tage.hh
src/cpu/pred/tage_base.cc
src/cpu/pred/tage_base.hh
src/cpu/pred/tage_sc_l.cc
src/cpu/pred/tage_sc_l.hh
src/cpu/pred/tage_sc_l_64KB.cc
src/cpu/pred/tage_sc_l_64KB.hh
src/cpu/pred/tage_sc_l_8KB.cc
src/cpu/pred/tage_sc_l_8KB.hh
src/cpu/pred/tournament.cc
src/cpu/pred/tournament.hh
src/cpu/simple/NonCachingSimpleCPU.py
src/cpu/simple/atomic.cc
src/cpu/simple/atomic.hh
src/cpu/simple/base.cc
src/cpu/simple/base.hh
src/cpu/simple/noncaching.cc
src/cpu/simple/noncaching.hh
src/cpu/simple/probes/simpoint.cc
src/cpu/simple/probes/simpoint.hh
src/cpu/simple/timing.cc
src/cpu/simple/timing.hh
src/cpu/testers/directedtest/DirectedGenerator.cc
src/cpu/testers/directedtest/DirectedGenerator.hh
src/cpu/testers/directedtest/InvalidateGenerator.cc
src/cpu/testers/directedtest/InvalidateGenerator.hh
src/cpu/testers/directedtest/RubyDirectedTester.cc
src/cpu/testers/directedtest/RubyDirectedTester.hh
src/cpu/testers/directedtest/SeriesRequestGenerator.cc
src/cpu/testers/directedtest/SeriesRequestGenerator.hh
src/cpu/testers/garnet_synthetic_traffic/GarnetSyntheticTraffic.cc
src/cpu/testers/garnet_synthetic_traffic/GarnetSyntheticTraffic.hh
src/cpu/testers/memtest/memtest.cc
src/cpu/testers/memtest/memtest.hh
src/cpu/testers/rubytest/RubyTester.cc
src/cpu/testers/rubytest/RubyTester.hh
src/cpu/testers/traffic_gen/base.cc
src/cpu/testers/traffic_gen/base.hh
src/cpu/testers/traffic_gen/pygen.cc
src/cpu/testers/traffic_gen/pygen.hh
src/cpu/testers/traffic_gen/stream_gen.cc
src/cpu/testers/traffic_gen/stream_gen.hh
src/cpu/testers/traffic_gen/traffic_gen.cc
src/cpu/testers/traffic_gen/traffic_gen.hh
src/cpu/timing_expr.cc
src/cpu/timing_expr.hh
src/cpu/trace/trace_cpu.cc
src/cpu/trace/trace_cpu.hh
src/dev/arm/a9scu.cc
src/dev/arm/a9scu.hh
src/dev/arm/abstract_nvm.hh
src/dev/arm/amba_device.cc
src/dev/arm/amba_device.hh
src/dev/arm/amba_fake.cc
src/dev/arm/amba_fake.hh
src/dev/arm/base_gic.cc
src/dev/arm/base_gic.hh
src/dev/arm/display.cc
src/dev/arm/display.hh
src/dev/arm/energy_ctrl.cc
src/dev/arm/energy_ctrl.hh
src/dev/arm/flash_device.cc
src/dev/arm/flash_device.hh
src/dev/arm/fvp_base_pwr_ctrl.cc
src/dev/arm/fvp_base_pwr_ctrl.hh
src/dev/arm/generic_timer.cc
src/dev/arm/generic_timer.hh
src/dev/arm/gic_v2.cc
src/dev/arm/gic_v2.hh
src/dev/arm/gic_v2m.cc
src/dev/arm/gic_v2m.hh
src/dev/arm/gic_v3.cc
src/dev/arm/gic_v3.hh
src/dev/arm/gic_v3_cpu_interface.cc
src/dev/arm/gic_v3_its.cc
src/dev/arm/gic_v3_its.hh
src/dev/arm/gic_v3_redistributor.cc
src/dev/arm/gpu_nomali.cc
src/dev/arm/gpu_nomali.hh
src/dev/arm/hdlcd.cc
src/dev/arm/hdlcd.hh
src/dev/arm/kmi.cc
src/dev/arm/kmi.hh
src/dev/arm/pci_host.cc
src/dev/arm/pci_host.hh
src/dev/arm/pl011.cc
src/dev/arm/pl011.hh
src/dev/arm/pl111.cc
src/dev/arm/pl111.hh
src/dev/arm/realview.cc
src/dev/arm/realview.hh
src/dev/arm/rtc_pl031.cc
src/dev/arm/rtc_pl031.hh
src/dev/arm/rv_ctrl.cc
src/dev/arm/rv_ctrl.hh
src/dev/arm/smmu_v3.cc
src/dev/arm/smmu_v3.hh
src/dev/arm/smmu_v3_deviceifc.cc
src/dev/arm/smmu_v3_deviceifc.hh
src/dev/arm/timer_a9global.cc
src/dev/arm/timer_a9global.hh
src/dev/arm/timer_cpulocal.cc
src/dev/arm/timer_cpulocal.hh
src/dev/arm/timer_sp804.cc
src/dev/arm/timer_sp804.hh
src/dev/arm/ufs_device.cc
src/dev/arm/ufs_device.hh
src/dev/arm/vgic.cc
src/dev/arm/vgic.hh
src/dev/arm/vio_mmio.cc
src/dev/arm/vio_mmio.hh
src/dev/arm/watchdog_sp805.cc
src/dev/arm/watchdog_sp805.hh
src/dev/baddev.cc
src/dev/baddev.hh
src/dev/dma_device.cc
src/dev/dma_device.hh
src/dev/hsa/hsa_device.hh
src/dev/hsa/hsa_driver.cc
src/dev/hsa/hsa_driver.hh
src/dev/hsa/hsa_packet_processor.cc
src/dev/hsa/hsa_packet_processor.hh
src/dev/i2c/bus.cc
src/dev/i2c/bus.hh
src/dev/i2c/device.hh
src/dev/io_device.cc
src/dev/io_device.hh
src/dev/isa_fake.cc
src/dev/isa_fake.hh
src/dev/mips/malta.cc
src/dev/mips/malta.hh
src/dev/mips/malta_cchip.cc
src/dev/mips/malta_cchip.hh
src/dev/mips/malta_io.cc
src/dev/mips/malta_io.hh
src/dev/net/dist_etherlink.cc
src/dev/net/dist_etherlink.hh
src/dev/net/etherbus.cc
src/dev/net/etherbus.hh
src/dev/net/etherdevice.hh
src/dev/net/etherdump.cc
src/dev/net/etherdump.hh
src/dev/net/etherlink.cc
src/dev/net/etherlink.hh
src/dev/net/etherswitch.cc
src/dev/net/etherswitch.hh
src/dev/net/ethertap.cc
src/dev/net/ethertap.hh
src/dev/net/i8254xGBe.cc
src/dev/net/i8254xGBe.hh
src/dev/net/ns_gige.cc
src/dev/net/ns_gige.hh
src/dev/net/sinic.cc
src/dev/net/sinic.hh
src/dev/pci/copy_engine.cc
src/dev/pci/copy_engine.hh
src/dev/pci/device.cc
src/dev/pci/device.hh
src/dev/pci/host.cc
src/dev/pci/host.hh
src/dev/platform.cc
src/dev/platform.hh
src/dev/ps2/device.cc
src/dev/ps2/device.hh
src/dev/ps2/keyboard.cc
src/dev/ps2/keyboard.hh
src/dev/ps2/mouse.cc
src/dev/ps2/mouse.hh
src/dev/ps2/touchkit.cc
src/dev/ps2/touchkit.hh
src/dev/serial/serial.cc
src/dev/serial/serial.hh
src/dev/serial/simple.cc
src/dev/serial/simple.hh
src/dev/serial/terminal.cc
src/dev/serial/terminal.hh
src/dev/serial/uart.cc
src/dev/serial/uart.hh
src/dev/serial/uart8250.cc
src/dev/serial/uart8250.hh
src/dev/sparc/dtod.cc
src/dev/sparc/dtod.hh
src/dev/sparc/iob.cc
src/dev/sparc/iob.hh
src/dev/sparc/mm_disk.cc
src/dev/sparc/mm_disk.hh
src/dev/sparc/t1000.cc
src/dev/sparc/t1000.hh
src/dev/storage/disk_image.cc
src/dev/storage/disk_image.hh
src/dev/storage/ide_ctrl.cc
src/dev/storage/ide_ctrl.hh
src/dev/storage/ide_disk.cc
src/dev/storage/ide_disk.hh
src/dev/storage/simple_disk.cc
src/dev/storage/simple_disk.hh
src/dev/virtio/base.cc
src/dev/virtio/base.hh
src/dev/virtio/block.cc
src/dev/virtio/block.hh
src/dev/virtio/console.cc
src/dev/virtio/console.hh
src/dev/virtio/fs9p.cc
src/dev/virtio/fs9p.hh
src/dev/virtio/pci.cc
src/dev/virtio/pci.hh
src/dev/x86/cmos.cc
src/dev/x86/cmos.hh
src/dev/x86/i8042.cc
src/dev/x86/i8042.hh
src/dev/x86/i82094aa.cc
src/dev/x86/i82094aa.hh
src/dev/x86/i8237.cc
src/dev/x86/i8237.hh
src/dev/x86/i8254.cc
src/dev/x86/i8254.hh
src/dev/x86/i8259.cc
src/dev/x86/i8259.hh
src/dev/x86/pc.cc
src/dev/x86/pc.hh
src/dev/x86/south_bridge.cc
src/dev/x86/south_bridge.hh
src/dev/x86/speaker.cc
src/dev/x86/speaker.hh
src/gpu-compute/comm.cc
src/gpu-compute/comm.hh
src/gpu-compute/compute_unit.cc
src/gpu-compute/compute_unit.hh
src/gpu-compute/dispatcher.cc
src/gpu-compute/dispatcher.hh
src/gpu-compute/exec_stage.cc
src/gpu-compute/exec_stage.hh
src/gpu-compute/fetch_stage.cc
src/gpu-compute/fetch_stage.hh
src/gpu-compute/fetch_unit.cc
src/gpu-compute/fetch_unit.hh
src/gpu-compute/global_memory_pipeline.cc
src/gpu-compute/global_memory_pipeline.hh
src/gpu-compute/gpu_command_processor.cc
src/gpu-compute/gpu_command_processor.hh
src/gpu-compute/gpu_compute_driver.cc
src/gpu-compute/gpu_compute_driver.hh
src/gpu-compute/gpu_tlb.cc
src/gpu-compute/gpu_tlb.hh
src/gpu-compute/lds_state.cc
src/gpu-compute/lds_state.hh
src/gpu-compute/local_memory_pipeline.cc
src/gpu-compute/local_memory_pipeline.hh
src/gpu-compute/pool_manager.cc
src/gpu-compute/pool_manager.hh
src/gpu-compute/register_file.cc
src/gpu-compute/register_file.hh
src/gpu-compute/register_manager.cc
src/gpu-compute/register_manager.hh
src/gpu-compute/scalar_memory_pipeline.cc
src/gpu-compute/scalar_memory_pipeline.hh
src/gpu-compute/scalar_register_file.cc
src/gpu-compute/scalar_register_file.hh
src/gpu-compute/schedule_stage.cc
src/gpu-compute/schedule_stage.hh
src/gpu-compute/scheduler.cc
src/gpu-compute/scheduler.hh
src/gpu-compute/scoreboard_check_stage.cc
src/gpu-compute/scoreboard_check_stage.hh
src/gpu-compute/shader.cc
src/gpu-compute/shader.hh
src/gpu-compute/simple_pool_manager.cc
src/gpu-compute/simple_pool_manager.hh
src/gpu-compute/tlb_coalescer.cc
src/gpu-compute/tlb_coalescer.hh
src/gpu-compute/vector_register_file.cc
src/gpu-compute/vector_register_file.hh
src/gpu-compute/wavefront.cc
src/gpu-compute/wavefront.hh
src/learning_gem5/part2/goodbye_object.cc
src/learning_gem5/part2/goodbye_object.hh
src/learning_gem5/part2/hello_object.cc
src/learning_gem5/part2/hello_object.hh
src/learning_gem5/part2/simple_cache.cc
src/learning_gem5/part2/simple_cache.hh
src/learning_gem5/part2/simple_memobj.cc
src/learning_gem5/part2/simple_memobj.hh
src/learning_gem5/part2/simple_object.cc
src/learning_gem5/part2/simple_object.hh
src/mem/abstract_mem.cc
src/mem/abstract_mem.hh
src/mem/addr_mapper.cc
src/mem/addr_mapper.hh
src/mem/bridge.cc
src/mem/bridge.hh
src/mem/cache/base.cc
src/mem/cache/base.hh
src/mem/cache/cache.cc
src/mem/cache/cache.hh
src/mem/cache/compressors/base.cc
src/mem/cache/compressors/base.hh
src/mem/cache/compressors/base_delta.cc
src/mem/cache/compressors/base_delta.hh
src/mem/cache/compressors/base_delta_impl.hh
src/mem/cache/compressors/base_dictionary_compressor.cc
src/mem/cache/compressors/cpack.cc
src/mem/cache/compressors/cpack.hh
src/mem/cache/compressors/dictionary_compressor.hh
src/mem/cache/compressors/dictionary_compressor_impl.hh
src/mem/cache/compressors/fpcd.cc
src/mem/cache/compressors/fpcd.hh
src/mem/cache/compressors/multi.cc
src/mem/cache/compressors/multi.hh
src/mem/cache/compressors/perfect.cc
src/mem/cache/compressors/perfect.hh
src/mem/cache/compressors/repeated_qwords.cc
src/mem/cache/compressors/repeated_qwords.hh
src/mem/cache/compressors/zero.cc
src/mem/cache/compressors/zero.hh
src/mem/cache/noncoherent_cache.cc
src/mem/cache/noncoherent_cache.hh
src/mem/cache/prefetch/access_map_pattern_matching.cc
src/mem/cache/prefetch/access_map_pattern_matching.hh
src/mem/cache/prefetch/base.cc
src/mem/cache/prefetch/base.hh
src/mem/cache/prefetch/bop.cc
src/mem/cache/prefetch/bop.hh
src/mem/cache/prefetch/delta_correlating_prediction_tables.cc
src/mem/cache/prefetch/delta_correlating_prediction_tables.hh
src/mem/cache/prefetch/indirect_memory.cc
src/mem/cache/prefetch/indirect_memory.hh
src/mem/cache/prefetch/irregular_stream_buffer.cc
src/mem/cache/prefetch/irregular_stream_buffer.hh
src/mem/cache/prefetch/multi.cc
src/mem/cache/prefetch/multi.hh
src/mem/cache/prefetch/pif.cc
src/mem/cache/prefetch/pif.hh
src/mem/cache/prefetch/queued.cc
src/mem/cache/prefetch/queued.hh
src/mem/cache/prefetch/sbooe.cc
src/mem/cache/prefetch/sbooe.hh
src/mem/cache/prefetch/signature_path.cc
src/mem/cache/prefetch/signature_path.hh
src/mem/cache/prefetch/signature_path_v2.cc
src/mem/cache/prefetch/signature_path_v2.hh
src/mem/cache/prefetch/slim_ampm.cc
src/mem/cache/prefetch/slim_ampm.hh
src/mem/cache/prefetch/spatio_temporal_memory_streaming.cc
src/mem/cache/prefetch/spatio_temporal_memory_streaming.hh
src/mem/cache/prefetch/stride.cc
src/mem/cache/prefetch/stride.hh
src/mem/cache/prefetch/tagged.cc
src/mem/cache/prefetch/tagged.hh
src/mem/cache/replacement_policies/base.hh
src/mem/cache/replacement_policies/bip_rp.cc
src/mem/cache/replacement_policies/bip_rp.hh
src/mem/cache/replacement_policies/brrip_rp.cc
src/mem/cache/replacement_policies/brrip_rp.hh
src/mem/cache/replacement_policies/fifo_rp.cc
src/mem/cache/replacement_policies/fifo_rp.hh
src/mem/cache/replacement_policies/lfu_rp.cc
src/mem/cache/replacement_policies/lfu_rp.hh
src/mem/cache/replacement_policies/lru_rp.cc
src/mem/cache/replacement_policies/lru_rp.hh
src/mem/cache/replacement_policies/mru_rp.cc
src/mem/cache/replacement_policies/mru_rp.hh
src/mem/cache/replacement_policies/random_rp.cc
src/mem/cache/replacement_policies/random_rp.hh
src/mem/cache/replacement_policies/second_chance_rp.cc
src/mem/cache/replacement_policies/second_chance_rp.hh
src/mem/cache/replacement_policies/tree_plru_rp.cc
src/mem/cache/replacement_policies/tree_plru_rp.hh
src/mem/cache/replacement_policies/weighted_lru_rp.cc
src/mem/cache/replacement_policies/weighted_lru_rp.hh
src/mem/cache/tags/base.cc
src/mem/cache/tags/base.hh
src/mem/cache/tags/base_set_assoc.cc
src/mem/cache/tags/base_set_assoc.hh
src/mem/cache/tags/compressed_tags.cc
src/mem/cache/tags/compressed_tags.hh
src/mem/cache/tags/fa_lru.cc
src/mem/cache/tags/fa_lru.hh
src/mem/cache/tags/indexing_policies/base.cc
src/mem/cache/tags/indexing_policies/base.hh
src/mem/cache/tags/indexing_policies/set_associative.cc
src/mem/cache/tags/indexing_policies/set_associative.hh
src/mem/cache/tags/indexing_policies/skewed_associative.cc
src/mem/cache/tags/indexing_policies/skewed_associative.hh
src/mem/cache/tags/sector_tags.cc
src/mem/cache/tags/sector_tags.hh
src/mem/coherent_xbar.cc
src/mem/coherent_xbar.hh
src/mem/comm_monitor.cc
src/mem/comm_monitor.hh
src/mem/drampower.cc
src/mem/drampower.hh
src/mem/dramsim2.cc
src/mem/dramsim2.hh
src/mem/dramsim3.cc
src/mem/dramsim3.hh
src/mem/external_master.cc
src/mem/external_master.hh
src/mem/external_slave.cc
src/mem/external_slave.hh
src/mem/hmc_controller.cc
src/mem/hmc_controller.hh
src/mem/mem_checker.cc
src/mem/mem_checker.hh
src/mem/mem_checker_monitor.cc
src/mem/mem_checker_monitor.hh
src/mem/mem_ctrl.cc
src/mem/mem_ctrl.hh
src/mem/mem_delay.cc
src/mem/mem_delay.hh
src/mem/mem_interface.cc
src/mem/mem_interface.hh
src/mem/mem_object.hh
src/mem/noncoherent_xbar.cc
src/mem/noncoherent_xbar.hh
src/mem/probes/base.cc
src/mem/probes/base.hh
src/mem/probes/mem_footprint.cc
src/mem/probes/mem_footprint.hh
src/mem/probes/mem_trace.cc
src/mem/probes/mem_trace.hh
src/mem/probes/stack_dist.cc
src/mem/probes/stack_dist.hh
src/mem/qos/mem_ctrl.cc
src/mem/qos/mem_ctrl.hh
src/mem/qos/mem_sink.cc
src/mem/qos/mem_sink.hh
src/mem/qos/policy.cc
src/mem/qos/policy.hh
src/mem/qos/policy_fixed_prio.cc
src/mem/qos/policy_fixed_prio.hh
src/mem/qos/policy_pf.cc
src/mem/qos/policy_pf.hh
src/mem/qos/q_policy.cc
src/mem/qos/q_policy.hh
src/mem/qos/turnaround_policy.hh
src/mem/qos/turnaround_policy_ideal.cc
src/mem/qos/turnaround_policy_ideal.hh
src/mem/ruby/network/BasicLink.cc
src/mem/ruby/network/BasicLink.hh
src/mem/ruby/network/BasicRouter.cc
src/mem/ruby/network/BasicRouter.hh
src/mem/ruby/network/MessageBuffer.cc
src/mem/ruby/network/MessageBuffer.hh
src/mem/ruby/network/Network.cc
src/mem/ruby/network/Network.hh
src/mem/ruby/network/Topology.cc
src/mem/ruby/network/fault_model/FaultModel.cc
src/mem/ruby/network/fault_model/FaultModel.hh
src/mem/ruby/network/garnet/CreditLink.hh
src/mem/ruby/network/garnet/GarnetLink.cc
src/mem/ruby/network/garnet/GarnetLink.hh
src/mem/ruby/network/garnet/GarnetNetwork.cc
src/mem/ruby/network/garnet/GarnetNetwork.hh
src/mem/ruby/network/garnet/NetworkBridge.cc
src/mem/ruby/network/garnet/NetworkBridge.hh
src/mem/ruby/network/garnet/NetworkInterface.cc
src/mem/ruby/network/garnet/NetworkInterface.hh
src/mem/ruby/network/garnet/NetworkLink.cc
src/mem/ruby/network/garnet/NetworkLink.hh
src/mem/ruby/network/garnet/Router.cc
src/mem/ruby/network/garnet/Router.hh
src/mem/ruby/network/simple/SimpleLink.cc
src/mem/ruby/network/simple/SimpleLink.hh
src/mem/ruby/network/simple/SimpleNetwork.cc
src/mem/ruby/network/simple/SimpleNetwork.hh
src/mem/ruby/network/simple/Switch.cc
src/mem/ruby/network/simple/Switch.hh
src/mem/ruby/profiler/Profiler.cc
src/mem/ruby/profiler/Profiler.hh
src/mem/ruby/slicc_interface/AbstractController.cc
src/mem/ruby/slicc_interface/AbstractController.hh
src/mem/ruby/structures/CacheMemory.cc
src/mem/ruby/structures/CacheMemory.hh
src/mem/ruby/structures/DirectoryMemory.cc
src/mem/ruby/structures/DirectoryMemory.hh
src/mem/ruby/structures/RubyPrefetcher.cc
src/mem/ruby/structures/RubyPrefetcher.hh
src/mem/ruby/structures/WireBuffer.cc
src/mem/ruby/structures/WireBuffer.hh
src/mem/ruby/system/DMASequencer.cc
src/mem/ruby/system/DMASequencer.hh
src/mem/ruby/system/GPUCoalescer.cc
src/mem/ruby/system/GPUCoalescer.hh
src/mem/ruby/system/HTMSequencer.cc
src/mem/ruby/system/HTMSequencer.hh
src/mem/ruby/system/RubyPort.cc
src/mem/ruby/system/RubyPort.hh
src/mem/ruby/system/RubyPortProxy.cc
src/mem/ruby/system/RubyPortProxy.hh
src/mem/ruby/system/RubySystem.cc
src/mem/ruby/system/RubySystem.hh
src/mem/ruby/system/Sequencer.cc
src/mem/ruby/system/Sequencer.hh
src/mem/ruby/system/VIPERCoalescer.cc
src/mem/ruby/system/VIPERCoalescer.hh
src/mem/serial_link.cc
src/mem/serial_link.hh
src/mem/simple_mem.cc
src/mem/simple_mem.hh
src/mem/slicc/symbols/StateMachine.py
src/mem/snoop_filter.cc
src/mem/snoop_filter.hh
src/mem/xbar.cc
src/mem/xbar.hh
src/python/m5/SimObject.py
src/sim/clock_domain.cc
src/sim/clock_domain.hh
src/sim/clocked_object.cc
src/sim/clocked_object.hh
src/sim/dvfs_handler.cc
src/sim/dvfs_handler.hh
src/sim/emul_driver.hh
src/sim/insttracer.hh
src/sim/kernel_workload.cc
src/sim/power/mathexpr_powermodel.cc
src/sim/power/mathexpr_powermodel.hh
src/sim/power/power_model.cc
src/sim/power/power_model.hh
src/sim/power/thermal_domain.cc
src/sim/power/thermal_domain.hh
src/sim/power/thermal_model.cc
src/sim/power/thermal_model.hh
src/sim/power/thermal_node.cc
src/sim/power/thermal_node.hh
src/sim/power_domain.cc
src/sim/power_domain.hh
src/sim/power_state.cc
src/sim/power_state.hh
src/sim/probe/probe.cc
src/sim/probe/probe.hh
src/sim/process.cc
src/sim/process.hh
src/sim/pseudo_inst.cc
src/sim/redirect_path.cc
src/sim/redirect_path.hh
src/sim/root.cc
src/sim/root.hh
src/sim/se_workload.cc
src/sim/sim_object.cc
src/sim/sim_object.hh
src/sim/sub_system.cc
src/sim/sub_system.hh
src/sim/system.cc
src/sim/system.hh
src/sim/ticked_object.cc
src/sim/ticked_object.hh
src/sim/voltage_domain.cc
src/sim/voltage_domain.hh
src/sim/workload.hh
src/systemc/core/kernel.cc
src/systemc/core/kernel.hh
src/systemc/tlm_bridge/gem5_to_tlm.cc
src/systemc/tlm_bridge/gem5_to_tlm.hh
src/systemc/tlm_bridge/tlm_to_gem5.cc
src/systemc/tlm_bridge/tlm_to_gem5.hh

index c723f60a724db73c3533c11fae41cbc3844a9adc..a9206dec366452fd4c903e25dc5b30de1ba21d09 100644 (file)
@@ -204,13 +204,13 @@ CortexA76Cluster::getPort(const std::string &if_name, PortID idx)
 } // namespace FastModel
 
 FastModel::CortexA76 *
-FastModelCortexA76Params::create()
+FastModelCortexA76Params::create() const
 {
     return new FastModel::CortexA76(*this);
 }
 
 FastModel::CortexA76Cluster *
-FastModelCortexA76ClusterParams::create()
+FastModelCortexA76ClusterParams::create() const
 {
     return new FastModel::CortexA76Cluster(*this);
 }
index ddeec3ad32b16e18953659fbbcb4207f00fb837d..4828b2df7dbdd5c9770c0dd30d3b8773f22e2679 100644 (file)
@@ -155,25 +155,25 @@ template class ScxEvsCortexA76<ScxEvsCortexA76x4Types>;
 } // namespace FastModel
 
 FastModel::ScxEvsCortexA76x1 *
-FastModelScxEvsCortexA76x1Params::create()
+FastModelScxEvsCortexA76x1Params::create() const
 {
     return new FastModel::ScxEvsCortexA76x1(name.c_str(), *this);
 }
 
 FastModel::ScxEvsCortexA76x2 *
-FastModelScxEvsCortexA76x2Params::create()
+FastModelScxEvsCortexA76x2Params::create() const
 {
     return new FastModel::ScxEvsCortexA76x2(name.c_str(), *this);
 }
 
 FastModel::ScxEvsCortexA76x3 *
-FastModelScxEvsCortexA76x3Params::create()
+FastModelScxEvsCortexA76x3Params::create() const
 {
     return new FastModel::ScxEvsCortexA76x3(name.c_str(), *this);
 }
 
 FastModel::ScxEvsCortexA76x4 *
-FastModelScxEvsCortexA76x4Params::create()
+FastModelScxEvsCortexA76x4Params::create() const
 {
     return new FastModel::ScxEvsCortexA76x4(name.c_str(), *this);
 }
index c246435d406d6d372efd5de359f72ac4f0c944d4..1936e2a69c70bb6af40cc8abfaa82a9b2ebd492f 100644 (file)
@@ -93,7 +93,7 @@ CortexR52::getPort(const std::string &if_name, PortID idx)
     }
 }
 
-CortexR52Cluster::CortexR52Cluster(Params &p) :
+CortexR52Cluster::CortexR52Cluster(const Params &p) :
     SimObject(&p), _params(p), cores(p.cores), evs(p.evs)
 {
     for (int i = 0; i < p.cores.size(); i++)
@@ -162,13 +162,13 @@ CortexR52Cluster::getPort(const std::string &if_name, PortID idx)
 } // namespace FastModel
 
 FastModel::CortexR52 *
-FastModelCortexR52Params::create()
+FastModelCortexR52Params::create() const
 {
     return new FastModel::CortexR52(*this);
 }
 
 FastModel::CortexR52Cluster *
-FastModelCortexR52ClusterParams::create()
+FastModelCortexR52ClusterParams::create() const
 {
     return new FastModel::CortexR52Cluster(*this);
 }
index 2e1700d88c58019726f5a261e1ae25d5506aa943..9abf19463ff2c2b21fe798d5fca99910eeb8a96b 100644 (file)
@@ -62,8 +62,8 @@ class CortexR52 : public Iris::CPU<CortexR52TC>
     const Params &params() { return _params; }
 
   public:
-    CortexR52(Params &p) : Base(&p, scx::scx_get_iris_connection_interface()),
-        _params(p)
+    CortexR52(const Params &p) :
+        Base(&p, scx::scx_get_iris_connection_interface()), _params(p)
     {}
 
     template <class T>
@@ -95,7 +95,7 @@ class CortexR52Cluster : public SimObject
     CortexR52 *getCore(int num) const { return cores.at(num); }
     sc_core::sc_module *getEvs() const { return evs; }
 
-    CortexR52Cluster(Params &p);
+    CortexR52Cluster(const Params &p);
     const Params &params() { return _params; }
 
     Port &getPort(const std::string &if_name,
index 88812ee3b108b7b1ee1c75f74dd91531799716b0..403f3c3eda3175d072199abdc97d2eb2c9b00017 100644 (file)
@@ -131,25 +131,25 @@ template class ScxEvsCortexR52<ScxEvsCortexR52x4Types>;
 } // namespace FastModel
 
 FastModel::ScxEvsCortexR52x1 *
-FastModelScxEvsCortexR52x1Params::create()
+FastModelScxEvsCortexR52x1Params::create() const
 {
     return new FastModel::ScxEvsCortexR52x1(name.c_str(), *this);
 }
 
 FastModel::ScxEvsCortexR52x2 *
-FastModelScxEvsCortexR52x2Params::create()
+FastModelScxEvsCortexR52x2Params::create() const
 {
     return new FastModel::ScxEvsCortexR52x2(name.c_str(), *this);
 }
 
 FastModel::ScxEvsCortexR52x3 *
-FastModelScxEvsCortexR52x3Params::create()
+FastModelScxEvsCortexR52x3Params::create() const
 {
     return new FastModel::ScxEvsCortexR52x3(name.c_str(), *this);
 }
 
 FastModel::ScxEvsCortexR52x4 *
-FastModelScxEvsCortexR52x4Params::create()
+FastModelScxEvsCortexR52x4Params::create() const
 {
     return new FastModel::ScxEvsCortexR52x4(name.c_str(), *this);
 }
index c1670455a66951c2b328c84dcdbbf95e0c90e949..97d0154534c5dc60b18e2753cc5954290bfcfb11 100644 (file)
@@ -360,13 +360,13 @@ GIC::supportsVersion(GicVersion version)
 } // namespace FastModel
 
 FastModel::SCGIC *
-SCFastModelGICParams::create()
+SCFastModelGICParams::create() const
 {
     return new FastModel::SCGIC(*this, name.c_str());
 }
 
 FastModel::GIC *
-FastModelGICParams::create()
+FastModelGICParams::create() const
 {
     return new FastModel::GIC(*this);
 }
index 5ce494f153b87821e78fe99ef911238629a314b0..fbabc7a15269f2f43feb4be67894274403dfd7b1 100644 (file)
@@ -54,7 +54,7 @@ AmbaFromTlmBridge64::gem5_getPort(const std::string &if_name, int idx)
 } // namespace FastModel
 
 FastModel::AmbaFromTlmBridge64 *
-AmbaFromTlmBridge64Params::create()
+AmbaFromTlmBridge64Params::create() const
 {
     return new FastModel::AmbaFromTlmBridge64(name.c_str());
 }
index 0835c0bbc71a55582da8085d10d7db98d723a5b8..a011e355db45599f897f71fb564ad21226fbf7bd 100644 (file)
@@ -52,7 +52,7 @@ AmbaToTlmBridge64::gem5_getPort(const std::string &if_name, int idx)
 } // namespace FastModel
 
 FastModel::AmbaToTlmBridge64 *
-AmbaToTlmBridge64Params::create()
+AmbaToTlmBridge64Params::create() const
 {
     return new FastModel::AmbaToTlmBridge64(name.c_str());
 }
index 7d31a9b8665d550c7ec8bc0103ec29fd5b458895..cf93c8cd5d7f9b9e796a25ae433daef9e93f083b 100644 (file)
@@ -34,7 +34,7 @@
 namespace Iris
 {
 
-BaseCPU::BaseCPU(BaseCPUParams *params, sc_core::sc_module *_evs) :
+BaseCPU::BaseCPU(const BaseCPUParams &params, sc_core::sc_module *_evs) :
     ::BaseCPU::BaseCPU(params), evs(_evs),
     clockEvent(nullptr), periodAttribute(nullptr)
 {
index b0ba2c1ec5ee1fc4dfab48d3af051fd5dacc88de..39d9a1395111b441d1d66a9600f2a6fbbd8cfd18 100644 (file)
@@ -58,7 +58,7 @@ static const std::string SendFunctionalAttributeName = "gem5_send_functional";
 class BaseCPU : public ::BaseCPU
 {
   public:
-    BaseCPU(BaseCPUParams *params, sc_core::sc_module *_evs);
+    BaseCPU(const BaseCPUParams &params, sc_core::sc_module *_evs);
     virtual ~BaseCPU();
 
     Port &
@@ -128,18 +128,19 @@ template <class TC>
 class CPU : public Iris::BaseCPU
 {
   public:
-    CPU(IrisBaseCPUParams *params, iris::IrisConnectionInterface *iris_if) :
-        BaseCPU(params, params->evs)
+    CPU(const IrisBaseCPUParams &params,
+            iris::IrisConnectionInterface *iris_if) :
+        BaseCPU(params, params.evs)
     {
         const std::string parent_path = evs->name();
-        System *sys = params->system;
+        System *sys = params.system;
 
         int thread_id = 0;
-        for (const std::string &sub_path: params->thread_paths) {
+        for (const std::string &sub_path: params.thread_paths) {
             std::string path = parent_path + "." + sub_path;
             auto id = thread_id++;
-            auto *tc = new TC(this, id, sys, params->dtb, params->itb,
-                    params->isa[id], iris_if, path);
+            auto *tc = new TC(this, id, sys, params.dtb, params.itb,
+                    params.isa[id], iris_if, path);
             threadContexts.push_back(tc);
         }
     }
index 197608901a790e51ba3dda2ad9843dbd66ec137b..a6cf6c03d510e1c1cc19b6cf856f88b3ddef48a5 100644 (file)
@@ -108,7 +108,7 @@ Iris::Interrupts::unserialize(CheckpointIn &cp)
 }
 
 Iris::Interrupts *
-IrisInterruptsParams::create()
+IrisInterruptsParams::create() const
 {
-    return new Iris::Interrupts(this);
+    return new Iris::Interrupts(*this);
 }
index bb97e635cb408bbfc39c96f66bd2d454353661af..3a5c20c117713cecd9c07486003f7103739086c4 100644 (file)
@@ -40,13 +40,13 @@ class Interrupts : public BaseInterrupts
   public:
     typedef IrisInterruptsParams Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    Interrupts(Params *p) : BaseInterrupts(p) {}
+    Interrupts(const Params &p) : BaseInterrupts(p) {}
 
     bool checkInterrupts() const override { return false; }
     Fault getInterrupt() override { return NoFault; }
index 19b0d16e8f479cd1fbe962c8049149bc04d1fc0a..20ebf1c1df3780892da1d22b9dc2b014e2b96538 100644 (file)
@@ -42,7 +42,7 @@ Iris::ISA::serialize(CheckpointOut &cp) const
 }
 
 Iris::ISA *
-IrisISAParams::create()
+IrisISAParams::create() const
 {
-    return new Iris::ISA(this);
+    return new Iris::ISA(*this);
 }
index 72f2c1c794ff3fab9ab04b8a66247ed87294e2bf..d9646df23cc0378689cacec7faff27f60b9be281 100644 (file)
@@ -36,7 +36,7 @@ namespace Iris
 class ISA : public BaseISA
 {
   public:
-    ISA(const Params *p) : BaseISA(p) {}
+    ISA(const Params &p) : BaseISA(p) {}
 
     void serialize(CheckpointOut &cp) const;
 };
index 407c18a90fa6101ba1a986f0fcf7790aa13428fa..21d16015b1e86984b1e4e155d011574226e4773a 100644 (file)
@@ -38,7 +38,7 @@
 #include "arch/arm/fastmodel/iris/mmu.hh"
 
 Iris::MMU *
-IrisMMUParams::create()
+IrisMMUParams::create() const
 {
-    return new Iris::MMU(this);
+    return new Iris::MMU(*this);
 }
index 19899511d68eb7d6ac1c689218f3d299f36ccb20..1a7c2899782d93144c611c2943678078ceb7bb39 100644 (file)
@@ -48,7 +48,7 @@ namespace Iris
 class MMU : public BaseMMU
 {
   public:
-    MMU(const Params *p) : BaseMMU(p) {}
+    MMU(const Params &p) : BaseMMU(p) {}
 };
 
 } // namespace Iris
index e99c679ef64d34d94b1b0cbce85924de5f8292eb..84dd59d460f27b69aa308586ac3e2ef9248a72cf 100644 (file)
@@ -67,7 +67,7 @@ Iris::TLB::translateTiming(const RequestPtr &req, ::ThreadContext *tc,
 }
 
 Iris::TLB *
-IrisTLBParams::create()
+IrisTLBParams::create() const
 {
-    return new Iris::TLB(this);
+    return new Iris::TLB(*this);
 }
index 1d9c216bcb1d59f18968624ae9d4c6e43391be42..75d87436c46bf179d5673420b58fc51fd6186896 100644 (file)
@@ -36,7 +36,7 @@ namespace Iris
 class TLB : public BaseTLB
 {
   public:
-    TLB(const Params *p) : BaseTLB(p) {}
+    TLB(const Params &p) : BaseTLB(p) {}
 
     void demapPage(Addr vaddr, uint64_t asn) override {}
     void flushAll() override {}
index 080dc35e9b5b301f98916805c14421fcd2c90e77..8beba8bf54f617130b1a4ae6861011ae6b382e38 100644 (file)
@@ -51,10 +51,10 @@ using namespace FreeBSD;
 namespace ArmISA
 {
 
-FsFreebsd::FsFreebsd(Params *p) : ArmISA::FsWorkload(p),
-    enableContextSwitchStatsDump(p->enable_context_switch_stats_dump)
+FsFreebsd::FsFreebsd(const Params &p) : ArmISA::FsWorkload(p),
+    enableContextSwitchStatsDump(p.enable_context_switch_stats_dump)
 {
-    if (p->panic_on_panic) {
+    if (p.panic_on_panic) {
         kernelPanic = addKernelFuncEventOrPanic<PanicPCEvent>(
             "panic", "Kernel panic in simulated kernel");
     } else {
@@ -63,7 +63,7 @@ FsFreebsd::FsFreebsd(Params *p) : ArmISA::FsWorkload(p),
 #endif
     }
 
-    if (p->panic_on_oops) {
+    if (p.panic_on_oops) {
         kernelOops = addKernelFuncEventOrPanic<PanicPCEvent>(
             "oops_exit", "Kernel oops in guest");
     }
@@ -80,7 +80,7 @@ FsFreebsd::initState()
     // Load symbols at physical address, we might not want
     // to do this permanently, for but early bootup work
     // it is helpful.
-    if (params()->early_kernel_symbols) {
+    if (params().early_kernel_symbols) {
         auto phys_globals = kernelObj->symtab().globals()->mask(_loadAddrMask);
         kernelSymtab.insert(*phys_globals);
         Loader::debugSymbolTable.insert(*phys_globals);
@@ -90,33 +90,33 @@ FsFreebsd::initState()
     // device trees.
     fatal_if(kernelSymtab.find("fdt_get_range") == kernelSymtab.end(),
              "Kernel must have fdt support.");
-    fatal_if(params()->dtb_filename == "", "dtb file is not specified.");
+    fatal_if(params().dtb_filename == "", "dtb file is not specified.");
 
     // Kernel supports flattened device tree and dtb file specified.
     // Using Device Tree Blob to describe system configuration.
-    inform("Loading DTB file: %s at address %#x\n", params()->dtb_filename,
-            params()->atags_addr + _loadAddrOffset);
+    inform("Loading DTB file: %s at address %#x\n", params().dtb_filename,
+            params().atags_addr + _loadAddrOffset);
 
-    auto *dtb_file = new ::Loader::DtbFile(params()->dtb_filename);
+    auto *dtb_file = new ::Loader::DtbFile(params().dtb_filename);
 
     warn_if(!dtb_file->addBootCmdLine(commandLine.c_str(), commandLine.size()),
             "Couldn't append bootargs to DTB file: %s",
-            params()->dtb_filename);
+            params().dtb_filename);
 
     Addr ra = dtb_file->findReleaseAddr();
     if (ra)
         bootReleaseAddr = ra & ~ULL(0x7F);
 
     dtb_file->buildImage().
-        offset(params()->atags_addr + _loadAddrOffset).
+        offset(params().atags_addr + _loadAddrOffset).
         write(system->physProxy);
     delete dtb_file;
 
     // Kernel boot requirements to set up r0, r1 and r2 in ARMv7
     for (auto *tc: system->threads) {
         tc->setIntReg(0, 0);
-        tc->setIntReg(1, params()->machine_type);
-        tc->setIntReg(2, params()->atags_addr + _loadAddrOffset);
+        tc->setIntReg(1, params().machine_type);
+        tc->setIntReg(2, params().atags_addr + _loadAddrOffset);
     }
 }
 
@@ -128,7 +128,7 @@ FsFreebsd::~FsFreebsd()
 } // namespace ArmISA
 
 ArmISA::FsFreebsd *
-ArmFsFreebsdParams::create()
+ArmFsFreebsdParams::create() const
 {
-    return new ArmISA::FsFreebsd(this);
+    return new ArmISA::FsFreebsd(*this);
 }
index eed1d09b5dabc09804bbe00a0344abdf61739688..67ac820d6139a160d0d475b52a7d3f0f432b0a9b 100644 (file)
@@ -47,10 +47,10 @@ class FsFreebsd : public ArmISA::FsWorkload
   public:
     /** Boilerplate params code */
     typedef ArmFsFreebsdParams Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(&_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     /** When enabled, dump stats/task info on context switches for
@@ -67,7 +67,7 @@ class FsFreebsd : public ArmISA::FsWorkload
      * mappings between taskIds and OS process IDs */
     std::ostream* taskFile;
 
-    FsFreebsd(Params *p);
+    FsFreebsd(const Params &p);
     ~FsFreebsd();
 
     void initState() override;
index 4bf6bcca6568a2ece66b9ec85f109b24f0925321..ecdb8aab3c92a2adb7614de84f4ce075ec6c4e33 100644 (file)
@@ -62,7 +62,7 @@ class ArmFreebsdObjectFileLoader : public Process::Loader
 {
   public:
     Process *
-    load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
+    load(const ProcessParams &params, ::Loader::ObjectFile *obj_file) override
     {
         auto arch = obj_file->getArch();
         auto opsys = obj_file->getOpSys();
@@ -150,12 +150,12 @@ static SyscallDescTable<ArmFreebsdProcess64::SyscallABI> syscallDescs64 = {
     {  477, "mmap", mmapFunc<ArmFreebsd64> }
 };
 
-ArmFreebsdProcess32::ArmFreebsdProcess32(ProcessParams * params,
+ArmFreebsdProcess32::ArmFreebsdProcess32(const ProcessParams &params,
         ::Loader::ObjectFile *objFile, ::Loader::Arch _arch) :
     ArmProcess32(params, objFile, _arch)
 {}
 
-ArmFreebsdProcess64::ArmFreebsdProcess64(ProcessParams * params,
+ArmFreebsdProcess64::ArmFreebsdProcess64(const ProcessParams &params,
         ::Loader::ObjectFile *objFile, ::Loader::Arch _arch) :
     ArmProcess64(params, objFile, _arch)
 {}
index b64a3a06bf675b9692afb8fac06c19e6a3c7381c..de6539b40e1635a6fe2ea5793721607e14d69e56 100644 (file)
@@ -77,8 +77,8 @@ struct Result<ABI, SyscallReturn,
 class ArmFreebsdProcess32 : public ArmProcess32, public ArmFreebsdProcessBits
 {
   public:
-    ArmFreebsdProcess32(ProcessParams * params, ::Loader::ObjectFile *objFile,
-                        ::Loader::Arch _arch);
+    ArmFreebsdProcess32(const ProcessParams &params,
+                        ::Loader::ObjectFile *objFile, ::Loader::Arch _arch);
 
     void initState() override;
 
@@ -96,8 +96,8 @@ class ArmFreebsdProcess32 : public ArmProcess32, public ArmFreebsdProcessBits
 class ArmFreebsdProcess64 : public ArmProcess64, public ArmFreebsdProcessBits
 {
   public:
-    ArmFreebsdProcess64(ProcessParams * params, ::Loader::ObjectFile *objFile,
-                        ::Loader::Arch _arch);
+    ArmFreebsdProcess64(const ProcessParams &params,
+                        ::Loader::ObjectFile *objFile, ::Loader::Arch _arch);
 
     void initState() override;
     void syscall(ThreadContext *tc) override;
index 0cafb1b70efafab0615fc732174cfdb854d46d02..110ed00c5d9d3da2d07715cb74ebc017da203901 100644 (file)
@@ -69,15 +69,15 @@ SkipFunc::returnFromFuncIn(ThreadContext *tc)
     }
 }
 
-FsWorkload::FsWorkload(Params *p) : KernelWorkload(*p)
+FsWorkload::FsWorkload(const Params &p) : KernelWorkload(p)
 {
     if (kernelObj) {
         kernelEntry = (kernelObj->entryPoint() & loadAddrMask()) +
             loadAddrOffset();
     }
 
-    bootLoaders.reserve(p->boot_loader.size());
-    for (const auto &bl : p->boot_loader) {
+    bootLoaders.reserve(p.boot_loader.size());
+    for (const auto &bl : p.boot_loader) {
         std::unique_ptr<Loader::ObjectFile> bl_obj;
         bl_obj.reset(Loader::createObjectFile(bl));
 
@@ -120,18 +120,18 @@ FsWorkload::initState()
         // Put the address of the boot loader into r7 so we know
         // where to branch to after the reset fault
         // All other values needed by the boot loader to know what to do
-        fatal_if(!arm_sys->params()->flags_addr,
+        fatal_if(!arm_sys->params().flags_addr,
                  "flags_addr must be set with bootloader");
 
-        fatal_if(!arm_sys->params()->gic_cpu_addr && is_gic_v2,
+        fatal_if(!arm_sys->params().gic_cpu_addr && is_gic_v2,
                  "gic_cpu_addr must be set with bootloader");
 
         for (auto *tc: arm_sys->threads) {
             if (!arm_sys->highestELIs64())
                 tc->setIntReg(3, kernelEntry);
             if (is_gic_v2)
-                tc->setIntReg(4, arm_sys->params()->gic_cpu_addr);
-            tc->setIntReg(5, arm_sys->params()->flags_addr);
+                tc->setIntReg(4, arm_sys->params().gic_cpu_addr);
+            tc->setIntReg(5, arm_sys->params().flags_addr);
         }
         inform("Using kernel entry physical address at %#x\n", kernelEntry);
     } else {
@@ -159,7 +159,7 @@ FsWorkload::getBootLoader(Loader::ObjectFile *const obj)
 } // namespace ArmISA
 
 ArmISA::FsWorkload *
-ArmFsWorkloadParams::create()
+ArmFsWorkloadParams::create() const
 {
-    return new ArmISA::FsWorkload(this);
+    return new ArmISA::FsWorkload(*this);
 }
index 0618b8a9d21f7bbb6198a5fc6a57b2b89e08c646..44616704756b14e80c63726dc67c11a3dbec20c5 100644 (file)
@@ -88,10 +88,10 @@ class FsWorkload : public KernelWorkload
 
   public:
     typedef ArmFsWorkloadParams Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(&_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     Addr
@@ -114,7 +114,7 @@ class FsWorkload : public KernelWorkload
             return Loader::Arm64;
     }
 
-    FsWorkload(Params *p);
+    FsWorkload(const Params &p);
 
     void initState() override;
 
index 13c281e4d15ffeeaf4d5ca10276daed60c2fbb24..f5e7782c1c6102b391945ebc9227f51365f39b3d 100644 (file)
@@ -40,9 +40,9 @@
 #include "arch/arm/system.hh"
 
 ArmISA::Interrupts *
-ArmInterruptsParams::create()
+ArmInterruptsParams::create() const
 {
-    return new ArmISA::Interrupts(this);
+    return new ArmISA::Interrupts(*this);
 }
 
 bool
index 5c42dd959cefbe8f2ddedcb1ef45cb11a45f68ee..b9f6d6e15a149de9a44f45ef33a24aa2dff2f9b9 100644 (file)
@@ -76,13 +76,13 @@ class Interrupts : public BaseInterrupts
 
     typedef ArmInterruptsParams Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    Interrupts(Params * p) : BaseInterrupts(p)
+    Interrupts(const Params &p) : BaseInterrupts(p)
     {
         clearAll();
     }
index 8ec2dc6dd6cb9ee6e5ccbe4abb2bdb742cc68c0e..c54220deff285ba51983e811e6b6e5d1f45729f7 100644 (file)
@@ -60,9 +60,9 @@
 namespace ArmISA
 {
 
-ISA::ISA(Params *p) : BaseISA(p), system(NULL),
-    _decoderFlavor(p->decoderFlavor), _vecRegRenameMode(Enums::Full),
-    pmu(p->pmu), impdefAsNop(p->impdef_nop),
+ISA::ISA(const Params &p) : BaseISA(p), system(NULL),
+    _decoderFlavor(p.decoderFlavor), _vecRegRenameMode(Enums::Full),
+    pmu(p.pmu), impdefAsNop(p.impdef_nop),
     afterStartup(false)
 {
     miscRegs[MISCREG_SCTLR_RST] = 0;
@@ -76,7 +76,7 @@ ISA::ISA(Params *p) : BaseISA(p), system(NULL),
     // Give all ISA devices a pointer to this ISA
     pmu->setISA(this);
 
-    system = dynamic_cast<ArmSystem *>(p->system);
+    system = dynamic_cast<ArmSystem *>(p.system);
 
     // Cache system-level properties
     if (FullSystem && system) {
@@ -102,7 +102,7 @@ ISA::ISA(Params *p) : BaseISA(p), system(NULL),
         haveSVE = true;
         havePAN = false;
         haveSecEL2 = true;
-        sveVL = p->sve_vl_se;
+        sveVL = p.sve_vl_se;
         haveLSE = true;
         haveTME = true;
     }
@@ -120,16 +120,16 @@ ISA::ISA(Params *p) : BaseISA(p), system(NULL),
 
 std::vector<struct ISA::MiscRegLUTEntry> ISA::lookUpMiscReg(NUM_MISCREGS);
 
-const ArmISAParams *
+const ArmISAParams &
 ISA::params() const
 {
-    return dynamic_cast<const Params *>(_params);
+    return dynamic_cast<const Params &>(_params);
 }
 
 void
 ISA::clear()
 {
-    const Params *p(params());
+    const Params &p(params());
 
     // Invalidate cached copies of miscregs in the TLBs
     if (tc) {
@@ -220,7 +220,7 @@ ISA::clear()
 }
 
 void
-ISA::clear32(const ArmISAParams *p, const SCTLR &sctlr_rst)
+ISA::clear32(const ArmISAParams &p, const SCTLR &sctlr_rst)
 {
     CPSR cpsr = 0;
     cpsr.mode = MODE_USER;
@@ -249,7 +249,7 @@ ISA::clear32(const ArmISAParams *p, const SCTLR &sctlr_rst)
 
     miscRegs[MISCREG_CPACR] = 0;
 
-    miscRegs[MISCREG_FPSID] = p->fpsid;
+    miscRegs[MISCREG_FPSID] = p.fpsid;
 
     if (haveLPAE) {
         TTBCR ttbcr = miscRegs[MISCREG_TTBCR_NS];
@@ -272,7 +272,7 @@ ISA::clear32(const ArmISAParams *p, const SCTLR &sctlr_rst)
 }
 
 void
-ISA::clear64(const ArmISAParams *p)
+ISA::clear64(const ArmISAParams &p)
 {
     CPSR cpsr = 0;
     Addr rvbar = system->resetAddr();
@@ -321,13 +321,13 @@ ISA::clear64(const ArmISAParams *p)
 }
 
 void
-ISA::initID32(const ArmISAParams *p)
+ISA::initID32(const ArmISAParams &p)
 {
     // Initialize configurable default values
 
     uint32_t midr;
-    if (p->midr != 0x0)
-        midr = p->midr;
+    if (p.midr != 0x0)
+        midr = p.midr;
     else if (highestELIs64)
         // Cortex-A57 TRM r0p0 MIDR
         midr = 0x410fd070;
@@ -339,17 +339,17 @@ ISA::initID32(const ArmISAParams *p)
     miscRegs[MISCREG_MIDR_EL1] = midr;
     miscRegs[MISCREG_VPIDR] = midr;
 
-    miscRegs[MISCREG_ID_ISAR0] = p->id_isar0;
-    miscRegs[MISCREG_ID_ISAR1] = p->id_isar1;
-    miscRegs[MISCREG_ID_ISAR2] = p->id_isar2;
-    miscRegs[MISCREG_ID_ISAR3] = p->id_isar3;
-    miscRegs[MISCREG_ID_ISAR4] = p->id_isar4;
-    miscRegs[MISCREG_ID_ISAR5] = p->id_isar5;
+    miscRegs[MISCREG_ID_ISAR0] = p.id_isar0;
+    miscRegs[MISCREG_ID_ISAR1] = p.id_isar1;
+    miscRegs[MISCREG_ID_ISAR2] = p.id_isar2;
+    miscRegs[MISCREG_ID_ISAR3] = p.id_isar3;
+    miscRegs[MISCREG_ID_ISAR4] = p.id_isar4;
+    miscRegs[MISCREG_ID_ISAR5] = p.id_isar5;
 
-    miscRegs[MISCREG_ID_MMFR0] = p->id_mmfr0;
-    miscRegs[MISCREG_ID_MMFR1] = p->id_mmfr1;
-    miscRegs[MISCREG_ID_MMFR2] = p->id_mmfr2;
-    miscRegs[MISCREG_ID_MMFR3] = p->id_mmfr3;
+    miscRegs[MISCREG_ID_MMFR0] = p.id_mmfr0;
+    miscRegs[MISCREG_ID_MMFR1] = p.id_mmfr1;
+    miscRegs[MISCREG_ID_MMFR2] = p.id_mmfr2;
+    miscRegs[MISCREG_ID_MMFR3] = p.id_mmfr3;
 
     miscRegs[MISCREG_ID_ISAR5] = insertBits(
         miscRegs[MISCREG_ID_ISAR5], 19, 4,
@@ -357,24 +357,24 @@ ISA::initID32(const ArmISAParams *p)
 }
 
 void
-ISA::initID64(const ArmISAParams *p)
+ISA::initID64(const ArmISAParams &p)
 {
     // Initialize configurable id registers
-    miscRegs[MISCREG_ID_AA64AFR0_EL1] = p->id_aa64afr0_el1;
-    miscRegs[MISCREG_ID_AA64AFR1_EL1] = p->id_aa64afr1_el1;
+    miscRegs[MISCREG_ID_AA64AFR0_EL1] = p.id_aa64afr0_el1;
+    miscRegs[MISCREG_ID_AA64AFR1_EL1] = p.id_aa64afr1_el1;
     miscRegs[MISCREG_ID_AA64DFR0_EL1] =
-        (p->id_aa64dfr0_el1 & 0xfffffffffffff0ffULL) |
-        (p->pmu ?             0x0000000000000100ULL : 0); // Enable PMUv3
+        (p.id_aa64dfr0_el1 & 0xfffffffffffff0ffULL) |
+        (p.pmu ?             0x0000000000000100ULL : 0); // Enable PMUv3
 
-    miscRegs[MISCREG_ID_AA64DFR1_EL1] = p->id_aa64dfr1_el1;
-    miscRegs[MISCREG_ID_AA64ISAR0_EL1] = p->id_aa64isar0_el1;
-    miscRegs[MISCREG_ID_AA64ISAR1_EL1] = p->id_aa64isar1_el1;
-    miscRegs[MISCREG_ID_AA64MMFR0_EL1] = p->id_aa64mmfr0_el1;
-    miscRegs[MISCREG_ID_AA64MMFR1_EL1] = p->id_aa64mmfr1_el1;
-    miscRegs[MISCREG_ID_AA64MMFR2_EL1] = p->id_aa64mmfr2_el1;
+    miscRegs[MISCREG_ID_AA64DFR1_EL1] = p.id_aa64dfr1_el1;
+    miscRegs[MISCREG_ID_AA64ISAR0_EL1] = p.id_aa64isar0_el1;
+    miscRegs[MISCREG_ID_AA64ISAR1_EL1] = p.id_aa64isar1_el1;
+    miscRegs[MISCREG_ID_AA64MMFR0_EL1] = p.id_aa64mmfr0_el1;
+    miscRegs[MISCREG_ID_AA64MMFR1_EL1] = p.id_aa64mmfr1_el1;
+    miscRegs[MISCREG_ID_AA64MMFR2_EL1] = p.id_aa64mmfr2_el1;
 
     miscRegs[MISCREG_ID_DFR0_EL1] =
-        (p->pmu ? 0x03000000ULL : 0); // Enable PMUv3
+        (p.pmu ? 0x03000000ULL : 0); // Enable PMUv3
 
     miscRegs[MISCREG_ID_DFR0] = miscRegs[MISCREG_ID_DFR0_EL1];
 
@@ -2481,7 +2481,7 @@ ISA::MiscRegLUTEntryInitializer::highest(ArmSystem *const sys) const
 }  // namespace ArmISA
 
 ArmISA::ISA *
-ArmISAParams::create()
+ArmISAParams::create() const
 {
-    return new ArmISA::ISA(this);
+    return new ArmISA::ISA(*this);
 }
index 910dc2cc4e00d0afcb07b540cfbb3b07ab60ae54..4a824edce8fdc54cb836647ff44f7118086490f6 100644 (file)
@@ -461,10 +461,10 @@ namespace ArmISA
         void clear();
 
       protected:
-        void clear32(const ArmISAParams *p, const SCTLR &sctlr_rst);
-        void clear64(const ArmISAParams *p);
-        void initID32(const ArmISAParams *p);
-        void initID64(const ArmISAParams *p);
+        void clear32(const ArmISAParams &p, const SCTLR &sctlr_rst);
+        void clear64(const ArmISAParams &p);
+        void initID32(const ArmISAParams &p);
+        void initID64(const ArmISAParams &p);
 
         void addressTranslation(TLB::ArmTranslationType tran_type,
             BaseTLB::Mode mode, Request::Flags flags, RegVal val);
@@ -853,9 +853,9 @@ namespace ArmISA
 
         typedef ArmISAParams Params;
 
-        const Params *params() const;
+        const Params &params() const;
 
-        ISA(Params *p);
+        ISA(const Params &p);
     };
 }
 
index a8b07b99f4f3b97318b43bb62fa711ce36e4091a..0e5823e23c518b3244373afe8dd50019675c674a 100644 (file)
@@ -241,7 +241,7 @@ ArmKvmCPU::KvmCoreMiscRegInfo ArmKvmCPU::kvmCoreMiscRegs[] = {
     { 0, NUM_MISCREGS }
 };
 
-ArmKvmCPU::ArmKvmCPU(ArmKvmCPUParams *params)
+ArmKvmCPU::ArmKvmCPU(const ArmKvmCPUParams &params)
     : BaseKvmCPU(params),
       irqAsserted(false), fiqAsserted(false)
 {
@@ -843,7 +843,7 @@ ArmKvmCPU::updateTCStateVFP(uint64_t id, bool show_warnings)
 }
 
 ArmKvmCPU *
-ArmKvmCPUParams::create()
+ArmKvmCPUParams::create() const
 {
-    return new ArmKvmCPU(this);
+    return new ArmKvmCPU(*this);
 }
index cc3c93546eda891af8b2bfa068dfa547b4cfc840..2bf9557b90f038f8f0330dc1948876dfcdcd0e4f 100644 (file)
@@ -59,7 +59,7 @@
 class ArmKvmCPU : public BaseKvmCPU
 {
   public:
-    ArmKvmCPU(ArmKvmCPUParams *params);
+    ArmKvmCPU(const ArmKvmCPUParams &params);
     virtual ~ArmKvmCPU();
 
     void startup();
index 1001f81d35d9a74428723b9605271e7bcd4a8412..324507a2dabd410913c4f5fd7234a7f1eb715eab 100644 (file)
@@ -123,7 +123,7 @@ const std::vector<ArmV8KvmCPU::MiscRegInfo> ArmV8KvmCPU::miscRegIdMap = {
     MiscRegInfo(SYS_MPIDR_EL1, MISCREG_MPIDR_EL1, "MPIDR(EL1)"),
 };
 
-ArmV8KvmCPU::ArmV8KvmCPU(ArmV8KvmCPUParams *params)
+ArmV8KvmCPU::ArmV8KvmCPU(const ArmV8KvmCPUParams &params)
     : BaseArmKvmCPU(params)
 {
 }
@@ -397,7 +397,7 @@ ArmV8KvmCPU::getSysRegMap() const
 }
 
 ArmV8KvmCPU *
-ArmV8KvmCPUParams::create()
+ArmV8KvmCPUParams::create() const
 {
-    return new ArmV8KvmCPU(this);
+    return new ArmV8KvmCPU(*this);
 }
index dae9fe70ccefefb1e89a9633c9bb73c39005cb0a..8537bb5a1824609fcbdb0f59d5330bd1e87915b1 100644 (file)
@@ -79,7 +79,7 @@ struct ArmV8KvmCPUParams;
 class ArmV8KvmCPU : public BaseArmKvmCPU
 {
   public:
-    ArmV8KvmCPU(ArmV8KvmCPUParams *params);
+    ArmV8KvmCPU(const ArmV8KvmCPUParams &params);
     virtual ~ArmV8KvmCPU();
 
     void startup() override;
index 6fd2651c6404261ab601c290c4ac571374a16704..2a948c72f42ff00b2180651a0f74d955800c4e90 100644 (file)
@@ -59,7 +59,7 @@ using namespace ArmISA;
     INTERRUPT_ID(KVM_ARM_IRQ_TYPE_CPU, vcpu, KVM_ARM_IRQ_CPU_FIQ)
 
 
-BaseArmKvmCPU::BaseArmKvmCPU(BaseArmKvmCPUParams *params)
+BaseArmKvmCPU::BaseArmKvmCPU(const BaseArmKvmCPUParams &params)
     : BaseKvmCPU(params),
       irqAsserted(false), fiqAsserted(false),
       virtTimerPin(nullptr), prevDeviceIRQLevel(0)
@@ -90,7 +90,7 @@ BaseArmKvmCPU::startup()
 
     if (!vm.hasKernelIRQChip())
         virtTimerPin = static_cast<ArmSystem *>(system)\
-            ->getGenericTimer()->params()->int_virt->get(tc);
+            ->getGenericTimer()->params().int_virt->get(tc);
 }
 
 Tick
index 028cd3903733ead5a68813efa8939f762006e8f5..6419547117345491721a51c77b0b81f4ca679d73 100644 (file)
@@ -48,7 +48,7 @@ struct BaseArmKvmCPUParams;
 class BaseArmKvmCPU : public BaseKvmCPU
 {
   public:
-    BaseArmKvmCPU(BaseArmKvmCPUParams *params);
+    BaseArmKvmCPU(const BaseArmKvmCPUParams &params);
     virtual ~BaseArmKvmCPU();
 
     void startup() override;
index 97f0fa383dcdc452c96b44b650ed950b0ba2bebf..5f5cd14df47ce32f083b6a9f6c25c51859e22eea 100644 (file)
@@ -164,15 +164,15 @@ KvmKernelGicV2::writeCpu(ContextID ctx, Addr daddr, uint32_t data)
 
 
 
-MuxingKvmGic::MuxingKvmGic(const MuxingKvmGicParams *p)
+MuxingKvmGic::MuxingKvmGic(const MuxingKvmGicParams &p)
     : GicV2(p),
-      system(*p->system),
+      system(*p.system),
       kernelGic(nullptr),
       usingKvm(false)
 {
     if (auto vm = system.getKvmVM()) {
-        kernelGic = new KvmKernelGicV2(*vm, p->cpu_addr, p->dist_addr,
-                                       p->it_lines);
+        kernelGic = new KvmKernelGicV2(*vm, p.cpu_addr, p.dist_addr,
+                                       p.it_lines);
     }
 }
 
@@ -427,7 +427,7 @@ MuxingKvmGic::fromKvmToGicV2()
 }
 
 MuxingKvmGic *
-MuxingKvmGicParams::create()
+MuxingKvmGicParams::create() const
 {
-    return new MuxingKvmGic(this);
+    return new MuxingKvmGic(*this);
 }
index 9abd67ca9552fd58e6abd6ae7eabcadb72f43a19..79463b379769d8fdc65c7f60d8a2e9361e230fb5 100644 (file)
@@ -168,7 +168,7 @@ struct MuxingKvmGicParams;
 class MuxingKvmGic : public GicV2
 {
   public: // SimObject / Serializable / Drainable
-    MuxingKvmGic(const MuxingKvmGicParams *p);
+    MuxingKvmGic(const MuxingKvmGicParams &p);
     ~MuxingKvmGic();
 
     void startup() override;
index 8aba285cb758b81f7cf864c4459faf2e40b30d58..ad68b22bf1e6bc3000b79df8fbf0a08d5932c022 100644 (file)
@@ -63,8 +63,8 @@ using namespace Linux;
 namespace ArmISA
 {
 
-FsLinux::FsLinux(Params *p) : ArmISA::FsWorkload(p),
-    enableContextSwitchStatsDump(p->enable_context_switch_stats_dump)
+FsLinux::FsLinux(const Params &p) : ArmISA::FsWorkload(p),
+    enableContextSwitchStatsDump(p.enable_context_switch_stats_dump)
 {}
 
 void
@@ -75,7 +75,7 @@ FsLinux::initState()
     // Load symbols at physical address, we might not want
     // to do this permanently, for but early bootup work
     // it is helpful.
-    if (params()->early_kernel_symbols) {
+    if (params().early_kernel_symbols) {
         auto phys_globals = kernelObj->symtab().globals()->mask(_loadAddrMask);
         kernelSymtab.insert(*phys_globals);
         Loader::debugSymbolTable.insert(*phys_globals);
@@ -86,24 +86,24 @@ FsLinux::initState()
     // device trees.
     bool kernel_has_fdt_support =
         kernelSymtab.find("unflatten_device_tree") != kernelSymtab.end();
-    bool dtb_file_specified = params()->dtb_filename != "";
+    bool dtb_file_specified = params().dtb_filename != "";
 
     if (kernel_has_fdt_support && dtb_file_specified) {
         // Kernel supports flattened device tree and dtb file specified.
         // Using Device Tree Blob to describe system configuration.
-        inform("Loading DTB file: %s at address %#x\n", params()->dtb_filename,
-                params()->atags_addr + _loadAddrOffset);
+        inform("Loading DTB file: %s at address %#x\n", params().dtb_filename,
+                params().atags_addr + _loadAddrOffset);
 
-        auto *dtb_file = new ::Loader::DtbFile(params()->dtb_filename);
+        auto *dtb_file = new ::Loader::DtbFile(params().dtb_filename);
 
         if (!dtb_file->addBootCmdLine(
                     commandLine.c_str(), commandLine.size())) {
             warn("couldn't append bootargs to DTB file: %s\n",
-                 params()->dtb_filename);
+                 params().dtb_filename);
         }
 
         dtb_file->buildImage().
-            offset(params()->atags_addr + _loadAddrOffset).
+            offset(params().atags_addr + _loadAddrOffset).
             write(system->physProxy);
         delete dtb_file;
     } else {
@@ -152,7 +152,7 @@ FsLinux::initState()
         DPRINTF(Loader, "Boot atags was %d bytes in total\n", size << 2);
         DDUMP(Loader, boot_data, size << 2);
 
-        system->physProxy.writeBlob(params()->atags_addr + _loadAddrOffset,
+        system->physProxy.writeBlob(params().atags_addr + _loadAddrOffset,
                                     boot_data, size << 2);
 
         delete[] boot_data;
@@ -161,8 +161,8 @@ FsLinux::initState()
     // Kernel boot requirements to set up r0, r1 and r2 in ARMv7
     for (auto *tc: system->threads) {
         tc->setIntReg(0, 0);
-        tc->setIntReg(1, params()->machine_type);
-        tc->setIntReg(2, params()->atags_addr + _loadAddrOffset);
+        tc->setIntReg(1, params().machine_type);
+        tc->setIntReg(2, params().atags_addr + _loadAddrOffset);
     }
 }
 
@@ -203,7 +203,7 @@ FsLinux::startup()
     }
 
     const std::string dmesg_output = name() + ".dmesg";
-    if (params()->panic_on_panic) {
+    if (params().panic_on_panic) {
         kernelPanic = addKernelFuncEventOrPanic<Linux::KernelPanic>(
             "panic", "Kernel panic in simulated kernel", dmesg_output);
     } else {
@@ -211,7 +211,7 @@ FsLinux::startup()
             "panic", "Kernel panic in simulated kernel", dmesg_output);
     }
 
-    if (params()->panic_on_oops) {
+    if (params().panic_on_oops) {
         kernelOops = addKernelFuncEventOrPanic<Linux::KernelPanic>(
             "oops_exit", "Kernel oops in guest", dmesg_output);
     } else {
@@ -360,7 +360,7 @@ DumpStats::process(ThreadContext *tc)
 } // namespace ArmISA
 
 ArmISA::FsLinux *
-ArmFsLinuxParams::create()
+ArmFsLinuxParams::create() const
 {
-    return new ArmISA::FsLinux(this);
+    return new ArmISA::FsLinux(*this);
 }
index 6ab3c6c3da846b74d130b8945a1b64fa1f7e4491..8939b067bf4cde40515619edf4e9259204c3dcc3 100644 (file)
@@ -85,10 +85,10 @@ class FsLinux : public ArmISA::FsWorkload
   public:
     /** Boilerplate params code */
     typedef ArmFsLinuxParams Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(&_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     /** When enabled, dump stats/task info on context switches for
@@ -105,7 +105,7 @@ class FsLinux : public ArmISA::FsWorkload
      * mappings between taskIds and OS process IDs */
     OutputStream *taskFile = nullptr;
 
-    FsLinux(Params *p);
+    FsLinux(const Params &p);
     ~FsLinux();
 
     void initState() override;
index c190167227ebbdf6b0c32d19933142b9b77997b8..7110ee0b1b7e077d51619091a2caa1e71947ebc0 100644 (file)
@@ -64,7 +64,7 @@ class ArmLinuxObjectFileLoader : public Process::Loader
 {
   public:
     Process *
-    load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
+    load(const ProcessParams &params, ::Loader::ObjectFile *obj_file) override
     {
         auto arch = obj_file->getArch();
         auto opsys = obj_file->getOpSys();
@@ -845,12 +845,12 @@ static SyscallDescTable<ArmLinuxProcess64::SyscallABI> privSyscallDescs64 = {
     { 0x1005, "set_tls", setTLSFunc64 }
 };
 
-ArmLinuxProcess32::ArmLinuxProcess32(ProcessParams * params,
+ArmLinuxProcess32::ArmLinuxProcess32(const ProcessParams &params,
         ::Loader::ObjectFile *objFile, ::Loader::Arch _arch) :
     ArmProcess32(params, objFile, _arch)
 {}
 
-ArmLinuxProcess64::ArmLinuxProcess64(ProcessParams * params,
+ArmLinuxProcess64::ArmLinuxProcess64(const ProcessParams &params,
         ::Loader::ObjectFile *objFile, ::Loader::Arch _arch) :
     ArmProcess64(params, objFile, _arch)
 {}
index 21c2a293c97386ccf4c383fe3d1584d2ba5c22a7..57af06cc98337cf1c43239cf78693196042bb5da 100644 (file)
@@ -77,8 +77,8 @@ struct Result<ABI, SyscallReturn,
 class ArmLinuxProcess32 : public ArmProcess32, public ArmLinuxProcessBits
 {
   public:
-    ArmLinuxProcess32(ProcessParams * params, ::Loader::ObjectFile *objFile,
-                      ::Loader::Arch _arch);
+    ArmLinuxProcess32(const ProcessParams &params,
+                      ::Loader::ObjectFile *objFile, ::Loader::Arch _arch);
 
     void initState() override;
 
@@ -96,8 +96,8 @@ class ArmLinuxProcess32 : public ArmProcess32, public ArmLinuxProcessBits
 class ArmLinuxProcess64 : public ArmProcess64, public ArmLinuxProcessBits
 {
   public:
-    ArmLinuxProcess64(ProcessParams * params, ::Loader::ObjectFile *objFile,
-                      ::Loader::Arch _arch);
+    ArmLinuxProcess64(const ProcessParams &params,
+                      ::Loader::ObjectFile *objFile, ::Loader::Arch _arch);
 
     void initState() override;
     void syscall(ThreadContext *tc) override;
index 504e0ac04fa4fe56511178129bb1f1cf98d920aa..ca4716b5a208d80a9549f675cac5d7b8d6571fd9 100644 (file)
@@ -38,7 +38,7 @@
 #include "arch/arm/mmu.hh"
 
 ArmISA::MMU *
-ArmMMUParams::create()
+ArmMMUParams::create() const
 {
-    return new ArmISA::MMU(this);
+    return new ArmISA::MMU(*this);
 }
index 6494f1f9d1bbff9f96d674fd04d098f43b7db7d1..0337900d279f944ae9f836c9b6e062b3cc8078f0 100644 (file)
@@ -47,7 +47,7 @@ namespace ArmISA {
 class MMU : public BaseMMU
 {
   public:
-    MMU(const ArmMMUParams *p)
+    MMU(const ArmMMUParams &p)
       : BaseMMU(p)
     {}
 };
index e40b74c8dcd1c5e91a549cac7095bc0ce386730f..559602886456d1a0f273f3ff110c47378dfbf3cf 100644 (file)
@@ -225,7 +225,7 @@ Trace::ArmNativeTrace::check(NativeTraceRecord *record)
 //  ExeTracer Simulation Object
 //
 Trace::ArmNativeTrace *
-ArmNativeTraceParams::create()
+ArmNativeTraceParams::create() const
 {
-    return new Trace::ArmNativeTrace(this);
+    return new Trace::ArmNativeTrace(*this);
 }
index 99ee0b50af3e9f7d1fbd3ce8632c475f853abef1..429e77fae5366cab4800e132dfbc190791cb28f0 100644 (file)
@@ -98,14 +98,14 @@ class ArmNativeTrace : public NativeTrace
   public:
     typedef ArmNativeTraceParams Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    ArmNativeTrace(const Params *p) :
-        NativeTrace(p), stopOnPCError(p->stop_on_pc_error)
+    ArmNativeTrace(const Params &p) :
+        NativeTrace(p), stopOnPCError(p.stop_on_pc_error)
     {}
 
     void check(NativeTraceRecord *record);
index 97c66d2e2c507148f41698ced90586b009e9a961..17764e022549f17baa28b6034e6a333aac741c0d 100644 (file)
@@ -51,15 +51,15 @@ namespace ArmISA {
 
 const RegVal PMU::reg_pmcr_wr_mask = 0x39;
 
-PMU::PMU(const ArmPMUParams *p)
+PMU::PMU(const ArmPMUParams &p)
     : SimObject(p), BaseISADevice(),
       reg_pmcnten(0), reg_pmcr(0),
       reg_pmselr(0), reg_pminten(0), reg_pmovsr(0),
       reg_pmceid0(0),reg_pmceid1(0),
       clock_remainder(0),
-      maximumCounterCount(p->eventCounters),
+      maximumCounterCount(p.eventCounters),
       cycleCounter(*this, maximumCounterCount),
-      cycleCounterEventId(p->cycleEventId),
+      cycleCounterEventId(p.cycleEventId),
       swIncrementEvent(nullptr),
       reg_pmcr_conf(0),
       interrupt(nullptr)
@@ -71,13 +71,13 @@ PMU::PMU(const ArmPMUParams *p)
               maximumCounterCount);
     }
 
-    warn_if(!p->interrupt, "ARM PMU: No interrupt specified, interrupt " \
+    warn_if(!p.interrupt, "ARM PMU: No interrupt specified, interrupt " \
             "delivery disabled.\n");
 
     /* Setup the performance counter ID registers */
     reg_pmcr_conf.imp = 0x41;    // ARM Ltd.
     reg_pmcr_conf.idcode = 0x00;
-    reg_pmcr_conf.n = p->eventCounters;
+    reg_pmcr_conf.n = p.eventCounters;
 
     // Setup the hard-coded cycle counter, which is equivalent to
     // architected counter event type 0x11.
@@ -92,10 +92,10 @@ void
 PMU::setThreadContext(ThreadContext *tc)
 {
     DPRINTF(PMUVerbose, "Assigning PMU to ContextID %i.\n", tc->contextId());
-    auto pmu_params = static_cast<const ArmPMUParams *>(params());
+    const auto &pmu_params = static_cast<const ArmPMUParams &>(params());
 
-    if (pmu_params->interrupt)
-        interrupt = pmu_params->interrupt->get(tc);
+    if (pmu_params.interrupt)
+        interrupt = pmu_params.interrupt->get(tc);
 }
 
 void
@@ -809,7 +809,7 @@ PMU::SWIncrementEvent::write(uint64_t val)
 } // namespace ArmISA
 
 ArmISA::PMU *
-ArmPMUParams::create()
+ArmPMUParams::create() const
 {
-    return new ArmISA::PMU(this);
+    return new ArmISA::PMU(*this);
 }
index 18fc5796219f5d4de9ffedf73dcc70daa8e33f78..3cdcf1c0de815ae1a76c91d022bffe140fbd43e4 100644 (file)
@@ -93,7 +93,7 @@ namespace ArmISA {
  */
 class PMU : public SimObject, public ArmISA::BaseISADevice {
   public:
-    PMU(const ArmPMUParams *p);
+    PMU(const ArmPMUParams &p);
     ~PMU();
 
     void addEventProbe(unsigned int id, SimObject *obj, const char *name);
index 1734066cc839cffa8511066c1451c5672836b425..2174ae6983fc6ead9770a8f53a83f599e0e00319 100644 (file)
 using namespace std;
 using namespace ArmISA;
 
-ArmProcess::ArmProcess(ProcessParams *params, ::Loader::ObjectFile *objFile,
-                       ::Loader::Arch _arch)
+ArmProcess::ArmProcess(const ProcessParams &params,
+                       ::Loader::ObjectFile *objFile, ::Loader::Arch _arch)
     : Process(params,
-              new EmulationPageTable(params->name, params->pid, PageBytes),
+              new EmulationPageTable(params.name, params.pid, PageBytes),
               objFile),
       arch(_arch)
 {
-    fatal_if(params->useArchPT, "Arch page tables not implemented.");
+    fatal_if(params.useArchPT, "Arch page tables not implemented.");
 }
 
-ArmProcess32::ArmProcess32(ProcessParams *params,
+ArmProcess32::ArmProcess32(const ProcessParams &params,
         ::Loader::ObjectFile *objFile, ::Loader::Arch _arch)
     : ArmProcess(params, objFile, _arch)
 {
@@ -84,7 +84,7 @@ ArmProcess32::ArmProcess32(ProcessParams *params,
 }
 
 ArmProcess64::ArmProcess64(
-        ProcessParams *params, ::Loader::ObjectFile *objFile,
+        const ProcessParams &params, ::Loader::ObjectFile *objFile,
         ::Loader::Arch _arch)
     : ArmProcess(params, objFile, _arch)
 {
index d0694546211ce6fb6fa7668b2ff5b12dccfb44b1..bb9f0dbedea6508bcbc5c59c16418bee329c9733 100644 (file)
@@ -54,7 +54,7 @@ class ArmProcess : public Process
 {
   protected:
     ::Loader::Arch arch;
-    ArmProcess(ProcessParams * params, ::Loader::ObjectFile *objFile,
+    ArmProcess(const ProcessParams &params, ::Loader::ObjectFile *objFile,
                ::Loader::Arch _arch);
     template<class IntType>
     void argsInit(int pageSize, ArmISA::IntRegIndex spIndex);
@@ -74,7 +74,7 @@ class ArmProcess : public Process
 class ArmProcess32 : public ArmProcess
 {
   protected:
-    ArmProcess32(ProcessParams * params, ::Loader::ObjectFile *objFile,
+    ArmProcess32(const ProcessParams &params, ::Loader::ObjectFile *objFile,
                  ::Loader::Arch _arch);
 
     void initState() override;
@@ -117,7 +117,7 @@ struct Argument<ABI, Arg,
 class ArmProcess64 : public ArmProcess
 {
   protected:
-    ArmProcess64(ProcessParams * params, ::Loader::ObjectFile *objFile,
+    ArmProcess64(const ProcessParams &params, ::Loader::ObjectFile *objFile,
                  ::Loader::Arch _arch);
 
     void initState() override;
index 901fdd17b7cf0796bf523b4ff570e657727714d0..6e782bc593a26d5e713b615c2534a6211ac66e70 100644 (file)
@@ -138,21 +138,21 @@ const std::map<const std::string, FILE *> ArmSemihosting::stdioMap{
     {"stderr", ::stderr},
 };
 
-ArmSemihosting::ArmSemihosting(const ArmSemihostingParams *p)
+ArmSemihosting::ArmSemihosting(const ArmSemihostingParams &p)
     : SimObject(p),
-      cmdLine(p->cmd_line),
-      memReserve(p->mem_reserve),
-      stackSize(p->stack_size),
-      timeBase([p]{ struct tm t = p->time; return mkutctime(&t); }()),
+      cmdLine(p.cmd_line),
+      memReserve(p.mem_reserve),
+      stackSize(p.stack_size),
+      timeBase([p]{ struct tm t = p.time; return mkutctime(&t); }()),
       tickShift(calcTickShift()),
       semiErrno(0),
-      filesRootDir(!p->files_root_dir.empty() &&
-                   p->files_root_dir.back() != '/' ?
-                   p->files_root_dir + '/' : p->files_root_dir),
-      stdin(getSTDIO("stdin", p->stdin, "r")),
-      stdout(getSTDIO("stdout", p->stdout, "w")),
-      stderr(p->stderr == p->stdout ?
-             stdout : getSTDIO("stderr", p->stderr, "w"))
+      filesRootDir(!p.files_root_dir.empty() &&
+                   p.files_root_dir.back() != '/' ?
+                   p.files_root_dir + '/' : p.files_root_dir),
+      stdin(getSTDIO("stdin", p.stdin, "r")),
+      stdout(getSTDIO("stdout", p.stdout, "w")),
+      stderr(p.stderr == p.stdout ?
+             stdout : getSTDIO("stderr", p.stderr, "w"))
 {
     // Create an empty place-holder file for position 0 as semi-hosting
     // calls typically expect non-zero file handles.
@@ -1046,7 +1046,7 @@ operator << (std::ostream &os, const ArmSemihosting::InPlaceArg &ipa)
 
 
 ArmSemihosting *
-ArmSemihostingParams::create()
+ArmSemihostingParams::create() const
 {
-    return new ArmSemihosting(this);
+    return new ArmSemihosting(*this);
 }
index da0644fd8e4bcda6caa1991da9a8b5523fd0b361..fff969ffcb7942e256e21613c2d7e3a952fd8de8 100644 (file)
@@ -224,7 +224,7 @@ class ArmSemihosting : public SimObject
         SYS_GEM5_PSEUDO_OP = 0x100
     };
 
-    ArmSemihosting(const ArmSemihostingParams *p);
+    ArmSemihosting(const ArmSemihostingParams &p);
 
     /** Perform an Arm Semihosting call from aarch64 code. */
     bool call64(ThreadContext *tc, bool gem5_ops);
index 090c8c95fdf57a688e0cea984ce12bf077fe66ae..2f3f815540ca70e6d19b2bbe97c4e504244fed6d 100644 (file)
 
 using namespace ArmISA;
 
-Stage2MMU::Stage2MMU(const Params *p)
-    : SimObject(p), _stage1Tlb(p->tlb), _stage2Tlb(p->stage2_tlb),
-      port(_stage1Tlb->getTableWalker(), p->sys),
-      requestorId(p->sys->getRequestorId(_stage1Tlb->getTableWalker()))
+Stage2MMU::Stage2MMU(const Params &p)
+    : SimObject(p), _stage1Tlb(p.tlb), _stage2Tlb(p.stage2_tlb),
+      port(_stage1Tlb->getTableWalker(), p.sys),
+      requestorId(p.sys->getRequestorId(_stage1Tlb->getTableWalker()))
 {
     // we use the stage-one table walker as the parent of the port,
     // and to get our requestor id, this is done to keep things
@@ -142,7 +142,7 @@ Stage2MMU::Stage2Translation::finish(const Fault &_fault,
 }
 
 ArmISA::Stage2MMU *
-ArmStage2MMUParams::create()
+ArmStage2MMUParams::create() const
 {
-    return new ArmISA::Stage2MMU(this);
+    return new ArmISA::Stage2MMU(*this);
 }
index ed9f59e1ad044b720780b5fd814b2dc981ba0136..c416b15f6403002439f6bb23d7b398baf7545e24 100644 (file)
@@ -102,7 +102,7 @@ class Stage2MMU : public SimObject
     };
 
     typedef ArmStage2MMUParams Params;
-    Stage2MMU(const Params *p);
+    Stage2MMU(const Params &p);
 
     /**
      * Get the port that ultimately belongs to the stage-two MMU, but
index 20ebee2df4141ec7d7061ffc2a23e0991f63406b..d105fd44afd4e1a3a0388fd4dc4ec108db204dc1 100644 (file)
@@ -55,31 +55,31 @@ using namespace std;
 using namespace Linux;
 using namespace ArmISA;
 
-ArmSystem::ArmSystem(Params *p)
+ArmSystem::ArmSystem(const Params &p)
     : System(p),
-      _haveSecurity(p->have_security),
-      _haveLPAE(p->have_lpae),
-      _haveVirtualization(p->have_virtualization),
-      _haveCrypto(p->have_crypto),
+      _haveSecurity(p.have_security),
+      _haveLPAE(p.have_lpae),
+      _haveVirtualization(p.have_virtualization),
+      _haveCrypto(p.have_crypto),
       _genericTimer(nullptr),
       _gic(nullptr),
       _pwrCtrl(nullptr),
-      _highestELIs64(p->highest_el_is_64),
-      _physAddrRange64(p->phys_addr_range_64),
-      _haveLargeAsid64(p->have_large_asid_64),
-      _haveTME(p->have_tme),
-      _haveSVE(p->have_sve),
-      _sveVL(p->sve_vl),
-      _haveLSE(p->have_lse),
-      _havePAN(p->have_pan),
-      _haveSecEL2(p->have_secel2),
-      semihosting(p->semihosting),
-      multiProc(p->multi_proc)
-{
-    if (p->auto_reset_addr) {
+      _highestELIs64(p.highest_el_is_64),
+      _physAddrRange64(p.phys_addr_range_64),
+      _haveLargeAsid64(p.have_large_asid_64),
+      _haveTME(p.have_tme),
+      _haveSVE(p.have_sve),
+      _sveVL(p.sve_vl),
+      _haveLSE(p.have_lse),
+      _havePAN(p.have_pan),
+      _haveSecEL2(p.have_secel2),
+      semihosting(p.semihosting),
+      multiProc(p.multi_proc)
+{
+    if (p.auto_reset_addr) {
         _resetAddr = workload->getEntry();
     } else {
-        _resetAddr = p->reset_addr;
+        _resetAddr = p.reset_addr;
         warn_if(workload->getEntry() != _resetAddr,
                 "Workload entry point %#x and reset address %#x are different",
                 workload->getEntry(), _resetAddr);
@@ -236,7 +236,7 @@ ArmSystem::callClearWakeRequest(ThreadContext *tc)
 }
 
 ArmSystem *
-ArmSystemParams::create()
+ArmSystemParams::create() const
 {
-    return new ArmSystem(this);
+    return new ArmSystem(*this);
 }
index 62dfe76e611ff74f5778ed7c23922f2b24aab22c..628f15ccde91a99a43613cbe8f4cb303b676240e 100644 (file)
@@ -146,13 +146,13 @@ class ArmSystem : public System
     static constexpr Addr PageShift = ArmISA::PageShift;
 
     typedef ArmSystemParams Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    ArmSystem(Params *p);
+    ArmSystem(const Params &p);
 
     /** true if this a multiprocessor system */
     bool multiProc;
index 26e20b280691c31c6f07f2dfcc42b344a4c55d4c..6e67dcd0bc0d64991a69bf075db39de942d27cc9 100644 (file)
 
 using namespace ArmISA;
 
-TableWalker::TableWalker(const Params *p)
+TableWalker::TableWalker(const Params &p)
     : ClockedObject(p),
       stage2Mmu(NULL), port(NULL), requestorId(Request::invldRequestorId),
-      isStage2(p->is_stage2), tlb(NULL),
+      isStage2(p.is_stage2), tlb(NULL),
       currState(NULL), pending(false),
-      numSquashable(p->num_squash_per_cycle),
+      numSquashable(p.num_squash_per_cycle),
       stats(this),
       pendingReqs(0),
       pendingChangeTick(curTick()),
@@ -76,7 +76,7 @@ TableWalker::TableWalker(const Params *p)
 
     // Cache system-level properties
     if (FullSystem) {
-        ArmSystem *armSys = dynamic_cast<ArmSystem *>(p->sys);
+        ArmSystem *armSys = dynamic_cast<ArmSystem *>(p.sys);
         assert(armSys);
         haveSecurity = armSys->haveSecurity();
         _haveLPAE = armSys->haveLPAE();
@@ -178,7 +178,7 @@ TableWalker::drain()
 void
 TableWalker::drainResume()
 {
-    if (params()->sys->isTimingMode() && currState) {
+    if (params().sys->isTimingMode() && currState) {
         delete currState;
         currState = NULL;
         pendingChange();
@@ -2252,9 +2252,9 @@ TableWalker::insertTableEntry(DescriptorBase &descriptor, bool longDescriptor)
 }
 
 ArmISA::TableWalker *
-ArmTableWalkerParams::create()
+ArmTableWalkerParams::create() const
 {
-    return new ArmISA::TableWalker(this);
+    return new ArmISA::TableWalker(*this);
 }
 
 LookupLevel
index 309c402af721e6847ef873cfd30e90e643ddd652..dbb480e465e17a9f239c17cb11257974bf4d8d3b 100644 (file)
@@ -914,13 +914,13 @@ class TableWalker : public ClockedObject
 
   public:
    typedef ArmTableWalkerParams Params;
-    TableWalker(const Params *p);
+    TableWalker(const Params &p);
     virtual ~TableWalker();
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     void init() override;
index 700988e4bd0710922f68d04ab2860f94564484e1..0f9d7cde080b80ad063791df1ad652e472466cc5 100644 (file)
 using namespace std;
 using namespace ArmISA;
 
-TLB::TLB(const ArmTLBParams *p)
-    : BaseTLB(p), table(new TlbEntry[p->size]), size(p->size),
-      isStage2(p->is_stage2), stage2Req(false), stage2DescReq(false), _attr(0),
-      directToStage2(false), tableWalker(p->walker), stage2Tlb(NULL),
+TLB::TLB(const ArmTLBParams &p)
+    : BaseTLB(p), table(new TlbEntry[p.size]), size(p.size),
+      isStage2(p.is_stage2), stage2Req(false), stage2DescReq(false), _attr(0),
+      directToStage2(false), tableWalker(p.walker), stage2Tlb(NULL),
       stage2Mmu(NULL), test(nullptr), stats(this),  rangeMRU(1),
       aarch64(false), aarch64EL(EL0), isPriv(false), isSecure(false),
       isHyp(false), asid(0), vmid(0), hcr(0), dacr(0),
       miscRegValid(false), miscRegContext(0), curTranType(NormalTran)
 {
-    const ArmSystem *sys = dynamic_cast<const ArmSystem *>(p->sys);
+    const ArmSystem *sys = dynamic_cast<const ArmSystem *>(p.sys);
 
     tableWalker->setTlb(this);
 
@@ -1641,7 +1641,7 @@ TLB::testWalk(Addr pa, Addr size, Addr va, bool is_secure, Mode mode,
 
 
 ArmISA::TLB *
-ArmTLBParams::create()
+ArmTLBParams::create() const
 {
-    return new ArmISA::TLB(this);
+    return new ArmISA::TLB(*this);
 }
index e46d400a18446c04522163169de1f921b7f4c26c..9576b20a128b221f1c724ea303d417879d1dac58 100644 (file)
@@ -195,8 +195,8 @@ class TLB : public BaseTLB
     int rangeMRU; //On lookup, only move entries ahead when outside rangeMRU
 
   public:
-    TLB(const ArmTLBParams *p);
-    TLB(const Params *p, int _size, TableWalker *_walker);
+    TLB(const ArmTLBParams &p);
+    TLB(const Params &p, int _size, TableWalker *_walker);
 
     /** Lookup an entry in the TLB
      * @param vpn virtual address
@@ -439,10 +439,10 @@ protected:
                        ArmTranslationType tranType = NormalTran);
 
 public:
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
     inline void invalidateMiscReg() { miscRegValid = false; }
 
index c7bf97703bbd381b6b5cdd9beec1daaf233d1ddc..dda3a884a14fac71f2a02fdbe91d374edd45d6e2 100644 (file)
@@ -1365,7 +1365,7 @@ TarmacParserRecord::iSetStateToStr(ISetState isetstate) const
 } // namespace Trace
 
 Trace::TarmacParser *
-TarmacParserParams::create()
+TarmacParserParams::create() const
 {
-    return new Trace::TarmacParser(this);
+    return new Trace::TarmacParser(*this);
 }
index ecfc6dee8b59c71dcaa80e83727c5eea15ce81d8..3486cb2fa5cc541feebe3cea3eded6474e43145e 100644 (file)
@@ -216,17 +216,17 @@ class TarmacParser : public InstTracer
   public:
     typedef TarmacParserParams Params;
 
-    TarmacParser(const Params *p) : InstTracer(p), startPc(p->start_pc),
-                                    exitOnDiff(p->exit_on_diff),
-                                    exitOnInsnDiff(p->exit_on_insn_diff),
-                                    memWrCheck(p->mem_wr_check),
-                                    ignoredAddrRange(p->ignore_mem_addr),
-                                    cpuId(p->cpu_id),
+    TarmacParser(const Params &p) : InstTracer(p), startPc(p.start_pc),
+                                    exitOnDiff(p.exit_on_diff),
+                                    exitOnInsnDiff(p.exit_on_insn_diff),
+                                    memWrCheck(p.mem_wr_check),
+                                    ignoredAddrRange(p.ignore_mem_addr),
+                                    cpuId(p.cpu_id),
                                     macroopInProgress(false)
     {
         assert(!(exitOnDiff && exitOnInsnDiff));
 
-        trace.open(p->path_to_trace.c_str());
+        trace.open(p.path_to_trace.c_str());
         if (startPc == 0x0) {
             started = true;
         } else {
index a3d4a1ecc292ad5c83fef3561212cc96a09d193a..5d1b7120dcaa5e9a204dc1227d78d1064e9caf14 100644 (file)
@@ -51,10 +51,10 @@ TarmacContext::tarmacCpuName() const
     return "cpu" + std::to_string(id);
 }
 
-TarmacTracer::TarmacTracer(const Params *p)
+TarmacTracer::TarmacTracer(const Params &p)
   : InstTracer(p),
-    startTick(p->start_tick),
-    endTick(p->end_tick)
+    startTick(p.start_tick),
+    endTick(p.end_tick)
 {
     // Wrong parameter setting: The trace end happens before the
     // trace start.
@@ -95,7 +95,7 @@ TarmacTracer::getInstRecord(Tick when, ThreadContext *tc,
 } // namespace Trace
 
 Trace::TarmacTracer *
-TarmacTracerParams::create()
+TarmacTracerParams::create() const
 {
-    return new Trace::TarmacTracer(this);
+    return new Trace::TarmacTracer(*this);
 }
index a51def5af9a3e2cf305cc19050726f4d25aeb26d..fb2d96d398e6c8fd47abd4b1312f43aaf1ce2f2b 100644 (file)
@@ -87,7 +87,7 @@ class TarmacTracer : public InstTracer
   public:
     typedef TarmacTracerParams Params;
 
-    TarmacTracer(const Params *p);
+    TarmacTracer(const Params &p);
 
     /**
      * Generates a TarmacTracerRecord, depending on the Tarmac version.
index 51dd8f53d4a64d458d72fda155001533e54d4089..c8e1d0c3535d53589fe7d898a3fc6c580a6cf482 100644 (file)
@@ -42,14 +42,14 @@ class BaseInterrupts : public SimObject
   public:
     typedef BaseInterruptsParams Params;
 
-    BaseInterrupts(Params *p) : SimObject(p) {}
+    BaseInterrupts(const Params &p) : SimObject(p) {}
 
     virtual void setThreadContext(ThreadContext *_tc) { tc = _tc; }
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     /*
index fd1eb2f715eabf1b1087fd9a3f769f675ade7092..8f7ea883f27930ae20ec433e7048301770e32f8e 100644 (file)
@@ -47,8 +47,8 @@ class BaseMMU : public SimObject
   protected:
     typedef BaseMMUParams Params;
 
-    BaseMMU(const Params *p)
-      : SimObject(p), dtb(p->dtb), itb(p->itb)
+    BaseMMU(const Params &p)
+      : SimObject(p), dtb(p.dtb), itb(p.itb)
     {}
 
   public:
index f144f695c74d4846b330d5080e2e50e80bb17536..59b3a0104330b55cdfeac3175a048fbe420210cc 100644 (file)
@@ -50,7 +50,7 @@ class ThreadContext;
 class BaseTLB : public SimObject
 {
   protected:
-    BaseTLB(const Params *p) : SimObject(p) {}
+    BaseTLB(const Params &p) : SimObject(p) {}
 
   public:
 
index dfc5f306bcfbb5b1b0f53191970e9ed54472a48e..7421f3fa1eef3d93fee84b8b6b1638d3595f177e 100644 (file)
@@ -186,7 +186,7 @@ Interrupts::interruptsPending() const
 }
 
 MipsISA::Interrupts *
-MipsInterruptsParams::create()
+MipsInterruptsParams::create() const
 {
-    return new MipsISA::Interrupts(this);
+    return new MipsISA::Interrupts(*this);
 }
index f79a8dfa852d923fb473ba1c64edd83485197fd2..edde87727c82db7744baa07d70d3e0cae8b81073 100644 (file)
@@ -49,13 +49,13 @@ class Interrupts : public BaseInterrupts
   public:
     typedef MipsInterruptsParams Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    Interrupts(Params * p) : BaseInterrupts(p) {}
+    Interrupts(const Params &p) : BaseInterrupts(p) {}
 
     //  post(int int_num, int index) is responsible
     //  for posting an interrupt. It sets a bit
index 5fbb6cf06475038b608cbcd98a6d4b481f2e2ba5..733ba0aa8e0c0997f0ccbdd872647c6d39d6c5aa 100644 (file)
@@ -87,8 +87,8 @@ ISA::miscRegNames[NumMiscRegs] =
     "LLFlag"
 };
 
-ISA::ISA(Params *p) : BaseISA(p), numThreads(p->num_threads),
-    numVpes(p->num_vpes)
+ISA::ISA(const Params &p) : BaseISA(p), numThreads(p.num_threads),
+    numVpes(p.num_vpes)
 {
     miscRegFile.resize(NumMiscRegs);
     bankType.resize(NumMiscRegs);
@@ -140,10 +140,10 @@ ISA::ISA(Params *p) : BaseISA(p), numThreads(p->num_threads),
     clear();
 }
 
-const MipsISAParams *
+const MipsISAParams &
 ISA::params() const
 {
-    return dynamic_cast<const Params *>(_params);
+    return dynamic_cast<const Params &>(_params);
 }
 
 void
@@ -570,7 +570,7 @@ ISA::processCP0Event(BaseCPU *cpu, CP0EventType cp0EventType)
 }
 
 MipsISA::ISA *
-MipsISAParams::create()
+MipsISAParams::create() const
 {
-    return new MipsISA::ISA(this);
+    return new MipsISA::ISA(*this);
 }
index 301f573df58af4a604a02db61c5b7918c6e7e962..1b810466ea0791709fe51ad0b326903a8cf34ec4 100644 (file)
@@ -128,9 +128,9 @@ namespace MipsISA
         static std::string miscRegNames[NumMiscRegs];
 
       public:
-        const Params *params() const;
+        const Params &params() const;
 
-        ISA(Params *p);
+        ISA(const Params &p);
 
         RegId flattenRegId(const RegId& regId) const { return regId; }
 
index 3bc88dfea1fc125c179d7be66da24d5dc3177b77..ad423173c75676adce3362c7b76a8c753ec45e80 100644 (file)
@@ -52,7 +52,7 @@ class MipsLinuxObjectFileLoader : public Process::Loader
 {
   public:
     Process *
-    load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
+    load(const ProcessParams &params, ::Loader::ObjectFile *obj_file) override
     {
         if (obj_file->getArch() != ::Loader::Mips)
             return nullptr;
@@ -470,7 +470,7 @@ SyscallDescTable<MipsProcess::SyscallABI> MipsLinuxProcess::syscallDescs = {
     { 4319, "eventfd" }
 };
 
-MipsLinuxProcess::MipsLinuxProcess(ProcessParams * params,
+MipsLinuxProcess::MipsLinuxProcess(const ProcessParams &params,
                                    ::Loader::ObjectFile *objFile) :
     MipsProcess(params, objFile)
 {}
index 981526ca9789d1d8438e8b937353f38dc1b81212..04cbd169eccd39a336f6f4682a0a9df1385d1d42 100644 (file)
@@ -39,7 +39,8 @@ class MipsLinuxProcess : public MipsProcess
 {
   public:
     /// Constructor.
-    MipsLinuxProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
+    MipsLinuxProcess(const ProcessParams &params,
+                     ::Loader::ObjectFile *objFile);
 
     /// The target system's hostname.
     static const char *hostname;
index ea405fa7b7188881dacf40aeeca4a0f0e89cb3b0..a42685baf0fbb3230848f12fe7de11654f2e9e27 100644 (file)
@@ -38,7 +38,7 @@
 #include "arch/mips/mmu.hh"
 
 MipsISA::MMU *
-MipsMMUParams::create()
+MipsMMUParams::create() const
 {
-    return new MipsISA::MMU(this);
+    return new MipsISA::MMU(*this);
 }
index ea8369fd14b0f91d64bb4a92a13265b467a18610..1ac15773c89e9623a7c64b9fd390725d9461628d 100644 (file)
@@ -47,7 +47,7 @@ namespace MipsISA {
 class MMU : public BaseMMU
 {
   public:
-    MMU(const MipsMMUParams *p)
+    MMU(const MipsMMUParams &p)
       : BaseMMU(p)
     {}
 };
index f8916af8b1d77c00ba53b066adc92d7f6c1a91f1..f0f9a7bc9e6a89a77ba855e7b40efc2339446d12 100644 (file)
 using namespace std;
 using namespace MipsISA;
 
-MipsProcess::MipsProcess(ProcessParams *params, ::Loader::ObjectFile *objFile)
+MipsProcess::MipsProcess(const ProcessParams &params,
+                         ::Loader::ObjectFile *objFile)
     : Process(params,
-              new EmulationPageTable(params->name, params->pid, PageBytes),
+              new EmulationPageTable(params.name, params.pid, PageBytes),
               objFile)
 {
-    fatal_if(params->useArchPT, "Arch page tables not implemented.");
+    fatal_if(params.useArchPT, "Arch page tables not implemented.");
     // Set up stack. On MIPS, stack starts at the top of kuseg
     // user address space. MIPS stack grows down from here
     Addr stack_base = 0x7FFFFFFF;
index d236a8fff3a162db52e7632b0a02c7beedf05faf..578824c19c50951efacad4093362fa1ce27c048d 100644 (file)
@@ -44,7 +44,7 @@ class ObjectFile;
 class MipsProcess : public Process
 {
   protected:
-    MipsProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
+    MipsProcess(const ProcessParams &params, ::Loader::ObjectFile *objFile);
 
     void initState();
 
index 931e09a5cd489ce32bde563577963bf2baef367b..4dd0aa2363749d2eef6625ffc38deb13514dba72 100644 (file)
@@ -54,8 +54,7 @@ using namespace MipsISA;
 //  MIPS TLB
 //
 
-TLB::TLB(const Params *p)
-    : BaseTLB(p), size(p->size), nlu(0)
+TLB::TLB(const Params &p) : BaseTLB(p), size(p.size), nlu(0)
 {
     table = new PTE[size];
     memset(table, 0, sizeof(PTE[size]));
@@ -259,7 +258,7 @@ TLB::index(bool advance)
 }
 
 MipsISA::TLB *
-MipsTLBParams::create()
+MipsTLBParams::create() const
 {
-    return new MipsISA::TLB(this);
+    return new MipsISA::TLB(*this);
 }
index 2be2ddf717b42f0887d867b4e8e1d8150f8de71b..99c7280dcff306b2c01d893dba316e559d64ea1d 100644 (file)
@@ -63,7 +63,7 @@ class TLB : public BaseTLB
 
   public:
     typedef MipsTLBParams Params;
-    TLB(const Params *p);
+    TLB(const Params &p);
 
     int probeEntry(Addr vpn,uint8_t) const;
     MipsISA::PTE *getEntry(unsigned) const;
index edfb2950144597feb347f69e5a0f3b4de9bb881a..3d3e3fa852372975f854dd19552a36b3d21e173d 100644 (file)
@@ -29,7 +29,7 @@
 #include "arch/power/interrupts.hh"
 
 PowerISA::Interrupts *
-PowerInterruptsParams::create()
+PowerInterruptsParams::create() const
 {
-    return new PowerISA::Interrupts(this);
+    return new PowerISA::Interrupts(*this);
 }
index 29e665cae82dca256a1d13cea1f531edcedc7f89..7ca791d27598a90fc78cbde4a0c5590425fcdae0 100644 (file)
@@ -43,13 +43,13 @@ class Interrupts : public BaseInterrupts
   public:
     typedef PowerInterruptsParams Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    Interrupts(Params *p) : BaseInterrupts(p) {}
+    Interrupts(const Params &p) : BaseInterrupts(p) {}
 
     void
     post(int int_num, int index)
index 87eb71674ccd683d89550b6a716b0d215bea0e2e..06b3d938600c07896c1cb5181d1de8e09a63a69e 100644 (file)
 namespace PowerISA
 {
 
-ISA::ISA(Params *p) : BaseISA(p)
+ISA::ISA(const Params &p) : BaseISA(p)
 {
     clear();
 }
 
-const PowerISAParams *
+const PowerISAParams &
 ISA::params() const
 {
-    return dynamic_cast<const Params *>(_params);
+    return dynamic_cast<const Params &>(_params);
 }
 
 }
 
 PowerISA::ISA *
-PowerISAParams::create()
+PowerISAParams::create() const
 {
-    return new PowerISA::ISA(this);
+    return new PowerISA::ISA(*this);
 }
 
index a0d4a4660113af65beaf4620253b4639d158cc18..1fbbddfaada65612184a6421c143d650f4070197 100644 (file)
@@ -128,9 +128,9 @@ class ISA : public BaseISA
         return reg;
     }
 
-    const Params *params() const;
+    const Params &params() const;
 
-    ISA(Params *p);
+    ISA(const Params &p);
 };
 
 } // namespace PowerISA
index 633c3a76be4b52a8d1faf6da748c325d4ab26903..75fff8933c93dae418a6c5dc2661c038c9d15ef1 100644 (file)
@@ -51,7 +51,7 @@ class PowerLinuxObjectFileLoader : public Process::Loader
 {
   public:
     Process *
-    load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
+    load(const ProcessParams &params, ::Loader::ObjectFile *obj_file) override
     {
         if (obj_file->getArch() != ::Loader::Power)
             return nullptr;
@@ -439,8 +439,8 @@ SyscallDescTable<PowerProcess::SyscallABI> PowerLinuxProcess::syscallDescs = {
     { 346, "epoll_pwait" },
 };
 
-PowerLinuxProcess::PowerLinuxProcess(ProcessParams * params,
-        ::Loader::ObjectFile *objFile) :
+PowerLinuxProcess::PowerLinuxProcess(const ProcessParams &params,
+                                     ::Loader::ObjectFile *objFile) :
     PowerProcess(params, objFile)
 {}
 
index 2c7883de82bf0a690b2ec8c24b7aa6147b2c3f83..eca3da1d5951019c8aaa9ca10e7e9f7da24bab5d 100644 (file)
@@ -38,7 +38,8 @@
 class PowerLinuxProcess : public PowerProcess
 {
   public:
-    PowerLinuxProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
+    PowerLinuxProcess(const ProcessParams &params,
+                      ::Loader::ObjectFile *objFile);
 
     void initState() override;
 
index cda2f299d2e77da8cc35701cde0408c77497eef5..5aefcb3254e2616dd1d7cdbec9756f03b5412f3e 100644 (file)
@@ -38,7 +38,7 @@
 #include "arch/power/mmu.hh"
 
 PowerISA::MMU *
-PowerMMUParams::create()
+PowerMMUParams::create() const
 {
-    return new PowerISA::MMU(this);
+    return new PowerISA::MMU(*this);
 }
index 127299f4da0bacb7a51a47d026bbd68ef6e51fc5..eb04f985817f396b636131ed7f6d73cce00f211b 100644 (file)
@@ -47,7 +47,7 @@ namespace PowerISA {
 class MMU : public BaseMMU
 {
   public:
-    MMU(const PowerMMUParams *p)
+    MMU(const PowerMMUParams &p)
       : BaseMMU(p)
     {}
 };
index 19834e9997bf4a7e0f3914fc6506ee832281bea8..1b7f58fb36ab8b075d5c7318c2d605971911a55a 100644 (file)
@@ -47,12 +47,12 @@ using namespace std;
 using namespace PowerISA;
 
 PowerProcess::PowerProcess(
-        ProcessParams *params, ::Loader::ObjectFile *objFile)
+       const ProcessParams &params, ::Loader::ObjectFile *objFile)
     : Process(params,
-              new EmulationPageTable(params->name, params->pid, PageBytes),
+              new EmulationPageTable(params.name, params.pid, PageBytes),
               objFile)
 {
-    fatal_if(params->useArchPT, "Arch page tables not implemented.");
+    fatal_if(params.useArchPT, "Arch page tables not implemented.");
     // Set up break point (Top of Heap)
     Addr brk_point = image.maxAddr();
     brk_point = roundUp(brk_point, PageBytes);
index 7e40183087198463271c17a87cf9d7f58740afff..1d64176ac8083259391abb241fce6f2019db2de8 100644 (file)
@@ -45,7 +45,7 @@ class ObjectFile;
 class PowerProcess : public Process
 {
   protected:
-    PowerProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
+    PowerProcess(const ProcessParams &params, ::Loader::ObjectFile *objFile);
 
     void initState() override;
 
index 2726ca341f6a0cb6c7d4afcae64b18db70bcb283..88f66e0a515c0868d756a23ad3bfda7245e59c47 100644 (file)
@@ -58,8 +58,7 @@ using namespace PowerISA;
 
 #define MODE2MASK(X) (1 << (X))
 
-TLB::TLB(const Params *p)
-    : BaseTLB(p), size(p->size), nlu(0)
+TLB::TLB(const Params &p) : BaseTLB(p), size(p.size), nlu(0)
 {
     table = new PowerISA::PTE[size];
     memset(table, 0, sizeof(PowerISA::PTE[size]));
@@ -281,7 +280,7 @@ TLB::index(bool advance)
 }
 
 PowerISA::TLB *
-PowerTLBParams::create()
+PowerTLBParams::create() const
 {
-    return new PowerISA::TLB(this);
+    return new PowerISA::TLB(*this);
 }
index c119d93145967b19b2aeed1fac5287f14c4ceca2..a9653e6c5aad7166fc300365e95705129e0295bf 100644 (file)
@@ -112,7 +112,7 @@ class TLB : public BaseTLB
 
   public:
     typedef PowerTLBParams Params;
-    TLB(const Params *p);
+    TLB(const Params &p);
     virtual ~TLB();
 
     void takeOverFrom(BaseTLB *otlb) override {}
index 9c90c681173f5b519db4380a31f851bf00df28c6..eb2120c51320f14fe69ccb01d602e31483e2bcaa 100644 (file)
 namespace RiscvISA
 {
 
-BareMetal::BareMetal(Params *p) : RiscvISA::FsWorkload(p),
-      bootloader(Loader::createObjectFile(p->bootloader))
+BareMetal::BareMetal(const Params &p) : RiscvISA::FsWorkload(p),
+      bootloader(Loader::createObjectFile(p.bootloader))
 {
-    fatal_if(!bootloader, "Could not load bootloader file %s.", p->bootloader);
+    fatal_if(!bootloader, "Could not load bootloader file %s.", p.bootloader);
     _resetVect = bootloader->entryPoint();
     bootloaderSymtab = bootloader->symtab();
 }
@@ -71,7 +71,7 @@ BareMetal::initState()
 } // namespace RiscvISA
 
 RiscvISA::BareMetal *
-RiscvBareMetalParams::create()
+RiscvBareMetalParams::create() const
 {
-    return new RiscvISA::BareMetal(this);
+    return new RiscvISA::BareMetal(*this);
 }
index 45478782bc21c9849bd776585996a029f564ba0a..f4c62a156d120c61d949ab98d9833fd906c94f95 100644 (file)
@@ -43,7 +43,7 @@ class BareMetal : public RiscvISA::FsWorkload
 
   public:
     typedef RiscvBareMetalParams Params;
-    BareMetal(Params *p);
+    BareMetal(const Params &p);
     ~BareMetal();
 
     void initState() override;
index 0fbd7170dc55a86bd5a31967147cdd3f7c8c7eb0..0f18bb32a2d2c2ba8be91f59c74c402ef44665dc 100644 (file)
@@ -46,8 +46,8 @@ class FsWorkload : public Workload
     Addr _resetVect;
 
   public:
-    FsWorkload(RiscvFsWorkloadParams *p) : Workload(p),
-        _isBareMetal(p->bare_metal), _resetVect(p->reset_vect)
+    FsWorkload(const RiscvFsWorkloadParams &p) : Workload(p),
+        _isBareMetal(p.bare_metal), _resetVect(p.reset_vect)
     {}
 
     // return reset vector
index 4ad5cea63ed93b6a9da4387373f13ae5b76c4ea4..2cc88f1abbad76fd6e4005f917c6ea74cd228c93 100644 (file)
@@ -29,7 +29,7 @@
 #include "arch/riscv/interrupts.hh"
 
 RiscvISA::Interrupts *
-RiscvInterruptsParams::create()
+RiscvInterruptsParams::create() const
 {
-    return new RiscvISA::Interrupts(this);
+    return new RiscvISA::Interrupts(*this);
 }
index bf9f2a369a849be04b9881b590af6509447945da..fba925e205406a8c8ba9cce086ba51ad7e1b63d3 100644 (file)
@@ -59,13 +59,13 @@ class Interrupts : public BaseInterrupts
   public:
     typedef RiscvInterruptsParams Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    Interrupts(Params * p) : BaseInterrupts(p), ip(0), ie(0) {}
+    Interrupts(const Params &p) : BaseInterrupts(p), ip(0), ie(0) {}
 
     std::bitset<NumInterruptTypes>
     globalMask() const
index 2823618ecbb9cbf0176fa3a90480f5a09dceb014..080bf83a1e971472a0124c7237cfff4fa0bd5f82 100644 (file)
@@ -176,16 +176,16 @@ M5_VAR_USED const std::array<const char *, NumMiscRegs> MiscRegNames = {{
     [MISCREG_FRM]           = "FRM",
 }};
 
-ISA::ISA(Params *p) : BaseISA(p)
+ISA::ISA(const Params &p) : BaseISA(p)
 {
     miscRegFile.resize(NumMiscRegs);
     clear();
 }
 
-const RiscvISAParams *
+const RiscvISAParams &
 ISA::params() const
 {
-    return dynamic_cast<const Params *>(_params);
+    return dynamic_cast<const Params &>(_params);
 }
 
 void ISA::clear()
@@ -413,7 +413,7 @@ ISA::unserialize(CheckpointIn &cp)
 }
 
 RiscvISA::ISA *
-RiscvISAParams::create()
+RiscvISAParams::create() const
 {
-    return new RiscvISA::ISA(this);
+    return new RiscvISA::ISA(*this);
 }
index 1ece3bdf91c516c2d5ed142c74877d225a80e753..50ff73edece5428699abbe211eff65c09704ed1e 100644 (file)
@@ -98,9 +98,9 @@ class ISA : public BaseISA
     void serialize(CheckpointOut &cp) const;
     void unserialize(CheckpointIn &cp);
 
-    const Params *params() const;
+    const Params &params() const;
 
-    ISA(Params *p);
+    ISA(const Params &p);
 };
 
 } // namespace RiscvISA
index 094097f16bbb3684452b97e2990e7151a8cf8987..5c0624de50259935e77b98ec63e5587679d8a07d 100644 (file)
@@ -55,7 +55,7 @@ class RiscvLinuxObjectFileLoader : public Process::Loader
 {
   public:
     Process *
-    load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
+    load(const ProcessParams &params, ::Loader::ObjectFile *obj_file) override
     {
         auto arch = obj_file->getArch();
         auto opsys = obj_file->getOpSys();
@@ -776,7 +776,7 @@ SyscallDescTable<RiscvProcess::SyscallABI>
     { 2011, "getmainvars" }
 };
 
-RiscvLinuxProcess64::RiscvLinuxProcess64(ProcessParams * params,
+RiscvLinuxProcess64::RiscvLinuxProcess64(const ProcessParams &params,
     ::Loader::ObjectFile *objFile) : RiscvProcess64(params, objFile)
 {}
 
@@ -787,7 +787,7 @@ RiscvLinuxProcess64::syscall(ThreadContext *tc)
     syscallDescs.get(tc->readIntReg(SyscallNumReg))->doSyscall(tc);
 }
 
-RiscvLinuxProcess32::RiscvLinuxProcess32(ProcessParams * params,
+RiscvLinuxProcess32::RiscvLinuxProcess32(const ProcessParams &params,
     ::Loader::ObjectFile *objFile) : RiscvProcess32(params, objFile)
 {}
 
index 8844273cd1800688ef3f0881838c094a7588f0e1..dd9157cbdf388900649a924ff22e3f25a95241d3 100644 (file)
@@ -42,7 +42,8 @@ class RiscvLinuxProcess64 : public RiscvProcess64
 {
   public:
     /// Constructor.
-    RiscvLinuxProcess64(ProcessParams * params, ::Loader::ObjectFile *objFile);
+    RiscvLinuxProcess64(const ProcessParams &params,
+                        ::Loader::ObjectFile *objFile);
 
     /// The target system's hostname.
     static const char *hostname;
@@ -60,7 +61,8 @@ class RiscvLinuxProcess32 : public RiscvProcess32
 {
   public:
     /// Constructor.
-    RiscvLinuxProcess32(ProcessParams * params, ::Loader::ObjectFile *objFile);
+    RiscvLinuxProcess32(const ProcessParams &params,
+                        ::Loader::ObjectFile *objFile);
 
     /// The target system's hostname.
     static const char *hostname;
index 6aba56035b35b3f5bfe8fe615d3b590fb806384e..a50f9bf88f03d170dd08571fe4110f845b0a1ce7 100644 (file)
@@ -38,7 +38,7 @@
 #include "arch/riscv/mmu.hh"
 
 RiscvISA::MMU *
-RiscvMMUParams::create()
+RiscvMMUParams::create() const
 {
-    return new RiscvISA::MMU(this);
+    return new RiscvISA::MMU(*this);
 }
index 361aa0870039aa8424ca0b378824638c124d0b66..d10ce137abc63286feddea751947957d6c665924 100644 (file)
@@ -47,7 +47,7 @@ namespace RiscvISA {
 class MMU : public BaseMMU
 {
   public:
-    MMU(const RiscvMMUParams *p)
+    MMU(const RiscvMMUParams &p)
       : BaseMMU(p)
     {}
 };
index 3832ece467ada54241a4358131fac7979c443266..98f13200aad981a82763925ad5ebeaf9358328ae 100644 (file)
@@ -581,7 +581,7 @@ Walker::WalkerState::pageFault(bool present)
 } /* end namespace RiscvISA */
 
 RiscvISA::Walker *
-RiscvPagetableWalkerParams::create()
+RiscvPagetableWalkerParams::create() const
 {
-    return new RiscvISA::Walker(this);
+    return new RiscvISA::Walker(*this);
 }
index de4d6353d3d7009c4da075840f5539e8fc56f4a0..d4fe1ab5c4f4922db8943a493b82b20166f29f24 100644 (file)
@@ -193,17 +193,17 @@ namespace RiscvISA
 
         typedef RiscvPagetableWalkerParams Params;
 
-        const Params *
+        const Params &
         params() const
         {
-            return static_cast<const Params *>(_params);
+            return static_cast<const Params &>(_params);
         }
 
-        Walker(const Params *params) :
+        Walker(const Params &params) :
             ClockedObject(params), port(name() + ".port", this),
-            funcState(this, NULL, NULL, true), tlb(NULL), sys(params->system),
+            funcState(this, NULL, NULL, true), tlb(NULL), sys(params.system),
             requestorId(sys->getRequestorId(this)),
-            numSquashable(params->num_squash_per_cycle),
+            numSquashable(params.num_squash_per_cycle),
             startWalkWrapperEvent([this]{ startWalkWrapper(); }, name())
         {
         }
index a17b5154ad9dfae3d632fd32fb72fdef69bec563..3dd157a1c3c398a31c58b36900638d56b2818794 100644 (file)
 using namespace std;
 using namespace RiscvISA;
 
-RiscvProcess::RiscvProcess(ProcessParams *params,
+RiscvProcess::RiscvProcess(const ProcessParams &params,
         ::Loader::ObjectFile *objFile) :
         Process(params,
-                new EmulationPageTable(params->name, params->pid, PageBytes),
+                new EmulationPageTable(params.name, params.pid, PageBytes),
                 objFile)
 {
-    fatal_if(params->useArchPT, "Arch page tables not implemented.");
+    fatal_if(params.useArchPT, "Arch page tables not implemented.");
 }
 
-RiscvProcess64::RiscvProcess64(ProcessParams *params,
+RiscvProcess64::RiscvProcess64(const ProcessParams &params,
         ::Loader::ObjectFile *objFile) :
         RiscvProcess(params, objFile)
 {
@@ -79,7 +79,7 @@ RiscvProcess64::RiscvProcess64(ProcessParams *params,
             max_stack_size, next_thread_stack_base, mmap_end);
 }
 
-RiscvProcess32::RiscvProcess32(ProcessParams *params,
+RiscvProcess32::RiscvProcess32(const ProcessParams &params,
         ::Loader::ObjectFile *objFile) :
         RiscvProcess(params, objFile)
 {
index 05cde41fe8332d186adcd24648b1422ba3982614..03f106e666e6da96dcdca7f8e35fe099be205b17 100644 (file)
@@ -47,7 +47,7 @@ class System;
 class RiscvProcess : public Process
 {
   protected:
-    RiscvProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
+    RiscvProcess(const ProcessParams &params, ::Loader::ObjectFile *objFile);
     template<class IntType>
     void argsInit(int pageSize);
 
@@ -88,14 +88,14 @@ struct Result<RiscvProcess::SyscallABI, SyscallReturn>
 class RiscvProcess64 : public RiscvProcess
 {
   protected:
-    RiscvProcess64(ProcessParams * params, ::Loader::ObjectFile *objFile);
+    RiscvProcess64(const ProcessParams &params, ::Loader::ObjectFile *objFile);
     void initState() override;
 };
 
 class RiscvProcess32 : public RiscvProcess
 {
   protected:
-    RiscvProcess32(ProcessParams * params, ::Loader::ObjectFile *objFile);
+    RiscvProcess32(const ProcessParams &params, ::Loader::ObjectFile *objFile);
     void initState() override;
 };
 
index 34ccc03754085f4eb1aede2a1046efe0afd4d24e..883a6ca5169032b0d6e90bee82927937664acacf 100644 (file)
@@ -65,15 +65,15 @@ buildKey(Addr vpn, uint16_t asid)
     return (static_cast<Addr>(asid) << 48) | vpn;
 }
 
-TLB::TLB(const Params *p)
-    : BaseTLB(p), size(p->size), tlb(size), lruSeq(0), stats(this)
+TLB::TLB(const Params &p)
+    : BaseTLB(p), size(p.size), tlb(size), lruSeq(0), stats(this)
 {
     for (size_t x = 0; x < size; x++) {
         tlb[x].trieHandle = NULL;
         freeList.push_back(&tlb[x]);
     }
 
-    walker = p->walker;
+    walker = p.walker;
     walker->setTLB(this);
 }
 
@@ -513,7 +513,7 @@ TLB::TlbStats::TlbStats(Stats::Group *parent)
 }
 
 RiscvISA::TLB *
-RiscvTLBParams::create()
+RiscvTLBParams::create() const
 {
-    return new TLB(this);
+    return new TLB(*this);
 }
index a92bdd2c1011355bc0bd62a2082c7899c07d6d87..cb6059e1763caee5017c5d6947111595168e0174 100644 (file)
@@ -83,7 +83,7 @@ class TLB : public BaseTLB
 
   public:
     typedef RiscvTLBParams Params;
-    TLB(const Params *p);
+    TLB(const Params &p);
 
     Walker *getWalker();
 
index b812f5967490f916ef2bace6b592085f94807ebc..fc842c2c38f60a7bb514e08835d939f5d6550b56 100644 (file)
@@ -52,7 +52,7 @@ FsWorkload::initState()
 } // namespace SparcISA
 
 SparcISA::FsWorkload *
-SparcFsWorkloadParams::create()
+SparcFsWorkloadParams::create() const
 {
-    return new SparcISA::FsWorkload(this);
+    return new SparcISA::FsWorkload(*this);
 }
index 5a054855000847f69bdc2b6908554413862328ca..96fea4c50dae6676f0f3d862bccffeabb7956f6c 100644 (file)
@@ -42,7 +42,7 @@ class FsWorkload : public Workload
     Loader::SymbolTable defaultSymtab;
 
   public:
-    FsWorkload(SparcFsWorkloadParams *params) : Workload(params) {}
+    FsWorkload(const SparcFsWorkloadParams &params) : Workload(params) {}
     void initState() override;
 
     Addr
index bc843f73faf002e703f78a5079f8a299700b5964..d957b4e1f9efd99c833f90b35652e16b60b56997 100644 (file)
@@ -29,7 +29,7 @@
 #include "arch/sparc/interrupts.hh"
 
 SparcISA::Interrupts *
-SparcInterruptsParams::create()
+SparcInterruptsParams::create() const
 {
-    return new SparcISA::Interrupts(this);
+    return new SparcISA::Interrupts(*this);
 }
index d32f5af4dbd50d7198dbf88d9a736b7076b0c947..7e5dd9dced83ac2a0808ac2ec801aab74f0a00aa 100644 (file)
@@ -63,13 +63,13 @@ class Interrupts : public BaseInterrupts
 
     typedef SparcInterruptsParams Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    Interrupts(Params * p) : BaseInterrupts(p)
+    Interrupts(const Params &p) : BaseInterrupts(p)
     {
         clearAll();
     }
index 4f2805f32c94ba2ee619f64f3d4e3e42c61398a9..c8ed63ee6918f173eb0556a9c4014a4e95c2f018 100644 (file)
@@ -59,15 +59,15 @@ buildPstateMask()
 
 static const PSTATE PstateMask = buildPstateMask();
 
-ISA::ISA(Params *p) : BaseISA(p)
+ISA::ISA(const Params &p) : BaseISA(p)
 {
     clear();
 }
 
-const SparcISAParams *
+const SparcISAParams &
 ISA::params() const
 {
-    return dynamic_cast<const Params *>(_params);
+    return dynamic_cast<const Params &>(_params);
 }
 
 void
@@ -761,7 +761,7 @@ ISA::unserialize(CheckpointIn &cp)
 }
 
 SparcISA::ISA *
-SparcISAParams::create()
+SparcISAParams::create() const
 {
-    return new SparcISA::ISA(this);
+    return new SparcISA::ISA(*this);
 }
index c92855b0bc321eec12defd10add49308fb89c2d0..288138413c3fd81d7256e43e5e7a68c2a54cae93 100644 (file)
@@ -217,9 +217,9 @@ class ISA : public BaseISA
 
 
     typedef SparcISAParams Params;
-    const Params *params() const;
+    const Params &params() const;
 
-    ISA(Params *p);
+    ISA(const Params &p);
 };
 }
 
index ce051ba950605f04aa08afec6b250076a75c677a..37205c7656e36440af45685fdac34b8a7ac1c67f 100644 (file)
@@ -48,7 +48,7 @@ class SparcLinuxObjectFileLoader : public Process::Loader
 {
   public:
     Process *
-    load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
+    load(const ProcessParams &params, ::Loader::ObjectFile *obj_file) override
     {
         auto arch = obj_file->getArch();
         auto opsys = obj_file->getOpSys();
@@ -75,7 +75,7 @@ SparcLinuxObjectFileLoader loader;
 
 } // anonymous namespace
 
-Sparc32LinuxProcess::Sparc32LinuxProcess(ProcessParams * params,
+Sparc32LinuxProcess::Sparc32LinuxProcess(const ProcessParams &params,
                                          ::Loader::ObjectFile *objFile)
     : Sparc32Process(params, objFile)
 {}
@@ -99,7 +99,7 @@ Sparc32LinuxProcess::handleTrap(int trapNum, ThreadContext *tc)
     }
 }
 
-Sparc64LinuxProcess::Sparc64LinuxProcess(ProcessParams * params,
+Sparc64LinuxProcess::Sparc64LinuxProcess(const ProcessParams &params,
                                          ::Loader::ObjectFile *objFile)
     : Sparc64Process(params, objFile)
 {}
index 0cea430c5596cfb9390534f42f2d74a21e41c017..c1ade86d0511cf2648d2ceaf70ce6d920b9c269b 100644 (file)
@@ -54,7 +54,8 @@ class Sparc32LinuxProcess : public SparcLinuxProcess, public Sparc32Process
 {
   public:
     /// Constructor.
-    Sparc32LinuxProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
+    Sparc32LinuxProcess(const ProcessParams &params,
+                        ::Loader::ObjectFile *objFile);
 
     void syscall(ThreadContext *tc) override;
 
@@ -66,7 +67,8 @@ class Sparc64LinuxProcess : public SparcLinuxProcess, public Sparc64Process
 {
   public:
     /// Constructor.
-    Sparc64LinuxProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
+    Sparc64LinuxProcess(const ProcessParams &params,
+                        ::Loader::ObjectFile *objFile);
 
     void syscall(ThreadContext *tc) override;
 
index 525d2acd309610bc38099a1c2ed46e8500be97c1..e2da2f436b60a7cc7e768879661bf78205e24859 100644 (file)
@@ -38,7 +38,7 @@
 #include "arch/sparc/mmu.hh"
 
 SparcISA::MMU *
-SparcMMUParams::create()
+SparcMMUParams::create() const
 {
-    return new SparcISA::MMU(this);
+    return new SparcISA::MMU(*this);
 }
index 915a6144441a88d5180100d943247b4033fb36ae..39f5008e4ee322a241148baf415dff00c012e80c 100644 (file)
@@ -47,7 +47,7 @@ namespace SparcISA {
 class MMU : public BaseMMU
 {
   public:
-    MMU(const SparcMMUParams *p)
+    MMU(const SparcMMUParams &p)
       : BaseMMU(p)
     {}
 };
index 6e9e206ed48a4ef88d54b0f530ed97ecb62d7a8f..7cd19c711866c46bcf759c96a0a57f4758cd9fc3 100644 (file)
@@ -93,7 +93,7 @@ Trace::SparcNativeTrace::check(NativeTraceRecord *record)
 //  ExeTracer Simulation Object
 //
 Trace::SparcNativeTrace *
-SparcNativeTraceParams::create()
+SparcNativeTraceParams::create() const
 {
-    return new Trace::SparcNativeTrace(this);
+    return new Trace::SparcNativeTrace(*this);
 };
index d1cec2240f4cec63b7384eb0bcb660086e788508..26e5dfaa55bb3b3775a698354fae7e17ec36811e 100644 (file)
@@ -39,7 +39,7 @@ namespace Trace {
 class SparcNativeTrace : public NativeTrace
 {
   public:
-    SparcNativeTrace(const Params *p) : NativeTrace(p)
+    SparcNativeTrace(const Params &p) : NativeTrace(p)
     {}
 
     void check(NativeTraceRecord *record);
index 159f58237d6f4ea1ae92b9f3374902df8f578022..8f3509f8a90bdd3ae8a022c9b9d237cea232cf94 100644 (file)
@@ -52,14 +52,14 @@ const std::vector<int> SparcProcess::SyscallABI::ArgumentRegs = {
     INTREG_O0, INTREG_O1, INTREG_O2, INTREG_O3, INTREG_O4, INTREG_O5
 };
 
-SparcProcess::SparcProcess(ProcessParams *params,
+SparcProcess::SparcProcess(const ProcessParams &params,
                            ::Loader::ObjectFile *objFile, Addr _StackBias)
     : Process(params,
-              new EmulationPageTable(params->name, params->pid, PageBytes),
+              new EmulationPageTable(params.name, params.pid, PageBytes),
               objFile),
       StackBias(_StackBias)
 {
-    fatal_if(params->useArchPT, "Arch page tables not implemented.");
+    fatal_if(params.useArchPT, "Arch page tables not implemented.");
     // Initialize these to 0s
     fillStart = 0;
     spillStart = 0;
index 68b607f1437431fd02ea6759ac1b9b62104e1cd9..85d7da81f4681aa0eee8c042ef588294da089446 100644 (file)
@@ -50,7 +50,7 @@ class SparcProcess : public Process
     // The locations of the fill and spill handlers
     Addr fillStart, spillStart;
 
-    SparcProcess(ProcessParams * params, ::Loader::ObjectFile *objFile,
+    SparcProcess(const ProcessParams &params, ::Loader::ObjectFile *objFile,
                  Addr _StackBias);
 
     void initState() override;
@@ -117,7 +117,7 @@ class Sparc32Process : public SparcProcess
 {
   protected:
 
-    Sparc32Process(ProcessParams * params, ::Loader::ObjectFile *objFile)
+    Sparc32Process(const ProcessParams &params, ::Loader::ObjectFile *objFile)
         : SparcProcess(params, objFile, 0)
     {
         Addr brk_point = image.maxAddr();
@@ -182,7 +182,7 @@ class Sparc64Process : public SparcProcess
 {
   protected:
 
-    Sparc64Process(ProcessParams * params, ::Loader::ObjectFile *objFile)
+    Sparc64Process(const ProcessParams &params, ::Loader::ObjectFile *objFile)
         : SparcProcess(params, objFile, 2047)
     {
         Addr brk_point = image.maxAddr();
index 88fb1927f1802aca05e2336eb88b9930f15beda0..442e984d8e9edb1ac76c453e7beae34087b639a9 100644 (file)
@@ -48,7 +48,7 @@ class SparcSolarisObjectFileLoader : public Process::Loader
 {
   public:
     Process *
-    load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
+    load(const ProcessParams &params, ::Loader::ObjectFile *obj_file) override
     {
         auto arch = obj_file->getArch();
         auto opsys = obj_file->getOpSys();
@@ -344,7 +344,7 @@ SyscallDescTable<Sparc64Process::SyscallABI>
     { 255, "umount2" }
 };
 
-SparcSolarisProcess::SparcSolarisProcess(ProcessParams *params,
+SparcSolarisProcess::SparcSolarisProcess(const ProcessParams &params,
                                          ::Loader::ObjectFile *objFile) :
     Sparc64Process(params, objFile)
 {}
index 0c71d4a7d2d5cea843a923b5af3ddc6aedfbbf8c..bd1860d85ffbd48239a30bfc60950d5d0bfae4a4 100644 (file)
@@ -41,7 +41,8 @@ class SparcSolarisProcess : public Sparc64Process
 {
   public:
     /// Constructor.
-    SparcSolarisProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
+    SparcSolarisProcess(const ProcessParams &params,
+                        ::Loader::ObjectFile *objFile);
 
     /// The target system's hostname.
     static const char *hostname;
index fcb09734562bb9343da0a68afcade2d78582cfc5..20f316f21a37259298fd4e3227b7be0973c4e5dd 100644 (file)
@@ -52,8 +52,8 @@
  * */
 namespace SparcISA {
 
-TLB::TLB(const Params *p)
-    : BaseTLB(p), size(p->size), usedEntries(0), lastReplaced(0),
+TLB::TLB(const Params &p)
+    : BaseTLB(p), size(p.size), usedEntries(0), lastReplaced(0),
       cacheState(0), cacheValid(false)
 {
     // To make this work you'll have to change the hypervisor and OS
@@ -1508,7 +1508,7 @@ TLB::unserialize(CheckpointIn &cp)
 } // namespace SparcISA
 
 SparcISA::TLB *
-SparcTLBParams::create()
+SparcTLBParams::create() const
 {
-    return new SparcISA::TLB(this);
+    return new SparcISA::TLB(*this);
 }
index 15333abc477f726e7e33a23e41203b419f1fb981..9291343083dc0927e3c48cf23ee50b8030ae4ab1 100644 (file)
@@ -154,7 +154,7 @@ class TLB : public BaseTLB
 
   public:
     typedef SparcTLBParams Params;
-    TLB(const Params *p);
+    TLB(const Params &p);
 
     void takeOverFrom(BaseTLB *otlb) override {}
 
index 74abe05a8abfcf155e22770e8bf2797fbde3b777..c4fd27dd005cfe189c11d2db140c47637923aaa9 100644 (file)
@@ -49,40 +49,40 @@ using namespace std;
 
 const char X86ISA::ACPI::RSDP::signature[] = "RSD PTR ";
 
-X86ISA::ACPI::RSDP::RSDP(Params *p) : SimObject(p), oemID(p->oem_id),
-    revision(p->revision), rsdt(p->rsdt), xsdt(p->xsdt)
+X86ISA::ACPI::RSDP::RSDP(const Params &p) : SimObject(p), oemID(p.oem_id),
+    revision(p.revision), rsdt(p.rsdt), xsdt(p.xsdt)
 {}
 
-X86ISA::ACPI::SysDescTable::SysDescTable(Params *p,
+X86ISA::ACPI::SysDescTable::SysDescTable(const Params &p,
         const char * _signature, uint8_t _revision) : SimObject(p),
     signature(_signature), revision(_revision),
-    oemID(p->oem_id), oemTableID(p->oem_table_id),
-    oemRevision(p->oem_revision),
-    creatorID(p->creator_id), creatorRevision(p->creator_revision)
+    oemID(p.oem_id), oemTableID(p.oem_table_id),
+    oemRevision(p.oem_revision),
+    creatorID(p.creator_id), creatorRevision(p.creator_revision)
 {}
 
-X86ISA::ACPI::RSDT::RSDT(Params *p) :
-    SysDescTable(p, "RSDT", 1), entries(p->entries)
+X86ISA::ACPI::RSDT::RSDT(const Params &p) :
+    SysDescTable(p, "RSDT", 1), entries(p.entries)
 {}
 
-X86ISA::ACPI::XSDT::XSDT(Params *p) :
-    SysDescTable(p, "XSDT", 1), entries(p->entries)
+X86ISA::ACPI::XSDT::XSDT(const Params &p) :
+    SysDescTable(p, "XSDT", 1), entries(p.entries)
 {}
 
 X86ISA::ACPI::RSDP *
-X86ACPIRSDPParams::create()
+X86ACPIRSDPParams::create() const
 {
-    return new X86ISA::ACPI::RSDP(this);
+    return new X86ISA::ACPI::RSDP(*this);
 }
 
 X86ISA::ACPI::RSDT *
-X86ACPIRSDTParams::create()
+X86ACPIRSDTParams::create() const
 {
-    return new X86ISA::ACPI::RSDT(this);
+    return new X86ISA::ACPI::RSDT(*this);
 }
 
 X86ISA::ACPI::XSDT *
-X86ACPIXSDTParams::create()
+X86ACPIXSDTParams::create() const
 {
-    return new X86ISA::ACPI::XSDT(this);
+    return new X86ISA::ACPI::XSDT(*this);
 }
index ed09a7851c98a3d025ae656b009d49cafaf1cc22..bc6e2cd19eb3ef3588f11e76fd0edaf261ddf182 100644 (file)
@@ -76,7 +76,7 @@ class RSDP : public SimObject
     XSDT * xsdt;
 
   public:
-    RSDP(Params *p);
+    RSDP(const Params &p);
 };
 
 class SysDescTable : public SimObject
@@ -95,7 +95,7 @@ class SysDescTable : public SimObject
     uint32_t creatorRevision;
 
   public:
-    SysDescTable(Params *p, const char * _signature, uint8_t _revision);
+    SysDescTable(const Params &p, const char * _signature, uint8_t _revision);
 };
 
 class RSDT : public SysDescTable
@@ -106,7 +106,7 @@ class RSDT : public SysDescTable
     std::vector<SysDescTable *> entries;
 
   public:
-    RSDT(Params *p);
+    RSDT(const Params &p);
 };
 
 class XSDT : public SysDescTable
@@ -117,7 +117,7 @@ class XSDT : public SysDescTable
     std::vector<SysDescTable *> entries;
 
   public:
-    XSDT(Params *p);
+    XSDT(const Params &p);
 };
 
 } // namespace ACPI
index 44174f814bd4206acb79c259108c3857d7bbb45f..09cf3d1f6711b32e0ae348c6f0ba1ede30018453 100644 (file)
@@ -72,13 +72,13 @@ void X86ISA::E820Table::writeTo(PortProxy& proxy, Addr countAddr, Addr addr)
 }
 
 E820Table *
-X86E820TableParams::create()
+X86E820TableParams::create() const
 {
-    return new E820Table(this);
+    return new E820Table(*this);
 }
 
 E820Entry *
-X86E820EntryParams::create()
+X86E820EntryParams::create() const
 {
-    return new E820Entry(this);
+    return new E820Entry(*this);
 }
index 742e26eb9cbc2072458758cd83db59294e074472..0c59adfd296feb332116749f58422cdcf7cbdfad 100644 (file)
@@ -58,8 +58,8 @@ namespace X86ISA
 
       public:
         typedef X86E820EntryParams Params;
-        E820Entry(Params *p) :
-            SimObject(p), addr(p->addr), size(p->size), type(p->range_type)
+        E820Entry(const Params &p) :
+            SimObject(p), addr(p.addr), size(p.size), type(p.range_type)
         {}
     };
 
@@ -70,7 +70,7 @@ namespace X86ISA
 
       public:
         typedef X86E820TableParams Params;
-        E820Table(Params *p) : SimObject(p), entries(p->entries)
+        E820Table(const Params &p) : SimObject(p), entries(p.entries)
         {}
 
         void writeTo(PortProxy& proxy, Addr countAddr, Addr addr);
index 55088fd803e7b0cf0601d6997ec621d4506bf199..2050c27bdd5034ece23ba6213fa67df3f6d85da0 100644 (file)
@@ -145,15 +145,15 @@ X86ISA::IntelMP::FloatingPointer::writeOut(PortProxy& proxy, Addr addr)
     return 16;
 }
 
-X86ISA::IntelMP::FloatingPointer::FloatingPointer(Params * p) :
-    SimObject(p), tableAddr(0), specRev(p->spec_rev),
-    defaultConfig(p->default_config), imcrPresent(p->imcr_present)
+X86ISA::IntelMP::FloatingPointer::FloatingPointer(const Params &p) :
+    SimObject(p), tableAddr(0), specRev(p.spec_rev),
+    defaultConfig(p.default_config), imcrPresent(p.imcr_present)
 {}
 
 X86ISA::IntelMP::FloatingPointer *
-X86IntelMPFloatingPointerParams::create()
+X86IntelMPFloatingPointerParams::create() const
 {
-    return new X86ISA::IntelMP::FloatingPointer(this);
+    return new X86ISA::IntelMP::FloatingPointer(*this);
 }
 
 Addr
@@ -165,7 +165,8 @@ X86ISA::IntelMP::BaseConfigEntry::writeOut(PortProxy& proxy,
     return 1;
 }
 
-X86ISA::IntelMP::BaseConfigEntry::BaseConfigEntry(Params * p, uint8_t _type) :
+X86ISA::IntelMP::BaseConfigEntry::BaseConfigEntry(
+        const Params &p, uint8_t _type) :
     SimObject(p), type(_type)
 {}
 
@@ -180,7 +181,7 @@ X86ISA::IntelMP::ExtConfigEntry::writeOut(PortProxy& proxy,
     return 1;
 }
 
-X86ISA::IntelMP::ExtConfigEntry::ExtConfigEntry(Params * p,
+X86ISA::IntelMP::ExtConfigEntry::ExtConfigEntry(const Params &p,
         uint8_t _type, uint8_t _length) :
     SimObject(p), type(_type), length(_length)
 {}
@@ -245,17 +246,17 @@ X86ISA::IntelMP::ConfigTable::writeOut(PortProxy& proxy, Addr addr)
     return offset + extOffset;
 };
 
-X86ISA::IntelMP::ConfigTable::ConfigTable(Params * p) : SimObject(p),
-    specRev(p->spec_rev), oemID(p->oem_id), productID(p->product_id),
-    oemTableAddr(p->oem_table_addr), oemTableSize(p->oem_table_size),
-    localApic(p->local_apic),
-    baseEntries(p->base_entries), extEntries(p->ext_entries)
+X86ISA::IntelMP::ConfigTable::ConfigTable(const Params &p) : SimObject(p),
+    specRev(p.spec_rev), oemID(p.oem_id), productID(p.product_id),
+    oemTableAddr(p.oem_table_addr), oemTableSize(p.oem_table_size),
+    localApic(p.local_apic),
+    baseEntries(p.base_entries), extEntries(p.ext_entries)
 {}
 
 X86ISA::IntelMP::ConfigTable *
-X86IntelMPConfigTableParams::create()
+X86IntelMPConfigTableParams::create() const
 {
-    return new X86ISA::IntelMP::ConfigTable(this);
+    return new X86ISA::IntelMP::ConfigTable(*this);
 }
 
 Addr
@@ -275,24 +276,24 @@ X86ISA::IntelMP::Processor::writeOut(
     return 20;
 }
 
-X86ISA::IntelMP::Processor::Processor(Params * p) : BaseConfigEntry(p, 0),
-    localApicID(p->local_apic_id), localApicVersion(p->local_apic_version),
-    cpuFlags(0), cpuSignature(0), featureFlags(p->feature_flags)
+X86ISA::IntelMP::Processor::Processor(const Params &p) : BaseConfigEntry(p, 0),
+    localApicID(p.local_apic_id), localApicVersion(p.local_apic_version),
+    cpuFlags(0), cpuSignature(0), featureFlags(p.feature_flags)
 {
-    if (p->enable)
+    if (p.enable)
         cpuFlags |= (1 << 0);
-    if (p->bootstrap)
+    if (p.bootstrap)
         cpuFlags |= (1 << 1);
 
-    replaceBits(cpuSignature, 3, 0, p->stepping);
-    replaceBits(cpuSignature, 7, 4, p->model);
-    replaceBits(cpuSignature, 11, 8, p->family);
+    replaceBits(cpuSignature, 3, 0, p.stepping);
+    replaceBits(cpuSignature, 7, 4, p.model);
+    replaceBits(cpuSignature, 11, 8, p.family);
 }
 
 X86ISA::IntelMP::Processor *
-X86IntelMPProcessorParams::create()
+X86IntelMPProcessorParams::create() const
 {
-    return new X86ISA::IntelMP::Processor(this);
+    return new X86ISA::IntelMP::Processor(*this);
 }
 
 Addr
@@ -305,14 +306,14 @@ X86ISA::IntelMP::Bus::writeOut(
     return 8;
 }
 
-X86ISA::IntelMP::Bus::Bus(Params * p) : BaseConfigEntry(p, 1),
-    busID(p->bus_id), busType(p->bus_type)
+X86ISA::IntelMP::Bus::Bus(const Params &p) : BaseConfigEntry(p, 1),
+    busID(p.bus_id), busType(p.bus_type)
 {}
 
 X86ISA::IntelMP::Bus *
-X86IntelMPBusParams::create()
+X86IntelMPBusParams::create() const
 {
-    return new X86ISA::IntelMP::Bus(this);
+    return new X86ISA::IntelMP::Bus(*this);
 }
 
 Addr
@@ -327,17 +328,17 @@ X86ISA::IntelMP::IOAPIC::writeOut(
     return 8;
 }
 
-X86ISA::IntelMP::IOAPIC::IOAPIC(Params * p) : BaseConfigEntry(p, 2),
-    id(p->id), version(p->version), flags(0), address(p->address)
+X86ISA::IntelMP::IOAPIC::IOAPIC(const Params &p) : BaseConfigEntry(p, 2),
+    id(p.id), version(p.version), flags(0), address(p.address)
 {
-    if (p->enable)
+    if (p.enable)
         flags |= 1;
 }
 
 X86ISA::IntelMP::IOAPIC *
-X86IntelMPIOAPICParams::create()
+X86IntelMPIOAPICParams::create() const
 {
-    return new X86ISA::IntelMP::IOAPIC(this);
+    return new X86ISA::IntelMP::IOAPIC(*this);
 }
 
 Addr
@@ -354,28 +355,28 @@ X86ISA::IntelMP::IntAssignment::writeOut(
     return 8;
 }
 
-X86ISA::IntelMP::IOIntAssignment::IOIntAssignment(Params * p) :
-    IntAssignment(p, p->interrupt_type, p->polarity, p->trigger, 3,
-            p->source_bus_id, p->source_bus_irq,
-            p->dest_io_apic_id, p->dest_io_apic_intin)
+X86ISA::IntelMP::IOIntAssignment::IOIntAssignment(const Params &p) :
+    IntAssignment(p, p.interrupt_type, p.polarity, p.trigger, 3,
+            p.source_bus_id, p.source_bus_irq,
+            p.dest_io_apic_id, p.dest_io_apic_intin)
 {}
 
 X86ISA::IntelMP::IOIntAssignment *
-X86IntelMPIOIntAssignmentParams::create()
+X86IntelMPIOIntAssignmentParams::create() const
 {
-    return new X86ISA::IntelMP::IOIntAssignment(this);
+    return new X86ISA::IntelMP::IOIntAssignment(*this);
 }
 
-X86ISA::IntelMP::LocalIntAssignment::LocalIntAssignment(Params * p) :
-    IntAssignment(p, p->interrupt_type, p->polarity, p->trigger, 4,
-            p->source_bus_id, p->source_bus_irq,
-            p->dest_local_apic_id, p->dest_local_apic_intin)
+X86ISA::IntelMP::LocalIntAssignment::LocalIntAssignment(const Params &p) :
+    IntAssignment(p, p.interrupt_type, p.polarity, p.trigger, 4,
+            p.source_bus_id, p.source_bus_irq,
+            p.dest_local_apic_id, p.dest_local_apic_intin)
 {}
 
 X86ISA::IntelMP::LocalIntAssignment *
-X86IntelMPLocalIntAssignmentParams::create()
+X86IntelMPLocalIntAssignmentParams::create() const
 {
-    return new X86ISA::IntelMP::LocalIntAssignment(this);
+    return new X86ISA::IntelMP::LocalIntAssignment(*this);
 }
 
 Addr
@@ -390,16 +391,16 @@ X86ISA::IntelMP::AddrSpaceMapping::writeOut(
     return length;
 }
 
-X86ISA::IntelMP::AddrSpaceMapping::AddrSpaceMapping(Params * p) :
+X86ISA::IntelMP::AddrSpaceMapping::AddrSpaceMapping(const Params &p) :
     ExtConfigEntry(p, 128, 20),
-    busID(p->bus_id), addrType(p->address_type),
-    addr(p->address), addrLength(p->length)
+    busID(p.bus_id), addrType(p.address_type),
+    addr(p.address), addrLength(p.length)
 {}
 
 X86ISA::IntelMP::AddrSpaceMapping *
-X86IntelMPAddrSpaceMappingParams::create()
+X86IntelMPAddrSpaceMappingParams::create() const
 {
-    return new X86ISA::IntelMP::AddrSpaceMapping(this);
+    return new X86ISA::IntelMP::AddrSpaceMapping(*this);
 }
 
 Addr
@@ -417,18 +418,18 @@ X86ISA::IntelMP::BusHierarchy::writeOut(
     return length;
 }
 
-X86ISA::IntelMP::BusHierarchy::BusHierarchy(Params * p) :
+X86ISA::IntelMP::BusHierarchy::BusHierarchy(const Params &p) :
     ExtConfigEntry(p, 129, 8),
-    busID(p->bus_id), info(0), parentBus(p->parent_bus)
+    busID(p.bus_id), info(0), parentBus(p.parent_bus)
 {
-    if (p->subtractive_decode)
+    if (p.subtractive_decode)
         info |= 1;
 }
 
 X86ISA::IntelMP::BusHierarchy *
-X86IntelMPBusHierarchyParams::create()
+X86IntelMPBusHierarchyParams::create() const
 {
-    return new X86ISA::IntelMP::BusHierarchy(this);
+    return new X86ISA::IntelMP::BusHierarchy(*this);
 }
 
 Addr
@@ -442,16 +443,16 @@ X86ISA::IntelMP::CompatAddrSpaceMod::writeOut(
     return length;
 }
 
-X86ISA::IntelMP::CompatAddrSpaceMod::CompatAddrSpaceMod(Params * p) :
+X86ISA::IntelMP::CompatAddrSpaceMod::CompatAddrSpaceMod(const Params &p) :
     ExtConfigEntry(p, 130, 8),
-    busID(p->bus_id), mod(0), rangeList(p->range_list)
+    busID(p.bus_id), mod(0), rangeList(p.range_list)
 {
-    if (p->add)
+    if (p.add)
         mod |= 1;
 }
 
 X86ISA::IntelMP::CompatAddrSpaceMod *
-X86IntelMPCompatAddrSpaceModParams::create()
+X86IntelMPCompatAddrSpaceModParams::create() const
 {
-    return new X86ISA::IntelMP::CompatAddrSpaceMod(this);
+    return new X86ISA::IntelMP::CompatAddrSpaceMod(*this);
 }
index 2ee400f4c22b8723e1acac496902cd60d4635e4c..6e97047c337725b023b39f61324f205d3e1470ac 100644 (file)
@@ -109,7 +109,7 @@ class FloatingPointer : public SimObject
         tableAddr = addr;
     }
 
-    FloatingPointer(Params * p);
+    FloatingPointer(const Params &p);
 };
 
 class BaseConfigEntry : public SimObject
@@ -123,7 +123,7 @@ class BaseConfigEntry : public SimObject
 
     virtual Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
 
-    BaseConfigEntry(Params * p, uint8_t _type);
+    BaseConfigEntry(const Params &p, uint8_t _type);
 };
 
 class ExtConfigEntry : public SimObject
@@ -138,7 +138,7 @@ class ExtConfigEntry : public SimObject
 
     virtual Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
 
-    ExtConfigEntry(Params * p, uint8_t _type, uint8_t _length);
+    ExtConfigEntry(const Params &p, uint8_t _type, uint8_t _length);
 };
 
 class ConfigTable : public SimObject
@@ -161,7 +161,7 @@ class ConfigTable : public SimObject
   public:
     Addr writeOut(PortProxy& proxy, Addr addr);
 
-    ConfigTable(Params * p);
+    ConfigTable(const Params &p);
 };
 
 class Processor : public BaseConfigEntry
@@ -178,7 +178,7 @@ class Processor : public BaseConfigEntry
   public:
     Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
 
-    Processor(Params * p);
+    Processor(const Params &p);
 };
 
 class Bus : public BaseConfigEntry
@@ -192,7 +192,7 @@ class Bus : public BaseConfigEntry
   public:
     Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
 
-    Bus(Params * p);
+    Bus(const Params &p);
 };
 
 class IOAPIC : public BaseConfigEntry
@@ -208,7 +208,7 @@ class IOAPIC : public BaseConfigEntry
   public:
     Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
 
-    IOAPIC(Params * p);
+    IOAPIC(const Params &p);
 };
 
 class IntAssignment : public BaseConfigEntry
@@ -227,7 +227,7 @@ class IntAssignment : public BaseConfigEntry
   public:
     Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
 
-    IntAssignment(X86IntelMPBaseConfigEntryParams * p,
+    IntAssignment(const X86IntelMPBaseConfigEntryParams &p,
             Enums::X86IntelMPInterruptType _interruptType,
             Enums::X86IntelMPPolarity polarity,
             Enums::X86IntelMPTriggerMode trigger,
@@ -250,7 +250,7 @@ class IOIntAssignment : public IntAssignment
     typedef X86IntelMPIOIntAssignmentParams Params;
 
   public:
-    IOIntAssignment(Params * p);
+    IOIntAssignment(const Params &p);
 };
 
 class LocalIntAssignment : public IntAssignment
@@ -259,7 +259,7 @@ class LocalIntAssignment : public IntAssignment
     typedef X86IntelMPLocalIntAssignmentParams Params;
 
   public:
-    LocalIntAssignment(Params * p);
+    LocalIntAssignment(const Params &p);
 };
 
 class AddrSpaceMapping : public ExtConfigEntry
@@ -275,7 +275,7 @@ class AddrSpaceMapping : public ExtConfigEntry
   public:
     Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
 
-    AddrSpaceMapping(Params * p);
+    AddrSpaceMapping(const Params &p);
 };
 
 class BusHierarchy : public ExtConfigEntry
@@ -290,7 +290,7 @@ class BusHierarchy : public ExtConfigEntry
   public:
     Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
 
-    BusHierarchy(Params * p);
+    BusHierarchy(const Params &p);
 };
 
 class CompatAddrSpaceMod : public ExtConfigEntry
@@ -305,7 +305,7 @@ class CompatAddrSpaceMod : public ExtConfigEntry
   public:
     Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
 
-    CompatAddrSpaceMod(Params * p);
+    CompatAddrSpaceMod(const Params &p);
 };
 
 } //IntelMP
index cd3d8e055a486c1c7994a96bc5b651435ca1a086..53897443b00028ccd9730c5b28885ac5e445e337 100644 (file)
@@ -86,7 +86,8 @@ X86ISA::SMBios::SMBiosStructure::writeOut(PortProxy& proxy, Addr addr)
     return length + getStringLength();
 }
 
-X86ISA::SMBios::SMBiosStructure::SMBiosStructure(Params * p, uint8_t _type) :
+X86ISA::SMBios::SMBiosStructure::SMBiosStructure(
+        const Params &p, uint8_t _type) :
     SimObject(p), type(_type), handle(0), stringFields(false)
 {}
 
@@ -127,14 +128,14 @@ X86ISA::SMBios::SMBiosStructure::getStringLength()
 }
 
 int
-X86ISA::SMBios::SMBiosStructure::addString(string & newString)
+X86ISA::SMBios::SMBiosStructure::addString(const string &new_string)
 {
     stringFields = true;
     // If a string is empty, treat it as not existing. The index for empty
     // strings is 0.
-    if (newString.length() == 0)
+    if (new_string.length() == 0)
         return 0;
-    strings.push_back(newString);
+    strings.push_back(new_string);
     return strings.size();
 }
 
@@ -146,27 +147,28 @@ X86ISA::SMBios::SMBiosStructure::readString(int n)
 }
 
 void
-X86ISA::SMBios::SMBiosStructure::setString(int n, std::string & newString)
+X86ISA::SMBios::SMBiosStructure::setString(
+        int n, const std::string &new_string)
 {
     assert(n > 0 && n <= strings.size());
-    strings[n - 1] = newString;
+    strings[n - 1] = new_string;
 }
 
-X86ISA::SMBios::BiosInformation::BiosInformation(Params * p) :
+X86ISA::SMBios::BiosInformation::BiosInformation(const Params &p) :
         SMBiosStructure(p, Type),
-        startingAddrSegment(p->starting_addr_segment),
-        romSize(p->rom_size),
-        majorVer(p->major), minorVer(p->minor),
-        embContFirmwareMajor(p->emb_cont_firmware_major),
-        embContFirmwareMinor(p->emb_cont_firmware_minor)
+        startingAddrSegment(p.starting_addr_segment),
+        romSize(p.rom_size),
+        majorVer(p.major), minorVer(p.minor),
+        embContFirmwareMajor(p.emb_cont_firmware_major),
+        embContFirmwareMinor(p.emb_cont_firmware_minor)
     {
-        vendor = addString(p->vendor);
-        version = addString(p->version);
-        releaseDate = addString(p->release_date);
+        vendor = addString(p.vendor);
+        version = addString(p.version);
+        releaseDate = addString(p.release_date);
 
-        characteristics = composeBitVector(p->characteristics);
+        characteristics = composeBitVector(p.characteristics);
         characteristicExtBytes =
-            composeBitVector(p->characteristic_ext_bytes);
+            composeBitVector(p.characteristic_ext_bytes);
     }
 
 uint16_t
@@ -200,15 +202,15 @@ X86ISA::SMBios::BiosInformation::writeOut(PortProxy& proxy, Addr addr)
     return size;
 }
 
-X86ISA::SMBios::SMBiosTable::SMBiosTable(Params * p) :
-    SimObject(p), structures(p->structures)
+X86ISA::SMBios::SMBiosTable::SMBiosTable(const Params &p) :
+    SimObject(p), structures(p.structures)
 {
-    smbiosHeader.majorVersion = p->major_version;
-    smbiosHeader.minorVersion = p->minor_version;
-    assert(p->major_version <= 9);
-    assert(p->minor_version <= 9);
+    smbiosHeader.majorVersion = p.major_version;
+    smbiosHeader.minorVersion = p.minor_version;
+    assert(p.major_version <= 9);
+    assert(p.minor_version <= 9);
     smbiosHeader.intermediateHeader.smbiosBCDRevision =
-        (p->major_version << 4) | p->minor_version;
+        (p.major_version << 4) | p.minor_version;
 }
 
 void
@@ -322,13 +324,13 @@ X86ISA::SMBios::SMBiosTable::writeOut(PortProxy& proxy, Addr addr,
 }
 
 X86ISA::SMBios::BiosInformation *
-X86SMBiosBiosInformationParams::create()
+X86SMBiosBiosInformationParams::create() const
 {
-    return new X86ISA::SMBios::BiosInformation(this);
+    return new X86ISA::SMBios::BiosInformation(*this);
 }
 
 X86ISA::SMBios::SMBiosTable *
-X86SMBiosSMBiosTableParams::create()
+X86SMBiosSMBiosTableParams::create() const
 {
-    return new X86ISA::SMBios::SMBiosTable(this);
+    return new X86ISA::SMBios::SMBiosTable(*this);
 }
index f8bc58dec9dd379c5b4881ceaa76a049592a7479..bb49e99e576f5929c6ee2b53d2f670408eaeec7b 100644 (file)
@@ -92,7 +92,7 @@ class SMBiosStructure : public SimObject
   protected:
     bool stringFields;
 
-    SMBiosStructure(Params * p, uint8_t _type);
+    SMBiosStructure(const Params &p, uint8_t _type);
 
     std::vector<std::string> strings;
 
@@ -102,9 +102,9 @@ class SMBiosStructure : public SimObject
 
   public:
 
-    int addString(std::string & newString);
+    int addString(const std::string &new_string);
     std::string readString(int n);
-    void setString(int n, std::string & newString);
+    void setString(int n, const std::string &new_string);
 };
 
 class BiosInformation : public SMBiosStructure
@@ -140,7 +140,7 @@ class BiosInformation : public SMBiosStructure
     // Offset 17h, 1 byte
     uint8_t embContFirmwareMinor;
 
-    BiosInformation(Params * p);
+    BiosInformation(const Params &p);
 
     uint8_t getLength() { return 0x18; }
     uint16_t writeOut(PortProxy& proxy, Addr addr);
@@ -209,7 +209,7 @@ class SMBiosTable : public SimObject
     std::vector<SMBiosStructure *> structures;
 
   public:
-    SMBiosTable(Params * p);
+    SMBiosTable(const Params &p);
 
     Addr getTableAddr()
     {
index 44c01d779f7cb8005e42e77967ec7796cbfec9e7..b66ddfd13c24c25c5f38a1aa94c0223d654140a3 100644 (file)
 namespace X86ISA
 {
 
-FsWorkload::FsWorkload(Params *p) : KernelWorkload(*p),
-    smbiosTable(p->smbios_table),
-    mpFloatingPointer(p->intel_mp_pointer),
-    mpConfigTable(p->intel_mp_table),
-    rsdp(p->acpi_description_table_pointer)
+FsWorkload::FsWorkload(const Params &p) : KernelWorkload(p),
+    smbiosTable(p.smbios_table),
+    mpFloatingPointer(p.intel_mp_pointer),
+    mpConfigTable(p.intel_mp_table),
+    rsdp(p.acpi_description_table_pointer)
 {}
 
 void
@@ -367,7 +367,7 @@ FsWorkload::writeOutMPTable(Addr fp, Addr &fpSize, Addr &tableSize, Addr table)
 } // namespace X86ISA
 
 X86ISA::FsWorkload *
-X86FsWorkloadParams::create()
+X86FsWorkloadParams::create() const
 {
-    return new X86ISA::FsWorkload(this);
+    return new X86ISA::FsWorkload(*this);
 }
index 7080feb40638ff411c605e4b6bb8db8a0600a91e..ce1ca54e44e1d7513576bef0ae4cbd533eb6521c 100644 (file)
@@ -83,7 +83,7 @@ class FsWorkload : public KernelWorkload
 {
   public:
     typedef X86FsWorkloadParams Params;
-    FsWorkload(Params *p);
+    FsWorkload(const Params &p);
 
   public:
     void initState() override;
@@ -101,7 +101,7 @@ class FsWorkload : public KernelWorkload
     void writeOutMPTable(Addr fp,
             Addr &fpSize, Addr &tableSize, Addr table=0);
 
-    const Params *params() const { return (const Params *)&_params; }
+    const Params &params() const { return (const Params &)_params; }
 };
 
 } // namespace X86ISA
index 7767c80344811c0316ec10741e66ff34319a0861..10a642107bd04fc80f6c037897d41e7814b67539 100644 (file)
@@ -593,8 +593,8 @@ X86ISA::Interrupts::setReg(ApicRegIndex reg, uint32_t val)
 }
 
 
-X86ISA::Interrupts::Interrupts(Params *p)
-    : BaseInterrupts(p), sys(p->system), clockDomain(*p->clk_domain),
+X86ISA::Interrupts::Interrupts(const Params &p)
+    : BaseInterrupts(p), sys(p.system), clockDomain(*p.clk_domain),
       apicTimerEvent([this]{ processApicTimerEvent(); }, name()),
       pendingSmi(false), smiVector(0),
       pendingNmi(false), nmiVector(0),
@@ -604,8 +604,8 @@ X86ISA::Interrupts::Interrupts(Params *p)
       startedUp(false), pendingUnmaskableInt(false),
       pendingIPIs(0),
       intResponsePort(name() + ".int_responder", this, this),
-      intRequestPort(name() + ".int_requestor", this, this, p->int_latency),
-      pioPort(this), pioDelay(p->pio_latency)
+      intRequestPort(name() + ".int_requestor", this, this, p.int_latency),
+      pioPort(this), pioDelay(p.pio_latency)
 {
     memset(regs, 0, sizeof(regs));
     //Set the local apic DFR to the flat model.
@@ -774,13 +774,14 @@ X86ISA::Interrupts::unserialize(CheckpointIn &cp)
 }
 
 X86ISA::Interrupts *
-X86LocalApicParams::create()
+X86LocalApicParams::create() const
 {
-    return new X86ISA::Interrupts(this);
+    return new X86ISA::Interrupts(*this);
 }
 
 void
-X86ISA::Interrupts::processApicTimerEvent() {
+X86ISA::Interrupts::processApicTimerEvent()
+{
     if (triggerTimerInterrupt())
         setReg(APIC_INITIAL_COUNT, readReg(APIC_INITIAL_COUNT));
 }
index f078d421ab9d5655982feced4157217220d63c6b..c18275943a6f4f430e722fe5d468ef73444f0023 100644 (file)
@@ -194,10 +194,10 @@ class Interrupts : public BaseInterrupts
 
     void setThreadContext(ThreadContext *_tc) override;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     /*
@@ -254,7 +254,7 @@ class Interrupts : public BaseInterrupts
      * Constructor.
      */
 
-    Interrupts(Params * p);
+    Interrupts(const Params &p);
 
     /*
      * Functions for retrieving interrupts for the CPU to handle.
index a142bcf717c9c86168cf4065bcd20b287ff67216..1b2504abc11c8b8fdf73222c7f729391f3ef68cc 100644 (file)
@@ -130,15 +130,15 @@ ISA::clear()
     regVal[MISCREG_APIC_BASE] = lApicBase;
 }
 
-ISA::ISA(Params *p) : BaseISA(p)
+ISA::ISA(const Params &p) : BaseISA(p)
 {
     clear();
 }
 
-const X86ISAParams *
+const X86ISAParams &
 ISA::params() const
 {
-    return dynamic_cast<const Params *>(_params);
+    return dynamic_cast<const Params &>(_params);
 }
 
 RegVal
@@ -440,7 +440,7 @@ ISA::setThreadContext(ThreadContext *_tc)
 }
 
 X86ISA::ISA *
-X86ISAParams::create()
+X86ISAParams::create() const
 {
-    return new X86ISA::ISA(this);
+    return new X86ISA::ISA(*this);
 }
index 855c8e7b3095120eddbcc6ebd5ab29d6eff0a7f1..3df7cce925096999b1fa14546b5a3b0ab4185a07 100644 (file)
@@ -59,8 +59,8 @@ namespace X86ISA
 
         typedef X86ISAParams Params;
 
-        ISA(Params *p);
-        const Params *params() const;
+        ISA(const Params &p);
+        const Params &params() const;
 
         RegVal readMiscRegNoEffect(int miscReg) const;
         RegVal readMiscReg(int miscReg);
index 0303cc80039b3504cd511b6791423a9ad97dc805..c73e5b32e72d2b1394dda06a6a949ddabe5b0f8f 100644 (file)
@@ -49,7 +49,8 @@
 namespace X86ISA
 {
 
-FsLinux::FsLinux(Params *p) : X86ISA::FsWorkload(p), e820Table(p->e820_table)
+FsLinux::FsLinux(const Params &p) :
+    X86ISA::FsWorkload(p), e820Table(p.e820_table)
 {}
 
 void
@@ -129,7 +130,7 @@ FsLinux::initState()
 } // namespace X86ISA
 
 X86ISA::FsLinux *
-X86FsLinuxParams::create()
+X86FsLinuxParams::create() const
 {
-    return new X86ISA::FsLinux(this);
+    return new X86ISA::FsLinux(*this);
 }
index 2eb4ed6e66fc59567ecc348ee9210f4fbc1d992d..5601a833da6f4b9db4584f04e9ca73eb5d9b480f 100644 (file)
@@ -52,7 +52,7 @@ class FsLinux : public X86ISA::FsWorkload
 
   public:
     typedef X86FsLinuxParams Params;
-    FsLinux(Params *p);
+    FsLinux(const Params &p);
 
     void initState() override;
 };
index 68a9841f747403991605f5e459f752496efdc084..e95cf56df54e1ad189f39cf6a87ee614c113a586 100644 (file)
@@ -60,7 +60,7 @@ class X86LinuxObjectFileLoader : public Process::Loader
 {
   public:
     Process *
-    load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
+    load(const ProcessParams &params, ::Loader::ObjectFile *obj_file) override
     {
         auto arch = obj_file->getArch();
         auto opsys = obj_file->getOpSys();
index efaf620d86c6b67a24f292eefa822066aa1eebc6..5a06b3d6d062f4ecb9a55b935207c6ab17f7e83a 100644 (file)
@@ -38,7 +38,7 @@
 #include "arch/x86/mmu.hh"
 
 X86ISA::MMU *
-X86MMUParams::create()
+X86MMUParams::create() const
 {
-    return new X86ISA::MMU(this);
+    return new X86ISA::MMU(*this);
 }
index 6f4ba8775bf3c1a0cfd84d53955b51912f2e577e..4f3411a19db6a4b507f63567a059dd2947f3c6aa 100644 (file)
@@ -47,7 +47,7 @@ namespace X86ISA {
 class MMU : public BaseMMU
 {
   public:
-    MMU(const X86MMUParams *p)
+    MMU(const X86MMUParams &p)
       : BaseMMU(p)
     {}
 };
index 185cf39af3dc42c3a4286387675be044961ac38e..f7277f9bcaefffd3d6f16a6bfc6dff7293f1c174 100644 (file)
@@ -94,8 +94,7 @@ X86NativeTrace::ThreadState::update(ThreadContext *tc)
 }
 
 
-X86NativeTrace::X86NativeTrace(const Params *p)
-    : NativeTrace(p)
+X86NativeTrace::X86NativeTrace(const Params &p) : NativeTrace(p)
 {
     checkRcx = true;
     checkR11 = true;
@@ -193,7 +192,7 @@ X86NativeTrace::check(NativeTraceRecord *record)
 //  ExeTracer Simulation Object
 //
 Trace::X86NativeTrace *
-X86NativeTraceParams::create()
+X86NativeTraceParams::create() const
 {
-    return new Trace::X86NativeTrace(this);
+    return new Trace::X86NativeTrace(*this);
 }
index 80e4c9d2893983267f7c57baac2b5d6bc96c8c94..b47a896b431062267e8fc5040b7629eb83c3af6c 100644 (file)
@@ -78,7 +78,7 @@ class X86NativeTrace : public NativeTrace
     bool checkXMM(int num, uint64_t mXmmBuf[], uint64_t nXmmBuf[]);
 
   public:
-    X86NativeTrace(const Params *p);
+    X86NativeTrace(const Params &p);
 
     void check(NativeTraceRecord *record);
 };
index f5b5521334aa041fc1fcdff2467e12a3d93ab794..943295a5fa29a30909d0d16079c204af5d80f795 100644 (file)
@@ -738,7 +738,7 @@ Walker::WalkerState::pageFault(bool present)
 /* end namespace X86ISA */ }
 
 X86ISA::Walker *
-X86PagetableWalkerParams::create()
+X86PagetableWalkerParams::create() const
 {
-    return new X86ISA::Walker(this);
+    return new X86ISA::Walker(*this);
 }
index dba76c11071d06358429d12ca599d71c46a17601..8981e1f2bdd09ddec2a1985c3976451320c4b759 100644 (file)
@@ -195,17 +195,17 @@ namespace X86ISA
 
         typedef X86PagetableWalkerParams Params;
 
-        const Params *
+        const Params &
         params() const
         {
-            return static_cast<const Params *>(_params);
+            return static_cast<const Params &>(_params);
         }
 
-        Walker(const Params *params) :
+        Walker(const Params &params) :
             ClockedObject(params), port(name() + ".port", this),
-            funcState(this, NULL, NULL, true), tlb(NULL), sys(params->system),
+            funcState(this, NULL, NULL, true), tlb(NULL), sys(params.system),
             requestorId(sys->getRequestorId(this)),
-            numSquashable(params->num_squash_per_cycle),
+            numSquashable(params.num_squash_per_cycle),
             startWalkWrapperEvent([this]{ startWalkWrapper(); }, name())
         {
         }
index 7718fdcaa1eda583925a1b3d4e835d34a73ead93..d4986c251c1a67d8724a12a1ec0336a64f83955d 100644 (file)
@@ -76,12 +76,13 @@ typedef MultiLevelPageTable<LongModePTE<47, 39>,
                             LongModePTE<29, 21>,
                             LongModePTE<20, 12> > ArchPageTable;
 
-X86Process::X86Process(ProcessParams *params, ::Loader::ObjectFile *objFile) :
-    Process(params, params->useArchPT ?
+X86Process::X86Process(const ProcessParams &params,
+                       ::Loader::ObjectFile *objFile) :
+    Process(params, params.useArchPT ?
                     static_cast<EmulationPageTable *>(
-                            new ArchPageTable(params->name, params->pid,
-                                              params->system, PageBytes)) :
-                    new EmulationPageTable(params->name, params->pid,
+                            new ArchPageTable(params.name, params.pid,
+                                              params.system, PageBytes)) :
+                    new EmulationPageTable(params.name, params.pid,
                                            PageBytes),
             objFile)
 {
@@ -95,7 +96,7 @@ void X86Process::clone(ThreadContext *old_tc, ThreadContext *new_tc,
     *process = *this;
 }
 
-X86_64Process::X86_64Process(ProcessParams *params,
+X86_64Process::X86_64Process(const ProcessParams &params,
                              ::Loader::ObjectFile *objFile) :
     X86Process(params, objFile)
 {
@@ -116,7 +117,7 @@ X86_64Process::X86_64Process(ProcessParams *params,
 }
 
 
-I386Process::I386Process(ProcessParams *params,
+I386Process::I386Process(const ProcessParams &params,
                          ::Loader::ObjectFile *objFile) :
     X86Process(params, objFile)
 {
index 039e55a65ffcd2f7cd3af9c5babfd09f37241e58..a55212f40db4f9c1c291b5e5bc0ff753a92767f6 100644 (file)
@@ -61,7 +61,7 @@ namespace X86ISA
         Addr _gdtStart;
         Addr _gdtSize;
 
-        X86Process(ProcessParams *params, ::Loader::ObjectFile *objFile);
+        X86Process(const ProcessParams &params, ::Loader::ObjectFile *objFile);
 
         template<class IntType>
         void argsInit(int pageSize,
@@ -118,7 +118,8 @@ namespace X86ISA
         VSyscallPage vsyscallPage;
 
       public:
-        X86_64Process(ProcessParams *params, ::Loader::ObjectFile *objFile);
+        X86_64Process(const ProcessParams &params,
+                      ::Loader::ObjectFile *objFile);
 
         void argsInit(int pageSize);
         void initState() override;
@@ -155,7 +156,8 @@ namespace X86ISA
         VSyscallPage vsyscallPage;
 
       public:
-        I386Process(ProcessParams *params, ::Loader::ObjectFile *objFile);
+        I386Process(const ProcessParams &params,
+                    ::Loader::ObjectFile *objFile);
 
         void argsInit(int pageSize);
         void initState() override;
index 11ce66062d68c5adc0dd805ecf3222c6c30919bc..d336eb4edd8423c5c0110d9e2f64b245bbbc8bf8 100644 (file)
@@ -59,9 +59,9 @@
 
 namespace X86ISA {
 
-TLB::TLB(const Params *p)
-    : BaseTLB(p), configAddress(0), size(p->size),
-      tlb(size), lruSeq(0), m5opRange(p->system->m5opRange()), stats(this)
+TLB::TLB(const Params &p)
+    : BaseTLB(p), configAddress(0), size(p.size),
+      tlb(size), lruSeq(0), m5opRange(p.system->m5opRange()), stats(this)
 {
     if (!size)
         fatal("TLBs must have a non-zero size.\n");
@@ -71,7 +71,7 @@ TLB::TLB(const Params *p)
         freeList.push_back(&tlb[x]);
     }
 
-    walker = p->walker;
+    walker = p.walker;
     walker->setTLB(this);
 }
 
@@ -573,7 +573,7 @@ TLB::getTableWalkerPort()
 } // namespace X86ISA
 
 X86ISA::TLB *
-X86TLBParams::create()
+X86TLBParams::create() const
 {
-    return new X86ISA::TLB(this);
+    return new X86ISA::TLB(*this);
 }
index 671b1651864654693c240a1fc46fec666ff06c57..1741f5b022311be955e99dbcb6d017c349bd35e2 100644 (file)
@@ -66,7 +66,7 @@ namespace X86ISA
       public:
 
         typedef X86TLBParams Params;
-        TLB(const Params *p);
+        TLB(const Params &p);
 
         void takeOverFrom(BaseTLB *otlb) override {}
 
index a859424968c6afae6b2b41b9fd2afd7d49e532ab..3f4fac9ba75f521579f30f27cb6c775f6b33aaed 100644 (file)
@@ -59,10 +59,10 @@ class Base : public SimObject
     /**
      * Create and clear the filter.
      */
-    Base(const BloomFilterBaseParamsp)
-        : SimObject(p), offsetBits(p->offset_bits),
-          filter(p->size, SatCounter(p->num_bits)),
-          sizeBits(floorLog2(p->size)), setThreshold(p->threshold)
+    Base(const BloomFilterBaseParams &p)
+        : SimObject(p), offsetBits(p.offset_bits),
+          filter(p.size, SatCounter(p.num_bits)),
+          sizeBits(floorLog2(p.size)), setThreshold(p.threshold)
     {
         clear();
     }
index d7fa96a5247e6765f3b008f37773bef4281add88..7f72c810513d95a3289bd17dd6f34d7008f3b737 100644 (file)
@@ -35,9 +35,9 @@
 
 namespace BloomFilter {
 
-Block::Block(const BloomFilterBlockParamsp)
-    : Base(p), masksLSBs(p->masks_lsbs),
-      masksSizes(p->masks_sizes)
+Block::Block(const BloomFilterBlockParams &p)
+    : Base(p), masksLSBs(p.masks_lsbs),
+      masksSizes(p.masks_sizes)
 {
     fatal_if(masksLSBs.size() != masksSizes.size(),
         "Masks haven't been properly provided");
@@ -92,8 +92,8 @@ Block::hash(Addr addr) const
 } // namespace BloomFilter
 
 BloomFilter::Block*
-BloomFilterBlockParams::create()
+BloomFilterBlockParams::create() const
 {
-    return new BloomFilter::Block(this);
+    return new BloomFilter::Block(*this);
 }
 
index 33ef83a145b5574c74cd36ca5498957948d4fa95..72929142428229b599c19155ccf73069b077b03b 100644 (file)
@@ -45,7 +45,7 @@ namespace BloomFilter {
 class Block : public Base
 {
   public:
-    Block(const BloomFilterBlockParamsp);
+    Block(const BloomFilterBlockParams &p);
     ~Block();
 
     void set(Addr addr) override;
index 5dc1c4942933c1dda6adccdfb1ce26f043ba9237..0579b3dd7e65885d87000e2a7aa7ac5a0d7b7263 100644 (file)
@@ -37,7 +37,7 @@
 
 namespace BloomFilter {
 
-Bulk::Bulk(const BloomFilterBulkParamsp)
+Bulk::Bulk(const BloomFilterBulkParams &p)
     : MultiBitSel(p), sectorBits(floorLog2(parFilterSize))
 {
     fatal_if((numHashes * sectorBits) >
@@ -98,8 +98,8 @@ Bulk::permute(Addr addr) const
 } // namespace BloomFilter
 
 BloomFilter::Bulk*
-BloomFilterBulkParams::create()
+BloomFilterBulkParams::create() const
 {
-    return new BloomFilter::Bulk(this);
+    return new BloomFilter::Bulk(*this);
 }
 
index 72b053c1291d35a53059d93b401e7461da56991c..8cc054dde0e88c48beddfbd9659980f0f4a81bfe 100644 (file)
@@ -44,7 +44,7 @@ namespace BloomFilter {
 class Bulk : public MultiBitSel
 {
   public:
-    Bulk(const BloomFilterBulkParamsp);
+    Bulk(const BloomFilterBulkParams &p);
     ~Bulk();
 
   protected:
index a98b99b99dd83549560a5a8de5ee2c281b5124e0..9027873106f6cd9351880a8de2e9731a440d4397 100644 (file)
@@ -359,7 +359,7 @@ static int H3Matrix[64][16] = {
       394261773,  848616745,  15446017,   517723271,  },
 };
 
-H3::H3(const BloomFilterH3Paramsp)
+H3::H3(const BloomFilterH3Params &p)
     : MultiBitSel(p)
 {
     fatal_if(numHashes > 16, "There are only 16 H3 functions implemented.");
@@ -392,8 +392,8 @@ H3::hash(Addr addr, int hash_number) const
 } // namespace BloomFilter
 
 BloomFilter::H3*
-BloomFilterH3Params::create()
+BloomFilterH3Params::create() const
 {
-    return new BloomFilter::H3(this);
+    return new BloomFilter::H3(*this);
 }
 
index 0d007dd49ccf43eb5c8ade7945c0ba3b989cf22f..78b52eb44b6fc0c1ab5a5922870f5ad066742639 100644 (file)
@@ -43,7 +43,7 @@ namespace BloomFilter {
 class H3 : public MultiBitSel
 {
   public:
-    H3(const BloomFilterH3Paramsp);
+    H3(const BloomFilterH3Params &p);
     ~H3();
 
   protected:
index cab7fd837475f68d85d9d66674b34ff85da616a9..7bd30848124b43169d80d6432209745b78d6248a 100644 (file)
 
 namespace BloomFilter {
 
-MultiBitSel::MultiBitSel(const BloomFilterMultiBitSelParamsp)
-    : Base(p), numHashes(p->num_hashes),
-      parFilterSize(p->size / numHashes),
-      isParallel(p->is_parallel), skipBits(p->skip_bits)
+MultiBitSel::MultiBitSel(const BloomFilterMultiBitSelParams &p)
+    : Base(p), numHashes(p.num_hashes),
+      parFilterSize(p.size / numHashes),
+      isParallel(p.is_parallel), skipBits(p.skip_bits)
 {
-    if (p->size % numHashes) {
-        fatal("Can't divide filter (%d) in %d equal portions", p->size,
+    if (p.size % numHashes) {
+        fatal("Can't divide filter (%d) in %d equal portions", p.size,
               numHashes);
     }
 }
@@ -96,8 +96,8 @@ MultiBitSel::hash(Addr addr, int hash_number) const
 } // namespace BloomFilter
 
 BloomFilter::MultiBitSel*
-BloomFilterMultiBitSelParams::create()
+BloomFilterMultiBitSelParams::create() const
 {
-    return new BloomFilter::MultiBitSel(this);
+    return new BloomFilter::MultiBitSel(*this);
 }
 
index f90049c601864b211b1052f81cc2014a831072ce..0ba65dedbd466da5e0b03cee7941c212d2d69007 100644 (file)
@@ -43,7 +43,7 @@ namespace BloomFilter {
 class MultiBitSel : public Base
 {
   public:
-    MultiBitSel(const BloomFilterMultiBitSelParamsp);
+    MultiBitSel(const BloomFilterMultiBitSelParams &p);
     ~MultiBitSel();
 
     void set(Addr addr) override;
index ca467a739c1ca05ab15daa79e9a28e753cdd0bda..04fba3ddcd438dc69c28e92aeca042af311dfb44 100644 (file)
@@ -34,8 +34,8 @@
 
 namespace BloomFilter {
 
-Multi::Multi(const BloomFilterMultiParamsp)
-    : Base(p), filters(p->filters)
+Multi::Multi(const BloomFilterMultiParams &p)
+    : Base(p), filters(p.filters)
 {
 }
 
@@ -112,8 +112,8 @@ Multi::getTotalCount() const
 } // namespace BloomFilter
 
 BloomFilter::Multi*
-BloomFilterMultiParams::create()
+BloomFilterMultiParams::create() const
 {
-    return new BloomFilter::Multi(this);
+    return new BloomFilter::Multi(*this);
 }
 
index 99b1e2e8d53b4aa7075b8d282709eb8293127d3c..5f0255e7e7702783464b797c4df3ae11783b70ac 100644 (file)
@@ -46,7 +46,7 @@ namespace BloomFilter {
 class Multi : public Base
 {
   public:
-    Multi(const BloomFilterMultiParamsp);
+    Multi(const BloomFilterMultiParams &p);
     ~Multi();
 
     void clear() override;
index 2a495142495e5d96f82c311e521fc35c6f30136f..00ec92da7503650ad609303b7b68afbf394c28b1 100644 (file)
@@ -32,7 +32,7 @@
 
 namespace BloomFilter {
 
-Perfect::Perfect(const BloomFilterPerfectParamsp)
+Perfect::Perfect(const BloomFilterPerfectParams &p)
     : Base(p)
 {
 }
@@ -81,8 +81,8 @@ Perfect::getTotalCount() const
 } // namespace BloomFilter
 
 BloomFilter::Perfect*
-BloomFilterPerfectParams::create()
+BloomFilterPerfectParams::create() const
 {
-    return new BloomFilter::Perfect(this);
+    return new BloomFilter::Perfect(*this);
 }
 
index 864a68bc33e76756066ac9cc0cf1b5ba66462f9e..b37cefe9fcbca8de66b843b877f1ace578d172a3 100644 (file)
@@ -43,7 +43,7 @@ namespace BloomFilter {
 class Perfect : public Base
 {
   public:
-    Perfect(const BloomFilterPerfectParamsp);
+    Perfect(const BloomFilterPerfectParams &p);
     ~Perfect();
 
     void clear() override;
index ff9a6065d67611a3fec7b43f194c92c2b2e816a5..34349ff5ca46a61a6a79617b27f3c78869e167c5 100644 (file)
 
 using namespace std;
 
-VncInput::VncInput(const Params *p)
+VncInput::VncInput(const Params &p)
     : SimObject(p), keyboard(NULL), mouse(NULL),
       fb(&FrameBuffer::dummy),
       _videoWidth(fb->width()), _videoHeight(fb->height()),
-      captureEnabled(p->frame_capture),
+      captureEnabled(p.frame_capture),
       captureCurrentFrame(0), captureLastHash(0),
-      imgFormat(p->img_format)
+      imgFormat(p.img_format)
 {
     if (captureEnabled) {
         // remove existing frame output directory if it exists, then create a
@@ -136,7 +136,7 @@ VncInput::captureFrameBuffer()
 
 // create the VNC Replayer object
 VncInput *
-VncInputParams::create()
+VncInputParams::create() const
 {
-    return new VncInput(this);
+    return new VncInput(*this);
 }
index 95c4aab239a35cf61b8ee086bcd3377c662cf7d2..e574b9b9a2141838daf36a1a730424aedbc6068e 100644 (file)
@@ -152,7 +152,7 @@ class VncInput : public SimObject
     };
 
     typedef VncInputParams Params;
-    VncInput(const Params *p);
+    VncInput(const Params &p);
 
     /** Set the address of the frame buffer we are going to show.
      * To avoid copying, just have the display controller
index 2b34162050be694752a802b5ebbf59d1928962b1..e72b771463ad8f3ee70f51bd6ecb11477ffe39aa 100644 (file)
@@ -115,13 +115,13 @@ VncServer::DataEvent::process(int revent)
 /**
  * VncServer
  */
-VncServer::VncServer(const Params *p)
-    : VncInput(p), listenEvent(NULL), dataEvent(NULL), number(p->number),
+VncServer::VncServer(const Params &p)
+    : VncInput(p), listenEvent(NULL), dataEvent(NULL), number(p.number),
       dataFd(-1), sendUpdate(false),
       supportsRawEnc(false), supportsResizeEnc(false)
 {
-    if (p->port)
-        listen(p->port);
+    if (p.port)
+        listen(p.port);
 
     curState = WaitForProtocolVersion;
 
@@ -139,7 +139,7 @@ VncServer::VncServer(const Params *p)
     pixelFormat.greenshift = pixelConverter.ch_g.offset;
     pixelFormat.blueshift = pixelConverter.ch_b.offset;
 
-    DPRINTF(VNC, "Vnc server created at port %d\n", p->port);
+    DPRINTF(VNC, "Vnc server created at port %d\n", p.port);
 }
 
 VncServer::~VncServer()
@@ -732,8 +732,8 @@ VncServer::frameBufferResized()
 
 // create the VNC server object
 VncServer *
-VncServerParams::create()
+VncServerParams::create() const
 {
-    return new VncServer(this);
+    return new VncServer(*this);
 }
 
index c639af974e714ba29e958dd4e136ff663f16d12a..be8158571f8af36b2e5f1aba3b1c6156666e1f6b 100644 (file)
@@ -177,7 +177,7 @@ class VncServer : public VncInput
 
   public:
     typedef VncServerParams Params;
-    VncServer(const Params *p);
+    VncServer(const Params &p);
     ~VncServer();
 
     // RFB
index ef843d757184c526e5e610f51a8b5d3f02d481a8..8c53f8c80ed3ea78d385f53212dbcefcfe6c88b5 100644 (file)
@@ -123,20 +123,20 @@ CPUProgressEvent::description() const
     return "CPU Progress";
 }
 
-BaseCPU::BaseCPU(Params *p, bool is_checker)
-    : ClockedObject(p), instCnt(0), _cpuId(p->cpu_id), _socketId(p->socket_id),
-      _instRequestorId(p->system->getRequestorId(this, "inst")),
-      _dataRequestorId(p->system->getRequestorId(this, "data")),
+BaseCPU::BaseCPU(const Params &p, bool is_checker)
+    : ClockedObject(p), instCnt(0), _cpuId(p.cpu_id), _socketId(p.socket_id),
+      _instRequestorId(p.system->getRequestorId(this, "inst")),
+      _dataRequestorId(p.system->getRequestorId(this, "data")),
       _taskId(ContextSwitchTaskId::Unknown), _pid(invldPid),
-      _switchedOut(p->switched_out), _cacheLineSize(p->system->cacheLineSize()),
-      interrupts(p->interrupts), numThreads(p->numThreads), system(p->system),
+      _switchedOut(p.switched_out), _cacheLineSize(p.system->cacheLineSize()),
+      interrupts(p.interrupts), numThreads(p.numThreads), system(p.system),
       previousCycle(0), previousState(CPU_STATE_SLEEP),
       functionTraceStream(nullptr), currentFunctionStart(0),
       currentFunctionEnd(0), functionEntryTick(0),
-      addressMonitor(p->numThreads),
-      syscallRetryLatency(p->syscallRetryLatency),
-      pwrGatingLatency(p->pwr_gating_latency),
-      powerGatingOnIdle(p->power_gating_on_idle),
+      addressMonitor(p.numThreads),
+      syscallRetryLatency(p.syscallRetryLatency),
+      pwrGatingLatency(p.pwr_gating_latency),
+      powerGatingOnIdle(p.power_gating_on_idle),
       enterPwrGatingEvent([this]{ enterPwrGating(); }, name())
 {
     // if Python did not provide a valid ID, do it here
@@ -154,27 +154,27 @@ BaseCPU::BaseCPU(Params *p, bool is_checker)
         maxThreadsPerCPU = numThreads;
 
     functionTracingEnabled = false;
-    if (p->function_trace) {
+    if (p.function_trace) {
         const string fname = csprintf("ftrace.%s", name());
         functionTraceStream = simout.findOrCreate(fname)->stream();
 
         currentFunctionStart = currentFunctionEnd = 0;
-        functionEntryTick = p->function_trace_start;
+        functionEntryTick = p.function_trace_start;
 
-        if (p->function_trace_start == 0) {
+        if (p.function_trace_start == 0) {
             functionTracingEnabled = true;
         } else {
             Event *event = new EventFunctionWrapper(
                 [this]{ enableFunctionTrace(); }, name(), true);
-            schedule(event, p->function_trace_start);
+            schedule(event, p.function_trace_start);
         }
     }
 
-    tracer = params()->tracer;
+    tracer = params().tracer;
 
-    if (params()->isa.size() != numThreads) {
+    if (params().isa.size() != numThreads) {
         fatal("Number of ISAs (%i) assigned to the CPU does not equal number "
-              "of threads (%i).\n", params()->isa.size(), numThreads);
+              "of threads (%i).\n", params().isa.size(), numThreads);
     }
 }
 
@@ -271,23 +271,23 @@ BaseCPU::init()
 {
     // Set up instruction-count-based termination events, if any. This needs
     // to happen after threadContexts has been constructed.
-    if (params()->max_insts_any_thread != 0) {
+    if (params().max_insts_any_thread != 0) {
         const char *cause = "a thread reached the max instruction count";
         for (ThreadID tid = 0; tid < numThreads; ++tid)
-            scheduleInstStop(tid, params()->max_insts_any_thread, cause);
+            scheduleInstStop(tid, params().max_insts_any_thread, cause);
     }
 
     // Set up instruction-count-based termination events for SimPoints
     // Typically, there are more than one action points.
     // Simulation.py is responsible to take the necessary actions upon
     // exitting the simulation loop.
-    if (!params()->simpoint_start_insts.empty()) {
+    if (!params().simpoint_start_insts.empty()) {
         const char *cause = "simpoint starting point found";
-        for (size_t i = 0; i < params()->simpoint_start_insts.size(); ++i)
-            scheduleInstStop(0, params()->simpoint_start_insts[i], cause);
+        for (size_t i = 0; i < params().simpoint_start_insts.size(); ++i)
+            scheduleInstStop(0, params().simpoint_start_insts[i], cause);
     }
 
-    if (params()->max_insts_all_threads != 0) {
+    if (params().max_insts_all_threads != 0) {
         const char *cause = "all threads reached the max instruction count";
 
         // allocate & initialize shared downcounter: each event will
@@ -298,11 +298,11 @@ BaseCPU::init()
         for (ThreadID tid = 0; tid < numThreads; ++tid) {
             Event *event = new CountedExitEvent(cause, *counter);
             threadContexts[tid]->scheduleInstCountEvent(
-                    event, params()->max_insts_all_threads);
+                    event, params().max_insts_all_threads);
         }
     }
 
-    if (!params()->switched_out) {
+    if (!params().switched_out) {
         registerThreadContexts();
 
         verifyMemoryMode();
@@ -312,8 +312,8 @@ BaseCPU::init()
 void
 BaseCPU::startup()
 {
-    if (params()->progress_interval) {
-        new CPUProgressEvent(this, params()->progress_interval);
+    if (params().progress_interval) {
+        new CPUProgressEvent(this, params().progress_interval);
     }
 
     if (_switchedOut)
@@ -761,7 +761,7 @@ BaseCPU::traceFunctionsInternal(Addr pc)
 bool
 BaseCPU::waitForRemoteGDB() const
 {
-    return params()->wait_for_remote_gdb;
+    return params().wait_for_remote_gdb;
 }
 
 
index 9cf4baa7b03a3b3a8dbdf341b9c41e4aa4bf6df7..ae656effc4b35180e0dbf9fc8cab7c1a96f71ade 100644 (file)
@@ -310,9 +310,12 @@ class BaseCPU : public ClockedObject
 
   public:
     typedef BaseCPUParams Params;
-    const Params *params() const
-    { return reinterpret_cast<const Params *>(_params); }
-    BaseCPU(Params *params, bool is_checker = false);
+    const Params &
+    params() const
+    {
+        return reinterpret_cast<const Params &>(_params);
+    }
+    BaseCPU(const Params &params, bool is_checker = false);
     virtual ~BaseCPU();
 
     void init() override;
index 8f558703c8284cad7868bfe9c732031ac9d8563c..45f7e6ef7864b4f11f909d3f2a18a02eb2228d2c 100644 (file)
@@ -61,7 +61,7 @@ CheckerCPU::init()
     requestorId = systemPtr->getRequestorId(this);
 }
 
-CheckerCPU::CheckerCPU(Params *p)
+CheckerCPU::CheckerCPU(const Params &p)
     : BaseCPU(p, true), systemPtr(NULL), icachePort(NULL), dcachePort(NULL),
       tc(NULL), thread(NULL),
       unverifiedReq(nullptr),
@@ -78,11 +78,11 @@ CheckerCPU::CheckerCPU(Params *p)
 
     changedPC = willChangePC = false;
 
-    exitOnError = p->exitOnError;
-    warnOnlyOnLoadError = p->warnOnlyOnLoadError;
-    itb = p->itb;
-    dtb = p->dtb;
-    workload = p->workload;
+    exitOnError = p.exitOnError;
+    warnOnlyOnLoadError = p.warnOnlyOnLoadError;
+    itb = p.itb;
+    dtb = p.dtb;
+    workload = p.workload;
 
     updateOnError = true;
 }
@@ -94,16 +94,16 @@ CheckerCPU::~CheckerCPU()
 void
 CheckerCPU::setSystem(System *system)
 {
-    const Params *p(dynamic_cast<const Params *>(_params));
+    const Params &p = dynamic_cast<const Params &>(_params);
 
     systemPtr = system;
 
     if (FullSystem) {
-        thread = new SimpleThread(this, 0, systemPtr, itb, dtb, p->isa[0]);
+        thread = new SimpleThread(this, 0, systemPtr, itb, dtb, p.isa[0]);
     } else {
         thread = new SimpleThread(this, 0, systemPtr,
                                   workload.size() ? workload[0] : NULL,
-                                  itb, dtb, p->isa[0]);
+                                  itb, dtb, p.isa[0]);
     }
 
     tc = thread->getTC();
index 97203c28c5be43972d68e4419cd29aacaaf64bba..e9c1b7fee5f04833b89bebaa1b95449d53230a21 100644 (file)
@@ -94,7 +94,7 @@ class CheckerCPU : public BaseCPU, public ExecContext
     void init() override;
 
     typedef CheckerCPUParams Params;
-    CheckerCPU(Params *p);
+    CheckerCPU(const Params &p);
     virtual ~CheckerCPU();
 
     void setSystem(System *system);
@@ -653,7 +653,7 @@ class Checker : public CheckerCPU
     typedef typename Impl::DynInstPtr DynInstPtr;
 
   public:
-    Checker(Params *p)
+    Checker(const Params &p)
         : CheckerCPU(p), updateThisCycle(false), unverifiedInst(NULL)
     { }
 
index 7654ace97ee87701cf8ce8b13954c78e6b64ab38..890bd3434401fcf0ccdf38618ed1157a8892fa94 100644 (file)
@@ -40,7 +40,7 @@
 #include "params/DummyChecker.hh"
 
 DummyChecker *
-DummyCheckerParams::create()
+DummyCheckerParams::create() const
 {
     // The checker should check all instructions executed by the main
     // cpu and therefore any parameters for early exit don't make much
@@ -48,5 +48,5 @@ DummyCheckerParams::create()
     fatal_if(max_insts_any_thread || max_insts_all_threads ||
              progress_interval, "Invalid checker parameters");
 
-    return new DummyChecker(this);
+    return new DummyChecker(*this);
 }
index feef2e8d940618e9fd85d81797a028e9379068b2..0a144995bf506e562d69e83ef4d0722c9abef4d9 100644 (file)
@@ -46,7 +46,7 @@
 class DummyChecker : public CheckerCPU
 {
   public:
-    DummyChecker(Params *p)
+    DummyChecker(const Params &p)
           : CheckerCPU(p)
     { }
 };
index 69ee5cc514b85928402c27a3d15c72a31fea5918..132a876bf366d5991b294f259147b42132ba3677 100644 (file)
@@ -205,7 +205,7 @@ Trace::ExeTracerRecord::dump()
 //  ExeTracer Simulation Object
 //
 Trace::ExeTracer *
-ExeTracerParams::create()
+ExeTracerParams::create() const
 {
-    return new Trace::ExeTracer(this);
+    return new Trace::ExeTracer(*this);
 }
index 03e0e452941e23bbae843ca1bf3b070eceb8c225..33ba4574948cb7f7b884cb3109f7f45120003cb3 100644 (file)
@@ -60,7 +60,7 @@ class ExeTracer : public InstTracer
 {
   public:
     typedef ExeTracerParams Params;
-    ExeTracer(const Params *params) : InstTracer(params)
+    ExeTracer(const Params &params) : InstTracer(params)
     {}
 
     InstRecord *
index c135ee5806c80e95724e8deb674873f9881810fc..087fcb7cefb5a484b18d68ad0411f8349d6b935f 100644 (file)
@@ -117,16 +117,16 @@ FuncUnit::isPipelined(OpClass capability)
 //  The operation-class description object
 //
 OpDesc *
-OpDescParams::create()
+OpDescParams::create() const
 {
-    return new OpDesc(this);
+    return new OpDesc(*this);
 }
 
 //
 //  The FuDesc object
 //
 FUDesc *
-FUDescParams::create()
+FUDescParams::create() const
 {
-    return new FUDesc(this);
+    return new FUDesc(*this);
 }
index 65c04cb8b273244d86283b4831d205577ce7c1cc..235a08c13702c872132ee0dfe2151ae8087a0537 100644 (file)
@@ -53,9 +53,9 @@ class OpDesc : public SimObject
     Cycles opLat;
     bool pipelined;
 
-    OpDesc(const OpDescParams *p)
-        : SimObject(p), opClass(p->opClass), opLat(p->opLat),
-          pipelined(p->pipelined) {};
+    OpDesc(const OpDescParams &p)
+        : SimObject(p), opClass(p.opClass), opLat(p.opLat),
+          pipelined(p.pipelined) {};
 };
 
 class FUDesc : public SimObject
@@ -64,8 +64,8 @@ class FUDesc : public SimObject
     std::vector<OpDesc *> opDescList;
     unsigned         number;
 
-    FUDesc(const FUDescParams *p)
-        : SimObject(p), opDescList(p->opList), number(p->count) {};
+    FUDesc(const FUDescParams &p)
+        : SimObject(p), opDescList(p.opList), number(p.count) {};
 };
 
 typedef std::vector<OpDesc *>::const_iterator OPDDiterator;
index 7d7bbaa6dd1dc2cf7eef66a70be34e99591626cc..1bfd2163351c49bb6cf2534d1bf3931e95a7a3c0 100644 (file)
@@ -66,11 +66,11 @@ InstPBTraceRecord::dump()
         tracer.traceMem(staticInst, getAddr(), getSize(), getFlags());
 }
 
-InstPBTrace::InstPBTrace(const InstPBTraceParams *p)
+InstPBTrace::InstPBTrace(const InstPBTraceParams &p)
     : InstTracer(p), buf(nullptr), bufSize(0), curMsg(nullptr)
 {
     // Create our output file
-    createTraceFile(p->file_name);
+    createTraceFile(p.file_name);
 }
 
 void
@@ -177,8 +177,8 @@ InstPBTrace::traceMem(StaticInstPtr si, Addr a, Addr s, unsigned f)
 
 
 Trace::InstPBTrace*
-InstPBTraceParams::create()
+InstPBTraceParams::create() const
 {
-    return new Trace::InstPBTrace(this);
+    return new Trace::InstPBTrace(*this);
 }
 
index b6dd843e426864f1169bca32a686faca7e18227d..bce9bf79168debb972c5b15c6fa9e59e6f65a69a 100644 (file)
@@ -83,7 +83,7 @@ class InstPBTraceRecord : public InstRecord
 class InstPBTrace : public InstTracer
 {
  public:
-    InstPBTrace(const InstPBTraceParams *p);
+    InstPBTrace(const InstPBTraceParams &p);
     virtual ~InstPBTrace();
 
     InstPBTraceRecord* getInstRecord(Tick when, ThreadContext *tc, const
index 4a410e1b74816918a253d23ea75a4aff27b907f3..805851f53881f79de69c3b2cf697c256ebc4ef83 100644 (file)
@@ -60,7 +60,7 @@ Trace::IntelTraceRecord::dump()
 //  ExeTracer Simulation Object
 //
 Trace::IntelTrace *
-IntelTraceParams::create()
+IntelTraceParams::create() const
 {
-    return new Trace::IntelTrace(this);
+    return new Trace::IntelTrace(*this);
 }
index ef268edd11e223c485783ab93409fe02786234af..6b4fdb1795f70f9dc7c2a865c81abfa24db74156 100644 (file)
@@ -57,7 +57,7 @@ class IntelTrace : public InstTracer
 {
   public:
 
-    IntelTrace(const IntelTraceParams *p) : InstTracer(p)
+    IntelTrace(const IntelTraceParams &p) : InstTracer(p)
     {}
 
     IntelTraceRecord *
index 293b211433ea5479ca0301068383612900a0ecde..b6a00ded621fc44006ad6b9ab4f8665ed823b7cf 100644 (file)
@@ -39,8 +39,8 @@
 
 using namespace std;
 
-IntrControl::IntrControl(const Params *p)
-    : SimObject(p), sys(p->sys)
+IntrControl::IntrControl(const Params &p)
+    : SimObject(p), sys(p.sys)
 {}
 
 void
@@ -76,7 +76,7 @@ IntrControl::havePosted(int cpu_id) const
 }
 
 IntrControl *
-IntrControlParams::create()
+IntrControlParams::create() const
 {
-    return new IntrControl(this);
+    return new IntrControl(*this);
 }
index a6f025ecb4e1bb825d2b49eda67d2b609a74ad8b..fcb406cfd5f64c1c134305c6f589332b9e57f227 100644 (file)
@@ -41,7 +41,7 @@ class IntrControl : public SimObject
   public:
     System *sys;
     typedef IntrControlParams Params;
-    IntrControl(const Params *p);
+    IntrControl(const Params &p);
 
     void clear(int cpu_id, int int_num, int index);
     void post(int cpu_id, int int_num, int index);
index 4190a016153a2d8428db83e7e11c028fb6d55323..5180e4458b2c647ea1d4a03e6fa89bb7cba12162 100644 (file)
@@ -30,8 +30,8 @@
 
 using namespace std;
 
-IntrControl::IntrControl(const Params *p)
-    : SimObject(p), sys(p->sys)
+IntrControl::IntrControl(const Params &p)
+    : SimObject(p), sys(p.sys)
 {}
 
 void
@@ -45,7 +45,7 @@ IntrControl::clear(int cpu_id, int int_num, int index)
 }
 
 IntrControl *
-IntrControlParams::create()
+IntrControlParams::create() const
 {
-    return new IntrControl(this);
+    return new IntrControl(*this);
 }
index 83992cd3f6dd3f9e402344a115cf9e2abf5a1685..aecd6eecdc9e63ab77dcf04b338e91c194ccace1 100644 (file)
 /* Used by some KVM macros */
 #define PAGE_SIZE pageSize
 
-BaseKvmCPU::BaseKvmCPU(BaseKvmCPUParams *params)
+BaseKvmCPU::BaseKvmCPU(const BaseKvmCPUParams &params)
     : BaseCPU(params),
-      vm(*params->system->getKvmVM()),
+      vm(*params.system->getKvmVM()),
       _status(Idle),
       dataPort(name() + ".dcache_port", this),
       instPort(name() + ".icache_port", this),
-      alwaysSyncTC(params->alwaysSyncTC),
+      alwaysSyncTC(params.alwaysSyncTC),
       threadContextDirty(true),
       kvmStateDirty(false),
       vcpuID(vm.allocVCPUID()), vcpuFD(-1), vcpuMMapSize(0),
@@ -74,21 +74,22 @@ BaseKvmCPU::BaseKvmCPU(BaseKvmCPUParams *params)
       tickEvent([this]{ tick(); }, "BaseKvmCPU tick",
                 false, Event::CPU_Tick_Pri),
       activeInstPeriod(0),
-      perfControlledByTimer(params->usePerfOverflow),
-      hostFactor(params->hostFactor), stats(this),
+      perfControlledByTimer(params.usePerfOverflow),
+      hostFactor(params.hostFactor), stats(this),
       ctrInsts(0)
 {
     if (pageSize == -1)
         panic("KVM: Failed to determine host page size (%i)\n",
               errno);
 
-    if (FullSystem)
-        thread = new SimpleThread(this, 0, params->system, params->itb, params->dtb,
-                                  params->isa[0]);
-    else
-        thread = new SimpleThread(this, /* thread_num */ 0, params->system,
-                                  params->workload[0], params->itb,
-                                  params->dtb, params->isa[0]);
+    if (FullSystem) {
+        thread = new SimpleThread(this, 0, params.system, params.itb,
+                                  params.dtb, params.isa[0]);
+    } else {
+        thread = new SimpleThread(this, /* thread_num */ 0, params.system,
+                                  params.workload[0], params.itb,
+                                  params.dtb, params.isa[0]);
+    }
 
     thread->setStatus(ThreadContext::Halted);
     tc = thread->getTC();
@@ -116,8 +117,8 @@ BaseKvmCPU::init()
 void
 BaseKvmCPU::startup()
 {
-    const BaseKvmCPUParams * const p(
-        dynamic_cast<const BaseKvmCPUParams *>(params()));
+    const BaseKvmCPUParams &p =
+        dynamic_cast<const BaseKvmCPUParams &>(params());
 
     Kvm &kvm(*vm.kvm);
 
@@ -133,7 +134,7 @@ BaseKvmCPU::startup()
     // point. Initialize virtual CPUs here instead.
     vcpuFD = vm.createVCPU(vcpuID);
 
-    // Map the KVM run structure */
+    // Map the KVM run structure
     vcpuMMapSize = kvm.getVCPUMMapSize();
     _kvmRun = (struct kvm_run *)mmap(0, vcpuMMapSize,
                                      PROT_READ | PROT_WRITE, MAP_SHARED,
@@ -145,7 +146,7 @@ BaseKvmCPU::startup()
     // available. The offset into the KVM's communication page is
     // provided by the coalesced MMIO capability.
     int mmioOffset(kvm.capCoalescedMMIO());
-    if (!p->useCoalescedMMIO) {
+    if (!p.useCoalescedMMIO) {
         inform("KVM: Coalesced MMIO disabled by config.\n");
     } else if (mmioOffset) {
         inform("KVM: Coalesced IO available\n");
@@ -235,8 +236,8 @@ BaseKvmCPU::startupThread()
     // delivery for counters and timers from within the thread that
     // will execute the event queue to ensure that signals are
     // delivered to the right threads.
-    const BaseKvmCPUParams * const p(
-        dynamic_cast<const BaseKvmCPUParams *>(params()));
+    const BaseKvmCPUParams &p =
+        dynamic_cast<const BaseKvmCPUParams &>(params());
 
     vcpuThread = pthread_self();
 
@@ -246,16 +247,16 @@ BaseKvmCPU::startupThread()
 
     setupCounters();
 
-    if (p->usePerfOverflow)
+    if (p.usePerfOverflow) {
         runTimer.reset(new PerfKvmTimer(hwCycles,
                                         KVM_KICK_SIGNAL,
-                                        p->hostFactor,
-                                        p->hostFreq));
-    else
+                                        p.hostFactor,
+                                        p.hostFreq));
+    } else {
         runTimer.reset(new PosixKvmTimer(KVM_KICK_SIGNAL, CLOCK_MONOTONIC,
-                                         p->hostFactor,
-                                         p->hostFreq));
-
+                                         p.hostFactor,
+                                         p.hostFreq));
+    }
 }
 
 BaseKvmCPU::StatGroup::StatGroup(Stats::Group *parent)
index 73465af378f2886df5029ee4776c8815e83562af..d97845b65232d0429e69e97a0cf29859bda49e17 100644 (file)
@@ -77,7 +77,7 @@ struct BaseKvmCPUParams;
 class BaseKvmCPU : public BaseCPU
 {
   public:
-    BaseKvmCPU(BaseKvmCPUParams *params);
+    BaseKvmCPU(const BaseKvmCPUParams &params);
     virtual ~BaseKvmCPU();
 
     void init() override;
index 4640ca16fe21a35619158b2d58daab7b477a89ed..1ad09e6a0928b73928da2e1e1ba3d1bab7db653b 100644 (file)
@@ -289,7 +289,7 @@ Kvm::createVM()
 }
 
 
-KvmVM::KvmVM(KvmVMParams *params)
+KvmVM::KvmVM(const KvmVMParams &params)
     : SimObject(params),
       kvm(new Kvm()), system(nullptr),
       vmFD(kvm->createVM()),
@@ -302,8 +302,8 @@ KvmVM::KvmVM(KvmVMParams *params)
     if (!maxMemorySlot)
         maxMemorySlot = 32;
     /* Setup the coalesced MMIO regions */
-    for (int i = 0; i < params->coalescedMMIO.size(); ++i)
-        coalesceMMIO(params->coalescedMMIO[i]);
+    for (int i = 0; i < params.coalescedMMIO.size(); ++i)
+        coalesceMMIO(params.coalescedMMIO[i]);
 }
 
 KvmVM::~KvmVM()
@@ -582,7 +582,7 @@ KvmVM::ioctl(int request, long p1) const
 
 
 KvmVM *
-KvmVMParams::create()
+KvmVMParams::create() const
 {
     static bool created = false;
     if (created)
@@ -590,5 +590,5 @@ KvmVMParams::create()
 
     created = true;
 
-    return new KvmVM(this);
+    return new KvmVM(*this);
 }
index e28145768e106fde7634e75261dde2543f159518..340e6f5c4f38d6a5802d7a4f894708abe25a9380 100644 (file)
@@ -291,7 +291,7 @@ class KvmVM : public SimObject
     friend class BaseKvmCPU;
 
   public:
-    KvmVM(KvmVMParams *params);
+    KvmVM(const KvmVMParams &params);
     virtual ~KvmVM();
 
     void notifyFork();
index 1fda9a0f3bc8bf3fbe7e2d0b649a846ff54998c2..0d3aa26b0a163af4a5064f22ac1eb2f715509fa3 100644 (file)
@@ -520,9 +520,9 @@ checkSeg(const char *name, const int idx, const struct kvm_segment &seg,
     // TODO: Check CS DB
 }
 
-X86KvmCPU::X86KvmCPU(X86KvmCPUParams *params)
+X86KvmCPU::X86KvmCPU(const X86KvmCPUParams &params)
     : BaseKvmCPU(params),
-      useXSave(params->useXSave)
+      useXSave(params.useXSave)
 {
     Kvm &kvm(*vm.kvm);
 
@@ -1623,7 +1623,7 @@ X86KvmCPU::setVCpuEvents(const struct kvm_vcpu_events &events)
 }
 
 X86KvmCPU *
-X86KvmCPUParams::create()
+X86KvmCPUParams::create() const
 {
-    return new X86KvmCPU(this);
+    return new X86KvmCPU(*this);
 }
index 3fa6d81079bec2e8b376fc5ab2d49d746f9d92ac..a60d5979c5cdc52d012435a8400c21a59e8ff1ca 100644 (file)
@@ -39,7 +39,7 @@
 class X86KvmCPU : public BaseKvmCPU
 {
   public:
-    X86KvmCPU(X86KvmCPUParams *params);
+    X86KvmCPU(const X86KvmCPUParams &params);
     virtual ~X86KvmCPU();
 
     void startup() override;
index a375e07be7a23648a7599425fe3b7a52ee2a99b8..2bff55d95e2f42403635ffd7e31f463f8ef0e6c7 100644 (file)
 #include "debug/MinorCPU.hh"
 #include "debug/Quiesce.hh"
 
-MinorCPU::MinorCPU(MinorCPUParams *params) :
+MinorCPU::MinorCPU(const MinorCPUParams &params) :
     BaseCPU(params),
-    threadPolicy(params->threadPolicy)
+    threadPolicy(params.threadPolicy)
 {
     /* This is only written for one thread at the moment */
     Minor::MinorThread *thread;
 
     for (ThreadID i = 0; i < numThreads; i++) {
         if (FullSystem) {
-            thread = new Minor::MinorThread(this, i, params->system,
-                    params->itb, params->dtb, params->isa[i]);
+            thread = new Minor::MinorThread(this, i, params.system,
+                    params.itb, params.dtb, params.isa[i]);
             thread->setStatus(ThreadContext::Halted);
         } else {
-            thread = new Minor::MinorThread(this, i, params->system,
-                    params->workload[i], params->itb, params->dtb,
-                    params->isa[i]);
+            thread = new Minor::MinorThread(this, i, params.system,
+                    params.workload[i], params.itb, params.dtb,
+                    params.isa[i]);
         }
 
         threads.push_back(thread);
@@ -69,13 +69,13 @@ MinorCPU::MinorCPU(MinorCPUParams *params) :
     }
 
 
-    if (params->checker) {
+    if (params.checker) {
         fatal("The Minor model doesn't support checking (yet)\n");
     }
 
     Minor::MinorDynInst::init();
 
-    pipeline = new Minor::Pipeline(*this, *params);
+    pipeline = new Minor::Pipeline(*this, params);
     activityRecorder = pipeline->getActivityRecorder();
 }
 
@@ -93,7 +93,7 @@ MinorCPU::init()
 {
     BaseCPU::init();
 
-    if (!params()->switched_out &&
+    if (!params().switched_out &&
         system->getMemoryMode() != Enums::timing)
     {
         fatal("The Minor CPU requires the memory system to be in "
@@ -292,9 +292,9 @@ MinorCPU::wakeupOnEvent(unsigned int stage_id)
 }
 
 MinorCPU *
-MinorCPUParams::create()
+MinorCPUParams::create() const
 {
-    return new MinorCPU(this);
+    return new MinorCPU(*this);
 }
 
 Port &
index 579a96b0543f9e1bcc722d98d760600a43043fec..ac9831aeed602480b5870d2ba4876314369d0200 100644 (file)
@@ -118,7 +118,7 @@ class MinorCPU : public BaseCPU
     Port &getInstPort() override;
 
   public:
-    MinorCPU(MinorCPUParams *params);
+    MinorCPU(const MinorCPUParams &params);
 
     ~MinorCPU();
 
index b07ca4aa0f3a23e7282759cd03392a22c3a18b4c..2c90c8e23a0e7656395c13659c47467053640773 100644 (file)
@@ -45,7 +45,7 @@ namespace Minor
 
 Decode::Decode(const std::string &name,
     MinorCPU &cpu_,
-    MinorCPUParams &params,
+    const MinorCPUParams &params,
     Latch<ForwardInstData>::Output inp_,
     Latch<ForwardInstData>::Input out_,
     std::vector<InputBuffer<ForwardInstData>> &next_stage_input_buffer) :
index 73809178f789c87b8e8bf3db8958a8f8dcf475e0..89ed00b9bfc55cbf45fc2d82751ae2b4e2f14bb9 100644 (file)
@@ -138,7 +138,7 @@ class Decode : public Named
   public:
     Decode(const std::string &name,
         MinorCPU &cpu_,
-        MinorCPUParams &params,
+        const MinorCPUParams &params,
         Latch<ForwardInstData>::Output inp_,
         Latch<ForwardInstData>::Input out_,
         std::vector<InputBuffer<ForwardInstData>> &next_stage_input_buffer);
index 0833224996517b1b973fe7612f5ac41a58a133cd..52708abbe6d9ba50a7e59ed02dc3a4798e62348c 100644 (file)
@@ -60,7 +60,7 @@ namespace Minor
 
 Execute::Execute(const std::string &name_,
     MinorCPU &cpu_,
-    MinorCPUParams &params,
+    const MinorCPUParams &params,
     Latch<ForwardInstData>::Output inp_,
     Latch<BranchData>::Input out_) :
     Named(name_),
index 39ccf4a62fb44ec3ab051aec19cae649f7e5b326..ba33b81911149cc3a555460bdb7081167709a699 100644 (file)
@@ -314,7 +314,7 @@ class Execute : public Named
   public:
     Execute(const std::string &name_,
         MinorCPU &cpu_,
-        MinorCPUParams &params,
+        const MinorCPUParams &params,
         Latch<ForwardInstData>::Output inp_,
         Latch<BranchData>::Input out_);
 
index 287f52007dc88f9d6f36a464574e8e2e28f28409..7a5a33f58467b65f10da57f87c4d04361d0ef252 100644 (file)
@@ -52,7 +52,7 @@ namespace Minor
 
 Fetch1::Fetch1(const std::string &name_,
     MinorCPU &cpu_,
-    MinorCPUParams &params,
+    const MinorCPUParams &params,
     Latch<BranchData>::Output inp_,
     Latch<ForwardLineData>::Input out_,
     Latch<BranchData>::Output prediction_,
index 33f90c7e77006b43155a451fd0ae69dd9476ba75..9889d426868c58b3e73445c026fd80b1ea6daa32 100644 (file)
@@ -382,7 +382,7 @@ class Fetch1 : public Named
   public:
     Fetch1(const std::string &name_,
         MinorCPU &cpu_,
-        MinorCPUParams &params,
+        const MinorCPUParams &params,
         Latch<BranchData>::Output inp_,
         Latch<ForwardLineData>::Input out_,
         Latch<BranchData>::Output prediction_,
index c43b2f8ecf744b48608c1a53c308c957523154d1..263a3190315ade148cdca38b06d0fbed9a95848f 100644 (file)
@@ -52,7 +52,7 @@ namespace Minor
 
 Fetch2::Fetch2(const std::string &name,
     MinorCPU &cpu_,
-    MinorCPUParams &params,
+    const MinorCPUParams &params,
     Latch<ForwardLineData>::Output inp_,
     Latch<BranchData>::Output branchInp_,
     Latch<BranchData>::Input predictionOut_,
index 3196e4e07053267c9d4d0f9b1af847d575aa50af..fbeb96d73a71521beb8dd73c36a0a14897e38022 100644 (file)
@@ -203,7 +203,7 @@ class Fetch2 : public Named
   public:
     Fetch2(const std::string &name,
         MinorCPU &cpu_,
-        MinorCPUParams &params,
+        const MinorCPUParams &params,
         Latch<ForwardLineData>::Output inp_,
         Latch<BranchData>::Output branchInp_,
         Latch<BranchData>::Input predictionOut_,
index e1a2ebf72a4ccabc07daf471c834576a6b3ef326..ffe7f329a7b6ec79c3ea2abd9ac23c614382b2f1 100644 (file)
 #include "enums/OpClass.hh"
 
 MinorOpClass *
-MinorOpClassParams::create()
+MinorOpClassParams::create() const
 {
-    return new MinorOpClass(this);
+    return new MinorOpClass(*this);
 }
 
 MinorOpClassSet *
-MinorOpClassSetParams::create()
+MinorOpClassSetParams::create() const
 {
-    return new MinorOpClassSet(this);
+    return new MinorOpClassSet(*this);
 }
 
 MinorFUTiming *
-MinorFUTimingParams::create()
+MinorFUTimingParams::create() const
 {
-    return new MinorFUTiming(this);
+    return new MinorFUTiming(*this);
 }
 
 MinorFU *
-MinorFUParams::create()
+MinorFUParams::create() const
 {
-    return new MinorFU(this);
+    return new MinorFU(*this);
 }
 
 MinorFUPool *
-MinorFUPoolParams::create()
+MinorFUPoolParams::create() const
 {
-    return new MinorFUPool(this);
+    return new MinorFUPool(*this);
 }
 
-MinorOpClassSet::MinorOpClassSet(const MinorOpClassSetParams *params) :
+MinorOpClassSet::MinorOpClassSet(const MinorOpClassSetParams &params) :
     SimObject(params),
-    opClasses(params->opClasses),
+    opClasses(params.opClasses),
     /* Initialise to true for an empty list so that 'fully capable' is
      *  the default */
     capabilityList(Num_OpClasses, (opClasses.empty() ? true : false))
@@ -86,17 +86,17 @@ MinorOpClassSet::MinorOpClassSet(const MinorOpClassSetParams *params) :
 }
 
 MinorFUTiming::MinorFUTiming(
-    const MinorFUTimingParams *params) :
+    const MinorFUTimingParams &params) :
     SimObject(params),
-    mask(params->mask),
-    match(params->match),
-    description(params->description),
-    suppress(params->suppress),
-    extraCommitLat(params->extraCommitLat),
-    extraCommitLatExpr(params->extraCommitLatExpr),
-    extraAssumedLat(params->extraAssumedLat),
-    srcRegsRelativeLats(params->srcRegsRelativeLats),
-    opClasses(params->opClasses)
+    mask(params.mask),
+    match(params.match),
+    description(params.description),
+    suppress(params.suppress),
+    extraCommitLat(params.extraCommitLat),
+    extraCommitLatExpr(params.extraCommitLatExpr),
+    extraAssumedLat(params.extraAssumedLat),
+    srcRegsRelativeLats(params.srcRegsRelativeLats),
+    opClasses(params.opClasses)
 { }
 
 namespace Minor
index 985ff981bda7283f4f9b9a6b8ed048c88f669b43..09290e3eef7b990a15993b280c91db9fbf1859cf 100644 (file)
@@ -62,9 +62,9 @@ class MinorOpClass : public SimObject
     OpClass opClass;
 
   public:
-    MinorOpClass(const MinorOpClassParams *params) :
+    MinorOpClass(const MinorOpClassParams &params) :
         SimObject(params),
-        opClass(params->opClass)
+        opClass(params.opClass)
     { }
 };
 
@@ -79,7 +79,7 @@ class MinorOpClassSet : public SimObject
     std::vector<bool> capabilityList;
 
   public:
-    MinorOpClassSet(const MinorOpClassSetParams *params);
+    MinorOpClassSet(const MinorOpClassSetParams &params);
 
   public:
     /** Does this set support the given op class */
@@ -129,7 +129,7 @@ class MinorFUTiming: public SimObject
     MinorOpClassSet *opClasses;
 
   public:
-    MinorFUTiming(const MinorFUTimingParams *params);
+    MinorFUTiming(const MinorFUTimingParams &params);
 
   public:
     /** Does the extra decode in this object support the given op class */
@@ -165,13 +165,13 @@ class MinorFU : public SimObject
     std::vector<MinorFUTiming *> timings;
 
   public:
-    MinorFU(const MinorFUParams *params) :
+    MinorFU(const MinorFUParams &params) :
         SimObject(params),
-        opClasses(params->opClasses),
-        opLat(params->opLat),
-        issueLat(params->issueLat),
-        cantForwardFromFUIndices(params->cantForwardFromFUIndices),
-        timings(params->timings)
+        opClasses(params.opClasses),
+        opLat(params.opLat),
+        issueLat(params.issueLat),
+        cantForwardFromFUIndices(params.cantForwardFromFUIndices),
+        timings(params.timings)
     { }
 };
 
@@ -182,9 +182,9 @@ class MinorFUPool : public SimObject
     std::vector<MinorFU *> funcUnits;
 
   public:
-    MinorFUPool(const MinorFUPoolParams *params) :
+    MinorFUPool(const MinorFUPoolParams &params) :
         SimObject(params),
-        funcUnits(params->funcUnits)
+        funcUnits(params.funcUnits)
     { }
 };
 
index 29dbf8b16776ed83d4364c1ac4c0c5925dba78dd..d3f915700450e9546619c4b4547f2bda72083311 100644 (file)
@@ -51,7 +51,7 @@
 namespace Minor
 {
 
-Pipeline::Pipeline(MinorCPU &cpu_, MinorCPUParams &params) :
+Pipeline::Pipeline(MinorCPU &cpu_, const MinorCPUParams &params) :
     Ticked(cpu_, &(cpu_.BaseCPU::numCycles)),
     cpu(cpu_),
     allow_idling(params.enableIdling),
index caf8355fb29ad87ece72e918ee3bf2fd76efad62..b275f02366d82de2e36aaeaa39e0e0dee55f66ca 100644 (file)
@@ -105,7 +105,7 @@ class Pipeline : public Ticked
     bool needToSignalDrained;
 
   public:
-    Pipeline(MinorCPU &cpu_, MinorCPUParams &params);
+    Pipeline(MinorCPU &cpu_, const MinorCPUParams &params);
 
   public:
     /** Wake up the Fetch unit.  This is needed on thread activation esp.
index 22a4e31217249efababc615f7f33778cc9c664d9..65b28338b675510deb39efcf78eaae63c078851b 100644 (file)
@@ -37,7 +37,7 @@ using namespace std;
 
 namespace Trace {
 
-NativeTrace::NativeTrace(const Params *p)
+NativeTrace::NativeTrace(const Params &p)
     : ExeTracer(p)
 {
     if (ListenSocket::allDisabled())
index 5faa88fffd5f291c210a9bc312a9816db094fe4c..b04b91560356215bae9c75411451d96d71c0cb7a 100644 (file)
@@ -72,7 +72,7 @@ class NativeTrace : public ExeTracer
 
   public:
 
-    NativeTrace(const Params *p);
+    NativeTrace(const Params &p);
     virtual ~NativeTrace() {}
 
     NativeTraceRecord *
index 01940778b39f2838992693efe836147f82a2c3f5..7613e0861e8ea74ca80aeafbf6144ca29ea26114 100644 (file)
@@ -47,7 +47,7 @@ template
 class Checker<O3CPUImpl>;
 
 O3Checker *
-O3CheckerParams::create()
+O3CheckerParams::create() const
 {
     // The checker should check all instructions executed by the main
     // cpu and therefore any parameters for early exit don't make much
@@ -55,5 +55,5 @@ O3CheckerParams::create()
     fatal_if(max_insts_any_thread || max_insts_all_threads ||
              progress_interval, "Invalid checker parameters");
 
-    return new O3Checker(this);
+    return new O3Checker(*this);
 }
index 4fbe559179051387f28cd0b27df5f5bfd0dd2000..8751a184e3615faeaed106451509aced148d15de 100644 (file)
@@ -51,9 +51,7 @@
 class O3Checker : public Checker<O3CPUImpl>
 {
   public:
-    O3Checker(Params *p)
-          : Checker<O3CPUImpl>(p)
-    { }
+    O3Checker(const Params &p) : Checker<O3CPUImpl>(p) {}
 };
 
 #endif // __CPU_O3_CHECKER_HH__
index 01a0b7f907b7baad80e1cdc347e4e51335cd3124..58ca7d7af6c56e0f1c44949c95cd9f4f6e0992cb 100644 (file)
@@ -138,7 +138,7 @@ class DefaultCommit
 
   public:
     /** Construct a DefaultCommit with the given parameters. */
-    DefaultCommit(O3CPU *_cpu, DerivO3CPUParams *params);
+    DefaultCommit(O3CPU *_cpu, const DerivO3CPUParams &params);
 
     /** Returns the name of the DefaultCommit. */
     std::string name() const;
index 4935f1e73036b5d0681251e5c68a59837488399d..717ae3334d1bf245152cb63ffcbedf48acc47876 100644 (file)
@@ -78,19 +78,19 @@ DefaultCommit<Impl>::processTrapEvent(ThreadID tid)
 }
 
 template <class Impl>
-DefaultCommit<Impl>::DefaultCommit(O3CPU *_cpu, DerivO3CPUParams *params)
-    : commitPolicy(params->smtCommitPolicy),
+DefaultCommit<Impl>::DefaultCommit(O3CPU *_cpu, const DerivO3CPUParams &params)
+    : commitPolicy(params.smtCommitPolicy),
       cpu(_cpu),
-      iewToCommitDelay(params->iewToCommitDelay),
-      commitToIEWDelay(params->commitToIEWDelay),
-      renameToROBDelay(params->renameToROBDelay),
-      fetchToCommitDelay(params->commitToFetchDelay),
-      renameWidth(params->renameWidth),
-      commitWidth(params->commitWidth),
-      numThreads(params->numThreads),
+      iewToCommitDelay(params.iewToCommitDelay),
+      commitToIEWDelay(params.commitToIEWDelay),
+      renameToROBDelay(params.renameToROBDelay),
+      fetchToCommitDelay(params.commitToFetchDelay),
+      renameWidth(params.renameWidth),
+      commitWidth(params.commitWidth),
+      numThreads(params.numThreads),
       drainPending(false),
       drainImminent(false),
-      trapLatency(params->trapLatency),
+      trapLatency(params.trapLatency),
       canHandleInterrupts(true),
       avoidQuiesceLiveLock(false),
       stats(_cpu, this)
index c5043a7e5e996a3fa4a1bece4720478e178c9870..368093f66fec958578c0e787606eb7ea31238b87 100644 (file)
@@ -67,7 +67,7 @@ struct BaseCPUParams;
 using namespace TheISA;
 using namespace std;
 
-BaseO3CPU::BaseO3CPU(BaseCPUParams *params)
+BaseO3CPU::BaseO3CPU(const BaseCPUParams &params)
     : BaseCPU(params)
 {
 }
@@ -79,10 +79,10 @@ BaseO3CPU::regStats()
 }
 
 template <class Impl>
-FullO3CPU<Impl>::FullO3CPU(DerivO3CPUParams *params)
+FullO3CPU<Impl>::FullO3CPU(const DerivO3CPUParams &params)
     : BaseO3CPU(params),
-      itb(params->itb),
-      dtb(params->dtb),
+      itb(params.itb),
+      dtb(params.dtb),
       tickEvent([this]{ tick(); }, "FullO3CPU tick",
                 false, Event::CPU_Tick_Pri),
       threadExitEvent([this]{ exitThreads(); }, "FullO3CPU exit threads",
@@ -99,12 +99,12 @@ FullO3CPU<Impl>::FullO3CPU(DerivO3CPUParams *params)
 
       /* It is mandatory that all SMT threads use the same renaming mode as
        * they are sharing registers and rename */
-      vecMode(RenameMode<TheISA::ISA>::init(params->isa[0])),
-      regFile(params->numPhysIntRegs,
-              params->numPhysFloatRegs,
-              params->numPhysVecRegs,
-              params->numPhysVecPredRegs,
-              params->numPhysCCRegs,
+      vecMode(RenameMode<TheISA::ISA>::init(params.isa[0])),
+      regFile(params.numPhysIntRegs,
+              params.numPhysFloatRegs,
+              params.numPhysVecRegs,
+              params.numPhysVecPredRegs,
+              params.numPhysCCRegs,
               vecMode),
 
       freeList(name() + ".freelist", &regFile),
@@ -116,37 +116,37 @@ FullO3CPU<Impl>::FullO3CPU(DerivO3CPUParams *params)
 
       isa(numThreads, NULL),
 
-      timeBuffer(params->backComSize, params->forwardComSize),
-      fetchQueue(params->backComSize, params->forwardComSize),
-      decodeQueue(params->backComSize, params->forwardComSize),
-      renameQueue(params->backComSize, params->forwardComSize),
-      iewQueue(params->backComSize, params->forwardComSize),
+      timeBuffer(params.backComSize, params.forwardComSize),
+      fetchQueue(params.backComSize, params.forwardComSize),
+      decodeQueue(params.backComSize, params.forwardComSize),
+      renameQueue(params.backComSize, params.forwardComSize),
+      iewQueue(params.backComSize, params.forwardComSize),
       activityRec(name(), NumStages,
-                  params->backComSize + params->forwardComSize,
-                  params->activity),
+                  params.backComSize + params.forwardComSize,
+                  params.activity),
 
       globalSeqNum(1),
-      system(params->system),
+      system(params.system),
       lastRunningCycle(curCycle())
 {
-    fatal_if(FullSystem && params->numThreads > 1,
+    fatal_if(FullSystem && params.numThreads > 1,
             "SMT is not supported in O3 in full system mode currently.");
 
-    fatal_if(!FullSystem && params->numThreads < params->workload.size(),
+    fatal_if(!FullSystem && params.numThreads < params.workload.size(),
             "More workload items (%d) than threads (%d) on CPU %s.",
-            params->workload.size(), params->numThreads, name());
+            params.workload.size(), params.numThreads, name());
 
-    if (!params->switched_out) {
+    if (!params.switched_out) {
         _status = Running;
     } else {
         _status = SwitchedOut;
     }
 
-    if (params->checker) {
-        BaseCPU *temp_checker = params->checker;
+    if (params.checker) {
+        BaseCPU *temp_checker = params.checker;
         checker = dynamic_cast<Checker<Impl> *>(temp_checker);
         checker->setIcachePort(&this->fetch.getInstPort());
-        checker->setSystem(params->system);
+        checker->setSystem(params.system);
     } else {
         checker = NULL;
     }
@@ -194,7 +194,7 @@ FullO3CPU<Impl>::FullO3CPU(DerivO3CPUParams *params)
     if (FullSystem) {
         active_threads = 1;
     } else {
-        active_threads = params->workload.size();
+        active_threads = params.workload.size();
 
         if (active_threads > Impl::MaxThreads) {
             panic("Workload Size too large. Increase the 'MaxThreads' "
@@ -204,18 +204,18 @@ FullO3CPU<Impl>::FullO3CPU(DerivO3CPUParams *params)
     }
 
     //Make Sure That this a Valid Architeture
-    assert(params->numPhysIntRegs   >= numThreads * TheISA::NumIntRegs);
-    assert(params->numPhysFloatRegs >= numThreads * TheISA::NumFloatRegs);
-    assert(params->numPhysVecRegs >= numThreads * TheISA::NumVecRegs);
-    assert(params->numPhysVecPredRegs >= numThreads * TheISA::NumVecPredRegs);
-    assert(params->numPhysCCRegs >= numThreads * TheISA::NumCCRegs);
+    assert(params.numPhysIntRegs   >= numThreads * TheISA::NumIntRegs);
+    assert(params.numPhysFloatRegs >= numThreads * TheISA::NumFloatRegs);
+    assert(params.numPhysVecRegs >= numThreads * TheISA::NumVecRegs);
+    assert(params.numPhysVecPredRegs >= numThreads * TheISA::NumVecPredRegs);
+    assert(params.numPhysCCRegs >= numThreads * TheISA::NumCCRegs);
 
     rename.setScoreboard(&scoreboard);
     iew.setScoreboard(&scoreboard);
 
     // Setup the rename map for whichever stages need it.
     for (ThreadID tid = 0; tid < numThreads; tid++) {
-        isa[tid] = dynamic_cast<TheISA::ISA *>(params->isa[tid]);
+        isa[tid] = dynamic_cast<TheISA::ISA *>(params.isa[tid]);
         assert(isa[tid]);
         assert(RenameMode<TheISA::ISA>::equalsInit(isa[tid], isa[0]));
 
@@ -307,12 +307,12 @@ FullO3CPU<Impl>::FullO3CPU(DerivO3CPUParams *params)
             assert(this->numThreads == 1);
             this->thread[tid] = new Thread(this, 0, NULL);
         } else {
-            if (tid < params->workload.size()) {
+            if (tid < params.workload.size()) {
                 DPRINTF(O3CPU, "Workload[%i] process is %#x",
                         tid, this->thread[tid]);
                 this->thread[tid] = new typename FullO3CPU<Impl>::Thread(
                         (typename Impl::O3CPU *)(this),
-                        tid, params->workload[tid]);
+                        tid, params.workload[tid]);
 
                 //usedTids[tid] = true;
                 //threadMap[tid] = tid;
@@ -337,7 +337,7 @@ FullO3CPU<Impl>::FullO3CPU(DerivO3CPUParams *params)
 
         // If we're using a checker, then the TC should be the
         // CheckerThreadContext.
-        if (params->checker) {
+        if (params.checker) {
             tc = new CheckerThreadContext<O3ThreadContext<Impl> >(
                 o3_tc, this->checker);
         }
@@ -354,7 +354,7 @@ FullO3CPU<Impl>::FullO3CPU(DerivO3CPUParams *params)
     }
 
     // FullO3CPU always requires an interrupt controller.
-    if (!params->switched_out && interrupts.empty()) {
+    if (!params.switched_out && interrupts.empty()) {
         fatal("FullO3CPU %s has no interrupt controller.\n"
               "Ensure createInterruptController() is called.\n", name());
     }
index 200d34398ef001df9e733b9f64c9ff1eec5aa2cc..a2735c460c9331d7ecadb0165de6ff2f6943e181 100644 (file)
@@ -79,7 +79,7 @@ class BaseO3CPU : public BaseCPU
 {
     //Stuff that's pretty ISA independent will go here.
   public:
-    BaseO3CPU(BaseCPUParams *params);
+    BaseO3CPU(const BaseCPUParams &params);
 
     void regStats();
 };
@@ -179,7 +179,7 @@ class FullO3CPU : public BaseO3CPU
 
   public:
     /** Constructs a CPU with the given parameters. */
-    FullO3CPU(DerivO3CPUParams *params);
+    FullO3CPU(const DerivO3CPUParams &params);
     /** Destructor. */
     ~FullO3CPU();
 
index c0c0b81b4c1fa43a65de8cd8fa3531be2ac34477..ffaa1868da0a15e430287fe5fc6c3649d4e3e142 100644 (file)
@@ -97,7 +97,7 @@ class DefaultDecode
 
   public:
     /** DefaultDecode constructor. */
-    DefaultDecode(O3CPU *_cpu, DerivO3CPUParams *params);
+    DefaultDecode(O3CPU *_cpu, const DerivO3CPUParams &params);
 
     void startupStage();
 
index 24640f6a5519372198e98bbbf2c476d18fba6c38..76cc2cf1045565f4abf0f04226e9d53f2359eca3 100644 (file)
 using std::list;
 
 template<class Impl>
-DefaultDecode<Impl>::DefaultDecode(O3CPU *_cpu, DerivO3CPUParams *params)
+DefaultDecode<Impl>::DefaultDecode(O3CPU *_cpu, const DerivO3CPUParams &params)
     : cpu(_cpu),
-      renameToDecodeDelay(params->renameToDecodeDelay),
-      iewToDecodeDelay(params->iewToDecodeDelay),
-      commitToDecodeDelay(params->commitToDecodeDelay),
-      fetchToDecodeDelay(params->fetchToDecodeDelay),
-      decodeWidth(params->decodeWidth),
-      numThreads(params->numThreads),
+      renameToDecodeDelay(params.renameToDecodeDelay),
+      iewToDecodeDelay(params.iewToDecodeDelay),
+      commitToDecodeDelay(params.commitToDecodeDelay),
+      fetchToDecodeDelay(params.fetchToDecodeDelay),
+      decodeWidth(params.decodeWidth),
+      numThreads(params.numThreads),
       stats(_cpu)
 {
     if (decodeWidth > Impl::MaxWidth)
@@ -73,7 +73,7 @@ DefaultDecode<Impl>::DefaultDecode(O3CPU *_cpu, DerivO3CPUParams *params)
              decodeWidth, static_cast<int>(Impl::MaxWidth));
 
     // @todo: Make into a parameter
-    skidBufferMax = (fetchToDecodeDelay + 1) *  params->fetchWidth;
+    skidBufferMax = (fetchToDecodeDelay + 1) *  params.fetchWidth;
     for (int tid = 0; tid < Impl::MaxThreads; tid++) {
         stalls[tid] = {false};
         decodeStatus[tid] = Idle;
index 5da710fac3c6bea3d81edb8a57d07f2a7ab6e79a..dbcd34eb58a9484d99367378df286e8f59857644 100644 (file)
@@ -33,7 +33,7 @@
 #include "params/DerivO3CPU.hh"
 
 DerivO3CPU *
-DerivO3CPUParams::create()
+DerivO3CPUParams::create() const
 {
-    return new DerivO3CPU(this);
+    return new DerivO3CPU(*this);
 }
index 5afd7b51ff9a5fa51dd500189eb03e4f9dba3340..7851aafc8e0017534e891e641561b9682430a114 100644 (file)
@@ -36,9 +36,7 @@
 class DerivO3CPU : public FullO3CPU<O3CPUImpl>
 {
   public:
-    DerivO3CPU(DerivO3CPUParams *p)
-        : FullO3CPU<O3CPUImpl>(p)
-    { }
+    DerivO3CPU(const DerivO3CPUParams &p) : FullO3CPU<O3CPUImpl>(p) {}
 };
 
 #endif // __CPU_O3_DERIV_HH__
index e47059a6884b70f4a7dd3a6c58fb28ea2872dd21..704938b6c0ea9b6320e0ec98391612414aead5d7 100644 (file)
@@ -217,7 +217,7 @@ class DefaultFetch
 
   public:
     /** DefaultFetch constructor. */
-    DefaultFetch(O3CPU *_cpu, DerivO3CPUParams *params);
+    DefaultFetch(O3CPU *_cpu, const DerivO3CPUParams &params);
 
     /** Returns the name of fetch. */
     std::string name() const;
index 28b1357ed8e7919dc889982b2f28e3e5f1532dae..d0762ca3386467c8fb27a0bd8661033ce0290bf5 100644 (file)
@@ -54,7 +54,6 @@
 #include "base/types.hh"
 #include "config/the_isa.hh"
 #include "cpu/base.hh"
-//#include "cpu/checker/cpu.hh"
 #include "cpu/o3/cpu.hh"
 #include "cpu/o3/fetch.hh"
 #include "cpu/exetrace.hh"
 using namespace std;
 
 template<class Impl>
-DefaultFetch<Impl>::DefaultFetch(O3CPU *_cpu, DerivO3CPUParams *params)
-    : fetchPolicy(params->smtFetchPolicy),
+DefaultFetch<Impl>::DefaultFetch(O3CPU *_cpu, const DerivO3CPUParams &params)
+    : fetchPolicy(params.smtFetchPolicy),
       cpu(_cpu),
       branchPred(nullptr),
-      decodeToFetchDelay(params->decodeToFetchDelay),
-      renameToFetchDelay(params->renameToFetchDelay),
-      iewToFetchDelay(params->iewToFetchDelay),
-      commitToFetchDelay(params->commitToFetchDelay),
-      fetchWidth(params->fetchWidth),
-      decodeWidth(params->decodeWidth),
+      decodeToFetchDelay(params.decodeToFetchDelay),
+      renameToFetchDelay(params.renameToFetchDelay),
+      iewToFetchDelay(params.iewToFetchDelay),
+      commitToFetchDelay(params.commitToFetchDelay),
+      fetchWidth(params.fetchWidth),
+      decodeWidth(params.decodeWidth),
       retryPkt(NULL),
       retryTid(InvalidThreadID),
       cacheBlkSize(cpu->cacheLineSize()),
-      fetchBufferSize(params->fetchBufferSize),
+      fetchBufferSize(params.fetchBufferSize),
       fetchBufferMask(fetchBufferSize - 1),
-      fetchQueueSize(params->fetchQueueSize),
-      numThreads(params->numThreads),
-      numFetchingThreads(params->smtNumFetchingThreads),
+      fetchQueueSize(params.fetchQueueSize),
+      numThreads(params.numThreads),
+      numFetchingThreads(params.smtNumFetchingThreads),
       icachePort(this, _cpu),
       finishTranslationEvent(this), fetchStats(_cpu, this)
 {
@@ -130,11 +129,11 @@ DefaultFetch<Impl>::DefaultFetch(O3CPU *_cpu, DerivO3CPUParams *params)
         issuePipelinedIfetch[i] = false;
     }
 
-    branchPred = params->branchPred;
+    branchPred = params.branchPred;
 
     for (ThreadID tid = 0; tid < numThreads; tid++) {
         decoder[tid] = new TheISA::Decoder(
-                dynamic_cast<TheISA::ISA *>(params->isa[tid]));
+                dynamic_cast<TheISA::ISA *>(params.isa[tid]));
         // Create space to buffer the cache line data,
         // which may not hold the entire cache line.
         fetchBuffer[tid] = new uint8_t[fetchBufferSize];
index 5a26d80671d7a61239b2d250cf4185458defa239..7c4b44d69684b200bd95937065dfff176d129648 100644 (file)
@@ -79,7 +79,7 @@ FUPool::~FUPool()
 
 
 // Constructor
-FUPool::FUPool(const Params *p)
+FUPool::FUPool(const Params &p)
     : SimObject(p)
 {
     numFU = 0;
@@ -92,7 +92,7 @@ FUPool::FUPool(const Params *p)
     //
     //  Iterate through the list of FUDescData structures
     //
-    const vector<FUDesc *> &paramList =  p->FUList;
+    const vector<FUDesc *> &paramList =  p.FUList;
     for (FUDDiterator i = paramList.begin(); i != paramList.end(); ++i) {
 
         //
@@ -262,7 +262,7 @@ FUPool::isDrained() const
 //  The FuPool object
 //
 FUPool *
-FUPoolParams::create()
+FUPoolParams::create() const
 {
-    return new FUPool(this);
+    return new FUPool(*this);
 }
index 81c4a6f8f50c57e4e9017fa38af4d691e0bad2f1..4659fe7203647af1e57932d474b0f450b51e46c9 100644 (file)
@@ -129,7 +129,7 @@ class FUPool : public SimObject
   public:
     typedef FUPoolParams Params;
     /** Constructs a FU pool. */
-    FUPool(const Params *p);
+    FUPool(const Params &p);
     ~FUPool();
 
     static constexpr auto NoCapableFU = -2;
index 4dbb9efb443ae3a1f8bbc6c67e2b1d39efcfcb00..07f986d6d8fb09dc89e7252f757523816abf9ca3 100644 (file)
@@ -131,7 +131,7 @@ class DefaultIEW
 
   public:
     /** Constructs a DefaultIEW with the given parameters. */
-    DefaultIEW(O3CPU *_cpu, DerivO3CPUParams *params);
+    DefaultIEW(O3CPU *_cpu, const DerivO3CPUParams &params);
 
     /** Returns the name of the DefaultIEW stage. */
     std::string name() const;
index b39001dbc8b6c2b56062f471c01d264d6488953c..0eec64444b53012c5ff73fca9d60f3aadc963d98 100644 (file)
 using namespace std;
 
 template<class Impl>
-DefaultIEW<Impl>::DefaultIEW(O3CPU *_cpu, DerivO3CPUParams *params)
-    : issueToExecQueue(params->backComSize, params->forwardComSize),
+DefaultIEW<Impl>::DefaultIEW(O3CPU *_cpu, const DerivO3CPUParams &params)
+    : issueToExecQueue(params.backComSize, params.forwardComSize),
       cpu(_cpu),
       instQueue(_cpu, this, params),
       ldstQueue(_cpu, this, params),
-      fuPool(params->fuPool),
-      commitToIEWDelay(params->commitToIEWDelay),
-      renameToIEWDelay(params->renameToIEWDelay),
-      issueToExecuteDelay(params->issueToExecuteDelay),
-      dispatchWidth(params->dispatchWidth),
-      issueWidth(params->issueWidth),
+      fuPool(params.fuPool),
+      commitToIEWDelay(params.commitToIEWDelay),
+      renameToIEWDelay(params.renameToIEWDelay),
+      issueToExecuteDelay(params.issueToExecuteDelay),
+      dispatchWidth(params.dispatchWidth),
+      issueWidth(params.issueWidth),
       wbNumInst(0),
       wbCycle(0),
-      wbWidth(params->wbWidth),
-      numThreads(params->numThreads)
+      wbWidth(params.wbWidth),
+      numThreads(params.numThreads)
 {
     if (dispatchWidth > Impl::MaxWidth)
         fatal("dispatchWidth (%d) is larger than compiled limit (%d),\n"
@@ -109,7 +109,7 @@ DefaultIEW<Impl>::DefaultIEW(O3CPU *_cpu, DerivO3CPUParams *params)
 
     updateLSQNextCycle = false;
 
-    skidBufferMax = (renameToIEWDelay + 1) * params->renameWidth;
+    skidBufferMax = (renameToIEWDelay + 1) * params.renameWidth;
 }
 
 template <class Impl>
index b8878f3b15bf0274473305a84e3b10e9a49333c7..1aebfa0d200414d3f8db9ebc567555750dd80e83 100644 (file)
@@ -121,7 +121,8 @@ class InstructionQueue
     };
 
     /** Constructs an IQ. */
-    InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params);
+    InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr,
+                     const DerivO3CPUParams &params);
 
     /** Destructs the IQ. */
     ~InstructionQueue();
index 19ed49a5dbfd333ecfee7dc8eb2af70622f2943b..119dcd244d92a4fb3c420824d8824c4e24544b68 100644 (file)
@@ -83,26 +83,26 @@ InstructionQueue<Impl>::FUCompletion::description() const
 
 template <class Impl>
 InstructionQueue<Impl>::InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr,
-                                         DerivO3CPUParams *params)
+                                         const DerivO3CPUParams &params)
     : cpu(cpu_ptr),
       iewStage(iew_ptr),
-      fuPool(params->fuPool),
-      iqPolicy(params->smtIQPolicy),
-      numEntries(params->numIQEntries),
-      totalWidth(params->issueWidth),
-      commitToIEWDelay(params->commitToIEWDelay)
+      fuPool(params.fuPool),
+      iqPolicy(params.smtIQPolicy),
+      numEntries(params.numIQEntries),
+      totalWidth(params.issueWidth),
+      commitToIEWDelay(params.commitToIEWDelay)
 {
     assert(fuPool);
 
-    numThreads = params->numThreads;
+    numThreads = params.numThreads;
 
     // Set the number of total physical registers
     // As the vector registers have two addressing modes, they are added twice
-    numPhysRegs = params->numPhysIntRegs + params->numPhysFloatRegs +
-                    params->numPhysVecRegs +
-                    params->numPhysVecRegs * TheISA::NumVecElemPerVecReg +
-                    params->numPhysVecPredRegs +
-                    params->numPhysCCRegs;
+    numPhysRegs = params.numPhysIntRegs + params.numPhysFloatRegs +
+                    params.numPhysVecRegs +
+                    params.numPhysVecRegs * TheISA::NumVecElemPerVecReg +
+                    params.numPhysVecPredRegs +
+                    params.numPhysCCRegs;
 
     //Create an entry for each physical register within the
     //dependency graph.
@@ -138,7 +138,7 @@ InstructionQueue<Impl>::InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr,
         DPRINTF(IQ, "IQ sharing policy set to Partitioned:"
                 "%i entries per thread.\n",part_amt);
     } else if (iqPolicy == SMTQueuePolicy::Threshold) {
-        double threshold =  (double)params->smtIQThreshold / 100;
+        double threshold =  (double)params.smtIQThreshold / 100;
 
         int thresholdIQ = (int)((double)threshold * numEntries);
 
index bec3ac21c90375df0612f4835f042bcf1057a5cf..377ec590846df540684d262cfeee3c7cd2062c14 100644 (file)
@@ -847,7 +847,7 @@ class LSQ
     };
 
     /** Constructs an LSQ with the given parameters. */
-    LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params);
+    LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, const DerivO3CPUParams &params);
     ~LSQ() { }
 
     /** Returns the name of the LSQ. */
index e3922aece53095282ff64ab82b71f9fdeb7ec3c0..16b4b05eea13bda87324d51b70cd38a90688b13d 100644 (file)
 using namespace std;
 
 template <class Impl>
-LSQ<Impl>::LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params)
+LSQ<Impl>::LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, const DerivO3CPUParams &params)
     : cpu(cpu_ptr), iewStage(iew_ptr),
       _cacheBlocked(false),
-      cacheStorePorts(params->cacheStorePorts), usedStorePorts(0),
-      cacheLoadPorts(params->cacheLoadPorts), usedLoadPorts(0),
-      lsqPolicy(params->smtLSQPolicy),
-      LQEntries(params->LQEntries),
-      SQEntries(params->SQEntries),
-      maxLQEntries(maxLSQAllocation(lsqPolicy, LQEntries, params->numThreads,
-                  params->smtLSQThreshold)),
-      maxSQEntries(maxLSQAllocation(lsqPolicy, SQEntries, params->numThreads,
-                  params->smtLSQThreshold)),
+      cacheStorePorts(params.cacheStorePorts), usedStorePorts(0),
+      cacheLoadPorts(params.cacheLoadPorts), usedLoadPorts(0),
+      lsqPolicy(params.smtLSQPolicy),
+      LQEntries(params.LQEntries),
+      SQEntries(params.SQEntries),
+      maxLQEntries(maxLSQAllocation(lsqPolicy, LQEntries, params.numThreads,
+                  params.smtLSQThreshold)),
+      maxSQEntries(maxLSQAllocation(lsqPolicy, SQEntries, params.numThreads,
+                  params.smtLSQThreshold)),
       dcachePort(this, cpu_ptr),
-      numThreads(params->numThreads)
+      numThreads(params.numThreads)
 {
     assert(numThreads > 0 && numThreads <= Impl::MaxThreads);
 
-    //**********************************************/
-    //************ Handle SMT Parameters ***********/
-    //**********************************************/
+    //**********************************************
+    //************ Handle SMT Parameters ***********
+    //**********************************************
 
     /* Run SMT olicy checks. */
         if (lsqPolicy == SMTQueuePolicy::Dynamic) {
@@ -89,8 +89,8 @@ LSQ<Impl>::LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params)
                 maxLQEntries,maxSQEntries);
     } else if (lsqPolicy == SMTQueuePolicy::Threshold) {
 
-        assert(params->smtLSQThreshold > params->LQEntries);
-        assert(params->smtLSQThreshold > params->SQEntries);
+        assert(params.smtLSQThreshold > params.LQEntries);
+        assert(params.smtLSQThreshold > params.SQEntries);
 
         DPRINTF(LSQ, "LSQ sharing policy set to Threshold: "
                 "%i entries per LQ | %i entries per SQ\n",
index 3d6e3f0c2f2359d1f4721a92e8fc4cb624705c5a..55b229ae524f171b38172e9db552199e3bd80223 100644 (file)
@@ -232,7 +232,7 @@ class LSQUnit
     }
 
     /** Initializes the LSQ unit with the specified number of entries. */
-    void init(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params,
+    void init(O3CPU *cpu_ptr, IEW *iew_ptr, const DerivO3CPUParams &params,
             LSQ *lsq_ptr, unsigned id);
 
     /** Returns the name of the LSQ unit. */
index 808a6711f35bbe8e3ec99dae2087a7f7acafba10..93ac0093d6e59e7312e80369a15e4da479c4b0a4 100644 (file)
@@ -214,8 +214,8 @@ LSQUnit<Impl>::LSQUnit(uint32_t lqEntries, uint32_t sqEntries)
 
 template<class Impl>
 void
-LSQUnit<Impl>::init(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params,
-        LSQ *lsq_ptr, unsigned id)
+LSQUnit<Impl>::init(O3CPU *cpu_ptr, IEW *iew_ptr,
+        const DerivO3CPUParams &params, LSQ *lsq_ptr, unsigned id)
 {
     lsqID = id;
 
@@ -228,9 +228,9 @@ LSQUnit<Impl>::init(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params,
 
     DPRINTF(LSQUnit, "Creating LSQUnit%i object.\n",lsqID);
 
-    depCheckShift = params->LSQDepCheckShift;
-    checkLoads = params->LSQCheckLoads;
-    needsTSO = params->needsTSO;
+    depCheckShift = params.LSQDepCheckShift;
+    checkLoads = params.LSQCheckLoads;
+    needsTSO = params.needsTSO;
 
     resetState();
 }
index 685f6496bcbb6c07873b71ea7918fc8b1a6b90e3..ebeb70283d4c235840548da1ba6a81fa307c52fe 100644 (file)
@@ -90,7 +90,7 @@ class MemDepUnit
     MemDepUnit();
 
     /** Constructs a MemDepUnit with given parameters. */
-    MemDepUnit(DerivO3CPUParams *params);
+    MemDepUnit(const DerivO3CPUParams &params);
 
     /** Frees up any memory allocated. */
     ~MemDepUnit();
@@ -99,7 +99,7 @@ class MemDepUnit
     std::string name() const { return _name; }
 
     /** Initializes the unit with parameters and a thread id. */
-    void init(DerivO3CPUParams *params, ThreadID tid);
+    void init(const DerivO3CPUParams &params, ThreadID tid);
 
     /** Registers statistics. */
     void regStats();
index 7e1126e55c27c18d291de40114002bf3eda4298f..7af046999880081d2e557475a1ca4a8b61bc9fac 100644 (file)
@@ -57,10 +57,10 @@ MemDepUnit<MemDepPred, Impl>::MemDepUnit()
 }
 
 template <class MemDepPred, class Impl>
-MemDepUnit<MemDepPred, Impl>::MemDepUnit(DerivO3CPUParams *params)
-    : _name(params->name + ".memdepunit"),
-      depPred(params->store_set_clear_period, params->SSITSize,
-              params->LFSTSize),
+MemDepUnit<MemDepPred, Impl>::MemDepUnit(const DerivO3CPUParams &params)
+    : _name(params.name + ".memdepunit"),
+      depPred(params.store_set_clear_period, params.SSITSize,
+              params.LFSTSize),
       iqPtr(NULL)
 {
     DPRINTF(MemDepUnit, "Creating MemDepUnit object.\n");
@@ -93,15 +93,16 @@ MemDepUnit<MemDepPred, Impl>::~MemDepUnit()
 
 template <class MemDepPred, class Impl>
 void
-MemDepUnit<MemDepPred, Impl>::init(DerivO3CPUParams *params, ThreadID tid)
+MemDepUnit<MemDepPred, Impl>::init(
+        const DerivO3CPUParams &params, ThreadID tid)
 {
     DPRINTF(MemDepUnit, "Creating MemDepUnit %i object.\n",tid);
 
-    _name = csprintf("%s.memDep%d", params->name, tid);
+    _name = csprintf("%s.memDep%d", params.name, tid);
     id = tid;
 
-    depPred.init(params->store_set_clear_period, params->SSITSize,
-            params->LFSTSize);
+    depPred.init(params.store_set_clear_period, params.SSITSize,
+            params.LFSTSize);
 }
 
 template <class MemDepPred, class Impl>
index b40d2819777f56af2e79417e47b87cc0a87ac3a3..0f7e9b50bc5f54a84ef2fc91d3c9faa72da852b5 100644 (file)
 #include "debug/ElasticTrace.hh"
 #include "mem/packet.hh"
 
-ElasticTrace::ElasticTrace(const ElasticTraceParamsparams)
+ElasticTrace::ElasticTrace(const ElasticTraceParams &params)
     :  ProbeListenerObject(params),
        regEtraceListenersEvent([this]{ regEtraceListeners(); }, name()),
        firstWin(true),
        lastClearedSeqNum(0),
-       depWindowSize(params->depWindowSize),
+       depWindowSize(params.depWindowSize),
        dataTraceStream(nullptr),
        instTraceStream(nullptr),
-       startTraceInst(params->startTraceInst),
+       startTraceInst(params.startTraceInst),
        allProbesReg(false),
-       traceVirtAddr(params->traceVirtAddr),
+       traceVirtAddr(params.traceVirtAddr),
        stats(this)
 {
-    cpu = dynamic_cast<FullO3CPU<O3CPUImpl>*>(params->manager);
+    cpu = dynamic_cast<FullO3CPU<O3CPUImpl>*>(params.manager);
     fatal_if(!cpu, "Manager of %s is not of type O3CPU and thus does not "\
                 "support dependency tracing.\n", name());
 
@@ -67,14 +67,14 @@ ElasticTrace::ElasticTrace(const ElasticTraceParams* params)
     fatal_if(cpu->numThreads > 1, "numThreads = %i, %s supports tracing for"\
                 "single-threaded workload only", cpu->numThreads, name());
     // Initialize the protobuf output stream
-    fatal_if(params->instFetchTraceFile == "", "Assign instruction fetch "\
+    fatal_if(params.instFetchTraceFile == "", "Assign instruction fetch "\
                 "trace file path to instFetchTraceFile");
-    fatal_if(params->dataDepTraceFile == "", "Assign data dependency "\
+    fatal_if(params.dataDepTraceFile == "", "Assign data dependency "\
                 "trace file path to dataDepTraceFile");
     std::string filename = simout.resolve(name() + "." +
-                                            params->instFetchTraceFile);
+                                            params.instFetchTraceFile);
     instTraceStream = new ProtoOutputStream(filename);
-    filename = simout.resolve(name() + "." + params->dataDepTraceFile);
+    filename = simout.resolve(name() + "." + params.dataDepTraceFile);
     dataTraceStream = new ProtoOutputStream(filename);
     // Create a protobuf message for the header and write it to the stream
     ProtoMessage::PacketHeader inst_pkt_header;
@@ -921,7 +921,7 @@ ElasticTrace::flushTraces()
 }
 
 ElasticTrace*
-ElasticTraceParams::create()
+ElasticTraceParams::create() const
 {
-    return new ElasticTrace(this);
+    return new ElasticTrace(*this);
 }
index ddd94083f3202bcaa4c9868247a1ac97b6b60753..1c44873065bc26a0a4f61a6e23430abfeb3912cc 100644 (file)
@@ -94,7 +94,7 @@ class ElasticTrace : public ProbeListenerObject
     typedef ProtoMessage::InstDepRecord Record;
 
     /** Constructor */
-    ElasticTrace(const ElasticTraceParams *params);
+    ElasticTrace(const ElasticTraceParams &params);
 
     /**
      * Register the probe listeners that is the methods called on a probe point
index 902d49bb7b795c0c4073a93d58e1683cca50d2f4..9891cf28a528858008e1dadb64e98b4c898f0531 100644 (file)
@@ -65,7 +65,7 @@ void SimpleTrace::regProbeListeners()
 }
 
 SimpleTrace*
-SimpleTraceParams::create()
+SimpleTraceParams::create() const
 {
-    return new SimpleTrace(this);
+    return new SimpleTrace(*this);
 }
index a35a2b0716507f9c0623d16c1833d1af9d0ea38c..2cd409f50af4d797b01d66f9dcd479a10ba8590c 100644 (file)
@@ -52,7 +52,7 @@
 class SimpleTrace : public ProbeListenerObject {
 
   public:
-    SimpleTrace(const SimpleTraceParams *params):
+    SimpleTrace(const SimpleTraceParams &params):
         ProbeListenerObject(params)
     {
     }
index 5b45218f4a2a74e16f0798180c93b32483b7c55d..47302c68524909f3d3bfa696d4f5e02d1755bc2f 100644 (file)
@@ -128,7 +128,7 @@ class DefaultRename
 
   public:
     /** DefaultRename constructor. */
-    DefaultRename(O3CPU *_cpu, DerivO3CPUParams *params);
+    DefaultRename(O3CPU *_cpu, const DerivO3CPUParams &params);
 
     /** Returns the name of rename. */
     std::string name() const;
index 052012ee2602f891de13721b08462e81748b7f93..007ec878b3f3f8e7650e61960c069264e512111b 100644 (file)
 using namespace std;
 
 template <class Impl>
-DefaultRename<Impl>::DefaultRename(O3CPU *_cpu, DerivO3CPUParams *params)
+DefaultRename<Impl>::DefaultRename(O3CPU *_cpu, const DerivO3CPUParams &params)
     : cpu(_cpu),
-      iewToRenameDelay(params->iewToRenameDelay),
-      decodeToRenameDelay(params->decodeToRenameDelay),
-      commitToRenameDelay(params->commitToRenameDelay),
-      renameWidth(params->renameWidth),
-      commitWidth(params->commitWidth),
-      numThreads(params->numThreads),
+      iewToRenameDelay(params.iewToRenameDelay),
+      decodeToRenameDelay(params.decodeToRenameDelay),
+      commitToRenameDelay(params.commitToRenameDelay),
+      renameWidth(params.renameWidth),
+      commitWidth(params.commitWidth),
+      numThreads(params.numThreads),
       stats(_cpu)
 {
     if (renameWidth > Impl::MaxWidth)
@@ -72,7 +72,7 @@ DefaultRename<Impl>::DefaultRename(O3CPU *_cpu, DerivO3CPUParams *params)
              renameWidth, static_cast<int>(Impl::MaxWidth));
 
     // @todo: Make into a parameter.
-    skidBufferMax = (decodeToRenameDelay + 1) * params->decodeWidth;
+    skidBufferMax = (decodeToRenameDelay + 1) * params.decodeWidth;
     for (uint32_t tid = 0; tid < Impl::MaxThreads; tid++) {
         renameStatus[tid] = Idle;
         renameMap[tid] = nullptr;
index 4b87dc4d9ed88af262e1382cc655910e238182e1..60bcdcff43d0ecdde0d254925b6f2131229e5ffd 100644 (file)
@@ -85,7 +85,7 @@ class ROB
      *  @param _cpu   The cpu object pointer.
      *  @param params The cpu params including several ROB-specific parameters.
      */
-    ROB(O3CPU *_cpu, DerivO3CPUParams *params);
+    ROB(O3CPU *_cpu, const DerivO3CPUParams &params);
 
     std::string name() const;
 
index bfc368bc99dbd3416475f35cac3ae8ed40abb14b..d4a02b5988adc4c7f26e2e5cf1e74f96520e50fc 100644 (file)
 using namespace std;
 
 template <class Impl>
-ROB<Impl>::ROB(O3CPU *_cpu, DerivO3CPUParams *params)
-    : robPolicy(params->smtROBPolicy),
+ROB<Impl>::ROB(O3CPU *_cpu, const DerivO3CPUParams &params)
+    : robPolicy(params.smtROBPolicy),
       cpu(_cpu),
-      numEntries(params->numROBEntries),
-      squashWidth(params->squashWidth),
+      numEntries(params.numROBEntries),
+      squashWidth(params.squashWidth),
       numInstsInROB(0),
-      numThreads(params->numThreads),
+      numThreads(params.numThreads),
       stats(_cpu)
 {
     //Figure out rob policy
@@ -82,7 +82,7 @@ ROB<Impl>::ROB(O3CPU *_cpu, DerivO3CPUParams *params)
     } else if (robPolicy == SMTQueuePolicy::Threshold) {
         DPRINTF(Fetch, "ROB sharing policy set to Threshold\n");
 
-        int threshold =  params->smtROBThreshold;;
+        int threshold =  params.smtROBThreshold;;
 
         //Divide up by threshold amount
         for (ThreadID tid = 0; tid < numThreads; tid++) {
index 8f800cc946975c7bbba26c8fe1d2239d7b7ac1eb..5f076673a29596cbfadcbe6ce6e2691287192c8c 100644 (file)
 #include "base/trace.hh"
 #include "debug/Fetch.hh"
 
-LocalBP::LocalBP(const LocalBPParams *params)
+LocalBP::LocalBP(const LocalBPParams &params)
     : BPredUnit(params),
-      localPredictorSize(params->localPredictorSize),
-      localCtrBits(params->localCtrBits),
+      localPredictorSize(params.localPredictorSize),
+      localCtrBits(params.localCtrBits),
       localPredictorSets(localPredictorSize / localCtrBits),
       localCtrs(localPredictorSets, SatCounter(localCtrBits)),
       indexMask(localPredictorSets - 1)
@@ -135,7 +135,7 @@ LocalBP::uncondBranch(ThreadID tid, Addr pc, void *&bp_history)
 }
 
 LocalBP*
-LocalBPParams::create()
+LocalBPParams::create() const
 {
-    return new LocalBP(this);
+    return new LocalBP(*this);
 }
index 787d967666ae552add4e4bf7b4322eb8220c3e94..60808ca95af5cd15ab99e5a5822324e584e00c63 100644 (file)
@@ -61,7 +61,7 @@ class LocalBP : public BPredUnit
     /**
      * Default branch predictor constructor.
      */
-    LocalBP(const LocalBPParams *params);
+    LocalBP(const LocalBPParams &params);
 
     virtual void uncondBranch(ThreadID tid, Addr pc, void * &bp_history);
 
index 6c429f5e608e0b178f66740f8ba5c3e6cd5aa7a0..4d435a82fe7f3aea14ffea5e8c07d0a3d1889e25 100644 (file)
 #include "base/bitfield.hh"
 #include "base/intmath.hh"
 
-BiModeBP::BiModeBP(const BiModeBPParams *params)
+BiModeBP::BiModeBP(const BiModeBPParams &params)
     : BPredUnit(params),
-      globalHistoryReg(params->numThreads, 0),
-      globalHistoryBits(ceilLog2(params->globalPredictorSize)),
-      choicePredictorSize(params->choicePredictorSize),
-      choiceCtrBits(params->choiceCtrBits),
-      globalPredictorSize(params->globalPredictorSize),
-      globalCtrBits(params->globalCtrBits),
+      globalHistoryReg(params.numThreads, 0),
+      globalHistoryBits(ceilLog2(params.globalPredictorSize)),
+      choicePredictorSize(params.choicePredictorSize),
+      choiceCtrBits(params.choiceCtrBits),
+      globalPredictorSize(params.globalPredictorSize),
+      globalCtrBits(params.globalCtrBits),
       choiceCounters(choicePredictorSize, SatCounter(choiceCtrBits)),
       takenCounters(globalPredictorSize, SatCounter(globalCtrBits)),
       notTakenCounters(globalPredictorSize, SatCounter(globalCtrBits))
@@ -227,7 +227,7 @@ BiModeBP::updateGlobalHistReg(ThreadID tid, bool taken)
 }
 
 BiModeBP*
-BiModeBPParams::create()
+BiModeBPParams::create() const
 {
-    return new BiModeBP(this);
+    return new BiModeBP(*this);
 }
index f86ccce333deff4225da5094943c2533cac8df02..69c698bb65134639e398e89051e4be19f63a8d14 100644 (file)
@@ -54,7 +54,7 @@
 class BiModeBP : public BPredUnit
 {
   public:
-    BiModeBP(const BiModeBPParams *params);
+    BiModeBP(const BiModeBPParams &params);
     void uncondBranch(ThreadID tid, Addr pc, void * &bp_history);
     void squash(ThreadID tid, void *bp_history);
     bool lookup(ThreadID tid, Addr branch_addr, void * &bp_history);
index d71f464a87d91f0bccf3aef52551d5515914f02a..e618fb5196e8dcaf42a6f250a65d019db5dd6ceb 100644 (file)
 #include "config/the_isa.hh"
 #include "debug/Branch.hh"
 
-BPredUnit::BPredUnit(const Params *params)
+BPredUnit::BPredUnit(const Params &params)
     : SimObject(params),
-      numThreads(params->numThreads),
+      numThreads(params.numThreads),
       predHist(numThreads),
-      BTB(params->BTBEntries,
-          params->BTBTagSize,
-          params->instShiftAmt,
-          params->numThreads),
+      BTB(params.BTBEntries,
+          params.BTBTagSize,
+          params.instShiftAmt,
+          params.numThreads),
       RAS(numThreads),
-      iPred(params->indirectBranchPred),
+      iPred(params.indirectBranchPred),
       stats(this),
-      instShiftAmt(params->instShiftAmt)
+      instShiftAmt(params.instShiftAmt)
 {
     for (auto& r : RAS)
-        r.init(params->RASSize);
+        r.init(params.RASSize);
 }
 
 BPredUnit::BPredUnitStats::BPredUnitStats(Stats::Group *parent)
index c90d450bc064590beab359888b4e740da32e6b06..e445a39e76b73bce448423dcb4812368bc0be0fe 100644 (file)
@@ -66,7 +66,7 @@ class BPredUnit : public SimObject
     /**
      * @param params The params object, that has the size of the BP and BTB.
      */
-    BPredUnit(const Params *p);
+    BPredUnit(const Params &p);
 
     void regProbePoints() override;
 
index 5c070869e114bcf910cde571cc388cc4c2fb7e34..469c48d7d293902dcf3fd5f833d6e58dddc5187d 100644 (file)
@@ -41,7 +41,7 @@ class IndirectPredictor : public SimObject
 
     typedef IndirectPredictorParams Params;
 
-    IndirectPredictor(const Params *params)
+    IndirectPredictor(const Params &params)
         : SimObject(params)
     {
     }
index 5dad79713382fbe876273bd9982ebbe23e0ae0c8..af3b521f077086b7243f4d191c5220b07e2dacbb 100644 (file)
 #include "debug/LTage.hh"
 #include "params/LoopPredictor.hh"
 
-LoopPredictor::LoopPredictor(LoopPredictorParams *p)
-  : SimObject(p), logSizeLoopPred(p->logSizeLoopPred),
-    loopTableAgeBits(p->loopTableAgeBits),
-    loopTableConfidenceBits(p->loopTableConfidenceBits),
-    loopTableTagBits(p->loopTableTagBits),
-    loopTableIterBits(p->loopTableIterBits),
-    logLoopTableAssoc(p->logLoopTableAssoc),
+LoopPredictor::LoopPredictor(const LoopPredictorParams &p)
+  : SimObject(p), logSizeLoopPred(p.logSizeLoopPred),
+    loopTableAgeBits(p.loopTableAgeBits),
+    loopTableConfidenceBits(p.loopTableConfidenceBits),
+    loopTableTagBits(p.loopTableTagBits),
+    loopTableIterBits(p.loopTableIterBits),
+    logLoopTableAssoc(p.logLoopTableAssoc),
     confidenceThreshold((1 << loopTableConfidenceBits) - 1),
     loopTagMask((1 << loopTableTagBits) - 1),
     loopNumIterMask((1 << loopTableIterBits) - 1),
     loopSetMask((1 << (logSizeLoopPred - logLoopTableAssoc)) - 1),
     loopUseCounter(-1),
-    withLoopBits(p->withLoopBits),
-    useDirectionBit(p->useDirectionBit),
-    useSpeculation(p->useSpeculation),
-    useHashing(p->useHashing),
-    restrictAllocation(p->restrictAllocation),
-    initialLoopIter(p->initialLoopIter),
-    initialLoopAge(p->initialLoopAge),
-    optionalAgeReset(p->optionalAgeReset),
+    withLoopBits(p.withLoopBits),
+    useDirectionBit(p.useDirectionBit),
+    useSpeculation(p.useSpeculation),
+    useHashing(p.useHashing),
+    restrictAllocation(p.restrictAllocation),
+    initialLoopIter(p.initialLoopIter),
+    initialLoopAge(p.initialLoopAge),
+    optionalAgeReset(p.optionalAgeReset),
     stats(this)
 {
     assert(initialLoopAge <= ((1 << loopTableAgeBits) - 1));
@@ -364,7 +364,7 @@ LoopPredictor::getSizeInBits() const
 }
 
 LoopPredictor *
-LoopPredictorParams::create()
+LoopPredictorParams::create() const
 {
-    return new LoopPredictor(this);
+    return new LoopPredictor(*this);
 }
index b26bc7139c74066df4affbb85325080ade5572c7..1cc45c0c954fbd04847977b86ffab24b75fdbee9 100644 (file)
@@ -252,7 +252,7 @@ class LoopPredictor : public SimObject
      */
     void init() override;
 
-    LoopPredictor(LoopPredictorParams *p);
+    LoopPredictor(const LoopPredictorParams &p);
 
     size_t getSizeInBits() const;
 };
index 68a6db72af1c131df0a3d1703d03ed3e6382e98a..e770336d0d6271c7c337d80fd2d6b433b4cbfe68 100644 (file)
@@ -44,8 +44,8 @@
 #include "debug/Fetch.hh"
 #include "debug/LTage.hh"
 
-LTAGE::LTAGE(const LTAGEParams *params)
-  : TAGE(params), loopPredictor(params->loop_predictor)
+LTAGE::LTAGE(const LTAGEParams &params)
+  : TAGE(params), loopPredictor(params.loop_predictor)
 {
 }
 
@@ -148,7 +148,7 @@ LTAGE::regStats()
 }
 
 LTAGE*
-LTAGEParams::create()
+LTAGEParams::create() const
 {
-    return new LTAGE(this);
+    return new LTAGE(*this);
 }
index 0bbac81d15c4d02ef391e670a33d431647db93e3..9ed1e4838549660e7e6d79abced96c0365d9426a 100644 (file)
@@ -60,7 +60,7 @@
 class LTAGE : public TAGE
 {
   public:
-    LTAGE(const LTAGEParams *params);
+    LTAGE(const LTAGEParams &params);
 
     // Base class methods.
     void squash(ThreadID tid, void *bp_history) override;
index 6582197aad4bf44df9d525642fa08f4c68588f28..8e42e12f2bc3d0b1988e9537004ba9074d2a0238 100644 (file)
@@ -111,20 +111,20 @@ MultiperspectivePerceptron::ThreadData::ThreadData(int num_filters,
 }
 
 MultiperspectivePerceptron::MultiperspectivePerceptron(
-    const MultiperspectivePerceptronParams *p) : BPredUnit(p),
-    blockSize(p->block_size), pcshift(p->pcshift), threshold(p->threshold),
-    bias0(p->bias0), bias1(p->bias1), biasmostly0(p->biasmostly0),
-    biasmostly1(p->biasmostly1), nbest(p->nbest), tunebits(p->tunebits),
-    hshift(p->hshift), imli_mask1(p->imli_mask1), imli_mask4(p->imli_mask4),
-    recencypos_mask(p->recencypos_mask), fudge(p->fudge),
-    n_sign_bits(p->n_sign_bits), pcbit(p->pcbit), decay(p->decay),
-    record_mask(p->record_mask), hash_taken(p->hash_taken),
-    tuneonly(p->tuneonly), extra_rounds(p->extra_rounds), speed(p->speed),
-    budgetbits(p->budgetbits), speculative_update(p->speculative_update),
-    threadData(p->numThreads, nullptr), doing_local(false),
-    doing_recency(false), assoc(0), ghist_length(p->initial_ghist_length),
+    const MultiperspectivePerceptronParams &p) : BPredUnit(p),
+    blockSize(p.block_size), pcshift(p.pcshift), threshold(p.threshold),
+    bias0(p.bias0), bias1(p.bias1), biasmostly0(p.biasmostly0),
+    biasmostly1(p.biasmostly1), nbest(p.nbest), tunebits(p.tunebits),
+    hshift(p.hshift), imli_mask1(p.imli_mask1), imli_mask4(p.imli_mask4),
+    recencypos_mask(p.recencypos_mask), fudge(p.fudge),
+    n_sign_bits(p.n_sign_bits), pcbit(p.pcbit), decay(p.decay),
+    record_mask(p.record_mask), hash_taken(p.hash_taken),
+    tuneonly(p.tuneonly), extra_rounds(p.extra_rounds), speed(p.speed),
+    budgetbits(p.budgetbits), speculative_update(p.speculative_update),
+    threadData(p.numThreads, nullptr), doing_local(false),
+    doing_recency(false), assoc(0), ghist_length(p.initial_ghist_length),
     modghist_length(1), path_length(1), thresholdCounter(0),
-    theta(p->initial_theta), extrabits(0), imli_counter_bits(4),
+    theta(p.initial_theta), extrabits(0), imli_counter_bits(4),
     modhist_indices(), modhist_lengths(), modpath_indices(), modpath_lengths()
 {
     fatal_if(speculative_update, "Speculative update not implemented");
@@ -150,16 +150,16 @@ MultiperspectivePerceptron::init()
     for (auto &spec : specs) {
         spec->setBitRequirements();
     }
-    const MultiperspectivePerceptronParams *p =
-        static_cast<const MultiperspectivePerceptronParams *>(params());
+    const MultiperspectivePerceptronParams &p =
+        static_cast<const MultiperspectivePerceptronParams &>(params());
 
-    computeBits(p->num_filter_entries, p->num_local_histories,
-                p->local_history_length, p->ignore_path_size);
+    computeBits(p.num_filter_entries, p.num_local_histories,
+                p.local_history_length, p.ignore_path_size);
 
     for (int i = 0; i < threadData.size(); i += 1) {
-        threadData[i] = new ThreadData(p->num_filter_entries,
-                                       p->num_local_histories,
-                                       p->local_history_length, assoc,
+        threadData[i] = new ThreadData(p.num_filter_entries,
+                                       p.num_local_histories,
+                                       p.local_history_length, assoc,
                                        blurrypath_bits, path_length,
                                        ghist_length, blockSize, acyclic_bits,
                                        modhist_indices, modhist_lengths,
index c225aa4c338d63b379eb81ed20fc2e7e65840ee4..4f5f6130a1202b1401c9d28f8f41711f5d8eb4b2 100644 (file)
@@ -1012,7 +1012,7 @@ class MultiperspectivePerceptron : public BPredUnit
     };
 
     public:
-    MultiperspectivePerceptron(const MultiperspectivePerceptronParams *params);
+    MultiperspectivePerceptron(const MultiperspectivePerceptronParams &params);
 
     /**
      * Sets the starting number of storage bits to compute the number of
index a5d724183d130cc374afa79702898d513aa64ac9..ba45232ba39143306232fe14d3f4febf058c7a01 100644 (file)
@@ -40,7 +40,7 @@
 #include "cpu/pred/multiperspective_perceptron_64KB.hh"
 
 MultiperspectivePerceptron64KB::MultiperspectivePerceptron64KB(
-        const MultiperspectivePerceptron64KBParams *p)
+        const MultiperspectivePerceptron64KBParams &p)
     : MultiperspectivePerceptron(p)
 {
 }
@@ -86,8 +86,8 @@ MultiperspectivePerceptron64KB::createSpecs() {
     addSpec(new SGHISTPATH(1, 5, 2, 1.3125, 972, 6, *this));
 }
 
-    MultiperspectivePerceptron64KB*
-MultiperspectivePerceptron64KBParams::create()
+MultiperspectivePerceptron64KB*
+MultiperspectivePerceptron64KBParams::create() const
 {
-    return new MultiperspectivePerceptron64KB(this);
+    return new MultiperspectivePerceptron64KB(*this);
 }
index a87020b6d8c84ab586bdd0bf00ec9ebe69626ade..7ab932c8f1694d0b1e27489a5a13bd9c9663e07f 100644 (file)
@@ -47,7 +47,7 @@ class MultiperspectivePerceptron64KB : public MultiperspectivePerceptron {
     void createSpecs() override;
     public:
     MultiperspectivePerceptron64KB(
-            const MultiperspectivePerceptron64KBParams *p);
+            const MultiperspectivePerceptron64KBParams &p);
 };
 
 #endif // __CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_64KB_HH__
index 832e17237f5173c9eed8a71ae13c036319cab839..7279957ad889359f7b9a47e2816d70f954a20b97 100644 (file)
@@ -40,7 +40,7 @@
 #include "cpu/pred/multiperspective_perceptron_8KB.hh"
 
 MultiperspectivePerceptron8KB::MultiperspectivePerceptron8KB(
-        const MultiperspectivePerceptron8KBParams *p)
+        const MultiperspectivePerceptron8KBParams &p)
     : MultiperspectivePerceptron(p)
 {
 }
@@ -66,7 +66,7 @@ MultiperspectivePerceptron8KB::createSpecs() {
 }
 
     MultiperspectivePerceptron8KB*
-MultiperspectivePerceptron8KBParams::create()
+MultiperspectivePerceptron8KBParams::create() const
 {
-    return new MultiperspectivePerceptron8KB(this);
+    return new MultiperspectivePerceptron8KB(*this);
 }
index 032ecdf03b7a59fce719da598cad759911ef7e70..e297dfcbcf436096e26203189e6b4ac983cf131c 100644 (file)
@@ -47,7 +47,7 @@ class MultiperspectivePerceptron8KB : public MultiperspectivePerceptron {
     void createSpecs() override;
     public:
     MultiperspectivePerceptron8KB(
-            const MultiperspectivePerceptron8KBParams *p);
+            const MultiperspectivePerceptron8KBParams &p);
 };
 
 #endif // __CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_8KB_HH__
index a54f37c15394f1d31125f30a37c6258668c2ea6d..3f1803d852eefcfad53e12265d240102494d1efb 100644 (file)
@@ -243,9 +243,9 @@ MPP_TAGE::isHighConfidence(TAGEBase::BranchInfo *bi) const
 }
 
 MPP_TAGE*
-MPP_TAGEParams::create()
+MPP_TAGEParams::create() const
 {
-    return new MPP_TAGE(this);
+    return new MPP_TAGE(*this);
 }
 
 bool
@@ -262,15 +262,15 @@ MPP_LoopPredictor::optionalAgeInc() const
 }
 
 MPP_LoopPredictor*
-MPP_LoopPredictorParams::create()
+MPP_LoopPredictorParams::create() const
 {
-    return new MPP_LoopPredictor(this);
+    return new MPP_LoopPredictor(*this);
 }
 
 MPP_StatisticalCorrector::MPP_StatisticalCorrector(
-        const MPP_StatisticalCorrectorParams *p) : StatisticalCorrector(p),
-    thirdH(0), pnb(p->pnb), logPnb(p->logPnb), pm(p->pm), gnb(p->gnb),
-    logGnb(p->logGnb), gm(p->gm)
+        const MPP_StatisticalCorrectorParams &p) : StatisticalCorrector(p),
+    thirdH(0), pnb(p.pnb), logPnb(p.logPnb), pm(p.pm), gnb(p.gnb),
+    logGnb(p.logGnb), gm(p.gm)
 {
     initGEHLTable(pnb, pm, pgehl, logPnb, wp, -1);
     initGEHLTable(gnb, gm, ggehl, logGnb, wg, -1);
@@ -385,10 +385,10 @@ MPP_StatisticalCorrector::scPredict(ThreadID tid, Addr branch_pc,
 }
 
 MultiperspectivePerceptronTAGE::MultiperspectivePerceptronTAGE(
-    const MultiperspectivePerceptronTAGEParams *p)
-  : MultiperspectivePerceptron(p), tage(p->tage),
-    loopPredictor(p->loop_predictor),
-    statisticalCorrector(p->statistical_corrector)
+    const MultiperspectivePerceptronTAGEParams &p)
+  : MultiperspectivePerceptron(p), tage(p.tage),
+    loopPredictor(p.loop_predictor),
+    statisticalCorrector(p.statistical_corrector)
 {
     fatal_if(tage->isSpeculativeUpdateEnabled(),
         "Speculative updates support is not implemented");
index 366f7b8aae9445ced3a194c18760d6bc1464ff90..fb9d94f2d0741fe6d091fd8033dcb255d59f280d 100644 (file)
@@ -58,8 +58,8 @@ class MPP_TAGE : public TAGEBase {
         {}
     };
 
-    MPP_TAGE(const MPP_TAGEParams *p) : TAGEBase(p),
-        tunedHistoryLengths(p->tunedHistoryLengths)
+    MPP_TAGE(const MPP_TAGEParams &p) : TAGEBase(p),
+        tunedHistoryLengths(p.tunedHistoryLengths)
     {}
 
     void calculateParameters() override;
@@ -84,7 +84,7 @@ class MPP_TAGE : public TAGEBase {
 
 class MPP_LoopPredictor : public LoopPredictor {
   public:
-    MPP_LoopPredictor(MPP_LoopPredictorParams *p) : LoopPredictor(p)
+    MPP_LoopPredictor(const MPP_LoopPredictorParams &p) : LoopPredictor(p)
     {}
 
     bool calcConf(int index) const override;
@@ -146,7 +146,7 @@ class MPP_StatisticalCorrector : public StatisticalCorrector {
         virtual ~BranchInfo()
         {}
     };
-    MPP_StatisticalCorrector(const MPP_StatisticalCorrectorParams *p);
+    MPP_StatisticalCorrector(const MPP_StatisticalCorrectorParams &p);
 
     void initBias() override;
     unsigned getIndBias(Addr branch_pc, StatisticalCorrector::BranchInfo* bi,
@@ -219,7 +219,7 @@ class MultiperspectivePerceptronTAGE : public MultiperspectivePerceptron
 
   public:
     MultiperspectivePerceptronTAGE(
-        const MultiperspectivePerceptronTAGEParams *p);
+        const MultiperspectivePerceptronTAGEParams &p);
 
     void init() override;
 
index 9da21676b8b00f99ef63feb56f8d5b47e04e2280..8d4d40099cb4da7cc967ca7be46ccd67b3d696df 100644 (file)
 #include "cpu/pred/multiperspective_perceptron_tage_64KB.hh"
 
 MPP_StatisticalCorrector_64KB::MPP_StatisticalCorrector_64KB(
-    const MPP_StatisticalCorrector_64KBParams *p)
+    const MPP_StatisticalCorrector_64KBParams &p)
   : MPP_StatisticalCorrector(p),
-    numEntriesSecondLocalHistories(p->numEntriesSecondLocalHistories),
-    numEntriesThirdLocalHistories(p->numEntriesThirdLocalHistories),
-    snb(p->snb),
-    logSnb(p->logSnb),
-    sm(p->sm),
-    tnb(p->tnb),
-    logTnb(p->logTnb),
-    tm(p->tm)
+    numEntriesSecondLocalHistories(p.numEntriesSecondLocalHistories),
+    numEntriesThirdLocalHistories(p.numEntriesThirdLocalHistories),
+    snb(p.snb),
+    logSnb(p.logSnb),
+    sm(p.sm),
+    tnb(p.tnb),
+    logTnb(p.logTnb),
+    tm(p.tm)
 {
     initGEHLTable(snb, sm, sgehl, logSnb, ws, -1);
     initGEHLTable(tnb, tm, tgehl, logTnb, wt, -1);
@@ -197,14 +197,14 @@ MPP_StatisticalCorrector_64KB::getSizeInBits() const
 }
 
 MPP_StatisticalCorrector_64KB*
-MPP_StatisticalCorrector_64KBParams::create()
+MPP_StatisticalCorrector_64KBParams::create() const
 {
-    return new MPP_StatisticalCorrector_64KB(this);
+    return new MPP_StatisticalCorrector_64KB(*this);
 }
 
 
 MultiperspectivePerceptronTAGE64KB::MultiperspectivePerceptronTAGE64KB(
-        const MultiperspectivePerceptronTAGE64KBParams *p)
+        const MultiperspectivePerceptronTAGE64KBParams &p)
     : MultiperspectivePerceptronTAGE(p)
 {
 }
@@ -224,7 +224,7 @@ MultiperspectivePerceptronTAGE64KB::createSpecs()
 }
 
 MultiperspectivePerceptronTAGE64KB*
-MultiperspectivePerceptronTAGE64KBParams::create()
+MultiperspectivePerceptronTAGE64KBParams::create() const
 {
-    return new MultiperspectivePerceptronTAGE64KB(this);
+    return new MultiperspectivePerceptronTAGE64KB(*this);
 }
index aa5d37af3aad78a29add83c3a8bcbb0ea6227eff..ba9463175901f59820f01a6ac658e09c504a7265 100644 (file)
@@ -73,7 +73,7 @@ class MPP_StatisticalCorrector_64KB : public MPP_StatisticalCorrector {
             StatisticalCorrector::BranchInfo *bi, Addr corrTarget) override;
   public:
     MPP_StatisticalCorrector_64KB(
-            const MPP_StatisticalCorrector_64KBParams *p);
+            const MPP_StatisticalCorrector_64KBParams &p);
     size_t getSizeInBits() const override;
 };
 
@@ -82,7 +82,7 @@ class MultiperspectivePerceptronTAGE64KB :
     void createSpecs() override;
   public:
     MultiperspectivePerceptronTAGE64KB(
-            const MultiperspectivePerceptronTAGE64KBParams *p);
+            const MultiperspectivePerceptronTAGE64KBParams &p);
 };
 
 #endif // __CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_TAGE_64KB_HH__
index 872d817d5e77442e6c88c067b26c930bd0482d3d..e7c8ad5d551d2afbd6b84c1eabd40570349f8f38 100644 (file)
 #include "cpu/pred/multiperspective_perceptron_tage_8KB.hh"
 
 MPP_TAGE_8KB*
-MPP_TAGE_8KBParams::create()
+MPP_TAGE_8KBParams::create() const
 {
-    return new MPP_TAGE_8KB(this);
+    return new MPP_TAGE_8KB(*this);
 }
 
 MPP_LoopPredictor_8KB*
-MPP_LoopPredictor_8KBParams::create()
+MPP_LoopPredictor_8KBParams::create() const
 {
-    return new MPP_LoopPredictor_8KB(this);
+    return new MPP_LoopPredictor_8KB(*this);
 }
 
 MPP_StatisticalCorrector_8KB::MPP_StatisticalCorrector_8KB(
-        const MPP_StatisticalCorrector_8KBParams *p)
+        const MPP_StatisticalCorrector_8KBParams &p)
   : MPP_StatisticalCorrector(p)
 {
 }
@@ -168,13 +168,13 @@ MPP_StatisticalCorrector_8KB::getSizeInBits() const
 }
 
 MPP_StatisticalCorrector_8KB*
-MPP_StatisticalCorrector_8KBParams::create()
+MPP_StatisticalCorrector_8KBParams::create() const
 {
-    return new MPP_StatisticalCorrector_8KB(this);
+    return new MPP_StatisticalCorrector_8KB(*this);
 }
 
 MultiperspectivePerceptronTAGE8KB::MultiperspectivePerceptronTAGE8KB(
-        const MultiperspectivePerceptronTAGE8KBParams *p)
+        const MultiperspectivePerceptronTAGE8KBParams &p)
     : MultiperspectivePerceptronTAGE(p)
 {
 }
@@ -190,7 +190,7 @@ MultiperspectivePerceptronTAGE8KB::createSpecs()
 }
 
 MultiperspectivePerceptronTAGE8KB*
-MultiperspectivePerceptronTAGE8KBParams::create()
+MultiperspectivePerceptronTAGE8KBParams::create() const
 {
-    return new MultiperspectivePerceptronTAGE8KB(this);
+    return new MultiperspectivePerceptronTAGE8KB(*this);
 }
index 1bfec931b31acb8f77894494c2850e39fa9c403d..ad1037c0cb18620cfe9773e5ee0bcbe244930194 100644 (file)
 #include "params/MPP_TAGE_8KB.hh"
 #include "params/MultiperspectivePerceptronTAGE8KB.hh"
 
-class MPP_TAGE_8KB : public MPP_TAGE {
+class MPP_TAGE_8KB : public MPP_TAGE
+{
   public:
-    MPP_TAGE_8KB(const MPP_TAGE_8KBParams *p) : MPP_TAGE(p) {}
+    MPP_TAGE_8KB(const MPP_TAGE_8KBParams &p) : MPP_TAGE(p) {}
 };
 
-class MPP_LoopPredictor_8KB : public MPP_LoopPredictor {
+class MPP_LoopPredictor_8KB : public MPP_LoopPredictor
+{
   public:
-    MPP_LoopPredictor_8KB(MPP_LoopPredictor_8KBParams *p) :
+    MPP_LoopPredictor_8KB(const MPP_LoopPredictor_8KBParams &p) :
         MPP_LoopPredictor(p) {}
 };
 
-class MPP_StatisticalCorrector_8KB : public MPP_StatisticalCorrector {
+class MPP_StatisticalCorrector_8KB : public MPP_StatisticalCorrector
+{
     StatisticalCorrector::SCThreadHistory *makeThreadHistory() override;
     int gPredictions(ThreadID tid, Addr branch_pc,
             StatisticalCorrector::BranchInfo* bi, int &lsum, int64_t phist)
@@ -69,16 +72,17 @@ class MPP_StatisticalCorrector_8KB : public MPP_StatisticalCorrector {
     void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken,
             StatisticalCorrector::BranchInfo *bi, Addr corrTarget) override;
   public:
-    MPP_StatisticalCorrector_8KB(const MPP_StatisticalCorrector_8KBParams *p);
+    MPP_StatisticalCorrector_8KB(const MPP_StatisticalCorrector_8KBParams &p);
     size_t getSizeInBits() const override;
 };
 
 class MultiperspectivePerceptronTAGE8KB :
-        public MultiperspectivePerceptronTAGE {
+        public MultiperspectivePerceptronTAGE
+{
     void createSpecs() override;
   public:
     MultiperspectivePerceptronTAGE8KB(
-            const MultiperspectivePerceptronTAGE8KBParams *p);
+            const MultiperspectivePerceptronTAGE8KBParams &p);
 };
 
 #endif // __CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_TAGE_8KB_HH__
index 0ee9302d9e210d9a580c523c9fa394dc814f5d8d..5faab86adb36747395bf28cdf4b2bb900e106a4a 100644 (file)
 #include "debug/Indirect.hh"
 
 SimpleIndirectPredictor::SimpleIndirectPredictor(
-        const SimpleIndirectPredictorParams params)
+        const SimpleIndirectPredictorParams &params)
     : IndirectPredictor(params),
-      hashGHR(params->indirectHashGHR),
-      hashTargets(params->indirectHashTargets),
-      numSets(params->indirectSets),
-      numWays(params->indirectWays),
-      tagBits(params->indirectTagSize),
-      pathLength(params->indirectPathLength),
-      instShift(params->instShiftAmt),
-      ghrNumBits(params->indirectGHRBits),
-      ghrMask((1 << params->indirectGHRBits)-1)
+      hashGHR(params.indirectHashGHR),
+      hashTargets(params.indirectHashTargets),
+      numSets(params.indirectSets),
+      numWays(params.indirectWays),
+      tagBits(params.indirectTagSize),
+      pathLength(params.indirectPathLength),
+      instShift(params.instShiftAmt),
+      ghrNumBits(params.indirectGHRBits),
+      ghrMask((1 << params.indirectGHRBits)-1)
 {
     if (!isPowerOf2(numSets)) {
-      panic("Indirect predictor requires power of 2 number of sets");
+        panic("Indirect predictor requires power of 2 number of sets");
     }
 
-    threadInfo.resize(params->numThreads);
+    threadInfo.resize(params.numThreads);
 
     targetCache.resize(numSets);
     for (unsigned i = 0; i < numSets; i++) {
@@ -235,7 +235,7 @@ SimpleIndirectPredictor::getTag(Addr br_addr)
 }
 
 SimpleIndirectPredictor *
-SimpleIndirectPredictorParams::create()
+SimpleIndirectPredictorParams::create() const
 {
-    return new SimpleIndirectPredictor(this);
+    return new SimpleIndirectPredictor(*this);
 }
index e954892a1442ae13a85d8df814115b094ef28251..58214b2777fbf55c38790ca9ea3c69d3bc66e033 100644 (file)
@@ -39,7 +39,7 @@
 class SimpleIndirectPredictor : public IndirectPredictor
 {
   public:
-    SimpleIndirectPredictor(const SimpleIndirectPredictorParams params);
+    SimpleIndirectPredictor(const SimpleIndirectPredictorParams &params);
 
     bool lookup(Addr br_addr, TheISA::PCState& br_target, ThreadID tid);
     void recordIndirect(Addr br_addr, Addr tgt_addr, InstSeqNum seq_num,
index 305959504046cfb57c55a3f79d3d14854684b97b..0421acbabfd9e6e79ce6dd86c61cf60794ac0243 100644 (file)
  #include "params/StatisticalCorrector.hh"
 
  StatisticalCorrector::StatisticalCorrector(
-    const StatisticalCorrectorParams *p)
+    const StatisticalCorrectorParams &p)
   : SimObject(p),
-    logBias(p->logBias),
-    logSizeUp(p->logSizeUp),
+    logBias(p.logBias),
+    logSizeUp(p.logSizeUp),
     logSizeUps(logSizeUp / 2),
-    numEntriesFirstLocalHistories(p->numEntriesFirstLocalHistories),
-    bwnb(p->bwnb),
-    logBwnb(p->logBwnb),
-    bwm(p->bwm),
-    lnb(p->lnb),
-    logLnb(p->logLnb),
-    lm(p->lm),
-    inb(p->inb),
-    logInb(p->logInb),
-    im(p->im),
-    chooserConfWidth(p->chooserConfWidth),
-    updateThresholdWidth(p->updateThresholdWidth),
-    pUpdateThresholdWidth(p->pUpdateThresholdWidth),
-    extraWeightsWidth(p->extraWeightsWidth),
-    scCountersWidth(p->scCountersWidth),
+    numEntriesFirstLocalHistories(p.numEntriesFirstLocalHistories),
+    bwnb(p.bwnb),
+    logBwnb(p.logBwnb),
+    bwm(p.bwm),
+    lnb(p.lnb),
+    logLnb(p.logLnb),
+    lm(p.lm),
+    inb(p.inb),
+    logInb(p.logInb),
+    im(p.im),
+    chooserConfWidth(p.chooserConfWidth),
+    updateThresholdWidth(p.updateThresholdWidth),
+    pUpdateThresholdWidth(p.pUpdateThresholdWidth),
+    extraWeightsWidth(p.extraWeightsWidth),
+    scCountersWidth(p.scCountersWidth),
     firstH(0),
     secondH(0),
     stats(this)
 {
     wb.resize(1 << logSizeUps, 4);
 
-    initGEHLTable(lnb, lm, lgehl, logLnb, wl, p->lWeightInitValue);
-    initGEHLTable(bwnb, bwm, bwgehl, logBwnb, wbw, p->bwWeightInitValue);
-    initGEHLTable(inb, im, igehl, logInb, wi, p->iWeightInitValue);
+    initGEHLTable(lnb, lm, lgehl, logLnb, wl, p.lWeightInitValue);
+    initGEHLTable(bwnb, bwm, bwgehl, logBwnb, wbw, p.bwWeightInitValue);
+    initGEHLTable(inb, im, igehl, logInb, wi, p.iWeightInitValue);
 
     updateThreshold = 35 << 3;
 
-    pUpdateThreshold.resize(1 << logSizeUp, p->initialUpdateThresholdValue);
+    pUpdateThreshold.resize(1 << logSizeUp, p.initialUpdateThresholdValue);
 
     bias.resize(1 << logBias);
     biasSK.resize(1 << logBias);
index b61f0d8fecf807a65701507a6bde106259ef0e5d..52c0483c327303c49b4a851b59b9c573c6e70f22 100644 (file)
@@ -210,7 +210,7 @@ class StatisticalCorrector : public SimObject
         bool usedScPred;
     };
 
-    StatisticalCorrector(const StatisticalCorrectorParams *p);
+    StatisticalCorrector(const StatisticalCorrectorParams &p);
 
     virtual BranchInfo *makeBranchInfo();
     virtual SCThreadHistory *makeThreadHistory();
index d7c50f0d157d72cca7d35ae3a6068dcec13133d2..db649afd28310c27f0710ca6542aa5d95f963500 100644 (file)
@@ -44,7 +44,7 @@
 #include "debug/Fetch.hh"
 #include "debug/Tage.hh"
 
-TAGE::TAGE(const TAGEParams *params) : BPredUnit(params), tage(params->tage)
+TAGE::TAGE(const TAGEParams &params) : BPredUnit(params), tage(params.tage)
 {
 }
 
@@ -127,7 +127,7 @@ TAGE::uncondBranch(ThreadID tid, Addr br_pc, void* &bp_history)
 }
 
 TAGE*
-TAGEParams::create()
+TAGEParams::create() const
 {
-    return new TAGE(this);
+    return new TAGE(*this);
 }
index b32ce6746db9b55273354dd16efe932d6290d2d7..0ab68a033b5995800d7b95faac2f5802f79154d9 100644 (file)
@@ -77,7 +77,7 @@ class TAGE: public BPredUnit
 
   public:
 
-    TAGE(const TAGEParams *params);
+    TAGE(const TAGEParams &params);
 
     // Base class methods.
     void uncondBranch(ThreadID tid, Addr br_pc, void* &bp_history) override;
index 681e2ce1dd2907c140ccac5d6c79c8e16bb81f5a..d788ada51c593a59b9b30c6117e0763f03dbfd3d 100644 (file)
 #include "debug/Fetch.hh"
 #include "debug/Tage.hh"
 
-TAGEBase::TAGEBase(const TAGEBaseParams *p)
+TAGEBase::TAGEBase(const TAGEBaseParams &p)
    : SimObject(p),
-     logRatioBiModalHystEntries(p->logRatioBiModalHystEntries),
-     nHistoryTables(p->nHistoryTables),
-     tagTableCounterBits(p->tagTableCounterBits),
-     tagTableUBits(p->tagTableUBits),
-     histBufferSize(p->histBufferSize),
-     minHist(p->minHist),
-     maxHist(p->maxHist),
-     pathHistBits(p->pathHistBits),
-     tagTableTagWidths(p->tagTableTagWidths),
-     logTagTableSizes(p->logTagTableSizes),
-     threadHistory(p->numThreads),
-     logUResetPeriod(p->logUResetPeriod),
-     initialTCounterValue(p->initialTCounterValue),
-     numUseAltOnNa(p->numUseAltOnNa),
-     useAltOnNaBits(p->useAltOnNaBits),
-     maxNumAlloc(p->maxNumAlloc),
-     noSkip(p->noSkip),
-     speculativeHistUpdate(p->speculativeHistUpdate),
-     instShiftAmt(p->instShiftAmt),
+     logRatioBiModalHystEntries(p.logRatioBiModalHystEntries),
+     nHistoryTables(p.nHistoryTables),
+     tagTableCounterBits(p.tagTableCounterBits),
+     tagTableUBits(p.tagTableUBits),
+     histBufferSize(p.histBufferSize),
+     minHist(p.minHist),
+     maxHist(p.maxHist),
+     pathHistBits(p.pathHistBits),
+     tagTableTagWidths(p.tagTableTagWidths),
+     logTagTableSizes(p.logTagTableSizes),
+     threadHistory(p.numThreads),
+     logUResetPeriod(p.logUResetPeriod),
+     initialTCounterValue(p.initialTCounterValue),
+     numUseAltOnNa(p.numUseAltOnNa),
+     useAltOnNaBits(p.useAltOnNaBits),
+     maxNumAlloc(p.maxNumAlloc),
+     noSkip(p.noSkip),
+     speculativeHistUpdate(p.speculativeHistUpdate),
+     instShiftAmt(p.instShiftAmt),
      initialized(false),
      stats(this, nHistoryTables)
 {
@@ -792,7 +792,7 @@ TAGEBase::getSizeInBits() const {
 }
 
 TAGEBase*
-TAGEBaseParams::create()
+TAGEBaseParams::create() const
 {
-    return new TAGEBase(this);
+    return new TAGEBase(*this);
 }
index f5ee1b8ccd742e313e308a0dcba9875f2a3faa21..b382444903c2f7725695d3fadd1c4a5c3c7a3330 100644 (file)
@@ -58,7 +58,7 @@
 class TAGEBase : public SimObject
 {
   public:
-    TAGEBase(const TAGEBaseParams *p);
+    TAGEBase(const TAGEBaseParams &p);
     void init() override;
 
   protected:
index cbd9a45561d7d5142bc8483bdc8c918680cf3ebc..18fe983972aedc4c8db753804623596015c39859 100644 (file)
@@ -59,13 +59,13 @@ TAGE_SC_L_LoopPredictor::optionalAgeInc() const
 }
 
 TAGE_SC_L_LoopPredictor *
-TAGE_SC_L_LoopPredictorParams::create()
+TAGE_SC_L_LoopPredictorParams::create() const
 {
-    return new TAGE_SC_L_LoopPredictor(this);
+    return new TAGE_SC_L_LoopPredictor(*this);
 }
 
-TAGE_SC_L::TAGE_SC_L(const TAGE_SC_LParams *p)
-  : LTAGE(p), statisticalCorrector(p->statistical_corrector)
+TAGE_SC_L::TAGE_SC_L(const TAGE_SC_LParams &p)
+  : LTAGE(p), statisticalCorrector(p.statistical_corrector)
 {
 }
 
index 71f9c1766db39f2c4cfc3392109aebab61b55f6c..b8714ad834438cd5262cfa29940731e1206ff24a 100644 (file)
@@ -76,15 +76,15 @@ class TAGE_SC_L_TAGE : public TAGEBase {
 
     virtual TAGEBase::BranchInfo *makeBranchInfo() override;
 
-    TAGE_SC_L_TAGE(const TAGE_SC_L_TAGEParams *p)
+    TAGE_SC_L_TAGE(const TAGE_SC_L_TAGEParams &p)
       : TAGEBase(p),
-        firstLongTagTable(p->firstLongTagTable),
-        longTagsSize(p->longTagsSize),
-        shortTagsSize(p->shortTagsSize),
-        logTagTableSize(p->logTagTableSize),
-        shortTagsTageFactor(p->shortTagsTageFactor),
-        longTagsTageFactor(p->longTagsTageFactor),
-        truncatePathHist(p->truncatePathHist)
+        firstLongTagTable(p.firstLongTagTable),
+        longTagsSize(p.longTagsSize),
+        shortTagsSize(p.shortTagsSize),
+        logTagTableSize(p.logTagTableSize),
+        shortTagsTageFactor(p.shortTagsTageFactor),
+        longTagsTageFactor(p.longTagsTageFactor),
+        truncatePathHist(p.truncatePathHist)
     {}
 
     void calculateParameters() override;
@@ -137,7 +137,7 @@ class TAGE_SC_L_TAGE : public TAGEBase {
 class TAGE_SC_L_LoopPredictor : public LoopPredictor
 {
   public:
-    TAGE_SC_L_LoopPredictor(TAGE_SC_L_LoopPredictorParams *p)
+    TAGE_SC_L_LoopPredictor(const TAGE_SC_L_LoopPredictorParams &p)
       : LoopPredictor(p)
     {}
 
@@ -149,7 +149,7 @@ class TAGE_SC_L: public LTAGE
 {
     StatisticalCorrector *statisticalCorrector;
   public:
-    TAGE_SC_L(const TAGE_SC_LParams *params);
+    TAGE_SC_L(const TAGE_SC_LParams &params);
 
     bool predict(
         ThreadID tid, Addr branch_pc, bool cond_branch, void* &b) override;
index 72676e70951fc847a6dbbf6ac03ce6662d4f9cf6..2d71394ad0db334c93e90546820d091131c9f63f 100644 (file)
 #include "cpu/pred/tage_sc_l_64KB.hh"
 
 TAGE_SC_L_64KB_StatisticalCorrector::TAGE_SC_L_64KB_StatisticalCorrector(
-    TAGE_SC_L_64KB_StatisticalCorrectorParams *p)
+    const TAGE_SC_L_64KB_StatisticalCorrectorParams &p)
   : StatisticalCorrector(p),
-    numEntriesSecondLocalHistories(p->numEntriesSecondLocalHistories),
-    numEntriesThirdLocalHistories(p->numEntriesThirdLocalHistories),
-    pnb(p->pnb),
-    logPnb(p->logPnb),
-    pm(p->pm),
-    snb(p->snb),
-    logSnb(p->logSnb),
-    sm(p->sm),
-    tnb(p->tnb),
-    logTnb(p->logTnb),
-    tm(p->tm),
-    imnb(p->imnb),
-    logImnb(p->logImnb),
-    imm(p->imm)
+    numEntriesSecondLocalHistories(p.numEntriesSecondLocalHistories),
+    numEntriesThirdLocalHistories(p.numEntriesThirdLocalHistories),
+    pnb(p.pnb),
+    logPnb(p.logPnb),
+    pm(p.pm),
+    snb(p.snb),
+    logSnb(p.logSnb),
+    sm(p.sm),
+    tnb(p.tnb),
+    logTnb(p.logTnb),
+    tm(p.tm),
+    imnb(p.imnb),
+    logImnb(p.logImnb),
+    imm(p.imm)
 {
     initGEHLTable(pnb, pm, pgehl, logPnb, wp, 7);
     initGEHLTable(snb, sm, sgehl, logSnb, ws, 7);
@@ -191,9 +191,9 @@ TAGE_SC_L_64KB_StatisticalCorrector::gUpdates(ThreadID tid, Addr pc,
 }
 
 TAGE_SC_L_64KB_StatisticalCorrector*
-TAGE_SC_L_64KB_StatisticalCorrectorParams::create()
+TAGE_SC_L_64KB_StatisticalCorrectorParams::create() const
 {
-    return new TAGE_SC_L_64KB_StatisticalCorrector(this);
+    return new TAGE_SC_L_64KB_StatisticalCorrector(*this);
 }
 
 int
@@ -310,18 +310,18 @@ TAGE_SC_L_TAGE_64KB::handleTAGEUpdate(Addr branch_pc, bool taken,
 }
 
 TAGE_SC_L_TAGE_64KB*
-TAGE_SC_L_TAGE_64KBParams::create()
+TAGE_SC_L_TAGE_64KBParams::create() const
 {
-    return new TAGE_SC_L_TAGE_64KB(this);
+    return new TAGE_SC_L_TAGE_64KB(*this);
 }
 
-TAGE_SC_L_64KB::TAGE_SC_L_64KB(const TAGE_SC_L_64KBParams *params)
+TAGE_SC_L_64KB::TAGE_SC_L_64KB(const TAGE_SC_L_64KBParams &params)
   : TAGE_SC_L(params)
 {
 }
 
 TAGE_SC_L_64KB*
-TAGE_SC_L_64KBParams::create()
+TAGE_SC_L_64KBParams::create() const
 {
-    return new TAGE_SC_L_64KB(this);
+    return new TAGE_SC_L_64KB(*this);
 }
index 4928ba5beaeda8e7500997181280e88287268e14..01f5e3817eeb95160007baf76c3d143498eb8058 100644 (file)
@@ -52,7 +52,7 @@
 
 class TAGE_SC_L_TAGE_64KB : public TAGE_SC_L_TAGE {
     public:
-    TAGE_SC_L_TAGE_64KB(const TAGE_SC_L_TAGE_64KBParams *p) : TAGE_SC_L_TAGE(p)
+    TAGE_SC_L_TAGE_64KB(const TAGE_SC_L_TAGE_64KBParams &p) : TAGE_SC_L_TAGE(p)
     {}
 
     int gindex_ext(int index, int bank) const override;
@@ -108,7 +108,7 @@ class TAGE_SC_L_64KB_StatisticalCorrector : public StatisticalCorrector
 
   public:
     TAGE_SC_L_64KB_StatisticalCorrector(
-        TAGE_SC_L_64KB_StatisticalCorrectorParams *p);
+        const TAGE_SC_L_64KB_StatisticalCorrectorParams &p);
 
     unsigned getIndBiasBank(Addr branch_pc, BranchInfo* bi, int hitBank,
         int altBank) const override;
@@ -128,7 +128,7 @@ class TAGE_SC_L_64KB_StatisticalCorrector : public StatisticalCorrector
 class TAGE_SC_L_64KB : public TAGE_SC_L
 {
   public:
-    TAGE_SC_L_64KB(const TAGE_SC_L_64KBParams *params);
+    TAGE_SC_L_64KB(const TAGE_SC_L_64KBParams &params);
 };
 
 #endif // __CPU_PRED_TAGE_SC_L_64KB
index 2455990d4f5fc118b00ad0c54d89806c95a456f8..ec5571a8bec5edf78ca0f780c8138791086435f1 100644 (file)
 #include "debug/TageSCL.hh"
 
 TAGE_SC_L_8KB_StatisticalCorrector::TAGE_SC_L_8KB_StatisticalCorrector(
-    TAGE_SC_L_8KB_StatisticalCorrectorParams *p)
+    const TAGE_SC_L_8KB_StatisticalCorrectorParams &p)
   : StatisticalCorrector(p),
-    gnb(p->gnb),
-    logGnb(p->logGnb),
-    gm(p->gm)
+    gnb(p.gnb),
+    logGnb(p.logGnb),
+    gm(p.gm)
 {
     initGEHLTable(gnb, gm, ggehl, logGnb, wg, 7);
 }
@@ -133,12 +133,12 @@ TAGE_SC_L_8KB_StatisticalCorrector::gUpdates(ThreadID tid, Addr pc, bool taken,
 }
 
 TAGE_SC_L_8KB_StatisticalCorrector*
-TAGE_SC_L_8KB_StatisticalCorrectorParams::create()
+TAGE_SC_L_8KB_StatisticalCorrectorParams::create() const
 {
-    return new TAGE_SC_L_8KB_StatisticalCorrector(this);
+    return new TAGE_SC_L_8KB_StatisticalCorrector(*this);
 }
 
-TAGE_SC_L_8KB::TAGE_SC_L_8KB(const TAGE_SC_L_8KBParams *params)
+TAGE_SC_L_8KB::TAGE_SC_L_8KB(const TAGE_SC_L_8KBParams &params)
   : TAGE_SC_L(params)
 {
 }
@@ -318,13 +318,13 @@ TAGE_SC_L_TAGE_8KB::handleTAGEUpdate(Addr branch_pc, bool taken,
 }
 
 TAGE_SC_L_TAGE_8KB*
-TAGE_SC_L_TAGE_8KBParams::create()
+TAGE_SC_L_TAGE_8KBParams::create() const
 {
-    return new TAGE_SC_L_TAGE_8KB(this);
+    return new TAGE_SC_L_TAGE_8KB(*this);
 }
 
 TAGE_SC_L_8KB*
-TAGE_SC_L_8KBParams::create()
+TAGE_SC_L_8KBParams::create() const
 {
-    return new TAGE_SC_L_8KB(this);
+    return new TAGE_SC_L_8KB(*this);
 }
index 7730463b1aa23b5ba66df29be009be4835929d44..2cabbca9ef973c40f75bcb9e219c45ffb61c3722 100644 (file)
@@ -50,7 +50,7 @@
 class TAGE_SC_L_TAGE_8KB : public TAGE_SC_L_TAGE
 {
   public:
-    TAGE_SC_L_TAGE_8KB(const TAGE_SC_L_TAGE_8KBParams *p) : TAGE_SC_L_TAGE(p)
+    TAGE_SC_L_TAGE_8KB(const TAGE_SC_L_TAGE_8KBParams &p) : TAGE_SC_L_TAGE(p)
     {}
 
     void initFoldedHistories(ThreadHistory & history) override;
@@ -88,7 +88,7 @@ class TAGE_SC_L_8KB_StatisticalCorrector : public StatisticalCorrector
 
   public:
     TAGE_SC_L_8KB_StatisticalCorrector(
-        TAGE_SC_L_8KB_StatisticalCorrectorParams *p);
+        const TAGE_SC_L_8KB_StatisticalCorrectorParams &p);
 
     unsigned getIndBiasBank( Addr branch_pc, BranchInfo* bi, int hitBank,
         int altBank) const override;
@@ -109,7 +109,7 @@ class TAGE_SC_L_8KB_StatisticalCorrector : public StatisticalCorrector
 class TAGE_SC_L_8KB : public TAGE_SC_L
 {
   public:
-    TAGE_SC_L_8KB(const TAGE_SC_L_8KBParams *params);
+    TAGE_SC_L_8KB(const TAGE_SC_L_8KBParams &params);
 };
 
 #endif // __CPU_PRED_TAGE_SC_L_8KB
index e30ab291b94f214f51b9e7784bd531b5f5a5ad8d..1eb15c2259e870d0caf7564a3b7522bff8d4b4f2 100644 (file)
 #include "base/bitfield.hh"
 #include "base/intmath.hh"
 
-TournamentBP::TournamentBP(const TournamentBPParams *params)
+TournamentBP::TournamentBP(const TournamentBPParams &params)
     : BPredUnit(params),
-      localPredictorSize(params->localPredictorSize),
-      localCtrBits(params->localCtrBits),
+      localPredictorSize(params.localPredictorSize),
+      localCtrBits(params.localCtrBits),
       localCtrs(localPredictorSize, SatCounter(localCtrBits)),
-      localHistoryTableSize(params->localHistoryTableSize),
-      localHistoryBits(ceilLog2(params->localPredictorSize)),
-      globalPredictorSize(params->globalPredictorSize),
-      globalCtrBits(params->globalCtrBits),
+      localHistoryTableSize(params.localHistoryTableSize),
+      localHistoryBits(ceilLog2(params.localPredictorSize)),
+      globalPredictorSize(params.globalPredictorSize),
+      globalCtrBits(params.globalCtrBits),
       globalCtrs(globalPredictorSize, SatCounter(globalCtrBits)),
-      globalHistory(params->numThreads, 0),
+      globalHistory(params.numThreads, 0),
       globalHistoryBits(
-          ceilLog2(params->globalPredictorSize) >
-          ceilLog2(params->choicePredictorSize) ?
-          ceilLog2(params->globalPredictorSize) :
-          ceilLog2(params->choicePredictorSize)),
-      choicePredictorSize(params->choicePredictorSize),
-      choiceCtrBits(params->choiceCtrBits),
+          ceilLog2(params.globalPredictorSize) >
+          ceilLog2(params.choicePredictorSize) ?
+          ceilLog2(params.globalPredictorSize) :
+          ceilLog2(params.choicePredictorSize)),
+      choicePredictorSize(params.choicePredictorSize),
+      choiceCtrBits(params.choiceCtrBits),
       choiceCtrs(choicePredictorSize, SatCounter(choiceCtrBits))
 {
     if (!isPowerOf2(localPredictorSize)) {
@@ -344,9 +344,9 @@ TournamentBP::squash(ThreadID tid, void *bp_history)
 }
 
 TournamentBP*
-TournamentBPParams::create()
+TournamentBPParams::create() const
 {
-    return new TournamentBP(this);
+    return new TournamentBP(*this);
 }
 
 #ifdef DEBUG
index 65617107f6943230267238caaec6590060a79134..c109358d4a02088b136ff3ffb1879b56dd171f4e 100644 (file)
@@ -62,7 +62,7 @@ class TournamentBP : public BPredUnit
     /**
      * Default branch predictor constructor.
      */
-    TournamentBP(const TournamentBPParams *params);
+    TournamentBP(const TournamentBPParams &params);
 
     /**
      * Looks up the given address in the branch predictor and returns
index 0d3417de2fd1c250c48202193dd4d01b930102e3..98cb728afaf0564439d6d0021eaceea7de31c9a7 100644 (file)
@@ -48,6 +48,8 @@ class NonCachingSimpleCPU(AtomicSimpleCPU):
     type = 'NonCachingSimpleCPU'
     cxx_header = "cpu/simple/noncaching.hh"
 
+    numThreads = 1
+
     @classmethod
     def memory_mode(cls):
         return 'atomic_noncaching'
@@ -55,4 +57,3 @@ class NonCachingSimpleCPU(AtomicSimpleCPU):
     @classmethod
     def support_take_over(cls):
         return True
-
index 25248d9be0a2e237d42a956f02f53605c9279d9b..06607cd297826d9fae1830dc89c25b347ff6203f 100644 (file)
@@ -73,13 +73,13 @@ AtomicSimpleCPU::init()
     data_amo_req->setContext(cid);
 }
 
-AtomicSimpleCPU::AtomicSimpleCPU(AtomicSimpleCPUParams *p)
+AtomicSimpleCPU::AtomicSimpleCPU(const AtomicSimpleCPUParams &p)
     : BaseSimpleCPU(p),
       tickEvent([this]{ tick(); }, "AtomicSimpleCPU tick",
                 false, Event::CPU_Tick_Pri),
-      width(p->width), locked(false),
-      simulate_data_stalls(p->simulate_data_stalls),
-      simulate_inst_stalls(p->simulate_inst_stalls),
+      width(p.width), locked(false),
+      simulate_data_stalls(p.simulate_data_stalls),
+      simulate_inst_stalls(p.simulate_inst_stalls),
       icachePort(name() + ".icache_port", this),
       dcachePort(name() + ".dcache_port", this),
       dcache_access(false), dcache_latency(0),
@@ -777,7 +777,7 @@ AtomicSimpleCPU::printAddr(Addr a)
 //  AtomicSimpleCPU Simulation Object
 //
 AtomicSimpleCPU *
-AtomicSimpleCPUParams::create()
+AtomicSimpleCPUParams::create() const
 {
-    return new AtomicSimpleCPU(this);
+    return new AtomicSimpleCPU(*this);
 }
index 2d0a4656467b7cc4a0dd3adb641886f2f8dec442..26f4c0c5baab6e41c234912b0648418dc5d8a571 100644 (file)
@@ -51,7 +51,7 @@ class AtomicSimpleCPU : public BaseSimpleCPU
 {
   public:
 
-    AtomicSimpleCPU(AtomicSimpleCPUParams *params);
+    AtomicSimpleCPU(const AtomicSimpleCPUParams &params);
     virtual ~AtomicSimpleCPU();
 
     void init() override;
index 132d9196abd3f1463fd87341eebd6e024d69ebcc..31d5285dd60f31b222cd7446823534317f7ad6da 100644 (file)
 using namespace std;
 using namespace TheISA;
 
-BaseSimpleCPU::BaseSimpleCPU(BaseSimpleCPUParams *p)
+BaseSimpleCPU::BaseSimpleCPU(const BaseSimpleCPUParams &p)
     : BaseCPU(p),
       curThread(0),
-      branchPred(p->branchPred),
+      branchPred(p.branchPred),
       traceData(NULL),
       inst(),
       _status(Idle)
@@ -92,24 +92,24 @@ BaseSimpleCPU::BaseSimpleCPU(BaseSimpleCPUParams *p)
 
     for (unsigned i = 0; i < numThreads; i++) {
         if (FullSystem) {
-            thread = new SimpleThread(this, i, p->system,
-                                      p->itb, p->dtb, p->isa[i]);
+            thread = new SimpleThread(this, i, p.system,
+                                      p.itb, p.dtb, p.isa[i]);
         } else {
-            thread = new SimpleThread(this, i, p->system, p->workload[i],
-                                      p->itb, p->dtb, p->isa[i]);
+            thread = new SimpleThread(this, i, p.system, p.workload[i],
+                                      p.itb, p.dtb, p.isa[i]);
         }
         threadInfo.push_back(new SimpleExecContext(this, thread));
         ThreadContext *tc = thread->getTC();
         threadContexts.push_back(tc);
     }
 
-    if (p->checker) {
+    if (p.checker) {
         if (numThreads != 1)
             fatal("Checker currently does not support SMT");
 
-        BaseCPU *temp_checker = p->checker;
+        BaseCPU *temp_checker = p.checker;
         checker = dynamic_cast<CheckerCPU *>(temp_checker);
-        checker->setSystem(p->system);
+        checker->setSystem(p.system);
         // Manipulate thread context
         ThreadContext *cpu_tc = threadContexts[0];
         threadContexts[0] = new CheckerThreadContext<ThreadContext>(cpu_tc, this->checker);
index 82f52d9ccc94d8d95b3f8879e9e402aa96fca5d2..5d80ca0096138e0c7f8bd583f3b5e98dfe0430ca 100644 (file)
@@ -87,7 +87,7 @@ class BaseSimpleCPU : public BaseCPU
     void swapActiveThread();
 
   public:
-    BaseSimpleCPU(BaseSimpleCPUParams *params);
+    BaseSimpleCPU(const BaseSimpleCPUParams &params);
     virtual ~BaseSimpleCPU();
     void wakeup(ThreadID tid) override;
     void init() override;
index 34e1ce2a2ccb53a96fdc331ce8d56d676b73e9f2..9ab30d192b0663bf8a8817c2a64858fa520be7e9 100644 (file)
@@ -37,7 +37,9 @@
 
 #include "cpu/simple/noncaching.hh"
 
-NonCachingSimpleCPU::NonCachingSimpleCPU(NonCachingSimpleCPUParams *p)
+#include <cassert>
+
+NonCachingSimpleCPU::NonCachingSimpleCPU(const NonCachingSimpleCPUParams &p)
     : AtomicSimpleCPU(p)
 {
 }
@@ -63,10 +65,10 @@ NonCachingSimpleCPU::sendPacket(RequestPort &port, const PacketPtr &pkt)
 }
 
 NonCachingSimpleCPU *
-NonCachingSimpleCPUParams::create()
+NonCachingSimpleCPUParams::create() const
 {
-    numThreads = 1;
+    assert(numThreads == 1);
     if (!FullSystem && workload.size() != 1)
         fatal("only one workload allowed");
-    return new NonCachingSimpleCPU(this);
+    return new NonCachingSimpleCPU(*this);
 }
index f57fef2febe788f1db8f7b13912e0564ff83c7e4..1bc87184b0c9868325f1d778d196a0a2bcd4d701 100644 (file)
@@ -48,7 +48,7 @@
 class NonCachingSimpleCPU : public AtomicSimpleCPU
 {
   public:
-    NonCachingSimpleCPU(NonCachingSimpleCPUParams *p);
+    NonCachingSimpleCPU(const NonCachingSimpleCPUParams &p);
 
     void verifyMemoryMode() const override;
 
index 10f3105478be0e01db9cd75222cc7c29e63b2de5..c4193a3c984b847b63efc94d9b7e5688b7c4d3fa 100644 (file)
 
 #include "base/output.hh"
 
-SimPoint::SimPoint(const SimPointParams *p)
+SimPoint::SimPoint(const SimPointParams &p)
     : ProbeListenerObject(p),
-      intervalSize(p->interval),
+      intervalSize(p.interval),
       intervalCount(0),
       intervalDrift(0),
       simpointStream(NULL),
       currentBBV(0, 0),
       currentBBVInstCount(0)
 {
-    simpointStream = simout.create(p->profile_file, false);
+    simpointStream = simout.create(p.profile_file, false);
     if (!simpointStream)
         fatal("unable to open SimPoint profile_file");
 }
@@ -141,7 +141,7 @@ SimPoint::profile(const std::pair<SimpleThread*, StaticInstPtr>& p)
 
 /** SimPoint SimObject */
 SimPoint*
-SimPointParams::create()
+SimPointParams::create() const
 {
-    return new SimPoint(this);
+    return new SimPoint(*this);
 }
index 67353f5db6e2a2d3eed082fbe35bd93f102a4b4c..07467f6c5e8f27d14766f5c6b4d985d5d47e08d6 100644 (file)
@@ -72,7 +72,7 @@ struct hash<BasicBlockRange>
 class SimPoint : public ProbeListenerObject
 {
   public:
-    SimPoint(const SimPointParams *params);
+    SimPoint(const SimPointParams &params);
     virtual ~SimPoint();
 
     virtual void init();
index 19556950e378d47678878e9bdeea82b7f7ab82e0..ac28d6609233979936d314dee2d8ace5fa527ab3 100644 (file)
@@ -74,7 +74,7 @@ TimingSimpleCPU::TimingCPUPort::TickEvent::schedule(PacketPtr _pkt, Tick t)
     cpu->schedule(this, t);
 }
 
-TimingSimpleCPU::TimingSimpleCPU(TimingSimpleCPUParams *p)
+TimingSimpleCPU::TimingSimpleCPU(const TimingSimpleCPUParams &p)
     : BaseSimpleCPU(p), fetchTranslation(this), icachePort(this),
       dcachePort(this), ifetch_pkt(NULL), dcache_pkt(NULL), previousCycle(0),
       fetchEvent([this]{ fetch(); }, name())
@@ -1297,7 +1297,7 @@ TimingSimpleCPU::htmSendAbortSignal(HtmFailureFaultCause cause)
 //  TimingSimpleCPU Simulation Object
 //
 TimingSimpleCPU *
-TimingSimpleCPUParams::create()
+TimingSimpleCPUParams::create() const
 {
-    return new TimingSimpleCPU(this);
+    return new TimingSimpleCPU(*this);
 }
index c055896a0ec3027e02fb0159544fbf8d13eb23ea..134eefa219d3faa97a3073e21d16ee5db507ff0f 100644 (file)
@@ -50,7 +50,7 @@ class TimingSimpleCPU : public BaseSimpleCPU
 {
   public:
 
-    TimingSimpleCPU(TimingSimpleCPUParams * params);
+    TimingSimpleCPU(const TimingSimpleCPUParams &params);
     virtual ~TimingSimpleCPU();
 
     void init() override;
index 44f364049694aa4ee3fc05a5d664f982e0fd243a..2aab0687afcb40681b0013d80648d9925c1e3a04 100644 (file)
 
 #include "sim/system.hh"
 
-DirectedGenerator::DirectedGenerator(const Params *p)
+DirectedGenerator::DirectedGenerator(const Params &p)
     : SimObject(p),
-      requestorId(p->system->getRequestorId(this))
+      requestorId(p.system->getRequestorId(this))
 {
-    m_num_cpus = p->num_cpus;
+    m_num_cpus = p.num_cpus;
     m_directed_tester = NULL;
 }
 
index f53ff079ecee09a6b30cc84b8936c2159de5711a..503f866d2f15db66778a4d9d0a6e6df356c830de 100644 (file)
@@ -38,7 +38,7 @@ class DirectedGenerator : public SimObject
 {
   public:
     typedef DirectedGeneratorParams Params;
-    DirectedGenerator(const Params *p);
+    DirectedGenerator(const Params &p);
 
     virtual ~DirectedGenerator() {}
 
index a35c87e822ea0b54601436fddd581378ef128d71..4001501196bb3585862e7ff4c6b67c76d137bcb4 100644 (file)
@@ -34,7 +34,7 @@
 #include "cpu/testers/directedtest/RubyDirectedTester.hh"
 #include "debug/DirectedTest.hh"
 
-InvalidateGenerator::InvalidateGenerator(const Params *p)
+InvalidateGenerator::InvalidateGenerator(const Params &p)
     : DirectedGenerator(p)
 {
     //
@@ -44,7 +44,7 @@ InvalidateGenerator::InvalidateGenerator(const Params *p)
     m_active_read_node = 0;
     m_active_inv_node = 0;
     m_address = 0x0;
-    m_addr_increment_size = p->addr_increment_size;
+    m_addr_increment_size = p.addr_increment_size;
 }
 
 InvalidateGenerator::~InvalidateGenerator()
@@ -135,7 +135,7 @@ InvalidateGenerator::performCallback(uint32_t proc, Addr address)
 }
 
 InvalidateGenerator *
-InvalidateGeneratorParams::create()
+InvalidateGeneratorParams::create() const
 {
-    return new InvalidateGenerator(this);
+    return new InvalidateGenerator(*this);
 }
index 64b7ea7f4de467489a04022b7dfdc5467e00b879..aadbad2a6ed8fe8f81986043c87c57385fd88a20 100644 (file)
@@ -44,7 +44,7 @@ class InvalidateGenerator : public DirectedGenerator
 {
   public:
     typedef InvalidateGeneratorParams Params;
-    InvalidateGenerator(const Params *p);
+    InvalidateGenerator(const Params &p);
 
     ~InvalidateGenerator();
 
index 2bed14b7137da6623f284c224fd4355a2df4952f..74a809d97f1c71e645d7fb661ef926ca1b852437 100644 (file)
 #include "debug/DirectedTest.hh"
 #include "sim/sim_exit.hh"
 
-RubyDirectedTester::RubyDirectedTester(const Params *p)
+RubyDirectedTester::RubyDirectedTester(const Params &p)
   : ClockedObject(p),
     directedStartEvent([this]{ wakeup(); }, "Directed tick",
                        false, Event::CPU_Tick_Pri),
-    m_requests_to_complete(p->requests_to_complete),
-    generator(p->generator)
+    m_requests_to_complete(p.requests_to_complete),
+    generator(p.generator)
 {
     m_requests_completed = 0;
 
     // create the ports
-    for (int i = 0; i < p->port_cpuPort_connection_count; ++i) {
+    for (int i = 0; i < p.port_cpuPort_connection_count; ++i) {
         ports.push_back(new CpuPort(csprintf("%s-port%d", name(), i),
                                     this, i));
     }
@@ -138,7 +138,7 @@ RubyDirectedTester::wakeup()
 }
 
 RubyDirectedTester *
-RubyDirectedTesterParams::create()
+RubyDirectedTesterParams::create() const
 {
-    return new RubyDirectedTester(this);
+    return new RubyDirectedTester(*this);
 }
index de3e154cfec403a0fb9f6d050584eade363f56b9..a0e20c05de952dc59b34466ef22190fb461bba1d 100644 (file)
@@ -65,7 +65,7 @@ class RubyDirectedTester : public ClockedObject
     };
 
     typedef RubyDirectedTesterParams Params;
-    RubyDirectedTester(const Params *p);
+    RubyDirectedTester(const Params &p);
     ~RubyDirectedTester();
 
     Port &getPort(const std::string &if_name,
index a404ee9f0dfbaec6641f3a03706b677431f748bd..bf32bf1f97c785e7add543e7371500acc98fa179 100644 (file)
 #include "cpu/testers/directedtest/RubyDirectedTester.hh"
 #include "debug/DirectedTest.hh"
 
-SeriesRequestGenerator::SeriesRequestGenerator(const Params *p)
+SeriesRequestGenerator::SeriesRequestGenerator(const Params &p)
     : DirectedGenerator(p),
-      m_addr_increment_size(p->addr_increment_size),
-      m_percent_writes(p->percent_writes)
+      m_addr_increment_size(p.addr_increment_size),
+      m_percent_writes(p.percent_writes)
 {
     m_status = SeriesRequestGeneratorStatus_Thinking;
     m_active_node = 0;
@@ -110,7 +110,7 @@ SeriesRequestGenerator::performCallback(uint32_t proc, Addr address)
 }
 
 SeriesRequestGenerator *
-SeriesRequestGeneratorParams::create()
+SeriesRequestGeneratorParams::create() const
 {
-    return new SeriesRequestGenerator(this);
+    return new SeriesRequestGenerator(*this);
 }
index 77688b6f87f97db223bf24a294c77850889f1c71..27c19db0ad61fdf1896f1f87f531b3ca2af3c7c4 100644 (file)
@@ -44,7 +44,7 @@ class SeriesRequestGenerator : public DirectedGenerator
 {
   public:
     typedef SeriesRequestGeneratorParams Params;
-    SeriesRequestGenerator(const Params *p);
+    SeriesRequestGenerator(const Params &p);
 
     ~SeriesRequestGenerator();
 
index dc920553e5ff2f0607364b4bddfa7381c440a221..03ed862de9214c64f9c33420464d0e1c9ed6b675 100644 (file)
@@ -71,26 +71,26 @@ GarnetSyntheticTraffic::sendPkt(PacketPtr pkt)
     numPacketsSent++;
 }
 
-GarnetSyntheticTraffic::GarnetSyntheticTraffic(const Params *p)
+GarnetSyntheticTraffic::GarnetSyntheticTraffic(const Params &p)
     : ClockedObject(p),
       tickEvent([this]{ tick(); }, "GarnetSyntheticTraffic tick",
                 false, Event::CPU_Tick_Pri),
       cachePort("GarnetSyntheticTraffic", this),
       retryPkt(NULL),
-      size(p->memory_size),
-      blockSizeBits(p->block_offset),
-      numDestinations(p->num_dest),
-      simCycles(p->sim_cycles),
-      numPacketsMax(p->num_packets_max),
+      size(p.memory_size),
+      blockSizeBits(p.block_offset),
+      numDestinations(p.num_dest),
+      simCycles(p.sim_cycles),
+      numPacketsMax(p.num_packets_max),
       numPacketsSent(0),
-      singleSender(p->single_sender),
-      singleDest(p->single_dest),
-      trafficType(p->traffic_type),
-      injRate(p->inj_rate),
-      injVnet(p->inj_vnet),
-      precision(p->precision),
-      responseLimit(p->response_limit),
-      requestorId(p->system->getRequestorId(this))
+      singleSender(p.single_sender),
+      singleDest(p.single_dest),
+      trafficType(p.traffic_type),
+      injRate(p.inj_rate),
+      injVnet(p.inj_vnet),
+      precision(p.precision),
+      responseLimit(p.response_limit),
+      requestorId(p.system->getRequestorId(this))
 {
     // set up counters
     noResponseCycles = 0;
@@ -351,7 +351,7 @@ GarnetSyntheticTraffic::printAddr(Addr a)
 
 
 GarnetSyntheticTraffic *
-GarnetSyntheticTrafficParams::create()
+GarnetSyntheticTrafficParams::create() const
 {
-    return new GarnetSyntheticTraffic(this);
+    return new GarnetSyntheticTraffic(*this);
 }
index 2864ccfb5b9f7638c7311428bf9bafde26f786cc..b132a48329f18150f0a8d7f431fcef5116081580 100644 (file)
@@ -55,7 +55,7 @@ class GarnetSyntheticTraffic : public ClockedObject
 {
   public:
     typedef GarnetSyntheticTrafficParams Params;
-    GarnetSyntheticTraffic(const Params *p);
+    GarnetSyntheticTraffic(const Params &p);
 
     void init() override;
 
index bf990588c8b701dbe2c13c211bf59ee244029212..99cefb771cd260c1c8538761326b263da5ccb53d 100644 (file)
@@ -79,27 +79,27 @@ MemTest::sendPkt(PacketPtr pkt) {
     return true;
 }
 
-MemTest::MemTest(const Params *p)
+MemTest::MemTest(const Params &p)
     : ClockedObject(p),
       tickEvent([this]{ tick(); }, name()),
       noRequestEvent([this]{ noRequest(); }, name()),
       noResponseEvent([this]{ noResponse(); }, name()),
       port("port", *this),
       retryPkt(nullptr),
-      size(p->size),
-      interval(p->interval),
-      percentReads(p->percent_reads),
-      percentFunctional(p->percent_functional),
-      percentUncacheable(p->percent_uncacheable),
-      requestorId(p->system->getRequestorId(this)),
-      blockSize(p->system->cacheLineSize()),
+      size(p.size),
+      interval(p.interval),
+      percentReads(p.percent_reads),
+      percentFunctional(p.percent_functional),
+      percentUncacheable(p.percent_uncacheable),
+      requestorId(p.system->getRequestorId(this)),
+      blockSize(p.system->cacheLineSize()),
       blockAddrMask(blockSize - 1),
-      progressInterval(p->progress_interval),
-      progressCheck(p->progress_check),
-      nextProgressMessage(p->progress_interval),
-      maxLoads(p->max_loads),
-      atomic(p->system->isAtomicMode()),
-      suppressFuncErrors(p->suppress_func_errors), stats(this)
+      progressInterval(p.progress_interval),
+      progressCheck(p.progress_check),
+      nextProgressMessage(p.progress_interval),
+      maxLoads(p.max_loads),
+      atomic(p.system->isAtomicMode()),
+      suppressFuncErrors(p.suppress_func_errors), stats(this)
 {
     id = TESTER_ALLOCATOR++;
     fatal_if(id >= blockSize, "Too many testers, only %d allowed\n",
@@ -323,7 +323,7 @@ MemTest::recvRetry()
 }
 
 MemTest *
-MemTestParams::create()
+MemTestParams::create() const
 {
-    return new MemTest(this);
+    return new MemTest(*this);
 }
index fc61b7526b62ef63137207275fddb6bbcbb420a7..d806d7a74c9b2fe7061eabaf13c18b7ac4ab7b47 100644 (file)
@@ -70,7 +70,7 @@ class MemTest : public ClockedObject
   public:
 
     typedef MemTestParams Params;
-    MemTest(const Params *p);
+    MemTest(const Params &p);
 
 
     Port &getPort(const std::string &if_name,
index a64a965b9ba26f728abac90ebe6a8b935310067a..de715a867383a1e41b54713d96029fc532916d78 100644 (file)
 #include "sim/sim_exit.hh"
 #include "sim/system.hh"
 
-RubyTester::RubyTester(const Params *p)
+RubyTester::RubyTester(const Params &p)
   : ClockedObject(p),
     checkStartEvent([this]{ wakeup(); }, "RubyTester tick",
                     false, Event::CPU_Tick_Pri),
-    _requestorId(p->system->getRequestorId(this)),
+    _requestorId(p.system->getRequestorId(this)),
     m_checkTable_ptr(nullptr),
-    m_num_cpus(p->num_cpus),
-    m_checks_to_complete(p->checks_to_complete),
-    m_deadlock_threshold(p->deadlock_threshold),
+    m_num_cpus(p.num_cpus),
+    m_checks_to_complete(p.checks_to_complete),
+    m_deadlock_threshold(p.deadlock_threshold),
     m_num_writers(0),
     m_num_readers(0),
-    m_wakeup_frequency(p->wakeup_frequency),
-    m_check_flush(p->check_flush),
-    m_num_inst_only_ports(p->port_cpuInstPort_connection_count),
-    m_num_inst_data_ports(p->port_cpuInstDataPort_connection_count)
+    m_wakeup_frequency(p.wakeup_frequency),
+    m_check_flush(p.check_flush),
+    m_num_inst_only_ports(p.port_cpuInstPort_connection_count),
+    m_num_inst_data_ports(p.port_cpuInstDataPort_connection_count)
 {
     m_checks_completed = 0;
 
@@ -79,19 +79,19 @@ RubyTester::RubyTester(const Params *p)
     // then the data ports are added to the readPort vector
     //
     int idx = 0;
-    for (int i = 0; i < p->port_cpuInstPort_connection_count; ++i) {
+    for (int i = 0; i < p.port_cpuInstPort_connection_count; ++i) {
         readPorts.push_back(new CpuPort(csprintf("%s-instPort%d", name(), i),
                                         this, i, idx));
         idx++;
     }
-    for (int i = 0; i < p->port_cpuInstDataPort_connection_count; ++i) {
+    for (int i = 0; i < p.port_cpuInstDataPort_connection_count; ++i) {
         CpuPort *port = new CpuPort(csprintf("%s-instDataPort%d", name(), i),
                                     this, i, idx);
         readPorts.push_back(port);
         writePorts.push_back(port);
         idx++;
     }
-    for (int i = 0; i < p->port_cpuDataPort_connection_count; ++i) {
+    for (int i = 0; i < p.port_cpuDataPort_connection_count; ++i) {
         CpuPort *port = new CpuPort(csprintf("%s-dataPort%d", name(), i),
                                     this, i, idx);
         readPorts.push_back(port);
@@ -280,7 +280,7 @@ RubyTester::print(std::ostream& out) const
 }
 
 RubyTester *
-RubyTesterParams::create()
+RubyTesterParams::create() const
 {
-    return new RubyTester(this);
+    return new RubyTester(*this);
 }
index 64c33b87fc11ae55cc279661d80cb71c84c23072..50c334304fbc78f746a2f8fdb7b5f053ea681821 100644 (file)
@@ -92,7 +92,7 @@ class RubyTester : public ClockedObject
     };
 
     typedef RubyTesterParams Params;
-    RubyTester(const Params *p);
+    RubyTester(const Params &p);
     ~RubyTester();
 
     Port &getPort(const std::string &if_name,
index dcc410bf8028e1b8ce596afef51a1345ba01cbad..5cf532074f4a89c725de30e3bb59f6d52e16f5fe 100644 (file)
 
 using namespace std;
 
-BaseTrafficGen::BaseTrafficGen(const BaseTrafficGenParamsp)
+BaseTrafficGen::BaseTrafficGen(const BaseTrafficGenParams &p)
     : ClockedObject(p),
-      system(p->system),
-      elasticReq(p->elastic_req),
-      progressCheck(p->progress_check),
+      system(p.system),
+      elasticReq(p.elastic_req),
+      progressCheck(p.progress_check),
       noProgressEvent([this]{ noProgress(); }, name()),
       nextTransitionTick(0),
       nextPacketTick(0),
-      maxOutstandingReqs(p->max_outstanding_reqs),
+      maxOutstandingReqs(p.max_outstanding_reqs),
       port(name() + ".port", *this),
       retryPkt(NULL),
       retryPktTick(0), blockedWaitingResp(false),
index 7c3386e727da2439fccf882865bf66e35d7c066b..01b560e60f5f5967759d5f1bc198c0fd1f93ff25 100644 (file)
@@ -238,7 +238,7 @@ class BaseTrafficGen : public ClockedObject
     } stats;
 
   public:
-    BaseTrafficGen(const BaseTrafficGenParamsp);
+    BaseTrafficGen(const BaseTrafficGenParams &p);
 
     ~BaseTrafficGen();
 
index 19ce914a3b9803e2ce50f05d33615191796138ed..0d5e88026df5ea5fd410cb99b733d5c148c0ba17 100644 (file)
@@ -44,7 +44,7 @@
 
 namespace py = pybind11;
 
-PyTrafficGen::PyTrafficGen(const PyTrafficGenParams *p)
+PyTrafficGen::PyTrafficGen(const PyTrafficGenParams &p)
     : BaseTrafficGen(p)
 {
 }
@@ -91,8 +91,8 @@ pybind_init_tracers(py::module &m_native)
 static EmbeddedPyBind _py_tracers("trace", pybind_init_tracers);
 
 PyTrafficGen*
-PyTrafficGenParams::create()
+PyTrafficGenParams::create() const
 {
-    return new PyTrafficGen(this);
+    return new PyTrafficGen(*this);
 }
 
index f068b7f5fe59a98399b11ccf99cacab943e3600b..3e2b4d241e5f9963e64fd0940a596b04b3241582 100644 (file)
@@ -48,7 +48,7 @@ struct PyTrafficGenParams;
 class M5_LOCAL PyTrafficGen : public BaseTrafficGen
 {
   public:
-    PyTrafficGen(const PyTrafficGenParamsp);
+    PyTrafficGen(const PyTrafficGenParams &p);
     ~PyTrafficGen() {}
 
   public: // Python API
index 1f65d9af3670c4ebde48cc4fcdc521263d60cf92..d36b0f61e79d28b81ff89c563dff35fc5044d93c 100644 (file)
@@ -40,9 +40,9 @@
 #include "base/random.hh"
 
 StreamGen*
-StreamGen::create(const BaseTrafficGenParams *p)
+StreamGen::create(const BaseTrafficGenParams &p)
 {
-    switch (p->stream_gen) {
+    switch (p.stream_gen) {
       case StreamGenType::fixed:
         return new FixedStreamGen(p);
       case StreamGenType::random:
index 99b69423ec6575ca4b0a70e6c6a5f73db150c593..a4eb5bbc73d534cb87e5f566f5e11ef0eff867e3 100644 (file)
@@ -49,8 +49,8 @@
 class StreamGen
 {
   protected:
-    StreamGen(const BaseTrafficGenParams *p)
-      : streamIds(p->sids), substreamIds(p->ssids)
+    StreamGen(const BaseTrafficGenParams &p)
+      : streamIds(p.sids), substreamIds(p.ssids)
     {
         // A non empty vector of StreamIDs must be provided.
         // SubstreamIDs are not mandatory hence having an empty
@@ -75,7 +75,7 @@ class StreamGen
      *           the stream generator type is stored.
      * @return a pointer to the newly alocated StremGen
      */
-    static StreamGen* create(const BaseTrafficGenParams *p);
+    static StreamGen* create(const BaseTrafficGenParams &p);
 
     /**
      * Returns true if the substreamID generation is valid
@@ -102,7 +102,7 @@ class StreamGen
 class FixedStreamGen : public StreamGen
 {
   public:
-    FixedStreamGen(const BaseTrafficGenParams *p)
+    FixedStreamGen(const BaseTrafficGenParams &p)
       : StreamGen(p)
     {
         // For a fixed stream generator only one sid must be provided. The
@@ -121,7 +121,7 @@ class FixedStreamGen : public StreamGen
 class RandomStreamGen : public StreamGen
 {
   public:
-    RandomStreamGen(const BaseTrafficGenParams *p)
+    RandomStreamGen(const BaseTrafficGenParams &p)
       : StreamGen(p)
     {}
 
index 61f205d463a38b4ac1e8a7764c3269dfdb0e9238..0d7ea9d30b522cc6f5f2827386cb5d9044c298e6 100644 (file)
 
 using namespace std;
 
-TrafficGen::TrafficGen(const TrafficGenParamsp)
+TrafficGen::TrafficGen(const TrafficGenParams &p)
     : BaseTrafficGen(p),
-      configFile(p->config_file),
+      configFile(p.config_file),
       currState(0)
 {
 }
 
 TrafficGen*
-TrafficGenParams::create()
+TrafficGenParams::create() const
 {
-    return new TrafficGen(this);
+    return new TrafficGen(*this);
 }
 
 void
index d90df64920ca32e615d290a4fbff31b6d46a7d5f..492a161f9883d37306580ebb2b02160915179e90 100644 (file)
@@ -120,7 +120,7 @@ class TrafficGen : public BaseTrafficGen
 
   public:
 
-    TrafficGen(const TrafficGenParamsp);
+    TrafficGen(const TrafficGenParams &p);
 
     ~TrafficGen() {}
 
index d80ff9b9cf4378bb80b586eb3561ffff85cd0577..9938c0cce230472d60726bfbfe375d1d39001935 100644 (file)
@@ -199,49 +199,49 @@ uint64_t TimingExprIf::eval(TimingExprEvalContext &context)
 }
 
 TimingExprLiteral *
-TimingExprLiteralParams::create()
+TimingExprLiteralParams::create() const
 {
-    return new TimingExprLiteral(this);
+    return new TimingExprLiteral(*this);
 }
 
 TimingExprSrcReg *
-TimingExprSrcRegParams::create()
+TimingExprSrcRegParams::create() const
 {
-    return new TimingExprSrcReg(this);
+    return new TimingExprSrcReg(*this);
 }
 
 TimingExprReadIntReg *
-TimingExprReadIntRegParams::create()
+TimingExprReadIntRegParams::create() const
 {
-    return new TimingExprReadIntReg(this);
+    return new TimingExprReadIntReg(*this);
 }
 
 TimingExprLet *
-TimingExprLetParams::create()
+TimingExprLetParams::create() const
 {
-    return new TimingExprLet(this);
+    return new TimingExprLet(*this);
 }
 
 TimingExprRef *
-TimingExprRefParams::create()
+TimingExprRefParams::create() const
 {
-    return new TimingExprRef(this);
+    return new TimingExprRef(*this);
 }
 
 TimingExprUn *
-TimingExprUnParams::create()
+TimingExprUnParams::create() const
 {
-    return new TimingExprUn(this);
+    return new TimingExprUn(*this);
 }
 
 TimingExprBin *
-TimingExprBinParams::create()
+TimingExprBinParams::create() const
 {
-    return new TimingExprBin(this);
+    return new TimingExprBin(*this);
 }
 
 TimingExprIf *
-TimingExprIfParams::create()
+TimingExprIfParams::create() const
 {
-    return new TimingExprIf(this);
+    return new TimingExprIf(*this);
 }
index 316e03bf93007a0c91c33718d6358a9e85aee6ca..35e1643491394ba0c5afeca610c72248d161d45f 100644 (file)
@@ -88,7 +88,7 @@ class TimingExprEvalContext
 class TimingExpr : public SimObject
 {
   public:
-    TimingExpr(const TimingExprParams *params) :
+    TimingExpr(const TimingExprParams &params) :
         SimObject(params)
     { }
 
@@ -100,9 +100,9 @@ class TimingExprLiteral : public TimingExpr
   public:
     uint64_t value;
 
-    TimingExprLiteral(const TimingExprLiteralParams *params) :
+    TimingExprLiteral(const TimingExprLiteralParams &params) :
         TimingExpr(params),
-        value(params->value)
+        value(params.value)
     { }
 
     uint64_t eval(TimingExprEvalContext &context) { return value; }
@@ -113,9 +113,9 @@ class TimingExprSrcReg : public TimingExpr
   public:
     unsigned int index;
 
-    TimingExprSrcReg(const TimingExprSrcRegParams *params) :
+    TimingExprSrcReg(const TimingExprSrcRegParams &params) :
         TimingExpr(params),
-        index(params->index)
+        index(params.index)
     { }
 
     uint64_t eval(TimingExprEvalContext &context);
@@ -126,9 +126,9 @@ class TimingExprReadIntReg : public TimingExpr
   public:
     TimingExpr *reg;
 
-    TimingExprReadIntReg(const TimingExprReadIntRegParams *params) :
+    TimingExprReadIntReg(const TimingExprReadIntRegParams &params) :
         TimingExpr(params),
-        reg(params->reg)
+        reg(params.reg)
     { }
 
     uint64_t eval(TimingExprEvalContext &context);
@@ -140,10 +140,10 @@ class TimingExprLet : public TimingExpr
     std::vector<TimingExpr *> defns;
     TimingExpr *expr;
 
-    TimingExprLet(const TimingExprLetParams *params) :
+    TimingExprLet(const TimingExprLetParams &params) :
         TimingExpr(params),
-        defns(params->defns),
-        expr(params->expr)
+        defns(params.defns),
+        expr(params.expr)
     { }
 
     uint64_t eval(TimingExprEvalContext &context);
@@ -154,9 +154,9 @@ class TimingExprRef : public TimingExpr
   public:
     unsigned int index;
 
-    TimingExprRef(const TimingExprRefParams *params) :
+    TimingExprRef(const TimingExprRefParams &params) :
         TimingExpr(params),
-        index(params->index)
+        index(params.index)
     { }
 
     uint64_t eval(TimingExprEvalContext &context);
@@ -168,10 +168,10 @@ class TimingExprUn : public TimingExpr
     Enums::TimingExprOp op;
     TimingExpr *arg;
 
-    TimingExprUn(const TimingExprUnParams *params) :
+    TimingExprUn(const TimingExprUnParams &params) :
         TimingExpr(params),
-        op(params->op),
-        arg(params->arg)
+        op(params.op),
+        arg(params.arg)
     { }
 
     uint64_t eval(TimingExprEvalContext &context);
@@ -184,11 +184,11 @@ class TimingExprBin : public TimingExpr
     TimingExpr *left;
     TimingExpr *right;
 
-    TimingExprBin(const TimingExprBinParams *params) :
+    TimingExprBin(const TimingExprBinParams &params) :
         TimingExpr(params),
-        op(params->op),
-        left(params->left),
-        right(params->right)
+        op(params.op),
+        left(params.left),
+        right(params.right)
     { }
 
     uint64_t eval(TimingExprEvalContext &context);
@@ -201,11 +201,11 @@ class TimingExprIf : public TimingExpr
     TimingExpr *trueExpr;
     TimingExpr *falseExpr;
 
-    TimingExprIf(const TimingExprIfParams *params) :
+    TimingExprIf(const TimingExprIfParams &params) :
         TimingExpr(params),
-        cond(params->cond),
-        trueExpr(params->trueExpr),
-        falseExpr(params->falseExpr)
+        cond(params.cond),
+        trueExpr(params.trueExpr),
+        falseExpr(params.falseExpr)
     { }
 
     uint64_t eval(TimingExprEvalContext &context);
index a9789034e1f073d08caa421e89fb5ef1a5187132..b2326eb11e7ccd31972c5b1687707cf2577ed899 100644 (file)
 // Declare and initialize the static counter for number of trace CPUs.
 int TraceCPU::numTraceCPUs = 0;
 
-TraceCPU::TraceCPU(TraceCPUParams *params)
+TraceCPU::TraceCPU(const TraceCPUParams &params)
     :   BaseCPU(params),
         icachePort(this),
         dcachePort(this),
-        instRequestorID(params->system->getRequestorId(this, "inst")),
-        dataRequestorID(params->system->getRequestorId(this, "data")),
-        instTraceFile(params->instTraceFile),
-        dataTraceFile(params->dataTraceFile),
+        instRequestorID(params.system->getRequestorId(this, "inst")),
+        dataRequestorID(params.system->getRequestorId(this, "data")),
+        instTraceFile(params.instTraceFile),
+        dataTraceFile(params.dataTraceFile),
         icacheGen(*this, ".iside", icachePort, instRequestorID, instTraceFile),
         dcacheGen(*this, ".dside", dcachePort, dataRequestorID, dataTraceFile,
                   params),
@@ -58,23 +58,23 @@ TraceCPU::TraceCPU(TraceCPUParams *params)
         oneTraceComplete(false),
         traceOffset(0),
         execCompleteEvent(nullptr),
-        enableEarlyExit(params->enableEarlyExit),
-        progressMsgInterval(params->progressMsgInterval),
-        progressMsgThreshold(params->progressMsgInterval), traceStats(this)
+        enableEarlyExit(params.enableEarlyExit),
+        progressMsgInterval(params.progressMsgInterval),
+        progressMsgThreshold(params.progressMsgInterval), traceStats(this)
 {
     // Increment static counter for number of Trace CPUs.
     ++TraceCPU::numTraceCPUs;
 
     // Check that the python parameters for sizes of ROB, store buffer and
     // load buffer do not overflow the corresponding C++ variables.
-    fatal_if(params->sizeROB > UINT16_MAX, "ROB size set to %d exceeds the "
-                "max. value of %d.\n", params->sizeROB, UINT16_MAX);
-    fatal_if(params->sizeStoreBuffer > UINT16_MAX, "ROB size set to %d "
-                "exceeds the max. value of %d.\n", params->sizeROB,
+    fatal_if(params.sizeROB > UINT16_MAX, "ROB size set to %d exceeds the "
+                "max. value of %d.\n", params.sizeROB, UINT16_MAX);
+    fatal_if(params.sizeStoreBuffer > UINT16_MAX, "ROB size set to %d "
+                "exceeds the max. value of %d.\n", params.sizeROB,
                 UINT16_MAX);
-    fatal_if(params->sizeLoadBuffer > UINT16_MAX, "Load buffer size set to"
+    fatal_if(params.sizeLoadBuffer > UINT16_MAX, "Load buffer size set to"
                 " %d exceeds the max. value of %d.\n",
-                params->sizeLoadBuffer, UINT16_MAX);
+                params.sizeLoadBuffer, UINT16_MAX);
 }
 
 TraceCPU::~TraceCPU()
@@ -83,9 +83,9 @@ TraceCPU::~TraceCPU()
 }
 
 TraceCPU*
-TraceCPUParams::create()
+TraceCPUParams::create() const
 {
-    return new TraceCPU(this);
+    return new TraceCPU(*this);
 }
 
 void
index ba1c5e6417a8647033c42c23520f660ac98d9f5f..4fb72d2215fe5f8d83df14948e8dd9831aac8de4 100644 (file)
@@ -141,7 +141,7 @@ class TraceCPU : public BaseCPU
 {
 
   public:
-    TraceCPU(TraceCPUParams *params);
+    TraceCPU(const TraceCPUParams &params);
     ~TraceCPU();
 
     void init();
@@ -853,19 +853,19 @@ class TraceCPU : public BaseCPU
         /* Constructor */
         ElasticDataGen(TraceCPU& _owner, const std::string& _name,
                    RequestPort& _port, RequestorID requestor_id,
-                   const std::string& trace_file, TraceCPUParams *params)
+                   const std::string& trace_file, const TraceCPUParams &params)
             : owner(_owner),
               port(_port),
               requestorId(requestor_id),
-              trace(trace_file, 1.0 / params->freqMultiplier),
+              trace(trace_file, 1.0 / params.freqMultiplier),
               genName(owner.name() + ".elastic." + _name),
               retryPkt(nullptr),
               traceComplete(false),
               nextRead(false),
               execComplete(false),
               windowSize(trace.getWindowSize()),
-              hwResource(params->sizeROB, params->sizeStoreBuffer,
-                         params->sizeLoadBuffer), elasticStats(&_owner, _name)
+              hwResource(params.sizeROB, params.sizeStoreBuffer,
+                         params.sizeLoadBuffer), elasticStats(&_owner, _name)
         {
             DPRINTF(TraceCPUData, "Window size in the trace is %d.\n",
                     windowSize);
index 5101682a2a71e293ec02ce38f7b880b38c915da5..aab28b8022d3cece3c476b877eb05a3e59eb834f 100644 (file)
@@ -43,7 +43,7 @@
 #include "mem/packet_access.hh"
 #include "sim/system.hh"
 
-A9SCU::A9SCU(Params *p)
+A9SCU::A9SCU(const Params &p)
     : BasicPioDevice(p, 0x60)
 {
 }
@@ -105,7 +105,7 @@ A9SCU::write(PacketPtr pkt)
 }
 
 A9SCU *
-A9SCUParams::create()
+A9SCUParams::create() const
 {
-    return new A9SCU(this);
+    return new A9SCU(*this);
 }
index 5263b1cd359ec4bb13d0b0c64e1f340b35d15b4e..0e61520645d182a7128216a144064889828e2298 100644 (file)
@@ -60,7 +60,7 @@ class A9SCU : public BasicPioDevice
       * The constructor for RealView just registers itself with the MMU.
       * @param p params structure
       */
-    A9SCU(Params *p);
+    A9SCU(const Params &p);
 
     /**
      * Handle a read to the device
index dbcfa70b63982805d7bf622ee46060bf99168ff5..659fbd4625c59b84a6ece0f4e7dd6873ded1de27 100644 (file)
@@ -54,7 +54,7 @@ class AbstractNVM : public SimObject
 {
 
   public:
-    AbstractNVM(const AbstractNVMParamsp): SimObject(p) {};
+    AbstractNVM(const AbstractNVMParams &p): SimObject(p) {};
     virtual ~AbstractNVM() {};
 
     /**
index 4daf943271cd8f8818e19585d41c81493a0cf4a1..72310b32ed64e1f36ce7559654234537f310142b 100644 (file)
 
 const uint64_t AmbaVendor = ULL(0xb105f00d00000000);
 
-AmbaPioDevice::AmbaPioDevice(const Params *p, Addr pio_size)
-    : BasicPioDevice(p, pio_size), ambaId(AmbaVendor | p->amba_id)
+AmbaPioDevice::AmbaPioDevice(const Params &p, Addr pio_size)
+    : BasicPioDevice(p, pio_size), ambaId(AmbaVendor | p.amba_id)
 {
 }
 
-AmbaIntDevice::AmbaIntDevice(const Params *p, Addr pio_size)
+AmbaIntDevice::AmbaIntDevice(const Params &p, Addr pio_size)
     : AmbaPioDevice(p, pio_size),
-      interrupt(p->interrupt->get()), intDelay(p->int_delay)
+      interrupt(p.interrupt->get()), intDelay(p.int_delay)
 {
 }
 
 
 
-AmbaDmaDevice::AmbaDmaDevice(const Params *p, Addr pio_size)
-    : DmaDevice(p), ambaId(AmbaVendor | p->amba_id),
-      pioAddr(p->pio_addr), pioSize(pio_size),
-      pioDelay(p->pio_latency), interrupt(p->interrupt->get())
+AmbaDmaDevice::AmbaDmaDevice(const Params &p, Addr pio_size)
+    : DmaDevice(p), ambaId(AmbaVendor | p.amba_id),
+      pioAddr(p.pio_addr), pioSize(pio_size),
+      pioDelay(p.pio_latency), interrupt(p.interrupt->get())
 {
 }
 
index 3d7e30c9182f7f9745a59727b663784255b2fa9b..c1c46cf286e6057ac0b22032a2074056bb6f3632 100644 (file)
@@ -80,7 +80,7 @@ class AmbaPioDevice : public BasicPioDevice, public AmbaDevice
 
   public:
     typedef AmbaPioDeviceParams Params;
-    AmbaPioDevice(const Params *p, Addr pio_size);
+    AmbaPioDevice(const Params &p, Addr pio_size);
 };
 
 class AmbaIntDevice : public AmbaPioDevice
@@ -91,7 +91,7 @@ class AmbaIntDevice : public AmbaPioDevice
 
   public:
     typedef AmbaIntDeviceParams Params;
-    AmbaIntDevice(const Params *p, Addr pio_size);
+    AmbaIntDevice(const Params &p, Addr pio_size);
 };
 
 class AmbaDmaDevice : public DmaDevice, public AmbaDevice
@@ -105,7 +105,7 @@ class AmbaDmaDevice : public DmaDevice, public AmbaDevice
 
   public:
     typedef AmbaDmaDeviceParams Params;
-    AmbaDmaDevice(const Params *p, Addr pio_size = 0);
+    AmbaDmaDevice(const Params &p, Addr pio_size = 0);
 };
 
 
index 029ff459b55db6bfe1d6451a2806c2d567e61d08..c387854264349cd9ee5940e3187f6d639fe4160e 100644 (file)
@@ -45,7 +45,7 @@
 #include "mem/packet.hh"
 #include "mem/packet_access.hh"
 
-AmbaFake::AmbaFake(const Params *p)
+AmbaFake::AmbaFake(const Params &p)
     : AmbaPioDevice(p, 0x1000)
 {
 }
@@ -60,7 +60,7 @@ AmbaFake::read(PacketPtr pkt)
     DPRINTF(AMBA, " read register %#x\n", daddr);
 
     pkt->setLE<uint32_t>(0);
-    if (!readId(pkt, ambaId, pioAddr) && !params()->ignore_access)
+    if (!readId(pkt, ambaId, pioAddr) && !params().ignore_access)
         panic("Tried to read AmbaFake %s at offset %#x that doesn't exist\n",
               name(), daddr);
 
@@ -74,7 +74,7 @@ AmbaFake::write(PacketPtr pkt)
 
     Addr daddr = pkt->getAddr() - pioAddr;
 
-    if (!params()->ignore_access)
+    if (!params().ignore_access)
         panic("Tried to write AmbaFake %s at offset %#x that doesn't exist\n",
               name(), daddr);
 
@@ -84,7 +84,7 @@ AmbaFake::write(PacketPtr pkt)
 
 
 AmbaFake *
-AmbaFakeParams::create()
+AmbaFakeParams::create() const
 {
-    return new AmbaFake(this);
+    return new AmbaFake(*this);
 }
index 1a693acc74575c351276d9abf6739562a264bfe6..059ed7a3d480e4a86883cf6aff73e027458e37b8 100644 (file)
 class AmbaFake : public AmbaPioDevice
 {
   public:
-   typedef AmbaFakeParams Params;
-   const Params *
+    typedef AmbaFakeParams Params;
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
-    AmbaFake(const Params *p);
+    AmbaFake(const Params &p);
 
     virtual Tick read(PacketPtr pkt);
     virtual Tick write(PacketPtr pkt);
index 3181dca8287ed5ebb72d8611d9a8feeab660322f..493ffa68f3ad733b927be4ade1e388ca340a6d76 100644 (file)
 #include "params/ArmSPI.hh"
 #include "params/BaseGic.hh"
 
-BaseGic::BaseGic(const Params *p)
+BaseGic::BaseGic(const Params &p)
         : PioDevice(p),
-          platform(p->platform)
+          platform(p.platform)
 {
-    RealView *const rv(dynamic_cast<RealView*>(p->platform));
+    RealView *const rv = dynamic_cast<RealView*>(p.platform);
     // The platform keeps track of the GIC that is hooked up to the
     // system. Due to quirks in gem5's configuration system, the
     // platform can't take a GIC as parameter. Instead, we need to
@@ -69,19 +69,19 @@ BaseGic::init()
     getSystem()->setGIC(this);
 }
 
-const BaseGic::Params *
+const BaseGic::Params &
 BaseGic::params() const
 {
-    return dynamic_cast<const Params *>(_params);
+    return dynamic_cast<const Params &>(_params);
 }
 
-ArmInterruptPinGen::ArmInterruptPinGen(const ArmInterruptPinParams *p)
+ArmInterruptPinGen::ArmInterruptPinGen(const ArmInterruptPinParams &p)
   : SimObject(p)
 {
 }
 
-ArmSPIGen::ArmSPIGen(const ArmSPIParams *p)
-    : ArmInterruptPinGen(p), pin(new ArmSPI(p->platform, p->num))
+ArmSPIGen::ArmSPIGen(const ArmSPIParams &p)
+    : ArmInterruptPinGen(p), pin(new ArmSPI(p.platform, p.num))
 {
 }
 
@@ -91,7 +91,7 @@ ArmSPIGen::get(ThreadContext* tc)
     return pin;
 }
 
-ArmPPIGen::ArmPPIGen(const ArmPPIParams *p)
+ArmPPIGen::ArmPPIGen(const ArmPPIParams &p)
     : ArmInterruptPinGen(p)
 {
 }
@@ -109,8 +109,8 @@ ArmPPIGen::get(ThreadContext* tc)
         return pin_it->second;
     } else {
         // Generate PPI Pin
-        auto p = static_cast<const ArmPPIParams *>(_params);
-        ArmPPI *pin = new ArmPPI(p->platform, tc, p->num);
+        auto &p = static_cast<const ArmPPIParams &>(_params);
+        ArmPPI *pin = new ArmPPI(p.platform, tc, p.num);
 
         pins.insert({cid, pin});
 
@@ -196,13 +196,13 @@ ArmPPI::clear()
 }
 
 ArmSPIGen *
-ArmSPIParams::create()
+ArmSPIParams::create() const
 {
-    return new ArmSPIGen(this);
+    return new ArmSPIGen(*this);
 }
 
 ArmPPIGen *
-ArmPPIParams::create()
+ArmPPIParams::create() const
 {
-    return new ArmPPIGen(this);
+    return new ArmPPIGen(*this);
 }
index f8fd8140fc31c5f0dd5e15021e67b384432a18bb..1d86550787695346e97038dec72941f726cf8c2e 100644 (file)
@@ -65,11 +65,11 @@ class BaseGic :  public PioDevice
     typedef BaseGicParams Params;
     enum class GicVersion { GIC_V2, GIC_V3, GIC_V4 };
 
-    BaseGic(const Params *p);
+    BaseGic(const Params &p);
     virtual ~BaseGic();
     void init() override;
 
-    const Params params() const;
+    const Params &params() const;
 
     /**
      * Post an interrupt from a device that is connected to the GIC.
@@ -135,7 +135,7 @@ class BaseGicRegisters
 class ArmInterruptPinGen : public SimObject
 {
   public:
-    ArmInterruptPinGen(const ArmInterruptPinParams *p);
+    ArmInterruptPinGen(const ArmInterruptPinParams &p);
 
     virtual ArmInterruptPin* get(ThreadContext *tc = nullptr) = 0;
 };
@@ -148,7 +148,7 @@ class ArmInterruptPinGen : public SimObject
 class ArmSPIGen : public ArmInterruptPinGen
 {
   public:
-    ArmSPIGen(const ArmSPIParams *p);
+    ArmSPIGen(const ArmSPIParams &p);
 
     ArmInterruptPin* get(ThreadContext *tc = nullptr) override;
   protected:
@@ -163,7 +163,7 @@ class ArmSPIGen : public ArmInterruptPinGen
 class ArmPPIGen : public ArmInterruptPinGen
 {
   public:
-    ArmPPIGen(const ArmPPIParams *p);
+    ArmPPIGen(const ArmPPIParams &p);
 
     ArmInterruptPin* get(ThreadContext* tc = nullptr) override;
   protected:
index ca69a675e116b807f2001cf1850f40d50f6f3c97..1bfb161309140c903b90067d0ac0074d26775279 100644 (file)
 
 #include "params/Display.hh"
 
-Display::Display(const DisplayParams *p)
+Display::Display(const DisplayParams &p)
   : SimObject(p)
 {}
 
 Display *
-DisplayParams::create()
+DisplayParams::create() const
 {
-    return new Display(this);
+    return new Display(*this);
 }
index 2e0c106c805537a478731ff3ddb658e11a7a4e41..1359487aa86d5ea900206b506f1f1f4096dd40cc 100644 (file)
@@ -45,7 +45,7 @@ class DisplayParams;
 class Display : public SimObject
 {
   public:
-    Display(const DisplayParams *p);
+    Display(const DisplayParams &p);
 };
 
 #endif // __DEV_ARM_DISPLAY_H__
index 15c29fe51149447aaabbf181d7bd46b2481ac271..fadc36d916f011026806dc51a9f65bf26d343fa3 100644 (file)
 #include "params/EnergyCtrl.hh"
 #include "sim/dvfs_handler.hh"
 
-EnergyCtrl::EnergyCtrl(const Params *p)
+EnergyCtrl::EnergyCtrl(const Params &p)
     : BasicPioDevice(p, PIO_NUM_FIELDS * 4),        // each field is 32 bit
-      dvfsHandler(p->dvfs_handler),
+      dvfsHandler(p.dvfs_handler),
       domainID(0),
       domainIDIndexToRead(0),
       perfLevelAck(0),
       perfLevelToRead(0),
       updateAckEvent([this]{ updatePLAck(); }, name())
 {
-    fatal_if(!p->dvfs_handler, "EnergyCtrl: Needs a DVFSHandler for a "
+    fatal_if(!p.dvfs_handler, "EnergyCtrl: Needs a DVFSHandler for a "
              "functioning system.\n");
 }
 
@@ -241,9 +241,10 @@ EnergyCtrl::unserialize(CheckpointIn &cp)
     }
 }
 
-EnergyCtrl * EnergyCtrlParams::create()
+EnergyCtrl *
+EnergyCtrlParams::create() const
 {
-    return new EnergyCtrl(this);
+    return new EnergyCtrl(*this);
 }
 
 void
index 5194c2438f9afee27de68c39292be2efd365a2fb..c71ac537faad0adaf2188d69d295b51eb764ed2b 100644 (file)
@@ -113,7 +113,7 @@ class EnergyCtrl : public BasicPioDevice
     };
 
     typedef EnergyCtrlParams Params;
-    EnergyCtrl(const Params *p);
+    EnergyCtrl(const Params &p);
 
     /**
      * Read command sent to the device
index d8f14691f9f93bbcb82f75d62d2ee25e31b4bf73..1558817489c520ad58f5a1b69963017e2b505625 100644 (file)
@@ -60,9 +60,9 @@
  */
 
 FlashDevice*
-FlashDeviceParams::create()
+FlashDeviceParams::create() const
 {
-    return new FlashDevice(this);
+    return new FlashDevice(*this);
 }
 
 
@@ -70,17 +70,17 @@ FlashDeviceParams::create()
  * Flash Device constructor and destructor
  */
 
-FlashDevice::FlashDevice(const FlashDeviceParamsp):
+FlashDevice::FlashDevice(const FlashDeviceParams &p):
     AbstractNVM(p),
     diskSize(0),
-    blockSize(p->blk_size),
-    pageSize(p->page_size),
-    GCActivePercentage(p->GC_active),
-    readLatency(p->read_lat),
-    writeLatency(p->write_lat),
-    eraseLatency(p->erase_lat),
-    dataDistribution(p->data_distribution),
-    numPlanes(p->num_planes),
+    blockSize(p.blk_size),
+    pageSize(p.page_size),
+    GCActivePercentage(p.GC_active),
+    readLatency(p.read_lat),
+    writeLatency(p.write_lat),
+    eraseLatency(p.erase_lat),
+    dataDistribution(p.data_distribution),
+    numPlanes(p.num_planes),
     pagesPerBlock(0),
     pagesPerDisk(0),
     blocksPerDisk(0),
index a0ff83f6406d3ab6eb95a3be80eb737468eed6d5..b21acd06193a8a1275b7f5fc48adb5e78d3486ee 100644 (file)
@@ -56,7 +56,7 @@ class FlashDevice : public AbstractNVM
   public:
 
     /** Initialize functions*/
-    FlashDevice(const FlashDeviceParams*);
+    FlashDevice(const FlashDeviceParams &);
     ~FlashDevice();
 
     /** Checkpoint functions*/
index d6b6a5980a090d13fa42344d830c8e5fdc30f08d..fae1f6d53c14caeb2450a28ea16b60141841b3b8 100644 (file)
@@ -47,7 +47,7 @@
 #include "params/FVPBasePwrCtrl.hh"
 #include "sim/system.hh"
 
-FVPBasePwrCtrl::FVPBasePwrCtrl(FVPBasePwrCtrlParams *const params)
+FVPBasePwrCtrl::FVPBasePwrCtrl(const FVPBasePwrCtrlParams &params)
     : BasicPioDevice(params, 0x1000),
       regs(),
       system(*static_cast<ArmSystem *>(sys))
@@ -312,7 +312,7 @@ FVPBasePwrCtrl::startCoreUp(ThreadContext *const tc)
 }
 
 FVPBasePwrCtrl *
-FVPBasePwrCtrlParams::create()
+FVPBasePwrCtrlParams::create() const
 {
-    return new FVPBasePwrCtrl(this);
+    return new FVPBasePwrCtrl(*this);
 }
index 92c31980a1945f08c25c6ab188bc88316d32678b..4b1bc4cec942e65f707f495f7d8aeece29eaa9c1 100644 (file)
@@ -55,7 +55,7 @@ class ThreadContext;
 class FVPBasePwrCtrl : public BasicPioDevice
 {
   public:
-    FVPBasePwrCtrl(FVPBasePwrCtrlParams *const params);
+    FVPBasePwrCtrl(const FVPBasePwrCtrlParams &params);
 
     /**
      * Triggered by the ISA when a WFI instruction is executed and (1) there
index 458a2eb7a1fc3409ac7c2ec1fa243a07b934b6a3..5d5eff451c1d29ec1a5e8a5d364b0afc1dfd4c1d 100644 (file)
 
 using namespace ArmISA;
 
-SystemCounter::SystemCounter(SystemCounterParams *const p)
+SystemCounter::SystemCounter(const SystemCounterParams &p)
     : SimObject(p),
       _enabled(true),
       _value(0),
       _increment(1),
-      _freqTable(p->freqs),
+      _freqTable(p.freqs),
       _activeFreqEntry(0),
       _updateTick(0),
       _freqUpdateEvent([this]{ freqUpdateCallback(); }, name()),
@@ -395,21 +395,21 @@ ArchTimer::drainResume()
     updateCounter();
 }
 
-GenericTimer::GenericTimer(GenericTimerParams *const p)
+GenericTimer::GenericTimer(const GenericTimerParams &p)
     : SimObject(p),
-      systemCounter(*p->counter),
-      system(*p->system)
+      systemCounter(*p.counter),
+      system(*p.system)
 {
-    SystemCounter::validateCounterRef(p->counter);
-    fatal_if(!p->system, "GenericTimer::GenericTimer: No system specified, "
+    SystemCounter::validateCounterRef(p.counter);
+    fatal_if(!p.system, "GenericTimer::GenericTimer: No system specified, "
              "can't instantiate architected timers\n");
     system.setGenericTimer(this);
 }
 
-const GenericTimerParams *
+const GenericTimerParams &
 GenericTimer::params() const
 {
-    return dynamic_cast<const GenericTimerParams *>(_params);
+    return dynamic_cast<const GenericTimerParams &>(_params);
 }
 
 void
@@ -467,7 +467,7 @@ void
 GenericTimer::createTimers(unsigned cpus)
 {
     assert(timers.size() < cpus);
-    auto p = static_cast<const GenericTimerParams *>(_params);
+    auto &p = static_cast<const GenericTimerParams &>(_params);
 
     const unsigned old_cpu_count(timers.size());
     timers.resize(cpus);
@@ -477,10 +477,10 @@ GenericTimer::createTimers(unsigned cpus)
 
         timers[i].reset(
             new CoreTimers(*this, system, i,
-                           p->int_phys_s->get(tc),
-                           p->int_phys_ns->get(tc),
-                           p->int_virt->get(tc),
-                           p->int_hyp->get(tc)));
+                           p.int_phys_s->get(tc),
+                           p.int_phys_ns->get(tc),
+                           p.int_virt->get(tc),
+                           p.int_hyp->get(tc)));
     }
 }
 
@@ -727,7 +727,7 @@ GenericTimer::CoreTimers::CoreTimers(GenericTimer &_parent,
     ArmInterruptPin *_irqPhysS, ArmInterruptPin *_irqPhysNS,
     ArmInterruptPin *_irqVirt, ArmInterruptPin *_irqHyp)
       : parent(_parent),
-        cntfrq(parent.params()->cntfrq),
+        cntfrq(parent.params().cntfrq),
         threadContext(system.threads[cpu]),
         irqPhysS(_irqPhysS),
         irqPhysNS(_irqPhysNS),
@@ -873,23 +873,23 @@ GenericTimerISA::readMiscReg(int reg)
     return value;
 }
 
-GenericTimerFrame::GenericTimerFrame(GenericTimerFrameParams *const p)
+GenericTimerFrame::GenericTimerFrame(const GenericTimerFrameParams &p)
     : PioDevice(p),
-      timerRange(RangeSize(p->cnt_base, ArmSystem::PageBytes)),
+      timerRange(RangeSize(p.cnt_base, ArmSystem::PageBytes)),
       addrRanges({timerRange}),
-      systemCounter(*p->counter),
+      systemCounter(*p.counter),
       physTimer(csprintf("%s.phys_timer", name()),
-                *this, systemCounter, p->int_phys->get()),
+                *this, systemCounter, p.int_phys->get()),
       virtTimer(csprintf("%s.virt_timer", name()),
                 *this, systemCounter,
-                p->int_virt->get()),
+                p.int_virt->get()),
       accessBits(0x3f),
       system(*dynamic_cast<ArmSystem *>(sys))
 {
-    SystemCounter::validateCounterRef(p->counter);
+    SystemCounter::validateCounterRef(p.counter);
     // Expose optional CNTEL0Base register frame
-    if (p->cnt_el0_base != MaxAddr) {
-        timerEl0Range = RangeSize(p->cnt_el0_base, ArmSystem::PageBytes);
+    if (p.cnt_el0_base != MaxAddr) {
+        timerEl0Range = RangeSize(p.cnt_el0_base, ArmSystem::PageBytes);
         accessBitsEl0 = 0x303;
         addrRanges.push_back(timerEl0Range);
     }
@@ -1244,18 +1244,18 @@ GenericTimerFrame::timerWrite(Addr addr, size_t size, uint64_t data,
     }
 }
 
-GenericTimerMem::GenericTimerMem(GenericTimerMemParams *const p)
+GenericTimerMem::GenericTimerMem(const GenericTimerMemParams &p)
     : PioDevice(p),
-      counterCtrlRange(RangeSize(p->cnt_control_base, ArmSystem::PageBytes)),
-      counterStatusRange(RangeSize(p->cnt_read_base, ArmSystem::PageBytes)),
-      timerCtrlRange(RangeSize(p->cnt_ctl_base, ArmSystem::PageBytes)),
+      counterCtrlRange(RangeSize(p.cnt_control_base, ArmSystem::PageBytes)),
+      counterStatusRange(RangeSize(p.cnt_read_base, ArmSystem::PageBytes)),
+      timerCtrlRange(RangeSize(p.cnt_ctl_base, ArmSystem::PageBytes)),
       cnttidr(0x0),
       addrRanges{counterCtrlRange, counterStatusRange, timerCtrlRange},
-      systemCounter(*p->counter),
-      frames(p->frames),
+      systemCounter(*p.counter),
+      frames(p.frames),
       system(*dynamic_cast<ArmSystem *>(sys))
 {
-    SystemCounter::validateCounterRef(p->counter);
+    SystemCounter::validateCounterRef(p.counter);
     for (auto &range : addrRanges)
         GenericTimerMem::validateFrameRange(range);
     fatal_if(frames.size() > MAX_TIMER_FRAMES,
@@ -1586,25 +1586,25 @@ GenericTimerMem::timerCtrlWrite(Addr addr, size_t size, uint64_t data,
 }
 
 SystemCounter *
-SystemCounterParams::create()
+SystemCounterParams::create() const
 {
-    return new SystemCounter(this);
+    return new SystemCounter(*this);
 }
 
 GenericTimer *
-GenericTimerParams::create()
+GenericTimerParams::create() const
 {
-    return new GenericTimer(this);
+    return new GenericTimer(*this);
 }
 
 GenericTimerFrame *
-GenericTimerFrameParams::create()
+GenericTimerFrameParams::create() const
 {
-    return new GenericTimerFrame(this);
+    return new GenericTimerFrame(*this);
 }
 
 GenericTimerMem *
-GenericTimerMemParams::create()
+GenericTimerMemParams::create() const
 {
-    return new GenericTimerMem(this);
+    return new GenericTimerMem(*this);
 }
index e6308383fff3ea5b148b165ff5a82b9aa97f15ca..b007ef1559a6328deb7921755dc22604cf22b124 100644 (file)
@@ -100,7 +100,7 @@ class SystemCounter : public SimObject
     static constexpr size_t MAX_FREQ_ENTRIES = 1004;
 
   public:
-    SystemCounter(SystemCounterParams *const p);
+    SystemCounter(const SystemCounterParams &p);
 
     /// Validates a System Counter reference
     /// @param sys_cnt System counter reference to validate
@@ -276,9 +276,9 @@ class ArchTimerKvm : public ArchTimer
 class GenericTimer : public SimObject
 {
   public:
-    const GenericTimerParams params() const;
+    const GenericTimerParams &params() const;
 
-    GenericTimer(GenericTimerParams *const p);
+    GenericTimer(const GenericTimerParams &p);
 
     void serialize(CheckpointOut &cp) const override;
     void unserialize(CheckpointIn &cp) override;
@@ -392,7 +392,7 @@ class GenericTimerISA : public ArmISA::BaseISADevice
 class GenericTimerFrame : public PioDevice
 {
   public:
-    GenericTimerFrame(GenericTimerFrameParams *const p);
+    GenericTimerFrame(const GenericTimerFrameParams &p);
 
     void serialize(CheckpointOut &cp) const override;
     void unserialize(CheckpointIn &cp) override;
@@ -496,7 +496,7 @@ class GenericTimerFrame : public PioDevice
 class GenericTimerMem : public PioDevice
 {
   public:
-    GenericTimerMem(GenericTimerMemParams *const p);
+    GenericTimerMem(const GenericTimerMemParams &p);
 
     /// Validates a Generic Timer register frame address range
     /// @param base_addr Range of the register frame
index a3939d1c8548dc4587cf8eb13b148c14072ca922..a1522aabd0c905bb4c859614371b560c0b336ef2 100644 (file)
@@ -59,18 +59,18 @@ const AddrRange GicV2::GICD_IPRIORITYR(0x400, 0x800);
 const AddrRange GicV2::GICD_ITARGETSR (0x800, 0xc00);
 const AddrRange GicV2::GICD_ICFGR     (0xc00, 0xd00);
 
-GicV2::GicV2(const Params *p)
+GicV2::GicV2(const Params &p)
     : BaseGic(p),
-      gicdPIDR(p->gicd_pidr),
-      gicdIIDR(p->gicd_iidr),
-      giccIIDR(p->gicc_iidr),
-      distRange(RangeSize(p->dist_addr, DIST_SIZE)),
-      cpuRange(RangeSize(p->cpu_addr, p->cpu_size)),
+      gicdPIDR(p.gicd_pidr),
+      gicdIIDR(p.gicd_iidr),
+      giccIIDR(p.gicc_iidr),
+      distRange(RangeSize(p.dist_addr, DIST_SIZE)),
+      cpuRange(RangeSize(p.cpu_addr, p.cpu_size)),
       addrRanges{distRange, cpuRange},
-      distPioDelay(p->dist_pio_delay),
-      cpuPioDelay(p->cpu_pio_delay), intLatency(p->int_latency),
-      enabled(false), haveGem5Extensions(p->gem5_extensions),
-      itLines(p->it_lines),
+      distPioDelay(p.dist_pio_delay),
+      cpuPioDelay(p.cpu_pio_delay), intLatency(p.int_latency),
+      enabled(false), haveGem5Extensions(p.gem5_extensions),
+      itLines(p.it_lines),
       intEnabled {}, pendingInt {}, activeInt {},
       intPriority {}, intConfig {}, cpuTarget {},
       cpuSgiPending {}, cpuSgiActive {},
@@ -1092,7 +1092,7 @@ GicV2::BankedRegs::unserialize(CheckpointIn &cp)
 }
 
 GicV2 *
-GicV2Params::create()
+GicV2Params::create() const
 {
-    return new GicV2(this);
+    return new GicV2(*this);
 }
index d30a3283dc0bf6a124e42dd7b7e147b22f840187..9f7f0745e1bfe1f70d70c3cd74ef7c004885b803 100644 (file)
@@ -476,12 +476,12 @@ class GicV2 : public BaseGic, public BaseGicRegisters
 
   public:
     typedef GicV2Params Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
-    GicV2(const Params *p);
+    GicV2(const Params &p);
     ~GicV2();
 
     DrainState drain() override;
index 757eb1ed869ea1f72854cd90df43bb6906993ab6..6bb5e67d8917648ae02c32dfd1c84b8a3548d95d 100644 (file)
 #include "mem/packet_access.hh"
 
 Gicv2m *
-Gicv2mParams::create()
+Gicv2mParams::create() const
 {
-    return new Gicv2m(this);
+    return new Gicv2m(*this);
 }
 
 Gicv2mFrame *
-Gicv2mFrameParams::create()
+Gicv2mFrameParams::create() const
 {
-    return new Gicv2mFrame(this);
+    return new Gicv2mFrame(*this);
 }
 
-Gicv2m::Gicv2m(const Params *p)
-    : PioDevice(p), pioDelay(p->pio_delay), frames(p->frames), gic(p->gic)
+Gicv2m::Gicv2m(const Params &p)
+    : PioDevice(p), pioDelay(p.pio_delay), frames(p.frames), gic(p.gic)
 {
     // Assert SPI ranges start at 32
     for (int i = 0; i < frames.size(); i++) {
index 0a25aebc5a8f82deaceb3d8cf9d376e025fe99e1..9001adc926715d1cbbcf39c6ea69b9fa4136e1c2 100644 (file)
@@ -65,8 +65,8 @@ class Gicv2mFrame : public SimObject
     const unsigned int  spi_len;
 
     typedef Gicv2mFrameParams Params;
-    Gicv2mFrame(const Params *p) :
-        SimObject(p), addr(p->addr), spi_base(p->spi_base), spi_len(p->spi_len)
+    Gicv2mFrame(const Params &p) :
+        SimObject(p), addr(p.addr), spi_base(p.spi_base), spi_len(p.spi_len)
     {}
 };
 
@@ -93,7 +93,7 @@ class Gicv2m : public PioDevice
 
   public:
     typedef Gicv2mParams Params;
-    Gicv2m(const Params *p);
+    Gicv2m(const Params &p);
 
     /** @{ */
     /** Return the address ranges used by the Gicv2m
index 596f170f224b3b7b5a0e6fce9e38459cbbc8d9d0..36da51334746767d8fa6b3ddefd5974df560b380 100644 (file)
@@ -51,7 +51,7 @@
 #include "mem/packet.hh"
 #include "mem/packet_access.hh"
 
-Gicv3::Gicv3(const Params p)
+Gicv3::Gicv3(const Params &p)
     : BaseGic(p)
 {
 }
@@ -59,25 +59,25 @@ Gicv3::Gicv3(const Params * p)
 void
 Gicv3::init()
 {
-    distributor = new Gicv3Distributor(this, params()->it_lines);
+    distributor = new Gicv3Distributor(this, params().it_lines);
     int threads = sys->threads.size();
     redistributors.resize(threads, nullptr);
     cpuInterfaces.resize(threads, nullptr);
 
-    panic_if(threads > params()->cpu_max,
+    panic_if(threads > params().cpu_max,
         "Exceeding maximum number of PEs supported by GICv3: "
-        "using %u while maximum is %u.", threads, params()->cpu_max);
+        "using %u while maximum is %u.", threads, params().cpu_max);
 
     for (int i = 0; i < threads; i++) {
         redistributors[i] = new Gicv3Redistributor(this, i);
         cpuInterfaces[i] = new Gicv3CPUInterface(this, i);
     }
 
-    distRange = RangeSize(params()->dist_addr,
+    distRange = RangeSize(params().dist_addr,
         Gicv3Distributor::ADDR_RANGE_SIZE - 1);
 
     redistSize = redistributors[0]->addrRangeSize;
-    redistRange = RangeSize(params()->redist_addr, redistSize * threads - 1);
+    redistRange = RangeSize(params().redist_addr, redistSize * threads - 1);
 
     addrRanges = {distRange, redistRange};
 
@@ -88,7 +88,7 @@ Gicv3::init()
         cpuInterfaces[i]->init();
     }
 
-    Gicv3Its *its = params()->its;
+    Gicv3Its *its = params().its;
     if (its)
         its->setGIC(this);
 
@@ -108,7 +108,7 @@ Gicv3::read(PacketPtr pkt)
         const Addr daddr = addr - distRange.start();
         panic_if(!distributor, "Distributor is null!");
         resp = distributor->read(daddr, size, is_secure_access);
-        delay = params()->dist_pio_delay;
+        delay = params().dist_pio_delay;
         DPRINTF(GIC, "Gicv3::read(): (distributor) context_id %d register %#x "
                 "size %d is_secure_access %d (value %#x)\n",
                 pkt->req->contextId(), daddr, size, is_secure_access, resp);
@@ -118,7 +118,7 @@ Gicv3::read(PacketPtr pkt)
         Gicv3Redistributor *redist = getRedistributorByAddr(addr);
         resp = redist->read(daddr, size, is_secure_access);
 
-        delay = params()->redist_pio_delay;
+        delay = params().redist_pio_delay;
         DPRINTF(GIC, "Gicv3::read(): (redistributor %d) context_id %d "
                 "register %#x size %d is_secure_access %d (value %#x)\n",
                 redist->processorNumber(), pkt->req->contextId(), daddr, size,
@@ -148,7 +148,7 @@ Gicv3::write(PacketPtr pkt)
                 "register %#x size %d is_secure_access %d value %#x\n",
                 pkt->req->contextId(), daddr, size, is_secure_access, data);
         distributor->write(daddr, data, size, is_secure_access);
-        delay = params()->dist_pio_delay;
+        delay = params().dist_pio_delay;
     } else if (redistRange.contains(addr)) {
         Addr daddr = (addr - redistRange.start()) % redistSize;
 
@@ -160,7 +160,7 @@ Gicv3::write(PacketPtr pkt)
 
         redist->write(daddr, data, size, is_secure_access);
 
-        delay = params()->redist_pio_delay;
+        delay = params().redist_pio_delay;
     } else {
         panic("Gicv3::write(): unknown address %#x\n", addr);
     }
@@ -212,7 +212,7 @@ bool
 Gicv3::supportsVersion(GicVersion version)
 {
     return (version == GicVersion::GIC_V3) ||
-           (version == GicVersion::GIC_V4 && params()->gicv4);
+           (version == GicVersion::GIC_V4 && params().gicv4);
 }
 
 void
@@ -296,7 +296,7 @@ Gicv3::unserialize(CheckpointIn & cp)
 }
 
 Gicv3 *
-Gicv3Params::create()
+Gicv3Params::create() const
 {
-    return new Gicv3(this);
+    return new Gicv3(*this);
 }
index ecda6b6299f5f258c71b71d3ece9ebc5023eff88..9170923253ed8f3feb3504209d1a3a8d4e032428 100644 (file)
@@ -111,10 +111,10 @@ class Gicv3 : public BaseGic
 
     void init() override;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     Tick read(PacketPtr pkt) override;
@@ -128,7 +128,7 @@ class Gicv3 : public BaseGic
 
   public:
 
-    Gicv3(const Params p);
+    Gicv3(const Params &p);
     void deassertInt(uint32_t cpu, ArmISA::InterruptTypes int_type);
     void deassertAll(uint32_t cpu);
     bool haveAsserted(uint32_t cpu) const;
index 892e7479a2546ca1582f60bedde0ec6ef37b2ca2..8c6f4817ab8f6c0bde2d8faf510b3d9a045f32e7 100644 (file)
@@ -80,7 +80,7 @@ Gicv3CPUInterface::resetHppi(uint32_t intid)
 void
 Gicv3CPUInterface::setThreadContext(ThreadContext *tc)
 {
-    maintenanceInterrupt = gic->params()->maint_int->get(tc);
+    maintenanceInterrupt = gic->params().maint_int->get(tc);
     fatal_if(maintenanceInterrupt->num() >= redistributor->irqPending.size(),
         "Invalid maintenance interrupt number\n");
 }
index a3bb6726da3bb28a8262fcd82c4912e9cc3d2e56..ed349ac00295d59d0a664029edac1d260ef9eb84 100644 (file)
@@ -771,15 +771,15 @@ ItsCommand::vsync(Yield &yield, CommandEntry &command)
     panic("ITS %s command unimplemented", __func__);
 }
 
-Gicv3Its::Gicv3Its(const Gicv3ItsParams *params)
- : BasicPioDevice(params, params->pio_size),
+Gicv3Its::Gicv3Its(const Gicv3ItsParams &params)
+ : BasicPioDevice(params, params.pio_size),
    dmaPort(name() + ".dma", *this),
    gitsControl(CTLR_QUIESCENT),
-   gitsTyper(params->gits_typer),
+   gitsTyper(params.gits_typer),
    gitsCbaser(0), gitsCreadr(0),
    gitsCwriter(0), gitsIidr(0),
    tableBases(NUM_BASER_REGS, 0),
-   requestorId(params->system->getRequestorId(this)),
+   requestorId(params.system->getRequestorId(this)),
    gic(nullptr),
    commandEvent([this] { checkCommandQueue(); }, name()),
    pendingCommands(false),
@@ -1288,7 +1288,7 @@ Gicv3Its::moveAllPendingState(
 }
 
 Gicv3Its *
-Gicv3ItsParams::create()
+Gicv3ItsParams::create() const
 {
-    return new Gicv3Its(this);
+    return new Gicv3Its(*this);
 }
index e3b8734b0ee8b7f4982b7c51dfa55619a759f0dd..0262f46311caab6f4a5f9474fa56797b9de88b37 100644 (file)
@@ -100,7 +100,7 @@ class Gicv3Its : public BasicPioDevice
     bool recvTimingResp(PacketPtr pkt);
     void recvReqRetry();
 
-    Gicv3Its(const Gicv3ItsParams *params);
+    Gicv3Its(const Gicv3ItsParams &params);
 
     void setGIC(Gicv3 *_gic);
 
index 4a6fe49db35dbedf2ee51721a103af9ac4178a21..39a32e34ceb2799181338624da745c7d0480eedb 100644 (file)
@@ -73,7 +73,7 @@ Gicv3Redistributor::Gicv3Redistributor(Gicv3 * gic, uint32_t cpu_id)
       lpiConfigurationTablePtr(0),
       lpiIDBits(0),
       lpiPendingTablePtr(0),
-      addrRangeSize(gic->params()->gicv4 ? 0x40000 : 0x20000)
+      addrRangeSize(gic->params().gicv4 ? 0x40000 : 0x20000)
 {
 }
 
index 318ef20621373bfa9e0249027494a1a9004cd111..1d95c5f5a934ec5c153ac398400f1a73851d16a8 100644 (file)
@@ -52,14 +52,14 @@ static const std::map<Enums::NoMaliGpuType, nomali_gpu_type_t> gpuTypeMap{
     { Enums::T760, NOMALI_GPU_T760 },
 };
 
-NoMaliGpu::NoMaliGpu(const NoMaliGpuParams *p)
+NoMaliGpu::NoMaliGpu(const NoMaliGpuParams &p)
     : PioDevice(p),
-      pioAddr(p->pio_addr),
-      platform(p->platform),
+      pioAddr(p.pio_addr),
+      platform(p.platform),
       interruptMap{
-          { NOMALI_INT_GPU, p->int_gpu },
-          { NOMALI_INT_JOB, p->int_job },
-          { NOMALI_INT_MMU, p->int_mmu },
+          { NOMALI_INT_GPU, p.int_gpu },
+          { NOMALI_INT_JOB, p.int_job },
+          { NOMALI_INT_MMU, p.int_mmu },
       }
 {
     if (nomali_api_version() != NOMALI_API_VERSION)
@@ -69,16 +69,16 @@ NoMaliGpu::NoMaliGpu(const NoMaliGpuParams *p)
     nomali_config_t cfg;
     memset(&cfg, 0, sizeof(cfg));
 
-    const auto it_gpu(gpuTypeMap.find(p->gpu_type));
+    const auto it_gpu(gpuTypeMap.find(p.gpu_type));
     if (it_gpu == gpuTypeMap.end()) {
         fatal("Unrecognized GPU type: %s (%i)\n",
-              Enums::NoMaliGpuTypeStrings[p->gpu_type], p->gpu_type);
+              Enums::NoMaliGpuTypeStrings[p.gpu_type], p.gpu_type);
     }
     cfg.type = it_gpu->second;
 
-    cfg.ver_maj = p->ver_maj;
-    cfg.ver_min = p->ver_min;
-    cfg.ver_status = p->ver_status;
+    cfg.ver_maj = p.ver_maj;
+    cfg.ver_min = p.ver_min;
+    cfg.ver_status = p.ver_status;
 
     panicOnErr(
         nomali_create(&nomali, &cfg),
@@ -321,45 +321,45 @@ NoMaliGpu::_reset(nomali_handle_t h, void *usr)
 }
 
 
-CustomNoMaliGpu::CustomNoMaliGpu(const CustomNoMaliGpuParams *p)
+CustomNoMaliGpu::CustomNoMaliGpu(const CustomNoMaliGpuParams &p)
     : NoMaliGpu(p),
       idRegs{
-        { GPU_CONTROL_REG(GPU_ID), p->gpu_id },
-        { GPU_CONTROL_REG(L2_FEATURES), p->l2_features },
-        { GPU_CONTROL_REG(TILER_FEATURES), p->tiler_features },
-        { GPU_CONTROL_REG(MEM_FEATURES), p->mem_features },
-        { GPU_CONTROL_REG(MMU_FEATURES), p->mmu_features },
-        { GPU_CONTROL_REG(AS_PRESENT), p->as_present },
-        { GPU_CONTROL_REG(JS_PRESENT), p->js_present },
-
-        { GPU_CONTROL_REG(THREAD_MAX_THREADS), p->thread_max_threads },
+        { GPU_CONTROL_REG(GPU_ID), p.gpu_id },
+        { GPU_CONTROL_REG(L2_FEATURES), p.l2_features },
+        { GPU_CONTROL_REG(TILER_FEATURES), p.tiler_features },
+        { GPU_CONTROL_REG(MEM_FEATURES), p.mem_features },
+        { GPU_CONTROL_REG(MMU_FEATURES), p.mmu_features },
+        { GPU_CONTROL_REG(AS_PRESENT), p.as_present },
+        { GPU_CONTROL_REG(JS_PRESENT), p.js_present },
+
+        { GPU_CONTROL_REG(THREAD_MAX_THREADS), p.thread_max_threads },
         { GPU_CONTROL_REG(THREAD_MAX_WORKGROUP_SIZE),
-          p->thread_max_workgroup_size },
+          p.thread_max_workgroup_size },
         { GPU_CONTROL_REG(THREAD_MAX_BARRIER_SIZE),
-          p->thread_max_barrier_size },
-        { GPU_CONTROL_REG(THREAD_FEATURES), p->thread_features },
-
-        { GPU_CONTROL_REG(SHADER_PRESENT_LO), bits(p->shader_present, 31, 0) },
-        { GPU_CONTROL_REG(SHADER_PRESENT_HI), bits(p->shader_present, 63, 32) },
-        { GPU_CONTROL_REG(TILER_PRESENT_LO), bits(p->tiler_present, 31, 0) },
-        { GPU_CONTROL_REG(TILER_PRESENT_HI), bits(p->tiler_present, 63, 32) },
-        { GPU_CONTROL_REG(L2_PRESENT_LO), bits(p->l2_present, 31, 0) },
-        { GPU_CONTROL_REG(L2_PRESENT_HI), bits(p->l2_present, 63, 32) },
+          p.thread_max_barrier_size },
+        { GPU_CONTROL_REG(THREAD_FEATURES), p.thread_features },
+
+        { GPU_CONTROL_REG(SHADER_PRESENT_LO), bits(p.shader_present, 31, 0) },
+        { GPU_CONTROL_REG(SHADER_PRESENT_HI), bits(p.shader_present, 63, 32) },
+        { GPU_CONTROL_REG(TILER_PRESENT_LO), bits(p.tiler_present, 31, 0) },
+        { GPU_CONTROL_REG(TILER_PRESENT_HI), bits(p.tiler_present, 63, 32) },
+        { GPU_CONTROL_REG(L2_PRESENT_LO), bits(p.l2_present, 31, 0) },
+        { GPU_CONTROL_REG(L2_PRESENT_HI), bits(p.l2_present, 63, 32) },
       }
 {
-    fatal_if(p->texture_features.size() > 3,
+    fatal_if(p.texture_features.size() > 3,
              "Too many texture feature registers specified (%i)\n",
-             p->texture_features.size());
+             p.texture_features.size());
 
-    fatal_if(p->js_features.size() > 16,
+    fatal_if(p.js_features.size() > 16,
              "Too many job slot feature registers specified (%i)\n",
-             p->js_features.size());
+             p.js_features.size());
 
-    for (int i = 0; i < p->texture_features.size(); i++)
-        idRegs[TEXTURE_FEATURES_REG(i)] = p->texture_features[i];
+    for (int i = 0; i < p.texture_features.size(); i++)
+        idRegs[TEXTURE_FEATURES_REG(i)] = p.texture_features[i];
 
-    for (int i = 0; i < p->js_features.size(); i++)
-        idRegs[JS_FEATURES_REG(i)] = p->js_features[i];
+    for (int i = 0; i < p.js_features.size(); i++)
+        idRegs[JS_FEATURES_REG(i)] = p.js_features[i];
 }
 
 CustomNoMaliGpu::~CustomNoMaliGpu()
@@ -378,13 +378,13 @@ CustomNoMaliGpu::onReset()
 
 
 NoMaliGpu *
-NoMaliGpuParams::create()
+NoMaliGpuParams::create() const
 {
-    return new NoMaliGpu(this);
+    return new NoMaliGpu(*this);
 }
 
 CustomNoMaliGpu *
-CustomNoMaliGpuParams::create()
+CustomNoMaliGpuParams::create() const
 {
-    return new CustomNoMaliGpu(this);
+    return new CustomNoMaliGpu(*this);
 }
index 8c3ac265da50093e5347b988e38dc763bff16d6d..a096edbee496b7a314da65e5d043726033fed5f9 100644 (file)
@@ -50,7 +50,7 @@ class RealView;
 class NoMaliGpu : public PioDevice
 {
   public:
-    NoMaliGpu(const NoMaliGpuParams *p);
+    NoMaliGpu(const NoMaliGpuParams &p);
     virtual ~NoMaliGpu();
 
     void init() override;
@@ -188,7 +188,7 @@ class NoMaliGpu : public PioDevice
 class CustomNoMaliGpu : public NoMaliGpu
 {
   public:
-    CustomNoMaliGpu(const CustomNoMaliGpuParams *p);
+    CustomNoMaliGpu(const CustomNoMaliGpuParams &p);
     virtual ~CustomNoMaliGpu();
 
   protected:
index cf5995a840dec103f048e51f30615d1a487eea67..6c218662ac5e672625fbeec451ce05dccdc688d4 100644 (file)
@@ -54,16 +54,16 @@ using std::vector;
 
 
 // initialize hdlcd registers
-HDLcd::HDLcd(const HDLcdParams *p)
+HDLcd::HDLcd(const HDLcdParams &p)
     : AmbaDmaDevice(p, 0xFFFF),
       // Parameters
-      vnc(p->vnc),
-      workaroundSwapRB(p->workaround_swap_rb),
-      workaroundDmaLineCount(p->workaround_dma_line_count),
+      vnc(p.vnc),
+      workaroundSwapRB(p.workaround_swap_rb),
+      workaroundDmaLineCount(p.workaround_dma_line_count),
       addrRanges{RangeSize(pioAddr, pioSize)},
-      enableCapture(p->enable_capture),
-      pixelBufferSize(p->pixel_buffer_size),
-      virtRefreshRate(p->virt_refresh_rate),
+      enableCapture(p.enable_capture),
+      pixelBufferSize(p.pixel_buffer_size),
+      virtRefreshRate(p.virt_refresh_rate),
 
       // Registers
       version(VERSION_RESETV),
@@ -83,8 +83,8 @@ HDLcd::HDLcd(const HDLcdParams *p)
 
       virtRefreshEvent([this]{ virtRefresh(); }, name()),
       // Other
-      imgFormat(p->frame_format), pic(NULL), conv(PixelConverter::rgba8888_le),
-      pixelPump(*this, *p->pxl_clk, p->pixel_chunk)
+      imgFormat(p.frame_format), pic(NULL), conv(PixelConverter::rgba8888_le),
+      pixelPump(*this, *p.pxl_clk, p.pixel_chunk)
 {
     if (vnc)
         vnc->setFrameBuffer(&pixelPump.fb);
@@ -692,7 +692,7 @@ HDLcd::PixelPump::dumpSettings()
 
 
 HDLcd *
-HDLcdParams::create()
+HDLcdParams::create() const
 {
-    return new HDLcd(this);
+    return new HDLcd(*this);
 }
index 2ffe5fdb2007ee0dcd84f4c43dafd4cddecc0548..c41100e083aac1d171beb72f0f0080e92dc30707 100644 (file)
@@ -90,7 +90,7 @@ class HDLcdPixelPump;
 class HDLcd: public AmbaDmaDevice
 {
   public:
-    HDLcd(const HDLcdParams *p);
+    HDLcd(const HDLcdParams &p);
     ~HDLcd();
 
     void regStats() override;
index 517a79ffe9f15f2b32eced49d1f4178b4e7a29ba..499a39ea51cbbd25f3d047cf9940380d5d5c9491 100644 (file)
 #include "mem/packet.hh"
 #include "mem/packet_access.hh"
 
-Pl050::Pl050(const Pl050Params *p)
+Pl050::Pl050(const Pl050Params &p)
     : AmbaIntDevice(p, 0x1000), control(0), status(0x43), clkdiv(0),
       rawInterrupts(0),
-      ps2(p->ps2)
+      ps2(p.ps2)
 {
     ps2->hostRegDataAvailable([this]() { this->updateRxInt(); });
 }
@@ -221,7 +221,7 @@ Pl050::unserialize(CheckpointIn &cp)
 }
 
 Pl050 *
-Pl050Params::create()
+Pl050Params::create() const
 {
-    return new Pl050(this);
+    return new Pl050(*this);
 }
index b38fc968c6e3e553197a77600fa4a650f58f0ef9..2d83c138d44bb377cc218d7cdfe7638d11ae08a3 100644 (file)
@@ -126,7 +126,7 @@ class Pl050 : public AmbaIntDevice
     PS2Device *ps2;
 
   public:
-    Pl050(const Pl050Params *p);
+    Pl050(const Pl050Params &p);
 
     Tick read(PacketPtr pkt) override;
     Tick write(PacketPtr pkt) override;
index 21f119b2698e77c4fce83c81696bae1289790dcb..1bb895957c60b1035d0192d5d2dc14f22305b885 100644 (file)
 
 #include "params/GenericArmPciHost.hh"
 
-GenericArmPciHost::GenericArmPciHost(const GenericArmPciHostParams *p)
+GenericArmPciHost::GenericArmPciHost(const GenericArmPciHostParams &p)
     : GenericPciHost(p),
-      intPolicy(p->int_policy), intBase(p->int_base),
-      intCount(p->int_count)
+      intPolicy(p.int_policy), intBase(p.int_base),
+      intCount(p.int_count)
 {
 }
 
@@ -71,7 +71,7 @@ GenericArmPciHost::mapPciInterrupt(const PciBusAddr &addr, PciIntPin pin) const
 
 
 GenericArmPciHost *
-GenericArmPciHostParams::create()
+GenericArmPciHostParams::create() const
 {
-    return new GenericArmPciHost(this);
+    return new GenericArmPciHost(*this);
 }
index 9c061b4baa40fb8e8fe1205969de4e28169ad40b..bf48b3d8797b0a7e350b08b681faf9c7accaad31 100644 (file)
@@ -48,7 +48,7 @@ class GenericArmPciHost
     : public GenericPciHost
 {
   public:
-    GenericArmPciHost(const GenericArmPciHostParams *p);
+    GenericArmPciHost(const GenericArmPciHostParams &p);
     virtual ~GenericArmPciHost() {}
 
   protected:
index 9b83cf8c753aba0d73c40657da2edad01e152f4b..f39d11116e4127f28a77e2370eca165c39db6ae1 100755 (executable)
 #include "params/Pl011.hh"
 #include "sim/sim_exit.hh"
 
-Pl011::Pl011(const Pl011Params *p)
+Pl011::Pl011(const Pl011Params &p)
     : Uart(p, 0x1000),
       intEvent([this]{ generateInterrupt(); }, name()),
       control(0x300), fbrd(0), ibrd(0), lcrh(0), ifls(0x12),
       imsc(0), rawInt(0),
-      endOnEOT(p->end_on_eot), interrupt(p->interrupt->get()),
-      intDelay(p->int_delay)
+      endOnEOT(p.end_on_eot), interrupt(p.interrupt->get()),
+      intDelay(p.int_delay)
 {
 }
 
@@ -327,7 +327,7 @@ Pl011::unserialize(CheckpointIn &cp)
 }
 
 Pl011 *
-Pl011Params::create()
+Pl011Params::create() const
 {
-    return new Pl011(this);
+    return new Pl011(*this);
 }
index 0ecbe1300d1c0d21647df4a4c0d93c0e5e494b06..1e370f012263bd3f7a62ef6fa8ab36b91fb12365 100755 (executable)
@@ -55,7 +55,7 @@ struct Pl011Params;
 class Pl011 : public Uart, public AmbaDevice
 {
   public:
-    Pl011(const Pl011Params *p);
+    Pl011(const Pl011Params &p);
 
     void serialize(CheckpointOut &cp) const override;
     void unserialize(CheckpointIn &cp) override;
index f36b33f17f4b3682660ecdac425e8053eaa56200..16e2990a27102a6a00b849af5bb4426c088aca9b 100644 (file)
 using std::vector;
 
 // initialize clcd registers
-Pl111::Pl111(const Params *p)
+Pl111::Pl111(const Params &p)
     : AmbaDmaDevice(p), lcdTiming0(0), lcdTiming1(0), lcdTiming2(0),
       lcdTiming3(0), lcdUpbase(0), lcdLpbase(0), lcdControl(0), lcdImsc(0),
       lcdRis(0), lcdMis(0),
       clcdCrsrCtrl(0), clcdCrsrConfig(0), clcdCrsrPalette0(0),
       clcdCrsrPalette1(0), clcdCrsrXY(0), clcdCrsrClip(0), clcdCrsrImsc(0),
       clcdCrsrIcr(0), clcdCrsrRis(0), clcdCrsrMis(0),
-      pixelClock(p->pixel_clock),
+      pixelClock(p.pixel_clock),
       converter(PixelConverter::rgba8888_le), fb(LcdMaxWidth, LcdMaxHeight),
-      vnc(p->vnc), bmp(&fb), pic(NULL),
+      vnc(p.vnc), bmp(&fb), pic(NULL),
       width(LcdMaxWidth), height(LcdMaxHeight),
       bytesPerPixel(4), startTime(0), startAddr(0), maxAddr(0), curAddr(0),
       waterMark(0), dmaPendingNum(0),
@@ -71,7 +71,7 @@ Pl111::Pl111(const Params *p)
       dmaDoneEventAll(maxOutstandingDma, this),
       dmaDoneEventFree(maxOutstandingDma),
       intEvent([this]{ generateInterrupt(); }, name()),
-      enableCapture(p->enable_capture)
+      enableCapture(p.enable_capture)
 {
     pioSize = 0xFFFF;
 
@@ -744,9 +744,9 @@ Pl111::getAddrRanges() const
 }
 
 Pl111 *
-Pl111Params::create()
+Pl111Params::create() const
 {
-    return new Pl111(this);
+    return new Pl111(*this);
 }
 
 
index dffbba26b9061fad3335ae8080a34758f1a71b56..67cfed0473f172196958a57ab4d603f69d6f8b3e 100644 (file)
@@ -358,12 +358,12 @@ class Pl111: public AmbaDmaDevice
   public:
     typedef Pl111Params Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
-    Pl111(const Params *p);
+    Pl111(const Params &p);
     ~Pl111();
 
     Tick read(PacketPtr pkt) override;
index 85949d4ad56d4fa8a3eb4f2fb9666b134145928a..343f41623779c39cfdfb422ef2bfc5891c785f6f 100644 (file)
@@ -53,8 +53,8 @@
 #include "sim/system.hh"
 
 
-RealView::RealView(const Params *p)
-    : Platform(p), system(p->system), gic(nullptr)
+RealView::RealView(const Params &p)
+    : Platform(p), system(p.system), gic(nullptr)
 {}
 
 void
@@ -84,7 +84,7 @@ RealView::clearPciInt(int line)
 }
 
 RealView *
-RealViewParams::create()
+RealViewParams::create() const
 {
-    return new RealView(this);
+    return new RealView(*this);
 }
index 236b83d1e6e18542325464ea93a31fbf6b2e7e60..460c37902e2f2e05f8a0e1eacc241de6ea32d78f 100644 (file)
@@ -64,9 +64,9 @@ class RealView : public Platform
 
   public:
     typedef RealViewParams Params;
-    const Params *
+    const Params &
     params() const {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     /**
@@ -75,7 +75,7 @@ class RealView : public Platform
      * @param s system the object belongs to
      * @param intctrl pointer to the interrupt controller
      */
-    RealView(const Params *p);
+    RealView(const Params &p);
 
     /** Give platform a pointer to interrupt controller */
     void setGic(BaseGic *_gic) { gic = _gic; }
index 3ff478f731a0a836323772c3f23b9ea559f1a1f1..963c126bd0cd8d1708417ab69ce11103877e70c1 100644 (file)
 #include "mem/packet.hh"
 #include "mem/packet_access.hh"
 
-PL031::PL031(Params *p)
-    : AmbaIntDevice(p, 0x1000), timeVal(mkutctime(&p->time)),
-      lastWrittenTick(0), loadVal(0), matchVal(0),
+PL031::PL031(const Params &p)
+    : AmbaIntDevice(p, 0x1000), lastWrittenTick(0), loadVal(0), matchVal(0),
       rawInt(false), maskInt(false), pendingInt(false),
       matchEvent([this]{ counterMatch(); }, name())
 {
+    // Make a temporary copy so mkutctime can modify it.
+    struct tm local_time = p.time;
+    timeVal = mkutctime(&local_time);
 }
 
 
@@ -239,7 +241,7 @@ PL031::unserialize(CheckpointIn &cp)
 
 
 PL031 *
-PL031Params::create()
+PL031Params::create() const
 {
-    return new PL031(this);
+    return new PL031(*this);
 }
index 98fe68a530a70837fecc2a77ed96b73403c2d716..97a02e8752a465e3cbaaa2b940893c6859baed53 100644 (file)
@@ -98,16 +98,16 @@ class PL031 : public AmbaIntDevice
 
   public:
     typedef PL031Params Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
     /**
       * The constructor for RealView just registers itself with the MMU.
       * @param p params structure
       */
-    PL031(Params *p);
+    PL031(const Params &p);
 
     /**
      * Handle a read to the device
index 1ec93ab9539cf8279626047e373aaf87a8113996..63d2e831e923ccc7a2f99f6788ffb0ef6db8ee72 100644 (file)
@@ -45,7 +45,7 @@
 #include "sim/system.hh"
 #include "sim/voltage_domain.hh"
 
-RealViewCtrl::RealViewCtrl(Params *p)
+RealViewCtrl::RealViewCtrl(const Params &p)
     : BasicPioDevice(p, 0xD4), flags(0), scData(0)
 {
 }
@@ -59,10 +59,10 @@ RealViewCtrl::read(PacketPtr pkt)
 
     switch(daddr) {
       case ProcId0:
-        pkt->setLE(params()->proc_id0);
+        pkt->setLE(params().proc_id0);
         break;
       case ProcId1:
-        pkt->setLE(params()->proc_id1);
+        pkt->setLE(params().proc_id1);
         break;
       case Clock24:
         Tick clk;
@@ -102,7 +102,7 @@ RealViewCtrl::read(PacketPtr pkt)
         pkt->setLE<uint32_t>(flags);
         break;
       case IdReg:
-        pkt->setLE<uint32_t>(params()->idreg);
+        pkt->setLE<uint32_t>(params().idreg);
         break;
       case CfgStat:
         pkt->setLE<uint32_t>(1);
@@ -234,17 +234,17 @@ RealViewCtrl::registerDevice(DeviceFunc func, uint8_t site, uint8_t pos,
 }
 
 
-RealViewOsc::RealViewOsc(RealViewOscParams *p)
-    : ClockDomain(p, p->voltage_domain),
-      RealViewCtrl::Device(*p->parent, RealViewCtrl::FUNC_OSC,
-                           p->site, p->position, p->dcc, p->device)
+RealViewOsc::RealViewOsc(const RealViewOscParams &p)
+    : ClockDomain(p, p.voltage_domain),
+      RealViewCtrl::Device(*p.parent, RealViewCtrl::FUNC_OSC,
+                           p.site, p.position, p.dcc, p.device)
 {
-    if (SimClock::Float::s  / p->freq > UINT32_MAX) {
+    if (SimClock::Float::s  / p.freq > UINT32_MAX) {
         fatal("Oscillator frequency out of range: %f\n",
-            SimClock::Float::s  / p->freq / 1E6);
+            SimClock::Float::s  / p.freq / 1E6);
     }
 
-    _clockPeriod = p->freq;
+    _clockPeriod = p.freq;
 }
 
 void
@@ -315,19 +315,19 @@ RealViewTemperatureSensor::read() const
 }
 
 RealViewCtrl *
-RealViewCtrlParams::create()
+RealViewCtrlParams::create() const
 {
-    return new RealViewCtrl(this);
+    return new RealViewCtrl(*this);
 }
 
 RealViewOsc *
-RealViewOscParams::create()
+RealViewOscParams::create() const
 {
-    return new RealViewOsc(this);
+    return new RealViewOsc(*this);
 }
 
 RealViewTemperatureSensor *
-RealViewTemperatureSensorParams::create()
+RealViewTemperatureSensorParams::create() const
 {
-    return new RealViewTemperatureSensor(this);
+    return new RealViewTemperatureSensor(*this);
 }
index b226b4383d6f3841a6964b5a6facb4c9b949ebb2..23fb2c94f861282ed5852a576106fd0b4d13bd74 100644 (file)
@@ -154,16 +154,16 @@ class RealViewCtrl : public BasicPioDevice
 
   public:
     typedef RealViewCtrlParams Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
     /**
       * The constructor for RealView just registers itself with the MMU.
       * @param p params structure
       */
-    RealViewCtrl(Params *p);
+    RealViewCtrl(const Params &p);
 
     /**
      * Handle a read to the device
@@ -202,7 +202,7 @@ class RealViewOsc
     : public ClockDomain, RealViewCtrl::Device
 {
   public:
-    RealViewOsc(RealViewOscParams *p);
+    RealViewOsc(const RealViewOscParams &p);
     virtual ~RealViewOsc() {};
 
     void startup() override;
@@ -228,11 +228,11 @@ class RealViewTemperatureSensor
     : public SimObject, RealViewCtrl::Device
 {
   public:
-    RealViewTemperatureSensor(RealViewTemperatureSensorParams *p)
+    RealViewTemperatureSensor(const RealViewTemperatureSensorParams &p)
     : SimObject(p),
-      RealViewCtrl::Device(*p->parent, RealViewCtrl::FUNC_TEMP,
-                           p->site, p->position, p->dcc, p->device),
-      system(p->system)
+      RealViewCtrl::Device(*p.parent, RealViewCtrl::FUNC_TEMP,
+                           p.site, p.position, p.dcc, p.device),
+      system(p.system)
     {}
     virtual ~RealViewTemperatureSensor() {};
 
index f9bdc277c691360343339c95d4be28a7488207f7..18870a260ac6df262b9ad96c46440ebf9d660103 100644 (file)
 #include "mem/packet_access.hh"
 #include "sim/system.hh"
 
-SMMUv3::SMMUv3(SMMUv3Params *params) :
+SMMUv3::SMMUv3(const SMMUv3Params &params) :
     ClockedObject(params),
-    system(*params->system),
-    requestorId(params->system->getRequestorId(this)),
+    system(*params.system),
+    requestorId(params.system->getRequestorId(this)),
     requestPort(name() + ".request", *this),
     tableWalkPort(name() + ".walker", *this),
-    controlPort(name() + ".control", *this, params->reg_map),
-    tlb(params->tlb_entries, params->tlb_assoc, params->tlb_policy),
-    configCache(params->cfg_entries, params->cfg_assoc, params->cfg_policy),
-    ipaCache(params->ipa_entries, params->ipa_assoc, params->ipa_policy),
-    walkCache({ { params->walk_S1L0, params->walk_S1L1,
-                  params->walk_S1L2, params->walk_S1L3,
-                  params->walk_S2L0, params->walk_S2L1,
-                  params->walk_S2L2, params->walk_S2L3 } },
-              params->walk_assoc, params->walk_policy),
-    tlbEnable(params->tlb_enable),
-    configCacheEnable(params->cfg_enable),
-    ipaCacheEnable(params->ipa_enable),
-    walkCacheEnable(params->walk_enable),
+    controlPort(name() + ".control", *this, params.reg_map),
+    tlb(params.tlb_entries, params.tlb_assoc, params.tlb_policy),
+    configCache(params.cfg_entries, params.cfg_assoc, params.cfg_policy),
+    ipaCache(params.ipa_entries, params.ipa_assoc, params.ipa_policy),
+    walkCache({ { params.walk_S1L0, params.walk_S1L1,
+                  params.walk_S1L2, params.walk_S1L3,
+                  params.walk_S2L0, params.walk_S2L1,
+                  params.walk_S2L2, params.walk_S2L3 } },
+              params.walk_assoc, params.walk_policy),
+    tlbEnable(params.tlb_enable),
+    configCacheEnable(params.cfg_enable),
+    ipaCacheEnable(params.ipa_enable),
+    walkCacheEnable(params.walk_enable),
     tableWalkPortEnable(false),
-    walkCacheNonfinalEnable(params->wc_nonfinal_enable),
-    walkCacheS1Levels(params->wc_s1_levels),
-    walkCacheS2Levels(params->wc_s2_levels),
-    requestPortWidth(params->request_port_width),
-    tlbSem(params->tlb_slots),
+    walkCacheNonfinalEnable(params.wc_nonfinal_enable),
+    walkCacheS1Levels(params.wc_s1_levels),
+    walkCacheS2Levels(params.wc_s2_levels),
+    requestPortWidth(params.request_port_width),
+    tlbSem(params.tlb_slots),
     ifcSmmuSem(1),
     smmuIfcSem(1),
-    configSem(params->cfg_slots),
-    ipaSem(params->ipa_slots),
-    walkSem(params->walk_slots),
+    configSem(params.cfg_slots),
+    ipaSem(params.ipa_slots),
+    walkSem(params.walk_slots),
     requestPortSem(1),
-    transSem(params->xlate_slots),
-    ptwSem(params->ptw_slots),
+    transSem(params.xlate_slots),
+    ptwSem(params.ptw_slots),
     cycleSem(1),
-    tlbLat(params->tlb_lat),
-    ifcSmmuLat(params->ifc_smmu_lat),
-    smmuIfcLat(params->smmu_ifc_lat),
-    configLat(params->cfg_lat),
-    ipaLat(params->ipa_lat),
-    walkLat(params->walk_lat),
-    deviceInterfaces(params->device_interfaces),
+    tlbLat(params.tlb_lat),
+    ifcSmmuLat(params.ifc_smmu_lat),
+    smmuIfcLat(params.smmu_ifc_lat),
+    configLat(params.cfg_lat),
+    ipaLat(params.ipa_lat),
+    walkLat(params.walk_lat),
+    deviceInterfaces(params.device_interfaces),
     commandExecutor(name() + ".cmd_exec", *this),
-    regsMap(params->reg_map),
+    regsMap(params.reg_map),
     processCommandsEvent(this)
 {
     fatal_if(regsMap.size() != SMMU_REG_SIZE,
@@ -104,14 +104,14 @@ SMMUv3::SMMUv3(SMMUv3Params *params) :
     memset(&regs, 0, sizeof(regs));
 
     // Setup RO ID registers
-    regs.idr0 = params->smmu_idr0;
-    regs.idr1 = params->smmu_idr1;
-    regs.idr2 = params->smmu_idr2;
-    regs.idr3 = params->smmu_idr3;
-    regs.idr4 = params->smmu_idr4;
-    regs.idr5 = params->smmu_idr5;
-    regs.iidr = params->smmu_iidr;
-    regs.aidr = params->smmu_aidr;
+    regs.idr0 = params.smmu_idr0;
+    regs.idr1 = params.smmu_idr1;
+    regs.idr2 = params.smmu_idr2;
+    regs.idr3 = params.smmu_idr3;
+    regs.idr4 = params.smmu_idr4;
+    regs.idr5 = params.smmu_idr5;
+    regs.iidr = params.smmu_iidr;
+    regs.aidr = params.smmu_aidr;
 
     // TODO: At the moment it possible to set the ID registers to hold
     // any possible value. It would be nice to have a sanity check here
@@ -828,7 +828,7 @@ SMMUv3::getPort(const std::string &name, PortID id)
 }
 
 SMMUv3*
-SMMUv3Params::create()
+SMMUv3Params::create() const
 {
-    return new SMMUv3(this);
+    return new SMMUv3(*this);
 }
index 6b3f3982b8694cce8b9559203ad5a83e1bc3a1d2..7601e15d808d0694e9884456d9ffaa88ce3d7eb8 100644 (file)
@@ -165,7 +165,7 @@ class SMMUv3 : public ClockedObject
     const PageTableOps *getPageTableOps(uint8_t trans_granule);
 
   public:
-    SMMUv3(SMMUv3Params *p);
+    SMMUv3(const SMMUv3Params &p);
     virtual ~SMMUv3() {}
 
     virtual void init() override;
index 751605556bdb4a694db7710448fb432843901f48..985ca178955e447a7ea3771f67c54fd58ffe3ff0 100644 (file)
 #include "dev/arm/smmu_v3_transl.hh"
 
 SMMUv3DeviceInterface::SMMUv3DeviceInterface(
-    const SMMUv3DeviceInterfaceParams *p) :
+    const SMMUv3DeviceInterfaceParams &p) :
     ClockedObject(p),
     smmu(nullptr),
-    microTLB(new SMMUTLB(p->utlb_entries,
-                         p->utlb_assoc,
-                         p->utlb_policy)),
-    mainTLB(new SMMUTLB(p->tlb_entries,
-                        p->tlb_assoc,
-                        p->tlb_policy)),
-    microTLBEnable(p->utlb_enable),
-    mainTLBEnable(p->tlb_enable),
+    microTLB(new SMMUTLB(p.utlb_entries,
+                         p.utlb_assoc,
+                         p.utlb_policy)),
+    mainTLB(new SMMUTLB(p.tlb_entries,
+                        p.tlb_assoc,
+                        p.tlb_policy)),
+    microTLBEnable(p.utlb_enable),
+    mainTLBEnable(p.tlb_enable),
     devicePortSem(1),
-    microTLBSem(p->utlb_slots),
-    mainTLBSem(p->tlb_slots),
-    microTLBLat(p->utlb_lat),
-    mainTLBLat(p->tlb_lat),
+    microTLBSem(p.utlb_slots),
+    mainTLBSem(p.tlb_slots),
+    microTLBLat(p.utlb_lat),
+    mainTLBLat(p.tlb_lat),
     devicePort(new SMMUDevicePort(csprintf("%s.device_port",
                                             name()), *this)),
     atsDevicePort(name() + ".atsDevicePort", *this),
     atsMemPort(name() + ".atsMemPort", *this),
-    portWidth(p->port_width),
-    wrBufSlotsRemaining(p->wrbuf_slots),
-    xlateSlotsRemaining(p->xlate_slots),
+    portWidth(p.port_width),
+    wrBufSlotsRemaining(p.wrbuf_slots),
+    xlateSlotsRemaining(p.xlate_slots),
     pendingMemAccesses(0),
-    prefetchEnable(p->prefetch_enable),
+    prefetchEnable(p.prefetch_enable),
     prefetchReserveLastWay(
-        p->prefetch_reserve_last_way),
+        p.prefetch_reserve_last_way),
     deviceNeedsRetry(false),
     atsDeviceNeedsRetry(false),
     sendDeviceRetryEvent(*this),
@@ -254,14 +254,14 @@ DrainState
 SMMUv3DeviceInterface::drain()
 {
     // Wait until all SMMU translations are completed
-    if (xlateSlotsRemaining < params()->xlate_slots) {
+    if (xlateSlotsRemaining < params().xlate_slots) {
         return DrainState::Draining;
     }
     return DrainState::Drained;
 }
 
 SMMUv3DeviceInterface*
-SMMUv3DeviceInterfaceParams::create()
+SMMUv3DeviceInterfaceParams::create() const
 {
-    return new SMMUv3DeviceInterface(this);
+    return new SMMUv3DeviceInterface(*this);
 }
index 64dcc57980a89ad9740949581afc3060346852ab..c324a6aa6d395debe96b1420901b4724a1685034 100644 (file)
@@ -118,7 +118,7 @@ class SMMUv3DeviceInterface : public ClockedObject
     Port& getPort(const std::string &name, PortID id) override;
 
   public:
-    SMMUv3DeviceInterface(const SMMUv3DeviceInterfaceParams *p);
+    SMMUv3DeviceInterface(const SMMUv3DeviceInterfaceParams &p);
 
     ~SMMUv3DeviceInterface()
     {
@@ -126,10 +126,10 @@ class SMMUv3DeviceInterface : public ClockedObject
         delete mainTLB;
     }
 
-    const SMMUv3DeviceInterfaceParams *
+    const SMMUv3DeviceInterfaceParams &
     params() const
     {
-        return static_cast<const SMMUv3DeviceInterfaceParams *>(_params);
+        return static_cast<const SMMUv3DeviceInterfaceParams &>(_params);
     }
 
     DrainState drain() override;
index 9fea813d090b9a35da390e3410495598770ea9ba..ddae9dfcb1ff93f072fcc8adf1fb645893f5a13c 100644 (file)
@@ -46,9 +46,9 @@
 #include "mem/packet.hh"
 #include "mem/packet_access.hh"
 
-A9GlobalTimer::A9GlobalTimer(Params *p)
-    : BasicPioDevice(p, 0x1C), gic(p->gic),
-      global_timer(name() + ".globaltimer", this, p->int_num)
+A9GlobalTimer::A9GlobalTimer(const Params &p)
+    : BasicPioDevice(p, 0x1C), gic(p.gic),
+      global_timer(name() + ".globaltimer", this, p.int_num)
 {
 }
 
@@ -310,7 +310,7 @@ A9GlobalTimer::unserialize(CheckpointIn &cp)
 }
 
 A9GlobalTimer *
-A9GlobalTimerParams::create()
+A9GlobalTimerParams::create() const
 {
-    return new A9GlobalTimer(this);
+    return new A9GlobalTimer(*this);
 }
index 31cb640eeb8c5c74797afcf5ca826b5276a76925..aea02cb57dab66dedeb58769943cd9da8b9991c7 100644 (file)
@@ -143,16 +143,16 @@ class A9GlobalTimer : public BasicPioDevice
 
   public:
     typedef A9GlobalTimerParams Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
     /**
       * The constructor for RealView just registers itself with the MMU.
       * @param p params structure
       */
-    A9GlobalTimer(Params *p);
+    A9GlobalTimer(const Params &p);
 
     /**
      * Handle a read to the device
index 5ba0b16baf3466450072dfbfffbd01f0457f0cf6..0ae7777a2325f170d79f2a587498284fd135cc51 100644 (file)
@@ -46,7 +46,7 @@
 #include "mem/packet.hh"
 #include "mem/packet_access.hh"
 
-CpuLocalTimer::CpuLocalTimer(Params *p)
+CpuLocalTimer::CpuLocalTimer(const Params &p)
     : BasicPioDevice(p, 0x38)
 {
 }
@@ -54,7 +54,7 @@ CpuLocalTimer::CpuLocalTimer(Params *p)
 void
 CpuLocalTimer::init()
 {
-   auto p = params();
+   const auto &p = params();
    // Initialize the timer registers for each per cpu timer
    for (int i = 0; i < sys->threads.size(); i++) {
         ThreadContext* tc = sys->threads[i];
@@ -63,8 +63,8 @@ CpuLocalTimer::init()
 
         localTimer.emplace_back(
             new Timer(oss.str(), this,
-                      p->int_timer->get(tc),
-                      p->int_watchdog->get(tc)));
+                      p.int_timer->get(tc),
+                      p.int_watchdog->get(tc)));
     }
 
     BasicPioDevice::init();
@@ -441,7 +441,7 @@ CpuLocalTimer::unserialize(CheckpointIn &cp)
 }
 
 CpuLocalTimer *
-CpuLocalTimerParams::create()
+CpuLocalTimerParams::create() const
 {
-    return new CpuLocalTimer(this);
+    return new CpuLocalTimer(*this);
 }
index a963311591d1e146e5f25e0e53eba1aa4d4e0f29..6966d3e8396e1cfa9b573e8e92ca138e95d24406 100644 (file)
@@ -157,16 +157,16 @@ class CpuLocalTimer : public BasicPioDevice
 
   public:
     typedef CpuLocalTimerParams Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
     /**
       * The constructor for RealView just registers itself with the MMU.
       * @param p params structure
       */
-    CpuLocalTimer(Params *p);
+    CpuLocalTimer(const Params &p);
 
     /** Inits the local timers */
     void init() override;
index dbfa7ff60da541915fddca91a685fdcf91cdbf3a..52bc992583f3c73487f40e84b067678abbeccc88 100644 (file)
 #include "mem/packet.hh"
 #include "mem/packet_access.hh"
 
-Sp804::Sp804(Params *p)
+Sp804::Sp804(const Params &p)
     : AmbaPioDevice(p, 0x1000),
-      timer0(name() + ".timer0", this, p->int0->get(), p->clock0),
-      timer1(name() + ".timer1", this, p->int1->get(), p->clock1)
+      timer0(name() + ".timer0", this, p.int0->get(), p.clock0),
+      timer1(name() + ".timer1", this, p.int1->get(), p.clock1)
 {
 }
 
@@ -282,7 +282,7 @@ Sp804::unserialize(CheckpointIn &cp)
 }
 
 Sp804 *
-Sp804Params::create()
+Sp804Params::create() const
 {
-    return new Sp804(this);
+    return new Sp804(*this);
 }
index 1054b6a73d00074d4cb7628b07dc931329edfbe6..34df8aac7d1591bf57c42f523cccea33c72f4a46 100644 (file)
@@ -130,16 +130,16 @@ class Sp804 : public AmbaPioDevice
 
   public:
     typedef Sp804Params Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
     /**
       * The constructor for RealView just registers itself with the MMU.
       * @param p params structure
       */
-    Sp804(Params *p);
+    Sp804(const Params &p);
 
     /**
      * Handle a read to the device
index b11eb7bc751a5e6b9cebd392bf474a0d50d0a65b..b9943c34a6e2924fc05f590d1830ee423a73f9cc 100644 (file)
 /**
  * Constructor and destructor functions of UFSHCM device
  */
-UFSHostDevice::UFSSCSIDevice::UFSSCSIDevice(const UFSHostDeviceParamsp,
+UFSHostDevice::UFSSCSIDevice::UFSSCSIDevice(const UFSHostDeviceParams &p,
                              uint32_t lun_id, const Callback &transfer_cb,
                              const Callback &read_cb):
     SimObject(p),
-    flashDisk(p->image[lun_id]),
-    flashDevice(p->internalflash[lun_id]),
-    blkSize(p->img_blk_size),
-    lunAvail(p->image.size()),
+    flashDisk(p.image[lun_id]),
+    flashDevice(p.internalflash[lun_id]),
+    blkSize(p.img_blk_size),
+    lunAvail(p.image.size()),
     diskSize(flashDisk->size()),
     capacityLower((diskSize - 1) & 0xffffffff),
     capacityUpper((diskSize - SectorSize) >> 32),
@@ -712,15 +712,15 @@ UFSHostDevice::UFSSCSIDevice::writeFlash(uint8_t* writeaddr, uint64_t offset,
  * Constructor for the UFS Host device
  */
 
-UFSHostDevice::UFSHostDevice(const UFSHostDeviceParamsp) :
+UFSHostDevice::UFSHostDevice(const UFSHostDeviceParams &p) :
     DmaDevice(p),
-    pioAddr(p->pio_addr),
+    pioAddr(p.pio_addr),
     pioSize(0x0FFF),
-    pioDelay(p->pio_latency),
-    intNum(p->int_num),
-    gic(p->gic),
-    lunAvail(p->image.size()),
-    UFSSlots(p->ufs_slots - 1),
+    pioDelay(p.pio_latency),
+    intNum(p.int_num),
+    gic(p.gic),
+    lunAvail(p.image.size()),
+    UFSSlots(p.ufs_slots - 1),
     readPendingNum(0),
     writePendingNum(0),
     activeDoorbells(0),
@@ -757,9 +757,9 @@ UFSHostDevice::UFSHostDevice(const UFSHostDeviceParams* p) :
  */
 
 UFSHostDevice*
-UFSHostDeviceParams::create()
+UFSHostDeviceParams::create() const
 {
-    return new UFSHostDevice(this);
+    return new UFSHostDevice(*this);
 }
 
 
index d3ea35da624bca46c253f31b7999d389cb3767f7..2a6d1bf96dd6dec4745b6a7087bba4d8fb0b4b35 100644 (file)
@@ -170,7 +170,7 @@ class UFSHostDevice : public DmaDevice
 {
   public:
 
-    UFSHostDevice(const UFSHostDeviceParamsp);
+    UFSHostDevice(const UFSHostDeviceParams &p);
 
     DrainState drain() override;
     void checkDrain();
@@ -541,7 +541,7 @@ class UFSHostDevice : public DmaDevice
         /**
          * Constructor and destructor
          */
-        UFSSCSIDevice(const UFSHostDeviceParamsp, uint32_t lun_id,
+        UFSSCSIDevice(const UFSHostDeviceParams &p, uint32_t lun_id,
                       const Callback &transfer_cb, const Callback &read_cb);
         ~UFSSCSIDevice();
 
index 154256179569a182d29b0b13113667253b935c52..daf29d92f8b48b6bff751d19efb485296b22d297 100644 (file)
 #include "mem/packet.hh"
 #include "mem/packet_access.hh"
 
-VGic::VGic(const Params *p)
-    : PioDevice(p), gicvIIDR(p->gicv_iidr), platform(p->platform),
-      gic(p->gic), vcpuAddr(p->vcpu_addr), hvAddr(p->hv_addr),
-      pioDelay(p->pio_delay), maintInt(p->maint_int)
+VGic::VGic(const Params &p)
+    : PioDevice(p), gicvIIDR(p.gicv_iidr), platform(p.platform),
+      gic(p.gic), vcpuAddr(p.vcpu_addr), hvAddr(p.hv_addr),
+      pioDelay(p.pio_delay), maintInt(p.maint_int)
 {
     for (int x = 0; x < VGIC_CPU_MAX; x++) {
         postVIntEvent[x] = new EventFunctionWrapper(
@@ -554,7 +554,7 @@ VGic::vcpuIntData::unserialize(CheckpointIn &cp)
 }
 
 VGic *
-VGicParams::create()
+VGicParams::create() const
 {
-    return new VGic(this);
+    return new VGic(*this);
 }
index e8bf9162de93b7d6fbc9b1702cfb7ef19e5a337a..7a79f43cffddc9acc869d626c871979d6124c2c0 100644 (file)
@@ -186,13 +186,13 @@ class VGic : public PioDevice
     struct std::array<vcpuIntData, VGIC_CPU_MAX>  vcpuData;
 
   public:
-   typedef VGicParams Params;
-   const Params *
+    typedef VGicParams Params;
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
-    VGic(const Params *p);
+    VGic(const Params &p);
     ~VGic();
 
     AddrRangeList getAddrRanges() const override;
index 2dfbc61a3b64a2fcfa738133affaabacb6d1de5d..b402f1c191a61b7d65708e83e49ce7a5615d2a5e 100644 (file)
 #include "mem/packet_access.hh"
 #include "params/MmioVirtIO.hh"
 
-MmioVirtIO::MmioVirtIO(const MmioVirtIOParams *params)
-    : BasicPioDevice(params, params->pio_size),
+MmioVirtIO::MmioVirtIO(const MmioVirtIOParams &params)
+    : BasicPioDevice(params, params.pio_size),
       hostFeaturesSelect(0), guestFeaturesSelect(0), pageSize(0),
-      interruptStatus(0), vio(*params->vio),
-      interrupt(params->interrupt->get())
+      interruptStatus(0), vio(*params.vio),
+      interrupt(params.interrupt->get())
 {
     fatal_if(!interrupt, "No MMIO VirtIO interrupt specified\n");
 
@@ -276,7 +276,7 @@ MmioVirtIO::setInterrupts(uint32_t value)
 
 
 MmioVirtIO *
-MmioVirtIOParams::create()
+MmioVirtIOParams::create() const
 {
-    return new MmioVirtIO(this);
+    return new MmioVirtIO(*this);
 }
index d42d92a44a701a3d4c6dbbcbf812128c1dde7dde..3ac695057e00aded4f30f30e94b087489e71f2bf 100644 (file)
@@ -47,7 +47,7 @@ struct MmioVirtIOParams;
 class MmioVirtIO : public BasicPioDevice
 {
   public:
-    MmioVirtIO(const MmioVirtIOParams *params);
+    MmioVirtIO(const MmioVirtIOParams &params);
     virtual ~MmioVirtIO();
 
   protected: // BasicPioDevice
index 32417e02060f09e9af7ed3f4703491ea0e31eb90..3ae4e64fd0f0e1f14e12c41f4efa47af38ebe411 100644 (file)
@@ -42,7 +42,7 @@
 #include "mem/packet_access.hh"
 #include "params/Sp805.hh"
 
-Sp805::Sp805(Sp805Params const* params)
+Sp805::Sp805(const Sp805Params &params)
     : AmbaIntDevice(params, 0x1000),
       timeoutInterval(0xffffffff),
       timeoutStartTick(MaxTick),
@@ -261,7 +261,7 @@ Sp805::unserialize(CheckpointIn &cp)
 }
 
 Sp805 *
-Sp805Params::create()
+Sp805Params::create() const
 {
-    return new Sp805(this);
+    return new Sp805(*this);
 }
index 4d9094d175ada8297acbef12ca4839b660e3621b..a64e4c9f61b9d68ab60af20c77cc5bff0fa729bb 100644 (file)
@@ -52,7 +52,7 @@ class Sp805Params;
 class Sp805 : public AmbaIntDevice
 {
   public:
-    Sp805(Sp805Params const* params);
+    Sp805(const Sp805Params &params);
 
     void serialize(CheckpointOut &cp) const override;
     void unserialize(CheckpointIn &cp) override;
index 48cdff3fac5101eb96381d1ab989ea5b48f1341e..104699f2007282e789cee4e025fb0ffb17e098b4 100644 (file)
@@ -40,8 +40,8 @@
 
 using namespace std;
 
-BadDevice::BadDevice(Params *p)
-    : BasicPioDevice(p, 0x10), devname(p->devicename)
+BadDevice::BadDevice(const Params &p)
+    : BasicPioDevice(p, 0x10), devname(p.devicename)
 {
 }
 
@@ -58,7 +58,7 @@ BadDevice::write(PacketPtr pkt)
 }
 
 BadDevice *
-BadDeviceParams::create()
+BadDeviceParams::create() const
 {
-    return new BadDevice(this);
+    return new BadDevice(*this);
 }
index 2772ce49b762f822e195c38ae902d917bfc2b122..2040b4907b5686bcbfbc9766447d7b4ef9247b02 100644 (file)
@@ -52,10 +52,10 @@ class BadDevice : public BasicPioDevice
     typedef BadDeviceParams Params;
 
   protected:
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
   public:
@@ -64,7 +64,7 @@ class BadDevice : public BasicPioDevice
       * @param p object parameters
       * @param a base address of the write
       */
-    BadDevice(Params *p);
+    BadDevice(const Params &p);
 
     virtual Tick read(PacketPtr pkt);
     virtual Tick write(PacketPtr pkt);
index ace8f2c86430d07aed0896009898552f49035093..0caf2b94715b39534a25a66cb9988b40b130d133 100644 (file)
@@ -114,8 +114,8 @@ DmaPort::recvTimingResp(PacketPtr pkt)
     return true;
 }
 
-DmaDevice::DmaDevice(const Params *p)
-    : PioDevice(p), dmaPort(this, sys, p->sid, p->ssid)
+DmaDevice::DmaDevice(const Params &p)
+    : PioDevice(p), dmaPort(this, sys, p.sid, p.ssid)
 { }
 
 void
index 2369fc471d63141743f284beb4950b2911d622a9..53ceff0e7849d4dac0c53535bb1ddcfcce2dc541 100644 (file)
@@ -169,7 +169,7 @@ class DmaDevice : public PioDevice
 
   public:
     typedef DmaDeviceParams Params;
-    DmaDevice(const Params *p);
+    DmaDevice(const Params &p);
     virtual ~DmaDevice() { }
 
     void dmaWrite(Addr addr, int size, Event *event, uint8_t *data,
index c396e435be4c38c670e92b84c8ca83037bf95d7c..7e8f1b7bda03fd9f09a69f2e3ee2ab44bd71e773 100644 (file)
@@ -48,7 +48,7 @@ class HSADevice : public DmaDevice
   public:
     typedef HSADeviceParams Params;
 
-    HSADevice(const Params *p) : DmaDevice(p), hsaPP(p->hsapp)
+    HSADevice(const Params &p) : DmaDevice(p), hsaPP(p.hsapp)
     {
         assert(hsaPP);
         hsaPP->setDevice(this);
index b165af4b16d791de2f17fab7ee68826956be5185..190213a8b3fbef7bd732b5a4ec9ef5222c145a97 100644 (file)
@@ -45,8 +45,8 @@
 #include "sim/proxy_ptr.hh"
 #include "sim/syscall_emul_buf.hh"
 
-HSADriver::HSADriver(HSADriverParams *p)
-    : EmulatedDriver(p), device(p->device), queueId(0)
+HSADriver::HSADriver(const HSADriverParams &p)
+    : EmulatedDriver(p), device(p.device), queueId(0)
 {
 }
 
index 19982f75746cb27e1e67680bcbc130d8425b28aa..429deddcaaa4acc247cf814d37088523b573cc25 100644 (file)
@@ -62,7 +62,7 @@ class ThreadContext;
 class HSADriver : public EmulatedDriver
 {
   public:
-    HSADriver(HSADriverParams *p);
+    HSADriver(const HSADriverParams &p);
 
     int open(ThreadContext *tc, int mode, int flags);
     Addr mmap(ThreadContext *tc, Addr start, uint64_t length,
index 89399ced001ce0f8b4d8fd3bb8d24eab7c742332..fef70df73a88008fbe8d1453b6adcfd0b237950a 100644 (file)
@@ -70,12 +70,12 @@ HSAPP_EVENT_DESCRIPTION_GENERATOR(CmdQueueCmdDmaEvent)
 HSAPP_EVENT_DESCRIPTION_GENERATOR(QueueProcessEvent)
 HSAPP_EVENT_DESCRIPTION_GENERATOR(DepSignalsReadDmaEvent)
 
-HSAPacketProcessor::HSAPacketProcessor(const Params *p)
-    : DmaDevice(p), numHWQueues(p->numHWQueues), pioAddr(p->pioAddr),
-      pioSize(PAGE_SIZE), pioDelay(10), pktProcessDelay(p->pktProcessDelay)
+HSAPacketProcessor::HSAPacketProcessor(const Params &p)
+    : DmaDevice(p), numHWQueues(p.numHWQueues), pioAddr(p.pioAddr),
+      pioSize(PAGE_SIZE), pioDelay(10), pktProcessDelay(p.pktProcessDelay)
 {
     DPRINTF(HSAPacketProcessor, "%s:\n", __FUNCTION__);
-    hwSchdlr = new HWScheduler(this, p->wakeupDelay);
+    hwSchdlr = new HWScheduler(this, p.wakeupDelay);
     regdQList.resize(numHWQueues);
     for (int i = 0; i < numHWQueues; i++) {
         regdQList[i] = new RQLEntry(this, i);
@@ -658,9 +658,9 @@ AQLRingBuffer::allocEntry(uint32_t nBufReq)
 }
 
 HSAPacketProcessor *
-HSAPacketProcessorParams::create()
+HSAPacketProcessorParams::create() const
 {
-    return new HSAPacketProcessor(this);
+    return new HSAPacketProcessor(*this);
 }
 
 void
index 551d09ddaaab0eb447aabed290bcd8164139d496..27df90a85124b5eac89042f271c51ab66f21512f 100644 (file)
@@ -309,7 +309,7 @@ class HSAPacketProcessor: public DmaDevice
     const Tick pktProcessDelay;
 
     typedef HSAPacketProcessorParams Params;
-    HSAPacketProcessor(const Params *p);
+    HSAPacketProcessor(const Params &p);
     ~HSAPacketProcessor();
     void setDeviceQueueDesc(uint64_t hostReadIndexPointer,
                             uint64_t basePointer,
index 7a8d1a056b1a11815be1a63018fc1f0065c2b85d..4c6fe00dc83a9480fe86f7710ccc524a926dc3cb 100644 (file)
@@ -51,13 +51,13 @@ using std::map;
  * 4KB - see e.g.
  * http://infocenter.arm.com/help/topic/com.arm.doc.dui0440b/Bbajihec.html
  */
-I2CBus::I2CBus(const I2CBusParams *p)
+I2CBus::I2CBus(const I2CBusParams &p)
     : BasicPioDevice(p, 0x1000), scl(1), sda(1), state(IDLE), currBit(7),
       i2cAddr(0x00), message(0x00)
 {
-    vector<I2CDevice*> devs = p->devices;
+    vector<I2CDevice*> devs = p.devices;
 
-    for (auto d : p->devices) {
+    for (auto d : p.devices) {
         devices[d->i2cAddr()] = d;
     }
 }
@@ -236,7 +236,7 @@ I2CBus::unserialize(CheckpointIn &cp)
 }
 
 I2CBus*
-I2CBusParams::create()
+I2CBusParams::create() const
 {
-    return new I2CBus(this);
+    return new I2CBus(*this);
 }
index 3fcdcf3e54ff850d012d2dadbf2e9aa06c232e31..9f92a6d442076a77eded2d0ae9d5fa29a1a3fe9a 100644 (file)
@@ -140,7 +140,7 @@ class I2CBus : public BasicPioDevice
 
   public:
 
-    I2CBus(const I2CBusParamsp);
+    I2CBus(const I2CBusParams &p);
 
     Tick read(PacketPtr pkt) override;
     Tick write(PacketPtr pkt) override;
index 71d1aca85d21c5dcdc5c45e4b2a1fcc564321891..6d76e784e0dfb02334bee958573e6a68f07a58eb 100644 (file)
@@ -56,8 +56,8 @@ class I2CDevice : public SimObject
 
   public:
 
-    I2CDevice(const I2CDeviceParamsp)
-        : SimObject(p), _addr(p->i2c_addr)
+    I2CDevice(const I2CDeviceParams &p)
+        : SimObject(p), _addr(p.i2c_addr)
     { }
 
     virtual ~I2CDevice() { }
index 5eb2b13409c6efee5d7be5c4cbf4c9c7a107cdfc..ae6a5e3c29abf9c570cc9c83d5a1e80f1deeeb14 100644 (file)
@@ -44,8 +44,8 @@
 #include "debug/AddrRanges.hh"
 #include "sim/system.hh"
 
-PioDevice::PioDevice(const Params *p)
-    : ClockedObject(p), sys(p->system), pioPort(this)
+PioDevice::PioDevice(const Params &p)
+    : ClockedObject(p), sys(p.system), pioPort(this)
 {}
 
 PioDevice::~PioDevice()
@@ -69,9 +69,9 @@ PioDevice::getPort(const std::string &if_name, PortID idx)
     return ClockedObject::getPort(if_name, idx);
 }
 
-BasicPioDevice::BasicPioDevice(const Params *p, Addr size)
-    : PioDevice(p), pioAddr(p->pio_addr), pioSize(size),
-      pioDelay(p->pio_latency)
+BasicPioDevice::BasicPioDevice(const Params &p, Addr size)
+    : PioDevice(p), pioAddr(p.pio_addr), pioSize(size),
+      pioDelay(p.pio_latency)
 {}
 
 AddrRangeList
index 842b98de3b4d7b9f170481384496494072f59ea8..fe74828e9938dc4664bc9654919be852f535c781 100644 (file)
@@ -129,13 +129,13 @@ class PioDevice : public ClockedObject
 
   public:
     typedef PioDeviceParams Params;
-    PioDevice(const Params *p);
+    PioDevice(const Params &p);
     virtual ~PioDevice();
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     void init() override;
@@ -161,12 +161,12 @@ class BasicPioDevice : public PioDevice
 
   public:
     typedef BasicPioDeviceParams Params;
-    BasicPioDevice(const Params *p, Addr size);
+    BasicPioDevice(const Params &p, Addr size);
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     /**
index 49e1df5636627e79f5564198f8e238c5f996ca4c..bcce9198157039e70b1b3dd4a82af8972cee4503 100644 (file)
 
 using namespace std;
 
-IsaFake::IsaFake(Params *p)
-    : BasicPioDevice(p, p->ret_bad_addr ? 0 : p->pio_size)
+IsaFake::IsaFake(const Params &p)
+    : BasicPioDevice(p, p.ret_bad_addr ? 0 : p.pio_size)
 {
-    retData8 = p->ret_data8;
-    retData16 = p->ret_data16;
-    retData32 = p->ret_data32;
-    retData64 = p->ret_data64;
+    retData8 = p.ret_data8;
+    retData16 = p.ret_data16;
+    retData32 = p.ret_data32;
+    retData64 = p.ret_data64;
 }
 
 Tick
@@ -54,10 +54,10 @@ IsaFake::read(PacketPtr pkt)
 {
     pkt->makeAtomicResponse();
 
-    if (params()->warn_access != "")
+    if (params().warn_access != "")
         warn("Device %s accessed by read to address %#x size=%d\n",
                 name(), pkt->getAddr(), pkt->getSize());
-    if (params()->ret_bad_addr) {
+    if (params().ret_bad_addr) {
         DPRINTF(IsaFake, "read to bad address va=%#x size=%d\n",
                 pkt->getAddr(), pkt->getSize());
         pkt->setBadAddress();
@@ -79,7 +79,7 @@ IsaFake::read(PacketPtr pkt)
              pkt->setLE(retData8);
              break;
           default:
-             if (params()->fake_mem)
+             if (params().fake_mem)
                  std::memset(pkt->getPtr<uint8_t>(), 0, pkt->getSize());
              else
                  panic("invalid access size! Device being accessed by cache?\n");
@@ -92,7 +92,7 @@ Tick
 IsaFake::write(PacketPtr pkt)
 {
     pkt->makeAtomicResponse();
-    if (params()->warn_access != "") {
+    if (params().warn_access != "") {
         uint64_t data;
         switch (pkt->getSize()) {
           case sizeof(uint64_t):
@@ -113,7 +113,7 @@ IsaFake::write(PacketPtr pkt)
         warn("Device %s accessed by write to address %#x size=%d data=%#x\n",
                 name(), pkt->getAddr(), pkt->getSize(), data);
     }
-    if (params()->ret_bad_addr) {
+    if (params().ret_bad_addr) {
         DPRINTF(IsaFake, "write to bad address va=%#x size=%d \n",
                 pkt->getAddr(), pkt->getSize());
         pkt->setBadAddress();
@@ -121,7 +121,7 @@ IsaFake::write(PacketPtr pkt)
         DPRINTF(IsaFake, "write - va=%#x size=%d \n",
                 pkt->getAddr(), pkt->getSize());
 
-        if (params()->update_data) {
+        if (params().update_data) {
             switch (pkt->getSize()) {
               case sizeof(uint64_t):
                 retData64 = pkt->getLE<uint64_t>();
@@ -144,7 +144,7 @@ IsaFake::write(PacketPtr pkt)
 }
 
 IsaFake *
-IsaFakeParams::create()
+IsaFakeParams::create() const
 {
-    return new IsaFake(this);
+    return new IsaFake(*this);
 }
index 43dfd35a94f6a43ef96bff51fea37001c101aa96..75b120b9f58ca0ceb4b8424464299a341b431c2f 100644 (file)
@@ -56,16 +56,16 @@ class IsaFake : public BasicPioDevice
 
   public:
     typedef IsaFakeParams Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
     /**
       * The constructor for Isa Fake just registers itself with the MMU.
       * @param p params structure
       */
-    IsaFake(Params *p);
+    IsaFake(const Params &p);
 
     /**
      * This read always returns -1.
index 61aa7ce4874bbddc37c8f2ba5d35e0984ffae9c8..eddc83867364bcbb878bbead4c9ce61cd6afe005 100644 (file)
@@ -45,8 +45,8 @@
 
 using namespace std;
 
-Malta::Malta(const Params *p)
-    : Platform(p), system(p->system)
+Malta::Malta(const Params &p)
+    : Platform(p), system(p.system)
 {
     for (int i = 0; i < Malta::Max_CPUs; i++)
         intr_sum_type[i] = 0;
@@ -97,7 +97,7 @@ Malta::unserialize(CheckpointIn &cp)
 }
 
 Malta *
-MaltaParams::create()
+MaltaParams::create() const
 {
-    return new Malta(this);
+    return new Malta(*this);
 }
index d424dafa5ce92546690740089c74cfdb4d7c9504..e99bd30c89e3ac5b9fd21545acf4daf69cdd72ae 100644 (file)
@@ -79,7 +79,7 @@ class Malta : public Platform
      * @param intctrl pointer to the interrupt controller
      */
     typedef MaltaParams Params;
-    Malta(const Params *p);
+    Malta(const Params &p);
 
     /**
      * Cause the cpu to post a serial interrupt to the CPU.
index c8fe7a8400685d7247abdcf41f90379c4cfc8749..81ec67ecae7c0ffbfc0c127a3a50d6ea7a332500 100644 (file)
@@ -50,8 +50,8 @@
 
 using namespace std;
 
-MaltaCChip::MaltaCChip(Params *p)
-    : BasicPioDevice(p, 0xfffffff), malta(p->malta)
+MaltaCChip::MaltaCChip(const Params &p)
+    : BasicPioDevice(p, 0xfffffff), malta(p.malta)
 {
     warn("MaltaCCHIP::MaltaCChip() not implemented.");
 
@@ -141,8 +141,8 @@ MaltaCChip::unserialize(CheckpointIn &cp)
 }
 
 MaltaCChip *
-MaltaCChipParams::create()
+MaltaCChipParams::create() const
 {
-    return new MaltaCChip(this);
+    return new MaltaCChip(*this);
 }
 
index 8df14cc938961dd733b304b0c9be2adc7d55ea43..0841ba87d551257231d96e6f5c4605b361e64ad5 100644 (file)
@@ -78,10 +78,10 @@ class MaltaCChip : public BasicPioDevice
   public:
     typedef MaltaCChipParams Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     /**
@@ -89,7 +89,7 @@ class MaltaCChip : public BasicPioDevice
      * device register to 0.
      * @param p params struct
      */
-    MaltaCChip(Params *p);
+    MaltaCChip(const Params &p);
 
     Tick read(PacketPtr pkt) override;
 
index ef671a645930e3e95b3c7d3d4b9fd911608ee05c..0f979cc650762ef3673e1199c97c61ca7d220b4a 100644 (file)
 
 using namespace std;
 
-MaltaIO::RTC::RTC(const string &name, const MaltaIOParams *p)
-    : MC146818(p->malta, name, p->time, p->year_is_bcd, p->frequency),
-      malta(p->malta)
+MaltaIO::RTC::RTC(const string &name, const MaltaIOParams &p)
+    : MC146818(p.malta, name, p.time, p.year_is_bcd, p.frequency),
+      malta(p.malta)
 {
 }
 
-MaltaIO::MaltaIO(const Params *p)
-    : BasicPioDevice(p, 0x100), malta(p->malta),
-      pitimer(this, p->name + "pitimer"), rtc(p->name + ".rtc", p)
+MaltaIO::MaltaIO(const Params &p)
+    : BasicPioDevice(p, 0x100), malta(p.malta),
+      pitimer(this, p.name + "pitimer"), rtc(p.name + ".rtc", p)
 {
     // set the back pointer from malta to myself
     malta->io = this;
@@ -74,7 +74,7 @@ MaltaIO::MaltaIO(const Params *p)
 Tick
 MaltaIO::frequency() const
 {
-    return SimClock::Frequency / params()->frequency;
+    return SimClock::Frequency / params().frequency;
 }
 
 Tick
@@ -145,7 +145,7 @@ MaltaIO::startup()
 }
 
 MaltaIO *
-MaltaIOParams::create()
+MaltaIOParams::create() const
 {
-    return new MaltaIO(this);
+    return new MaltaIO(*this);
 }
index ef3b7a58cc24ec132d62e0025a6d5e837f962c85..96dfb1d818e4ff2d396e5650f27a4d8b3699a884 100644 (file)
@@ -53,7 +53,7 @@ class MaltaIO : public BasicPioDevice
     {
       public:
         Malta *malta;
-        RTC(const std::string &name, const MaltaIOParams *p);
+        RTC(const std::string &name, const MaltaIOParams &p);
 
       protected:
         void handleEvent()
@@ -104,17 +104,17 @@ class MaltaIO : public BasicPioDevice
 
     typedef MaltaIOParams Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     /**
      * Initialize all the data for devices supported by Malta I/O.
      * @param p pointer to Params struct
      */
-    MaltaIO(const Params *p);
+    MaltaIO(const Params &p);
 
     Tick read(PacketPtr pkt) override;
     Tick write(PacketPtr pkt) override;
index 2d3034952580643d1f7703cef9c1fd2533612a41..b55763308f97e4ecc08bacd519afb4b45617cf2f 100644 (file)
 
 using namespace std;
 
-DistEtherLink::DistEtherLink(const Params *p)
-    : SimObject(p), linkDelay(p->delay)
+DistEtherLink::DistEtherLink(const Params &p)
+    : SimObject(p), linkDelay(p.delay)
 {
     DPRINTF(DistEthernet,"DistEtherLink::DistEtherLink() "
-            "link delay:%llu ticksPerByte:%f\n", p->delay, p->speed);
+            "link delay:%llu ticksPerByte:%f\n", p.delay, p.speed);
 
-    txLink = new TxLink(name() + ".link0", this, p->speed, p->delay_var,
-                        p->dump);
-    rxLink = new RxLink(name() + ".link1", this, p->delay, p->dump);
+    txLink = new TxLink(name() + ".link0", this, p.speed, p.delay_var,
+                        p.dump);
+    rxLink = new RxLink(name() + ".link1", this, p.delay, p.dump);
 
     Tick sync_repeat;
-    if (p->sync_repeat != 0) {
-        if (p->sync_repeat != p->delay)
+    if (p.sync_repeat != 0) {
+        if (p.sync_repeat != p.delay)
             warn("DistEtherLink(): sync_repeat is %lu and linkdelay is %lu",
-                 p->sync_repeat, p->delay);
-        sync_repeat = p->sync_repeat;
+                 p.sync_repeat, p.delay);
+        sync_repeat = p.sync_repeat;
     } else {
-        sync_repeat = p->delay;
+        sync_repeat = p.delay;
     }
 
     // create the dist (TCP) interface to talk to the peer gem5 processes.
-    distIface = new TCPIface(p->server_name, p->server_port,
-                             p->dist_rank, p->dist_size,
-                             p->sync_start, sync_repeat, this,
-                             p->dist_sync_on_pseudo_op, p->is_switch,
-                             p->num_nodes);
+    distIface = new TCPIface(p.server_name, p.server_port,
+                             p.dist_rank, p.dist_size,
+                             p.sync_start, sync_repeat, this,
+                             p.dist_sync_on_pseudo_op, p.is_switch,
+                             p.num_nodes);
 
     localIface = new LocalIface(name() + ".int0", txLink, rxLink, distIface);
 }
@@ -254,9 +254,9 @@ DistEtherLink::LocalIface::LocalIface(const std::string &name,
 }
 
 DistEtherLink *
-DistEtherLinkParams::create()
+DistEtherLinkParams::create() const
 {
-    return new DistEtherLink(this);
+    return new DistEtherLink(*this);
 }
 
 
index e4c4e42ae39d1355edfcae677b5ff3c29ffde769..bb99c33bee18272deb64c821c41590bf631d5540 100644 (file)
@@ -212,13 +212,13 @@ class DistEtherLink : public SimObject
 
   public:
     typedef DistEtherLinkParams Params;
-    DistEtherLink(const Params *p);
+    DistEtherLink(const Params &p);
     ~DistEtherLink();
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     Port &getPort(const std::string &if_name,
index 3b36d7b193808259ef083b9aadf70cdd33334057..c92074cbfe1a0fd1dbf1c5e48ac823e6435a6724 100644 (file)
 
 using namespace std;
 
-EtherBus::EtherBus(const Params *p)
-    : SimObject(p), ticksPerByte(p->speed), loopback(p->loopback),
+EtherBus::EtherBus(const Params &p)
+    : SimObject(p), ticksPerByte(p.speed), loopback(p.loopback),
       event([this]{ txDone(); }, "ethernet bus completion"),
-      sender(0), dump(p->dump)
+      sender(0), dump(p.dump)
 {
 }
 
@@ -107,7 +107,7 @@ EtherBus::send(EtherInt *sndr, EthPacketPtr &pkt)
 }
 
 EtherBus *
-EtherBusParams::create()
+EtherBusParams::create() const
 {
-    return new EtherBus(this);
+    return new EtherBus(*this);
 }
index 0fae90e2c4b0f915433b717adc4d381ffaee8f62..c5cd4e6bf9c2a3b10e133fa374f9376a19fedcfe 100644 (file)
@@ -56,13 +56,13 @@ class EtherBus : public SimObject
 
   public:
     typedef EtherBusParams Params;
-    EtherBus(const Params *p);
+    EtherBus(const Params &p);
     virtual ~EtherBus() {}
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     void txDone();
index a54853eecf769710f9a81fda38623a3580822fc1..9aef1a5fc825fff17f5f58e2c9f516e4cfda88ca 100644 (file)
@@ -46,14 +46,14 @@ class EtherDevice : public PciDevice
 {
   public:
     typedef EtherDeviceParams Params;
-    EtherDevice(const Params *params)
+    EtherDevice(const Params &params)
         : PciDevice(params)
     {}
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
   public:
@@ -124,14 +124,14 @@ class EtherDevice : public PciDevice
 class EtherDevBase : public EtherDevice
 {
   public:
-    EtherDevBase(const EtherDevBaseParams *params)
+    EtherDevBase(const EtherDevBaseParams &params)
         : EtherDevice(params)
     {}
 
-    const EtherDevBaseParams *
+    const EtherDevBaseParams &
     params() const
     {
-        return dynamic_cast<const EtherDevBaseParams *>(_params);
+        return dynamic_cast<const EtherDevBaseParams &>(_params);
     }
 
 };
index 75736945a982121d352082691c24ef12fdbaa4d2..6e0ae6316e277dea5e92f6463ad70401d4b71c92 100644 (file)
@@ -42,9 +42,9 @@
 
 using std::string;
 
-EtherDump::EtherDump(const Params *p)
-    : SimObject(p), stream(simout.create(p->file, true)->stream()),
-      maxlen(p->maxlen)
+EtherDump::EtherDump(const Params &p)
+    : SimObject(p), stream(simout.create(p.file, true)->stream()),
+      maxlen(p.maxlen)
 {
 }
 
@@ -102,7 +102,7 @@ EtherDump::dumpPacket(EthPacketPtr &packet)
 }
 
 EtherDump *
-EtherDumpParams::create()
+EtherDumpParams::create() const
 {
-    return new EtherDump(this);
+    return new EtherDump(*this);
 }
index 70f5f3629eb35ff70a97a67744ffc14a5341c6ab..594e56db84ed5cca8f21870ec30b80a8cfc2f5a0 100644 (file)
@@ -52,7 +52,7 @@ class EtherDump : public SimObject
 
   public:
     typedef EtherDumpParams Params;
-    EtherDump(const Params *p);
+    EtherDump(const Params &p);
 
     inline void dump(EthPacketPtr &pkt) { dumpPacket(pkt); }
 };
index 36c46f42023a84d3a09492546e4d696601107109..9bbe000fd7627729a4fe0596fb366e9307cdf947 100644 (file)
 
 using namespace std;
 
-EtherLink::EtherLink(const Params *p)
+EtherLink::EtherLink(const Params &p)
     : SimObject(p)
 {
-    link[0] = new Link(name() + ".link0", this, 0, p->speed,
-                       p->delay, p->delay_var, p->dump);
-    link[1] = new Link(name() + ".link1", this, 1, p->speed,
-                       p->delay, p->delay_var, p->dump);
+    link[0] = new Link(name() + ".link0", this, 0, p.speed,
+                       p.delay, p.delay_var, p.dump);
+    link[1] = new Link(name() + ".link1", this, 1, p.speed,
+                       p.delay, p.delay_var, p.dump);
 
     interface[0] = new Interface(name() + ".int0", link[0], link[1]);
     interface[1] = new Interface(name() + ".int1", link[1], link[0]);
@@ -266,7 +266,7 @@ EtherLink::Link::unserialize(const string &base, CheckpointIn &cp)
 }
 
 EtherLink *
-EtherLinkParams::create()
+EtherLinkParams::create() const
 {
-    return new EtherLink(this);
+    return new EtherLink(*this);
 }
index da031fa80403aa1ba973d9ef0c3a18452ffc1b63..036d7defc42868ebd5554e238787ffdf4456e859 100644 (file)
@@ -140,13 +140,13 @@ class EtherLink : public SimObject
 
   public:
     typedef EtherLinkParams Params;
-    EtherLink(const Params *p);
+    EtherLink(const Params &p);
     virtual ~EtherLink();
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     Port &getPort(const std::string &if_name,
index 972cf56b85146335a9bd6cf799e7cd1b02885fde..19c3bdba89b8b69bc38defbfd4651d94204a21aa 100644 (file)
 
 using namespace std;
 
-EtherSwitch::EtherSwitch(const Params *p)
-    : SimObject(p), ttl(p->time_to_live)
+EtherSwitch::EtherSwitch(const Params &p)
+    : SimObject(p), ttl(p.time_to_live)
 {
-    for (int i = 0; i < p->port_interface_connection_count; ++i) {
+    for (int i = 0; i < p.port_interface_connection_count; ++i) {
         std::string interfaceName = csprintf("%s.interface%d", name(), i);
         Interface *interface = new Interface(interfaceName, this,
-                                        p->output_buffer_size, p->delay,
-                                        p->delay_var, p->fabric_speed, i);
+                                        p.output_buffer_size, p.delay,
+                                        p.delay_var, p.fabric_speed, i);
         interfaces.push_back(interface);
     }
 }
@@ -347,7 +347,7 @@ EtherSwitch::Interface::PortFifo::unserialize(CheckpointIn &cp)
 }
 
 EtherSwitch *
-EtherSwitchParams::create()
+EtherSwitchParams::create() const
 {
-    return new EtherSwitch(this);
+    return new EtherSwitch(*this);
 }
index 6eda171f62837af4a39cebaff6e6870f4ed36935..7f7f36e96825b771bdfd2d6c5443e6efe1151ca9 100644 (file)
@@ -50,12 +50,13 @@ class EtherSwitch : public SimObject
   public:
     typedef EtherSwitchParams Params;
 
-    EtherSwitch(const Params *p);
+    EtherSwitch(const Params &p);
     ~EtherSwitch();
 
-    const Params * params() const
+    const Params &
+    params() const
     {
-        return dynamic_cast<const Params*>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     Port &getPort(const std::string &if_name,
index f4aba21aa91ace98206f75072ca7ae5138d9e2eb..79a4f94911a7cf4e87db8ec6c31501d9e50f1cda 100644 (file)
@@ -89,8 +89,8 @@ class TapEvent : public PollEvent
     }
 };
 
-EtherTapBase::EtherTapBase(const Params *p)
-    : SimObject(p), buflen(p->bufsz), dump(p->dump), event(NULL),
+EtherTapBase::EtherTapBase(const Params &p)
+    : SimObject(p), buflen(p.bufsz), dump(p.dump), event(NULL),
       interface(NULL),
       txEvent([this]{ retransmit(); }, "EtherTapBase retransmit")
 {
@@ -283,12 +283,12 @@ TapListener::accept()
 }
 
 
-EtherTapStub::EtherTapStub(const Params *p) : EtherTapBase(p), socket(-1)
+EtherTapStub::EtherTapStub(const Params &p) : EtherTapBase(p), socket(-1)
 {
     if (ListenSocket::allDisabled())
         fatal("All listeners are disabled! EtherTapStub can't work!");
 
-    listener = new TapListener(this, p->port);
+    listener = new TapListener(this, p.port);
     listener->listen();
 }
 
@@ -399,16 +399,16 @@ EtherTapStub::sendReal(const void *data, size_t len)
 
 #if USE_TUNTAP
 
-EtherTap::EtherTap(const Params *p) : EtherTapBase(p)
+EtherTap::EtherTap(const Params &p) : EtherTapBase(p)
 {
-    int fd = open(p->tun_clone_device.c_str(), O_RDWR | O_NONBLOCK);
+    int fd = open(p.tun_clone_device.c_str(), O_RDWR | O_NONBLOCK);
     if (fd < 0)
-        panic("Couldn't open %s.\n", p->tun_clone_device);
+        panic("Couldn't open %s.\n", p.tun_clone_device);
 
     struct ifreq ifr;
     memset(&ifr, 0, sizeof(ifr));
     ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
-    strncpy(ifr.ifr_name, p->tap_device_name.c_str(), IFNAMSIZ - 1);
+    strncpy(ifr.ifr_name, p.tap_device_name.c_str(), IFNAMSIZ - 1);
 
     if (ioctl(fd, TUNSETIFF, (void *)&ifr) < 0)
         panic("Failed to access tap device %s.\n", ifr.ifr_name);
@@ -470,15 +470,15 @@ EtherTap::sendReal(const void *data, size_t len)
 }
 
 EtherTap *
-EtherTapParams::create()
+EtherTapParams::create() const
 {
-    return new EtherTap(this);
+    return new EtherTap(*this);
 }
 
 #endif
 
 EtherTapStub *
-EtherTapStubParams::create()
+EtherTapStubParams::create() const
 {
-    return new EtherTapStub(this);
+    return new EtherTapStub(*this);
 }
index af185f18d83eb28ddad0db85870ae6e1248230b2..d79cd0a394dfc8fed6138f346e90509be0a59d47 100644 (file)
@@ -57,13 +57,13 @@ class EtherTapBase : public SimObject
 {
   public:
     typedef EtherTapBaseParams Params;
-    EtherTapBase(const Params *p);
+    EtherTapBase(const Params &p);
     virtual ~EtherTapBase();
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     void serialize(CheckpointOut &cp) const override;
@@ -137,13 +137,13 @@ class EtherTapStub : public EtherTapBase
 {
   public:
     typedef EtherTapStubParams Params;
-    EtherTapStub(const Params *p);
+    EtherTapStub(const Params &p);
     ~EtherTapStub();
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     void serialize(CheckpointOut &cp) const override;
@@ -172,13 +172,13 @@ class EtherTap : public EtherTapBase
 {
   public:
     typedef EtherTapParams Params;
-    EtherTap(const Params *p);
+    EtherTap(const Params &p);
     ~EtherTap();
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
 
index 950a9b7a35f7e8e5cc9affdb756fd60518df0713..72af0c9b7b4ecc2ce7f1aad877adec8f6765a470 100644 (file)
 using namespace iGbReg;
 using namespace Net;
 
-IGbE::IGbE(const Params *p)
+IGbE::IGbE(const Params &p)
     : EtherDevice(p), etherInt(NULL),
-      rxFifo(p->rx_fifo_size), txFifo(p->tx_fifo_size), inTick(false),
+      rxFifo(p.rx_fifo_size), txFifo(p.tx_fifo_size), inTick(false),
       rxTick(false), txTick(false), txFifoTick(false), rxDmaPacket(false),
-      pktOffset(0), fetchDelay(p->fetch_delay), wbDelay(p->wb_delay),
-      fetchCompDelay(p->fetch_comp_delay), wbCompDelay(p->wb_comp_delay),
-      rxWriteDelay(p->rx_write_delay), txReadDelay(p->tx_read_delay),
+      pktOffset(0), fetchDelay(p.fetch_delay), wbDelay(p.wb_delay),
+      fetchCompDelay(p.fetch_comp_delay), wbCompDelay(p.wb_comp_delay),
+      rxWriteDelay(p.rx_write_delay), txReadDelay(p.tx_read_delay),
       rdtrEvent([this]{ rdtrProcess(); }, name()),
       radvEvent([this]{ radvProcess(); }, name()),
       tadvEvent([this]{ tadvProcess(); }, name()),
       tidvEvent([this]{ tidvProcess(); }, name()),
       tickEvent([this]{ tick(); }, name()),
       interEvent([this]{ delayIntEvent(); }, name()),
-      rxDescCache(this, name()+".RxDesc", p->rx_desc_cache_size),
-      txDescCache(this, name()+".TxDesc", p->tx_desc_cache_size),
+      rxDescCache(this, name()+".RxDesc", p.rx_desc_cache_size),
+      txDescCache(this, name()+".TxDesc", p.tx_desc_cache_size),
       lastInterrupt(0)
 {
     etherInt = new IGbEInt(name() + ".int", this);
@@ -106,7 +106,7 @@ IGbE::IGbE(const Params *p)
     memset(&flash, 0, EEPROM_SIZE*2);
 
     // Set the MAC address
-    memcpy(flash, p->hardware_address.bytes(), ETH_ADDR_LEN);
+    memcpy(flash, p.hardware_address.bytes(), ETH_ADDR_LEN);
     for (int x = 0; x < ETH_ADDR_LEN/2; x++)
         flash[x] = htobe(flash[x]);
 
@@ -119,7 +119,7 @@ IGbE::IGbE(const Params *p)
     flash[EEPROM_SIZE-1] = htobe((uint16_t)(EEPROM_CSUM - csum));
 
     // Store the MAC address as queue ID
-    macAddr = p->hardware_address;
+    macAddr = p.hardware_address;
 
     rxFifo.clear();
     txFifo.clear();
@@ -468,10 +468,10 @@ IGbE::write(PacketPtr pkt)
             regs.mdic.data(0x796D); // link up
             break;
           case PHY_PID:
-            regs.mdic.data(params()->phy_pid);
+            regs.mdic.data(params().phy_pid);
             break;
           case PHY_EPID:
-            regs.mdic.data(params()->phy_epid);
+            regs.mdic.data(params().phy_epid);
             break;
           case PHY_GSTATUS:
             regs.mdic.data(0x7C00);
@@ -2465,7 +2465,7 @@ IGbE::unserialize(CheckpointIn &cp)
 }
 
 IGbE *
-IGbEParams::create()
+IGbEParams::create() const
 {
-    return new IGbE(this);
+    return new IGbE(*this);
 }
index 5d9761bedab79a1a630d411fd72f2555e71ab3ea..070edde828ac6db5d590e05da43b5d8a7c248689 100644 (file)
@@ -470,12 +470,13 @@ class IGbE : public EtherDevice
 
   public:
     typedef IGbEParams Params;
-    const Params *
-    params() const {
-        return dynamic_cast<const Params *>(_params);
+    const Params &
+    params() const
+    {
+        return dynamic_cast<const Params &>(_params);
     }
 
-    IGbE(const Params *params);
+    IGbE(const Params &params);
     ~IGbE();
     void init() override;
 
index 71f449a4d8abe3b2bdf6ec394cf6b70c41e77f47..af9d02e07e2c8b96f839aee2406dea2f3892fc85 100644 (file)
@@ -91,9 +91,9 @@ using namespace Net;
 //
 // NSGigE PCI Device
 //
-NSGigE::NSGigE(Params *p)
+NSGigE::NSGigE(const Params &p)
     : EtherDevBase(p), ioEnable(false),
-      txFifo(p->tx_fifo_size), rxFifo(p->rx_fifo_size),
+      txFifo(p.tx_fifo_size), rxFifo(p.rx_fifo_size),
       txPacket(0), rxPacket(0), txPacketBufPtr(NULL), rxPacketBufPtr(NULL),
       txXferLen(0), rxXferLen(0), rxDmaFree(false), txDmaFree(false),
       txState(txIdle), txEnable(false), CTDD(false), txHalt(false),
@@ -102,25 +102,25 @@ NSGigE::NSGigE(Params *p)
       rxFragPtr(0), rxDescCnt(0), rxDmaState(dmaIdle), extstsEnable(false),
       eepromState(eepromStart), eepromClk(false), eepromBitsToRx(0),
       eepromOpcode(0), eepromAddress(0), eepromData(0),
-      dmaReadDelay(p->dma_read_delay), dmaWriteDelay(p->dma_write_delay),
-      dmaReadFactor(p->dma_read_factor), dmaWriteFactor(p->dma_write_factor),
+      dmaReadDelay(p.dma_read_delay), dmaWriteDelay(p.dma_write_delay),
+      dmaReadFactor(p.dma_read_factor), dmaWriteFactor(p.dma_write_factor),
       rxDmaData(NULL), rxDmaAddr(0), rxDmaLen(0),
       txDmaData(NULL), txDmaAddr(0), txDmaLen(0),
       rxDmaReadEvent([this]{ rxDmaReadDone(); }, name()),
       rxDmaWriteEvent([this]{ rxDmaWriteDone(); }, name()),
       txDmaReadEvent([this]{ txDmaReadDone(); }, name()),
       txDmaWriteEvent([this]{ txDmaWriteDone(); }, name()),
-      dmaDescFree(p->dma_desc_free), dmaDataFree(p->dma_data_free),
-      txDelay(p->tx_delay), rxDelay(p->rx_delay),
+      dmaDescFree(p.dma_desc_free), dmaDataFree(p.dma_data_free),
+      txDelay(p.tx_delay), rxDelay(p.rx_delay),
       rxKickTick(0),
       rxKickEvent([this]{ rxKick(); }, name()),
       txKickTick(0),
       txKickEvent([this]{ txKick(); }, name()),
       txEvent([this]{ txEventTransmit(); }, name()),
-      rxFilterEnable(p->rx_filter),
+      rxFilterEnable(p.rx_filter),
       acceptBroadcast(false), acceptMulticast(false), acceptUnicast(false),
       acceptPerfect(false), acceptArp(false), multicastHashEnable(false),
-      intrDelay(p->intr_delay), intrTick(0), cpuPendingIntr(false),
+      intrDelay(p.intr_delay), intrTick(0), cpuPendingIntr(false),
       intrEvent(0), interface(0)
 {
 
@@ -128,7 +128,7 @@ NSGigE::NSGigE(Params *p)
     interface = new NSGigEInt(name() + ".int0", this);
 
     regsReset();
-    memcpy(&rom.perfectMatch, p->hardware_address.bytes(), ETH_ADDR_LEN);
+    memcpy(&rom.perfectMatch, p.hardware_address.bytes(), ETH_ADDR_LEN);
 
     memset(&rxDesc32, 0, sizeof(rxDesc32));
     memset(&txDesc32, 0, sizeof(txDesc32));
@@ -383,11 +383,11 @@ NSGigE::read(PacketPtr pkt)
 
           case M5REG:
             reg = 0;
-            if (params()->rx_thread)
+            if (params().rx_thread)
                 reg |= M5REG_RX_THREAD;
-            if (params()->tx_thread)
+            if (params().tx_thread)
                 reg |= M5REG_TX_THREAD;
-            if (params()->rss)
+            if (params().rss)
                 reg |= M5REG_RSS;
             break;
 
@@ -2367,7 +2367,7 @@ NSGigE::unserialize(CheckpointIn &cp)
 }
 
 NSGigE *
-NSGigEParams::create()
+NSGigEParams::create() const
 {
-    return new NSGigE(this);
+    return new NSGigE(*this);
 }
index d5018932ac852e73f1d902c8b2e02a60933527fa..f8789622344be5c035f88b1ea770789e77876b32 100644 (file)
@@ -327,11 +327,13 @@ class NSGigE : public EtherDevBase
 
   public:
     typedef NSGigEParams Params;
-    const Params *params() const {
-        return dynamic_cast<const Params *>(_params);
+    const Params &
+    params() const
+    {
+        return dynamic_cast<const Params &>(_params);
     }
 
-    NSGigE(Params *params);
+    NSGigE(const Params &params);
     ~NSGigE();
 
     Port &getPort(const std::string &if_name,
index bc6fdbd5a43a389e7bc739ded77601f77d806c0d..85eba6f076b31fa354e140dddb3884508dbe1ae1 100644 (file)
@@ -71,27 +71,26 @@ const char *TxStateStrings[] =
 //
 // Sinic PCI Device
 //
-Base::Base(const Params *p)
+Base::Base(const Params &p)
     : EtherDevBase(p), rxEnable(false), txEnable(false),
-      intrDelay(p->intr_delay), intrTick(0), cpuIntrEnable(false),
+      intrDelay(p.intr_delay), intrTick(0), cpuIntrEnable(false),
       cpuPendingIntr(false), intrEvent(0), interface(NULL)
 {
 }
 
-Device::Device(const Params *p)
+Device::Device(const Params &p)
     : Base(p), rxUnique(0), txUnique(0),
-      virtualRegs(p->virtual_count < 1 ? 1 : p->virtual_count),
-      rxFifo(p->rx_fifo_size), txFifo(p->tx_fifo_size),
+      virtualRegs(p.virtual_count < 1 ? 1 : p.virtual_count),
+      rxFifo(p.rx_fifo_size), txFifo(p.tx_fifo_size),
       rxKickTick(0), txKickTick(0),
       txEvent([this]{ txEventTransmit(); }, name()),
       rxDmaEvent([this]{ rxDmaDone(); }, name()),
       txDmaEvent([this]{ txDmaDone(); }, name()),
-      dmaReadDelay(p->dma_read_delay), dmaReadFactor(p->dma_read_factor),
-      dmaWriteDelay(p->dma_write_delay), dmaWriteFactor(p->dma_write_factor)
+      dmaReadDelay(p.dma_read_delay), dmaReadFactor(p.dma_read_factor),
+      dmaWriteDelay(p.dma_write_delay), dmaWriteFactor(p.dma_write_factor)
 {
     interface = new Interface(name() + ".int0", this);
     reset();
-
 }
 
 Device::~Device()
@@ -611,36 +610,36 @@ Device::reset()
     memset(&regs, 0, sizeof(regs));
 
     regs.Config = 0;
-    if (params()->rx_thread)
+    if (params().rx_thread)
         regs.Config |= Config_RxThread;
-    if (params()->tx_thread)
+    if (params().tx_thread)
         regs.Config |= Config_TxThread;
-    if (params()->rss)
+    if (params().rss)
         regs.Config |= Config_RSS;
-    if (params()->zero_copy)
+    if (params().zero_copy)
         regs.Config |= Config_ZeroCopy;
-    if (params()->delay_copy)
+    if (params().delay_copy)
         regs.Config |= Config_DelayCopy;
-    if (params()->virtual_addr)
+    if (params().virtual_addr)
         regs.Config |= Config_Vaddr;
 
-    if (params()->delay_copy && params()->zero_copy)
+    if (params().delay_copy && params().zero_copy)
         panic("Can't delay copy and zero copy");
 
     regs.IntrMask = Intr_Soft | Intr_RxHigh | Intr_RxPacket | Intr_TxLow;
-    regs.RxMaxCopy = params()->rx_max_copy;
-    regs.TxMaxCopy = params()->tx_max_copy;
-    regs.ZeroCopySize = params()->zero_copy_size;
-    regs.ZeroCopyMark = params()->zero_copy_threshold;
-    regs.VirtualCount = params()->virtual_count;
-    regs.RxMaxIntr = params()->rx_max_intr;
-    regs.RxFifoSize = params()->rx_fifo_size;
-    regs.TxFifoSize = params()->tx_fifo_size;
-    regs.RxFifoLow = params()->rx_fifo_low_mark;
-    regs.TxFifoLow = params()->tx_fifo_threshold;
-    regs.RxFifoHigh = params()->rx_fifo_threshold;
-    regs.TxFifoHigh = params()->tx_fifo_high_mark;
-    regs.HwAddr = params()->hardware_address;
+    regs.RxMaxCopy = params().rx_max_copy;
+    regs.TxMaxCopy = params().tx_max_copy;
+    regs.ZeroCopySize = params().zero_copy_size;
+    regs.ZeroCopyMark = params().zero_copy_threshold;
+    regs.VirtualCount = params().virtual_count;
+    regs.RxMaxIntr = params().rx_max_intr;
+    regs.RxFifoSize = params().rx_fifo_size;
+    regs.TxFifoSize = params().tx_fifo_size;
+    regs.RxFifoLow = params().rx_fifo_low_mark;
+    regs.TxFifoLow = params().tx_fifo_threshold;
+    regs.RxFifoHigh = params().rx_fifo_threshold;
+    regs.TxFifoHigh = params().tx_fifo_high_mark;
+    regs.HwAddr = params().hardware_address;
 
     if (regs.RxMaxCopy < regs.ZeroCopyMark)
         panic("Must be able to copy at least as many bytes as the threshold");
@@ -1500,7 +1499,7 @@ Device::unserialize(CheckpointIn &cp)
 } // namespace Sinic
 
 Sinic::Device *
-SinicParams::create()
+SinicParams::create() const
 {
-    return new Sinic::Device(this);
+    return new Sinic::Device(*this);
 }
index becfce03e5f40b6eeff4a7cbbb4be74a828b28fc..1cf7f6f41fb798eca4a472055633e3d8a132240a 100644 (file)
@@ -77,8 +77,8 @@ class Base : public EtherDevBase
  */
   public:
     typedef SinicParams Params;
-    const Params *params() const { return (const Params *)_params; }
-    Base(const Params *p);
+    const Params &params() const { return (const Params &)_params; }
+    Base(const Params &p);
 };
 
 class Device : public Base
@@ -290,7 +290,7 @@ class Device : public Base
     void unserialize(CheckpointIn &cp) override;
 
   public:
-    Device(const Params *p);
+    Device(const Params &p);
     ~Device();
 };
 
index d526a3e0785daa19ba0cba0457746e045e6f694c..7576bff2ef885a5dbabb88d3245dae86a43e8672 100644 (file)
 
 using namespace CopyEngineReg;
 
-CopyEngine::CopyEngine(const Params *p)
+CopyEngine::CopyEngine(const Params &p)
     : PciDevice(p)
 {
     // All Reg regs are initialized to 0 by default
-    regs.chanCount = p->ChanCnt;
-    regs.xferCap = findMsbSet(p->XferCap);
+    regs.chanCount = p.ChanCnt;
+    regs.xferCap = findMsbSet(p.XferCap);
     regs.attnStatus = 0;
 
     if (regs.chanCount > 64)
@@ -78,8 +78,8 @@ CopyEngine::CopyEngine(const Params *p)
 CopyEngine::CopyEngineChannel::CopyEngineChannel(CopyEngine *_ce, int cid)
     : cePort(_ce, _ce->sys),
       ce(_ce), channelId(cid), busy(false), underReset(false),
-      refreshNext(false), latBeforeBegin(ce->params()->latBeforeBegin),
-      latAfterCompletion(ce->params()->latAfterCompletion),
+      refreshNext(false), latBeforeBegin(ce->params().latBeforeBegin),
+      latAfterCompletion(ce->params().latAfterCompletion),
       completionDataReg(0), nextState(Idle),
       fetchCompleteEvent([this]{ fetchDescComplete(); }, name()),
       addrCompleteEvent([this]{ fetchAddrComplete(); }, name()),
@@ -94,7 +94,7 @@ CopyEngine::CopyEngineChannel::CopyEngineChannel(CopyEngine *_ce, int cid)
 
         curDmaDesc = new DmaDesc;
         memset(curDmaDesc, 0, sizeof(DmaDesc));
-        copyBuffer = new uint8_t[ce->params()->XferCap];
+        copyBuffer = new uint8_t[ce->params().XferCap];
 }
 
 CopyEngine::~CopyEngine()
@@ -675,7 +675,7 @@ CopyEngine::CopyEngineChannel::serialize(CheckpointOut &cp) const
     int nextState = this->nextState;
     SERIALIZE_SCALAR(nextState);
     arrayParamOut(cp, "curDmaDesc", (uint8_t*)curDmaDesc, sizeof(DmaDesc));
-    SERIALIZE_ARRAY(copyBuffer, ce->params()->XferCap);
+    SERIALIZE_ARRAY(copyBuffer, ce->params().XferCap);
     cr.serialize(cp);
 
 }
@@ -693,7 +693,7 @@ CopyEngine::CopyEngineChannel::unserialize(CheckpointIn &cp)
     UNSERIALIZE_SCALAR(nextState);
     this->nextState = (ChannelState)nextState;
     arrayParamIn(cp, "curDmaDesc", (uint8_t*)curDmaDesc, sizeof(DmaDesc));
-    UNSERIALIZE_ARRAY(copyBuffer, ce->params()->XferCap);
+    UNSERIALIZE_ARRAY(copyBuffer, ce->params().XferCap);
     cr.unserialize(cp);
 
 }
@@ -732,7 +732,7 @@ CopyEngine::CopyEngineChannel::drainResume()
 }
 
 CopyEngine *
-CopyEngineParams::create()
+CopyEngineParams::create() const
 {
-    return new CopyEngine(this);
+    return new CopyEngine(*this);
 }
index eba8a9bb867b79d6b65faeca6ee2a4022dd60bb1..ec3c45304fc86ed1b9d12f5bc606989504e99881 100644 (file)
@@ -150,12 +150,12 @@ class CopyEngine : public PciDevice
 
   public:
     typedef CopyEngineParams Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
-    CopyEngine(const Params *params);
+    CopyEngine(const Params &params);
     ~CopyEngine();
 
     void regStats() override;
index 1158bc6efa52d8a20e1b2e0be678075d0344f257..be132212a549bbf709216f46d485b1a05f9d732b 100644 (file)
 #include "sim/byteswap.hh"
 #include "sim/core.hh"
 
-PciDevice::PciDevice(const PciDeviceParams *p)
+PciDevice::PciDevice(const PciDeviceParams &p)
     : DmaDevice(p),
-      _busAddr(p->pci_bus, p->pci_dev, p->pci_func),
-      PMCAP_BASE(p->PMCAPBaseOffset),
-      PMCAP_ID_OFFSET(p->PMCAPBaseOffset+PMCAP_ID),
-      PMCAP_PC_OFFSET(p->PMCAPBaseOffset+PMCAP_PC),
-      PMCAP_PMCS_OFFSET(p->PMCAPBaseOffset+PMCAP_PMCS),
-      MSICAP_BASE(p->MSICAPBaseOffset),
-      MSIXCAP_BASE(p->MSIXCAPBaseOffset),
-      MSIXCAP_ID_OFFSET(p->MSIXCAPBaseOffset+MSIXCAP_ID),
-      MSIXCAP_MXC_OFFSET(p->MSIXCAPBaseOffset+MSIXCAP_MXC),
-      MSIXCAP_MTAB_OFFSET(p->MSIXCAPBaseOffset+MSIXCAP_MTAB),
-      MSIXCAP_MPBA_OFFSET(p->MSIXCAPBaseOffset+MSIXCAP_MPBA),
-      PXCAP_BASE(p->PXCAPBaseOffset),
-
-      hostInterface(p->host->registerDevice(this, _busAddr,
-                                            (PciIntPin)p->InterruptPin)),
-      pioDelay(p->pio_latency),
-      configDelay(p->config_latency)
+      _busAddr(p.pci_bus, p.pci_dev, p.pci_func),
+      PMCAP_BASE(p.PMCAPBaseOffset),
+      PMCAP_ID_OFFSET(p.PMCAPBaseOffset+PMCAP_ID),
+      PMCAP_PC_OFFSET(p.PMCAPBaseOffset+PMCAP_PC),
+      PMCAP_PMCS_OFFSET(p.PMCAPBaseOffset+PMCAP_PMCS),
+      MSICAP_BASE(p.MSICAPBaseOffset),
+      MSIXCAP_BASE(p.MSIXCAPBaseOffset),
+      MSIXCAP_ID_OFFSET(p.MSIXCAPBaseOffset+MSIXCAP_ID),
+      MSIXCAP_MXC_OFFSET(p.MSIXCAPBaseOffset+MSIXCAP_MXC),
+      MSIXCAP_MTAB_OFFSET(p.MSIXCAPBaseOffset+MSIXCAP_MTAB),
+      MSIXCAP_MPBA_OFFSET(p.MSIXCAPBaseOffset+MSIXCAP_MPBA),
+      PXCAP_BASE(p.PXCAPBaseOffset),
+
+      hostInterface(p.host->registerDevice(this, _busAddr,
+                                            (PciIntPin)p.InterruptPin)),
+      pioDelay(p.pio_latency),
+      configDelay(p.config_latency)
 {
-    fatal_if(p->InterruptPin >= 5,
-             "Invalid PCI interrupt '%i' specified.", p->InterruptPin);
-
-    config.vendor = htole(p->VendorID);
-    config.device = htole(p->DeviceID);
-    config.command = htole(p->Command);
-    config.status = htole(p->Status);
-    config.revision = htole(p->Revision);
-    config.progIF = htole(p->ProgIF);
-    config.subClassCode = htole(p->SubClassCode);
-    config.classCode = htole(p->ClassCode);
-    config.cacheLineSize = htole(p->CacheLineSize);
-    config.latencyTimer = htole(p->LatencyTimer);
-    config.headerType = htole(p->HeaderType);
-    config.bist = htole(p->BIST);
-
-    config.baseAddr[0] = htole(p->BAR0);
-    config.baseAddr[1] = htole(p->BAR1);
-    config.baseAddr[2] = htole(p->BAR2);
-    config.baseAddr[3] = htole(p->BAR3);
-    config.baseAddr[4] = htole(p->BAR4);
-    config.baseAddr[5] = htole(p->BAR5);
-    config.cardbusCIS = htole(p->CardbusCIS);
-    config.subsystemVendorID = htole(p->SubsystemVendorID);
-    config.subsystemID = htole(p->SubsystemID);
-    config.expansionROM = htole(p->ExpansionROM);
-    config.capabilityPtr = htole(p->CapabilityPtr);
+    fatal_if(p.InterruptPin >= 5,
+             "Invalid PCI interrupt '%i' specified.", p.InterruptPin);
+
+    config.vendor = htole(p.VendorID);
+    config.device = htole(p.DeviceID);
+    config.command = htole(p.Command);
+    config.status = htole(p.Status);
+    config.revision = htole(p.Revision);
+    config.progIF = htole(p.ProgIF);
+    config.subClassCode = htole(p.SubClassCode);
+    config.classCode = htole(p.ClassCode);
+    config.cacheLineSize = htole(p.CacheLineSize);
+    config.latencyTimer = htole(p.LatencyTimer);
+    config.headerType = htole(p.HeaderType);
+    config.bist = htole(p.BIST);
+
+    config.baseAddr[0] = htole(p.BAR0);
+    config.baseAddr[1] = htole(p.BAR1);
+    config.baseAddr[2] = htole(p.BAR2);
+    config.baseAddr[3] = htole(p.BAR3);
+    config.baseAddr[4] = htole(p.BAR4);
+    config.baseAddr[5] = htole(p.BAR5);
+    config.cardbusCIS = htole(p.CardbusCIS);
+    config.subsystemVendorID = htole(p.SubsystemVendorID);
+    config.subsystemID = htole(p.SubsystemID);
+    config.expansionROM = htole(p.ExpansionROM);
+    config.capabilityPtr = htole(p.CapabilityPtr);
     // Zero out the 7 bytes of reserved space in the PCI Config space register.
     bzero(config.reserved, 7*sizeof(uint8_t));
-    config.interruptLine = htole(p->InterruptLine);
-    config.interruptPin = htole(p->InterruptPin);
-    config.minimumGrant = htole(p->MinimumGrant);
-    config.maximumLatency = htole(p->MaximumLatency);
+    config.interruptLine = htole(p.InterruptLine);
+    config.interruptPin = htole(p.InterruptPin);
+    config.minimumGrant = htole(p.MinimumGrant);
+    config.maximumLatency = htole(p.MaximumLatency);
 
     // Initialize the capability lists
     // These structs are bitunions, meaning the data is stored in host
     // endianess and must be converted to Little Endian when accessed
     // by the guest
     // PMCAP
-    pmcap.pid = (uint16_t)p->PMCAPCapId; // pid.cid
-    pmcap.pid |= (uint16_t)p->PMCAPNextCapability << 8; //pid.next
-    pmcap.pc = p->PMCAPCapabilities;
-    pmcap.pmcs = p->PMCAPCtrlStatus;
+    pmcap.pid = (uint16_t)p.PMCAPCapId; // pid.cid
+    pmcap.pid |= (uint16_t)p.PMCAPNextCapability << 8; //pid.next
+    pmcap.pc = p.PMCAPCapabilities;
+    pmcap.pmcs = p.PMCAPCtrlStatus;
 
     // MSICAP
-    msicap.mid = (uint16_t)p->MSICAPCapId; //mid.cid
-    msicap.mid |= (uint16_t)p->MSICAPNextCapability << 8; //mid.next
-    msicap.mc = p->MSICAPMsgCtrl;
-    msicap.ma = p->MSICAPMsgAddr;
-    msicap.mua = p->MSICAPMsgUpperAddr;
-    msicap.md = p->MSICAPMsgData;
-    msicap.mmask = p->MSICAPMaskBits;
-    msicap.mpend = p->MSICAPPendingBits;
+    msicap.mid = (uint16_t)p.MSICAPCapId; //mid.cid
+    msicap.mid |= (uint16_t)p.MSICAPNextCapability << 8; //mid.next
+    msicap.mc = p.MSICAPMsgCtrl;
+    msicap.ma = p.MSICAPMsgAddr;
+    msicap.mua = p.MSICAPMsgUpperAddr;
+    msicap.md = p.MSICAPMsgData;
+    msicap.mmask = p.MSICAPMaskBits;
+    msicap.mpend = p.MSICAPPendingBits;
 
     // MSIXCAP
-    msixcap.mxid = (uint16_t)p->MSIXCAPCapId; //mxid.cid
-    msixcap.mxid |= (uint16_t)p->MSIXCAPNextCapability << 8; //mxid.next
-    msixcap.mxc = p->MSIXMsgCtrl;
-    msixcap.mtab = p->MSIXTableOffset;
-    msixcap.mpba = p->MSIXPbaOffset;
+    msixcap.mxid = (uint16_t)p.MSIXCAPCapId; //mxid.cid
+    msixcap.mxid |= (uint16_t)p.MSIXCAPNextCapability << 8; //mxid.next
+    msixcap.mxc = p.MSIXMsgCtrl;
+    msixcap.mtab = p.MSIXTableOffset;
+    msixcap.mpba = p.MSIXPbaOffset;
 
     // allocate MSIX structures if MSIXCAP_BASE
     // indicates the MSIXCAP is being used by having a
@@ -172,35 +172,35 @@ PciDevice::PciDevice(const PciDeviceParams *p)
     }
 
     // PXCAP
-    pxcap.pxid = (uint16_t)p->PXCAPCapId; //pxid.cid
-    pxcap.pxid |= (uint16_t)p->PXCAPNextCapability << 8; //pxid.next
-    pxcap.pxcap = p->PXCAPCapabilities;
-    pxcap.pxdcap = p->PXCAPDevCapabilities;
-    pxcap.pxdc = p->PXCAPDevCtrl;
-    pxcap.pxds = p->PXCAPDevStatus;
-    pxcap.pxlcap = p->PXCAPLinkCap;
-    pxcap.pxlc = p->PXCAPLinkCtrl;
-    pxcap.pxls = p->PXCAPLinkStatus;
-    pxcap.pxdcap2 = p->PXCAPDevCap2;
-    pxcap.pxdc2 = p->PXCAPDevCtrl2;
-
-    BARSize[0] = p->BAR0Size;
-    BARSize[1] = p->BAR1Size;
-    BARSize[2] = p->BAR2Size;
-    BARSize[3] = p->BAR3Size;
-    BARSize[4] = p->BAR4Size;
-    BARSize[5] = p->BAR5Size;
-
-    legacyIO[0] = p->BAR0LegacyIO;
-    legacyIO[1] = p->BAR1LegacyIO;
-    legacyIO[2] = p->BAR2LegacyIO;
-    legacyIO[3] = p->BAR3LegacyIO;
-    legacyIO[4] = p->BAR4LegacyIO;
-    legacyIO[5] = p->BAR5LegacyIO;
+    pxcap.pxid = (uint16_t)p.PXCAPCapId; //pxid.cid
+    pxcap.pxid |= (uint16_t)p.PXCAPNextCapability << 8; //pxid.next
+    pxcap.pxcap = p.PXCAPCapabilities;
+    pxcap.pxdcap = p.PXCAPDevCapabilities;
+    pxcap.pxdc = p.PXCAPDevCtrl;
+    pxcap.pxds = p.PXCAPDevStatus;
+    pxcap.pxlcap = p.PXCAPLinkCap;
+    pxcap.pxlc = p.PXCAPLinkCtrl;
+    pxcap.pxls = p.PXCAPLinkStatus;
+    pxcap.pxdcap2 = p.PXCAPDevCap2;
+    pxcap.pxdc2 = p.PXCAPDevCtrl2;
+
+    BARSize[0] = p.BAR0Size;
+    BARSize[1] = p.BAR1Size;
+    BARSize[2] = p.BAR2Size;
+    BARSize[3] = p.BAR3Size;
+    BARSize[4] = p.BAR4Size;
+    BARSize[5] = p.BAR5Size;
+
+    legacyIO[0] = p.BAR0LegacyIO;
+    legacyIO[1] = p.BAR1LegacyIO;
+    legacyIO[2] = p.BAR2LegacyIO;
+    legacyIO[3] = p.BAR3LegacyIO;
+    legacyIO[4] = p.BAR4LegacyIO;
+    legacyIO[5] = p.BAR5LegacyIO;
 
     for (int i = 0; i < 6; ++i) {
         if (legacyIO[i]) {
-            BARAddrs[i] = p->LegacyIOBase + letoh(config.baseAddr[i]);
+            BARAddrs[i] = p.LegacyIOBase + letoh(config.baseAddr[i]);
             config.baseAddr[i] = 0;
         } else {
             BARAddrs[i] = 0;
index 6f28376bbb2519b0e1f164931ccd0a300d0cb8bf..73e38566a63700ff3cd1bba4d6a33e2a35d116d3 100644 (file)
@@ -212,7 +212,7 @@ class PciDevice : public DmaDevice
      * config file object PCIConfigData and registers the device with
      * a PciHost object.
      */
-    PciDevice(const PciDeviceParams *params);
+    PciDevice(const PciDeviceParams &params);
 
     /**
      * Serialize this object to the given output stream.
index 53f6b32755f32e4f9502a4bae745fc48434de547..84b1403584988d94029133cf3c5d2664ad7eea65 100644 (file)
@@ -45,7 +45,7 @@
 #include "params/GenericPciHost.hh"
 #include "params/PciHost.hh"
 
-PciHost::PciHost(const PciHostParams *p)
+PciHost::PciHost(const PciHostParams &p)
     : PioDevice(p)
 {
 }
@@ -115,13 +115,13 @@ PciHost::DeviceInterface::clearInt()
 }
 
 
-GenericPciHost::GenericPciHost(const GenericPciHostParams *p)
+GenericPciHost::GenericPciHost(const GenericPciHostParams &p)
     : PciHost(p),
-      platform(*p->platform),
-      confBase(p->conf_base), confSize(p->conf_size),
-      confDeviceBits(p->conf_device_bits),
-      pciPioBase(p->pci_pio_base), pciMemBase(p->pci_mem_base),
-      pciDmaBase(p->pci_dma_base)
+      platform(*p.platform),
+      confBase(p.conf_base), confSize(p.conf_size),
+      confDeviceBits(p.conf_device_bits),
+      pciPioBase(p.pci_pio_base), pciMemBase(p.pci_mem_base),
+      pciDmaBase(p.pci_dma_base)
 {
 }
 
@@ -219,7 +219,7 @@ GenericPciHost::mapPciInterrupt(const PciBusAddr &addr, PciIntPin pin) const
 
 
 GenericPciHost *
-GenericPciHostParams::create()
+GenericPciHostParams::create() const
 {
-    return new GenericPciHost(this);
+    return new GenericPciHost(*this);
 }
index cacb5d1de51a3849601e92f2f3de63c1d3a720e2..8cf5f34e15f0c4763173a555f57202bbdbc126a8 100644 (file)
@@ -72,7 +72,7 @@ class Platform;
 class PciHost : public PioDevice
 {
   public:
-    PciHost(const PciHostParams *p);
+    PciHost(const PciHostParams &p);
     virtual ~PciHost();
 
   public:
@@ -273,7 +273,7 @@ class PciHost : public PioDevice
 class GenericPciHost : public PciHost
 {
   public:
-    GenericPciHost(const GenericPciHostParams *p);
+    GenericPciHost(const GenericPciHostParams &p);
     virtual ~GenericPciHost();
 
   public: // PioDevice
index 0abdf5435e1adb240f6d88a9d25e3afd229a3a22..718f76711b0582342dd9275b2ae0aaab2180ea0b 100644 (file)
@@ -33,8 +33,8 @@
 
 using namespace std;
 
-Platform::Platform(const Params *p)
-    : SimObject(p), intrctrl(p->intrctrl)
+Platform::Platform(const Params &p)
+    : SimObject(p), intrctrl(p.intrctrl)
 {
 }
 
index ba5322a090a95282dbad176e08e7bcd59dcad5e9..3b586c6aaaa4dde714ebc0ec99a3395070c9426e 100644 (file)
@@ -54,7 +54,7 @@ class Platform : public SimObject
 
   public:
     typedef PlatformParams Params;
-    Platform(const Params *p);
+    Platform(const Params &p);
     virtual ~Platform();
 
     /**
index 81c26187b37edddba5128b0d8c6b76c4f7f8307c..c32288e3ef1b9044487d7773101e1c2cb6df6f2d 100644 (file)
@@ -46,7 +46,7 @@
 #include "dev/ps2/types.hh"
 #include "params/PS2Device.hh"
 
-PS2Device::PS2Device(const PS2DeviceParams *p)
+PS2Device::PS2Device(const PS2DeviceParams &p)
     : SimObject(p)
 {
     inBuffer.reserve(16);
index f068d543a138aacdf9361b52dd578b5f09afb343..9671876dff9b2e387033bedfb3d274db8759b395 100644 (file)
@@ -51,7 +51,7 @@ struct PS2DeviceParams;
 class PS2Device : public SimObject
 {
   public:
-    PS2Device(const PS2DeviceParams *p);
+    PS2Device(const PS2DeviceParams &p);
 
     void serialize(CheckpointOut &cp) const override;
     void unserialize(CheckpointIn &cp) override;
index a825ee1fcf1fbd1c9512794e01e21688e79adaca..2075c4bbe415b4be81becfc531e7d0836c9dfb2f 100644 (file)
 #include "dev/ps2/types.hh"
 #include "params/PS2Keyboard.hh"
 
-PS2Keyboard::PS2Keyboard(const PS2KeyboardParams *p)
+PS2Keyboard::PS2Keyboard(const PS2KeyboardParams &p)
     : PS2Device(p),
       shiftDown(false),
       enabled(false)
 {
-    if (p->vnc)
-        p->vnc->setKeyboard(this);
+    if (p.vnc)
+        p.vnc->setKeyboard(this);
 }
 
 void
@@ -174,7 +174,7 @@ PS2Keyboard::keyPress(uint32_t key, bool down)
 
 
 PS2Keyboard *
-PS2KeyboardParams::create()
+PS2KeyboardParams::create() const
 {
-    return new PS2Keyboard(this);
+    return new PS2Keyboard(*this);
 }
index eaed055d602b4e1d5745e6b172b35107ce5d908d..68514cc4fd6cd20e11bd901b1789469931eccdee 100644 (file)
@@ -56,7 +56,7 @@ class PS2Keyboard : public PS2Device, VncKeyboard
     bool enabled;
 
   public:
-    PS2Keyboard(const PS2KeyboardParams *p);
+    PS2Keyboard(const PS2KeyboardParams &p);
 
     void serialize(CheckpointOut &cp) const override;
     void unserialize(CheckpointIn &cp) override;
index 7966bf8665f86a13a411ede6ede5f417306c346b..756b517364ddf1e608f07d123f20188a6445361d 100644 (file)
@@ -46,7 +46,7 @@
 #include "dev/ps2/types.hh"
 #include "params/PS2Mouse.hh"
 
-PS2Mouse::PS2Mouse(const PS2MouseParams *p)
+PS2Mouse::PS2Mouse(const PS2MouseParams &p)
     : PS2Device(p),
       status(0), resolution(4), sampleRate(100)
 {
@@ -168,7 +168,7 @@ PS2Mouse::unserialize(CheckpointIn &cp)
 }
 
 PS2Mouse *
-PS2MouseParams::create()
+PS2MouseParams::create() const
 {
-    return new PS2Mouse(this);
+    return new PS2Mouse(*this);
 }
index 0378c1fe187d2cce1bdf454edef4eabe0c1ee1db..7a1ef21c90c7b0c35463f839bf9010330f7f13f8 100644 (file)
@@ -61,7 +61,7 @@ class PS2Mouse : public PS2Device
     uint8_t sampleRate;
 
   public:
-    PS2Mouse(const PS2MouseParams *p);
+    PS2Mouse(const PS2MouseParams &p);
 
     void serialize(CheckpointOut &cp) const override;
     void unserialize(CheckpointIn &cp) override;
index 7d651a648e9d700dd57d8dec68ce5c9e009c22a5..7ffd273d8b6563956a87aa98a0019af9f5142f28 100644 (file)
@@ -46,9 +46,9 @@
 #include "dev/ps2/types.hh"
 #include "params/PS2TouchKit.hh"
 
-PS2TouchKit::PS2TouchKit(const PS2TouchKitParams *p)
+PS2TouchKit::PS2TouchKit(const PS2TouchKitParams &p)
     : PS2Device(p),
-      vnc(p->vnc),
+      vnc(p.vnc),
       enabled(false), touchKitEnabled(false)
 {
     if (vnc)
@@ -206,7 +206,7 @@ PS2TouchKit::mouseAt(uint16_t x, uint16_t y, uint8_t buttons)
 }
 
 PS2TouchKit *
-PS2TouchKitParams::create()
+PS2TouchKitParams::create() const
 {
-    return new PS2TouchKit(this);
+    return new PS2TouchKit(*this);
 }
index 383bda9098192ee18f219cddcef393c3e866de0a..161cf392acd97e005b4f1592f0aae738edd38296 100644 (file)
@@ -58,7 +58,7 @@ class PS2TouchKit : public PS2Device, public VncMouse
     };
 
   public:
-    PS2TouchKit(const PS2TouchKitParams *p);
+    PS2TouchKit(const PS2TouchKitParams &p);
 
     void serialize(CheckpointOut &cp) const override;
     void unserialize(CheckpointIn &cp) override;
index 366c3887a2111f4be9f095d0c820388bfbbc9966..90bdbf104b973eff8f4e0e7b4d001acb1af0ebfa 100644 (file)
@@ -41,7 +41,7 @@
 #include "params/SerialDevice.hh"
 #include "params/SerialNullDevice.hh"
 
-SerialDevice::SerialDevice(const SerialDeviceParams *p) : SimObject(p)
+SerialDevice::SerialDevice(const SerialDeviceParams &p) : SimObject(p)
 {
 }
 
@@ -72,7 +72,7 @@ SerialDevice::notifyInterface()
 
 
 
-SerialNullDevice::SerialNullDevice(const SerialNullDeviceParams *p)
+SerialNullDevice::SerialNullDevice(const SerialNullDeviceParams &p)
     : SerialDevice(p)
 {
 }
@@ -86,7 +86,7 @@ SerialNullDevice::readData()
 
 
 SerialNullDevice *
-SerialNullDeviceParams::create()
+SerialNullDeviceParams::create() const
 {
-    return new SerialNullDevice(this);
+    return new SerialNullDevice(*this);
 }
index 838c0ab51780386e6a334f18d50cba9d4d753d30..5ba4f70059019c7b31d6a79493b1135e3d15b89a 100644 (file)
@@ -91,7 +91,7 @@ struct SerialNullDeviceParams;
 class SerialDevice : public SimObject
 {
   public:
-    SerialDevice(const SerialDeviceParams *p);
+    SerialDevice(const SerialDeviceParams &p);
     ~SerialDevice();
 
   public: // Serial device API (UART->Device)
@@ -146,7 +146,7 @@ class SerialDevice : public SimObject
 class SerialNullDevice : public SerialDevice
 {
   public:
-    SerialNullDevice(const SerialNullDeviceParams *p);
+    SerialNullDevice(const SerialNullDeviceParams &p);
 
   public:
     bool dataAvailable() const override { return false; }
index 339d6b96dc0c53a2c07d767d6de7813c7a47b55a..6a7b94db87db5625192cb3b79eb90142123c0c39 100644 (file)
@@ -42,8 +42,8 @@
 #include "params/SimpleUart.hh"
 #include "sim/sim_exit.hh"
 
-SimpleUart::SimpleUart(const SimpleUartParams *p)
-    : Uart(p, p->pio_size), byteOrder(p->byte_order), endOnEOT(p->end_on_eot)
+SimpleUart::SimpleUart(const SimpleUartParams &p)
+    : Uart(p, p.pio_size), byteOrder(p.byte_order), endOnEOT(p.end_on_eot)
 {
 }
 
@@ -80,7 +80,7 @@ SimpleUart::write(PacketPtr pkt)
 }
 
 SimpleUart *
-SimpleUartParams::create()
+SimpleUartParams::create() const
 {
-    return new SimpleUart(this);
+    return new SimpleUart(*this);
 }
index cfcf8afbc309c7896d3f3fb73bc8bff9b8edab0a..3d841f063fa39f25ee4cc71690aec4991b8cdc1e 100644 (file)
@@ -46,7 +46,7 @@ struct SimpleUartParams;
 class SimpleUart : public Uart
 {
   public:
-    SimpleUart(const SimpleUartParams *p);
+    SimpleUart(const SimpleUartParams &p);
 
   public: // PioDevice
     Tick read(PacketPtr pkt) override;
index 8b420dae2a9538e286514f82d81a311debe2cb3b..9d5254ebacddf0601e086932417eb4cbd074f525 100644 (file)
@@ -115,9 +115,9 @@ Terminal::DataEvent::process(int revent)
 /*
  * Terminal code
  */
-Terminal::Terminal(const Params *p)
+Terminal::Terminal(const Params &p)
     : SerialDevice(p), listenEvent(NULL), dataEvent(NULL),
-      number(p->number), data_fd(-1), txbuf(16384), rxbuf(16384),
+      number(p.number), data_fd(-1), txbuf(16384), rxbuf(16384),
       outfile(terminalDump(p))
 #if TRACING_ON == 1
       , linebuf(16384)
@@ -126,8 +126,8 @@ Terminal::Terminal(const Params *p)
     if (outfile)
         outfile->stream()->setf(ios::unitbuf);
 
-    if (p->port)
-        listen(p->port);
+    if (p.port)
+        listen(p.port);
 }
 
 Terminal::~Terminal()
@@ -143,9 +143,9 @@ Terminal::~Terminal()
 }
 
 OutputStream *
-Terminal::terminalDump(const TerminalParamsp)
+Terminal::terminalDump(const TerminalParams &p)
 {
-    switch (p->outfile) {
+    switch (p.outfile) {
       case TerminalDump::none:
         return nullptr;
       case TerminalDump::stdoutput:
@@ -153,7 +153,7 @@ Terminal::terminalDump(const TerminalParams* p)
       case TerminalDump::stderror:
         return simout.findOrCreate("stderr");
       case TerminalDump::file:
-        return simout.findOrCreate(p->name);
+        return simout.findOrCreate(p.name);
       default:
         panic("Invalid option\n");
     }
@@ -361,7 +361,7 @@ Terminal::writeData(uint8_t c)
 }
 
 Terminal *
-TerminalParams::create()
+TerminalParams::create() const
 {
-    return new Terminal(this);
+    return new Terminal(*this);
 }
index b9fd7df43e52d8b89af7871f1a5d0f952471e026..ba9399874e5cd29567d22b1ec8ac44f78157d305 100644 (file)
@@ -93,9 +93,9 @@ class Terminal : public SerialDevice
 
   public:
     typedef TerminalParams Params;
-    Terminal(const Params *p);
+    Terminal(const Params &p);
     ~Terminal();
-    OutputStream * terminalDump(const TerminalParamsp);
+    OutputStream * terminalDump(const TerminalParams &p);
 
   protected:
     ListenSocket listener;
index 3e9131c48627b62d29015892a59f0653752ef2f2..60edf71a1d31e83768135525fa377d6920aad375 100644 (file)
@@ -32,8 +32,8 @@
 
 #include "dev/serial/uart.hh"
 
-Uart::Uart(const Params *p, Addr pio_size) :
-    BasicPioDevice(p, pio_size), platform(p->platform), device(p->device)
+Uart::Uart(const Params &p, Addr pio_size) :
+    BasicPioDevice(p, pio_size), platform(p.platform), device(p.device)
 {
     status = 0;
 
index 21ea5789e294e73cb394902bde726a970ad23bd8..0291b42eb6cbc586a717e1b21319e1dae0b21cae 100644 (file)
@@ -52,12 +52,12 @@ class Uart : public BasicPioDevice
 
   public:
     typedef UartParams Params;
-    Uart(const Params *p, Addr pio_size);
+    Uart(const Params &p, Addr pio_size);
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     /**
index 0b6f07a919959c430812fb1ce38762e8bea58b1a..4b7e9fe634ad391ded1f8ac31c91991048d07bf6 100644 (file)
@@ -83,7 +83,7 @@ Uart8250::scheduleIntr(Event *event)
 }
 
 
-Uart8250::Uart8250(const Params *p)
+Uart8250::Uart8250(const Params &p)
     : Uart(p, 8), IER(0), DLAB(0), LCR(0), MCR(0), lastTxInt(0),
       txIntrEvent([this]{ processIntrEvent(TX_INT); }, "TX"),
       rxIntrEvent([this]{ processIntrEvent(RX_INT); }, "RX")
@@ -321,7 +321,7 @@ Uart8250::unserialize(CheckpointIn &cp)
 }
 
 Uart8250 *
-Uart8250Params::create()
+Uart8250Params::create() const
 {
-    return new Uart8250(this);
+    return new Uart8250(*this);
 }
index 3b934c9ff1b915357b02e3e763dde353e81a15f7..3209416c6dab3a6f74c13ab31293c7d41521c852 100644 (file)
@@ -79,12 +79,12 @@ class Uart8250 : public Uart
 
   public:
     typedef Uart8250Params Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
-    Uart8250(const Params *p);
+    Uart8250(const Params &p);
 
     Tick read(PacketPtr pkt) override;
     Tick write(PacketPtr pkt) override;
index 195e45b05096d03ce56d964c80a3570467578183..a1d0967015feb945e7489e42f8bb8858ddbf7a34 100644 (file)
 
 using namespace std;
 
-DumbTOD::DumbTOD(const Params *p)
+DumbTOD::DumbTOD(const Params &p)
     : BasicPioDevice(p, 0x08)
 {
-    struct tm tm = p->time;
+    struct tm tm = p.time;
     todTime = mkutctime(&tm);
 
     DPRINTFN("Real-time clock set to %s\n", asctime(&tm));
@@ -88,7 +88,7 @@ DumbTOD::unserialize(CheckpointIn &cp)
 }
 
 DumbTOD *
-DumbTODParams::create()
+DumbTODParams::create() const
 {
-    return new DumbTOD(this);
+    return new DumbTOD(*this);
 }
index 68caa62e407fc30a3145781d6f4498b665d71ac7..74da99063a20d84ccf6b69728881b817e86ff918 100644 (file)
@@ -50,12 +50,12 @@ class DumbTOD : public BasicPioDevice
 
   public:
     typedef DumbTODParams Params;
-    DumbTOD(const Params *p);
+    DumbTOD(const Params &p);
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     Tick read(PacketPtr pkt) override;
index 44e7dc8679da9b60b5336c6fc551bf39e007faf8..d8f1087382df2d99cc80e7a50e20214c7af1c75a 100644 (file)
 #include "sim/faults.hh"
 #include "sim/system.hh"
 
-Iob::Iob(const Params *p)
-    : PioDevice(p), ic(p->platform->intrctrl)
+Iob::Iob(const Params &p)
+    : PioDevice(p), ic(p.platform->intrctrl)
 {
     iobManAddr = ULL(0x9800000000);
     iobManSize = ULL(0x0100000000);
     iobJBusAddr = ULL(0x9F00000000);
     iobJBusSize = ULL(0x0100000000);
-    assert(params()->system->threads.size() <= MaxNiagaraProcs);
+    assert(params().system->threads.size() <= MaxNiagaraProcs);
 
-    pioDelay = p->pio_latency;
+    pioDelay = p.pio_latency;
 
     for (int x = 0; x < NumDeviceIds; ++x) {
         intMan[x].cpu = 0;
@@ -377,7 +377,7 @@ Iob::unserialize(CheckpointIn &cp)
 }
 
 Iob *
-IobParams::create()
+IobParams::create() const
 {
-    return new Iob(this);
+    return new Iob(*this);
 }
index 3da17a370a1c342d09523f3d49ab797161b4baeb..8f2ff3cd66e81df937d5a18ecc5f8b0a22b88b20 100644 (file)
@@ -122,12 +122,12 @@ class Iob : public PioDevice
 
   public:
     typedef IobParams Params;
-    Iob(const Params *p);
+    Iob(const Params &p);
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     Tick read(PacketPtr pkt) override;
index f99f1f47691bcb14d5d8358bbb7bf21c4adba5be..ab45628849c0c1626f2a3a4fa4fb1983972df0a4 100644 (file)
@@ -43,9 +43,9 @@
 #include "sim/byteswap.hh"
 #include "sim/system.hh"
 
-MmDisk::MmDisk(const Params *p)
-    : BasicPioDevice(p, p->image->size() * SectorSize),
-      image(p->image), curSector((off_t)-1), dirty(false)
+MmDisk::MmDisk(const Params &p)
+    : BasicPioDevice(p, p.image->size() * SectorSize),
+      image(p.image), curSector((off_t)-1), dirty(false)
 {
     std::memset(&diskData, 0, SectorSize);
 }
@@ -184,7 +184,7 @@ MmDisk::serialize(CheckpointOut &cp) const
 }
 
 MmDisk *
-MmDiskParams::create()
+MmDiskParams::create() const
 {
-    return new MmDisk(this);
+    return new MmDisk(*this);
 }
index dffa5cf4c4eaad1c6adbdb7e84dfcf775128ff5c..03f9cae6fb515de69c29163beea7aba76f95255b 100644 (file)
@@ -48,12 +48,12 @@ class MmDisk : public BasicPioDevice
 
   public:
     typedef MmDiskParams Params;
-    MmDisk(const Params *p);
+    MmDisk(const Params &p);
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     Tick read(PacketPtr pkt) override;
index 6cf716a055eaaaa85a0348f792104d3f54bbccd2..3cb99b53f176014da1e74e70e482ef5528470ada 100644 (file)
@@ -41,8 +41,8 @@
 
 using namespace std;
 
-T1000::T1000(const Params *p)
-    : Platform(p), system(p->system)
+T1000::T1000(const Params &p)
+    : Platform(p), system(p.system)
 {}
 
 void
@@ -97,7 +97,7 @@ T1000::calcPciMemAddr(Addr addr)
 }
 
 T1000 *
-T1000Params::create()
+T1000Params::create() const
 {
-    return new T1000(this);
+    return new T1000(*this);
 }
index 4ec242fafc22c49366213ad94b6632282e79d6f8..1cc8abf545ae842af9a1d3b29a7e8ed6ab7f319a 100644 (file)
@@ -55,7 +55,7 @@ class T1000 : public Platform
      * @param s system the object belongs to
      * @param intctrl pointer to the interrupt controller
      */
-    T1000(const Params *p);
+    T1000(const Params &p);
 
     /**
      * Cause the cpu to post a serial interrupt to the CPU.
index e4b1ce02c947d2c501fe11db63af8526d06cce75..3ff29ae5cafa545ba01c7add5d2c4c9b52fef348 100644 (file)
@@ -55,12 +55,16 @@ using namespace std;
 //
 // Raw Disk image
 //
-RawDiskImage::RawDiskImage(const Paramsp)
+RawDiskImage::RawDiskImage(const Params &p)
     : DiskImage(p), disk_size(0)
-{ open(p->image_file, p->read_only); }
+{
+    open(p.image_file, p.read_only);
+}
 
 RawDiskImage::~RawDiskImage()
-{ close(); }
+{
+    close();
+}
 
 void
 RawDiskImage::notifyFork()
@@ -68,9 +72,9 @@ RawDiskImage::notifyFork()
     if (initialized && !readonly)
         panic("Attempting to fork system with read-write raw disk image.");
 
-    const Params *p(dynamic_cast<const Params *>(params()));
+    const Params &p = dynamic_cast<const Params &>(params());
     close();
-    open(p->image_file, p->read_only);
+    open(p.image_file, p.read_only);
 }
 
 void
@@ -156,9 +160,9 @@ RawDiskImage::write(const uint8_t *data, std::streampos offset)
 }
 
 RawDiskImage *
-RawDiskImageParams::create()
+RawDiskImageParams::create() const
 {
-    return new RawDiskImage(this);
+    return new RawDiskImage(*this);
 }
 
 ////////////////////////////////////////////////////////////////////////
@@ -168,19 +172,19 @@ RawDiskImageParams::create()
 const uint32_t CowDiskImage::VersionMajor = 1;
 const uint32_t CowDiskImage::VersionMinor = 0;
 
-CowDiskImage::CowDiskImage(const Params *p)
-    : DiskImage(p), filename(p->image_file), child(p->child), table(NULL)
+CowDiskImage::CowDiskImage(const Params &p)
+    : DiskImage(p), filename(p.image_file), child(p.child), table(NULL)
 {
     if (filename.empty()) {
-        initSectorTable(p->table_size);
+        initSectorTable(p.table_size);
     } else {
         if (!open(filename)) {
-            if (p->read_only)
+            if (p.read_only)
                 fatal("could not open read-only file");
-            initSectorTable(p->table_size);
+            initSectorTable(p.table_size);
         }
 
-        if (!p->read_only)
+        if (!p.read_only)
             registerExitCallback([this]() { save(); });
     }
 }
@@ -199,7 +203,7 @@ CowDiskImage::~CowDiskImage()
 void
 CowDiskImage::notifyFork()
 {
-    if (!dynamic_cast<const Params *>(params())->read_only &&
+    if (!dynamic_cast<const Params &>(params()).read_only &&
         !filename.empty()) {
         inform("Disabling saving of COW image in forked child process.\n");
         filename = "";
@@ -439,7 +443,7 @@ CowDiskImage::unserialize(CheckpointIn &cp)
 }
 
 CowDiskImage *
-CowDiskImageParams::create()
+CowDiskImageParams::create() const
 {
-    return new CowDiskImage(this);
+    return new CowDiskImage(*this);
 }
index 41a00947f50c81252ed9d04d1b44387b98ef5ac7..aa60f1dccfe0112401d4a5b44107e6e04584c822 100644 (file)
@@ -53,7 +53,7 @@ class DiskImage : public SimObject
 
   public:
     typedef DiskImageParams Params;
-    DiskImage(const Params *p) : SimObject(p), initialized(false) {}
+    DiskImage(const Params &p) : SimObject(p), initialized(false) {}
     virtual ~DiskImage() {}
 
     virtual std::streampos size() const = 0;
@@ -77,7 +77,7 @@ class RawDiskImage : public DiskImage
 
   public:
     typedef RawDiskImageParams Params;
-    RawDiskImage(const Params *p);
+    RawDiskImage(const Params &p);
     ~RawDiskImage();
 
     void notifyFork() override;
@@ -120,7 +120,7 @@ class CowDiskImage : public DiskImage
 
   public:
     typedef CowDiskImageParams Params;
-    CowDiskImage(const Params *p);
+    CowDiskImage(const Params &p);
     ~CowDiskImage();
 
     void notifyFork() override;
index 5efa42b1861d2ec8cd7eb258d6af11edcf82df2e..bf1d72f7f9c716ab0f1690adf9a80a5d3b000ebc 100644 (file)
@@ -88,7 +88,7 @@ IdeController::Channel::~Channel()
 {
 }
 
-IdeController::IdeController(Params *p)
+IdeController::IdeController(const Params &p)
     : PciDevice(p), primary(name() + ".primary", BARSize[0], BARSize[1]),
     secondary(name() + ".secondary", BARSize[2], BARSize[3]),
     bmiAddr(0), bmiSize(BARSize[4]),
@@ -96,32 +96,32 @@ IdeController::IdeController(Params *p)
     secondaryTiming(htole(timeRegWithDecodeEn)),
     deviceTiming(0), udmaControl(0), udmaTiming(0), ideConfig(0),
     ioEnabled(false), bmEnabled(false),
-    ioShift(p->io_shift), ctrlOffset(p->ctrl_offset)
+    ioShift(p.io_shift), ctrlOffset(p.ctrl_offset)
 {
 
     // Assign the disks to channels
-    for (int i = 0; i < params()->disks.size(); i++) {
-        if (!params()->disks[i])
+    for (int i = 0; i < params().disks.size(); i++) {
+        if (!params().disks[i])
             continue;
         switch (i) {
           case 0:
-            primary.device0 = params()->disks[0];
+            primary.device0 = params().disks[0];
             break;
           case 1:
-            primary.device1 = params()->disks[1];
+            primary.device1 = params().disks[1];
             break;
           case 2:
-            secondary.device0 = params()->disks[2];
+            secondary.device0 = params().disks[2];
             break;
           case 3:
-            secondary.device1 = params()->disks[3];
+            secondary.device1 = params().disks[3];
             break;
           default:
             panic("IDE controllers support a maximum "
                   "of 4 devices attached!\n");
         }
         // Arbitrarily set the chunk size to 4K.
-        params()->disks[i]->setController(this, 4 * 1024);
+        params().disks[i]->setController(this, 4 * 1024);
     }
 
     primary.select(false);
@@ -649,7 +649,7 @@ IdeController::Channel::unserialize(const std::string &base, CheckpointIn &cp)
 }
 
 IdeController *
-IdeControllerParams::create()
+IdeControllerParams::create() const
 {
-    return new IdeController(this);
+    return new IdeController(*this);
 }
index 51e1603f1157b8b524d075b6d20d929457b2c325..470ffd928bdace5c4442c7ce7a2db703e441210b 100644 (file)
@@ -143,8 +143,8 @@ class IdeController : public PciDevice
 
   public:
     typedef IdeControllerParams Params;
-    const Params *params() const { return (const Params *)_params; }
-    IdeController(Params *p);
+    const Params &params() const { return (const Params &)_params; }
+    IdeController(const Params &p);
 
     /** See if a disk is selected based on its pointer */
     bool isDiskSelected(IdeDisk *diskPtr);
index 57fa07632d90faef87f44cc290eeecb40b3773d7..25516ec4469bde61266a84728acb2faf7210aa66 100644 (file)
@@ -58,8 +58,8 @@
 #include "sim/core.hh"
 #include "sim/sim_object.hh"
 
-IdeDisk::IdeDisk(const Params *p)
-    : SimObject(p), ctrl(NULL), image(p->image), diskDelay(p->delay),
+IdeDisk::IdeDisk(const Params &p)
+    : SimObject(p), ctrl(NULL), image(p.image), diskDelay(p.delay),
       dmaTransferEvent([this]{ doDmaTransfer(); }, name()),
       dmaReadCG(NULL),
       dmaReadWaitEvent([this]{ doDmaRead(); }, name()),
@@ -70,7 +70,7 @@ IdeDisk::IdeDisk(const Params *p)
       dmaWriteEvent([this]{ dmaWriteDone(); }, name())
 {
     // Reset the device state
-    reset(p->driveID);
+    reset(p.driveID);
 
     // fill out the drive ID structure
     memset(&driveID, 0, sizeof(struct ataparams));
@@ -1199,7 +1199,7 @@ IdeDisk::unserialize(CheckpointIn &cp)
 }
 
 IdeDisk *
-IdeDiskParams::create()
+IdeDiskParams::create() const
 {
-    return new IdeDisk(this);
+    return new IdeDisk(*this);
 }
index 90cbf57059fac52f7aaa4ebee5a2da29d3e36750..ba2bad2a19d87c2837de4a71ca7a0016d9f15e5b 100644 (file)
@@ -261,7 +261,7 @@ class IdeDisk : public SimObject
 
   public:
     typedef IdeDiskParams Params;
-    IdeDisk(const Params *p);
+    IdeDisk(const Params &p);
 
     /**
      * Delete the data buffer.
index 0b37a884f06c4016ff3d8143f7ec3cd80cc57902..1e16685dfc5a20695c25fc55038f615fdf8aa8b3 100644 (file)
@@ -50,8 +50,8 @@
 
 using namespace std;
 
-SimpleDisk::SimpleDisk(const Params *p)
-    : SimObject(p), system(p->system), image(p->disk)
+SimpleDisk::SimpleDisk(const Params &p)
+    : SimObject(p), system(p.system), image(p.disk)
 {}
 
 SimpleDisk::~SimpleDisk()
@@ -84,7 +84,7 @@ SimpleDisk::write(Addr addr, baddr_t block, int count)
 }
 
 SimpleDisk *
-SimpleDiskParams::create()
+SimpleDiskParams::create() const
 {
-    return new SimpleDisk(this);
+    return new SimpleDisk(*this);
 }
index 726e2cc7c303872e453849220879596a389ca4d3..e0442c6775a1b92bf03692cc7db9074ad7a354fc 100644 (file)
@@ -53,7 +53,7 @@ class SimpleDisk : public SimObject
 
   public:
     typedef SimpleDiskParams Params;
-    SimpleDisk(const Params *p);
+    SimpleDisk(const Params &p);
     ~SimpleDisk();
 
     void read(Addr addr, baddr_t block, int count) const;
index 84841af4c844aa69b6a9bfbd66d972fe0c48a756..0443fb498d6f38cb063f2e3f02841928bacd317c 100644 (file)
@@ -322,11 +322,11 @@ VirtQueue::onNotify()
 }
 
 
-VirtIODeviceBase::VirtIODeviceBase(Params *params, DeviceId id,
+VirtIODeviceBase::VirtIODeviceBase(const Params &params, DeviceId id,
                                    size_t config_size, FeatureBits features)
     : SimObject(params),
       guestFeatures(0),
-      byteOrder(params->byte_order),
+      byteOrder(params.byte_order),
       deviceId(id), configSize(config_size), deviceFeatures(features),
       _deviceStatus(0), _queueSelect(0)
 {
@@ -480,13 +480,13 @@ VirtIODeviceBase::registerQueue(VirtQueue &queue)
 }
 
 
-VirtIODummyDevice::VirtIODummyDevice(VirtIODummyDeviceParams *params)
+VirtIODummyDevice::VirtIODummyDevice(const VirtIODummyDeviceParams &params)
     : VirtIODeviceBase(params, ID_INVALID, 0, 0)
 {
 }
 
 VirtIODummyDevice *
-VirtIODummyDeviceParams::create()
+VirtIODummyDeviceParams::create() const
 {
-    return new VirtIODummyDevice(this);
+    return new VirtIODummyDevice(*this);
 }
index e03237285395d9a94190eb7bb02bb62d1686bf6f..776c2a3518dd2bd27c86fb70190c7d3eb645834d 100644 (file)
@@ -577,7 +577,7 @@ class VirtIODeviceBase : public SimObject
     EndBitUnion(DeviceStatus)
 
     typedef VirtIODeviceBaseParams Params;
-    VirtIODeviceBase(Params *params, DeviceId id, size_t config_size,
+    VirtIODeviceBase(const Params &params, DeviceId id, size_t config_size,
                      FeatureBits features);
     virtual ~VirtIODeviceBase();
 
@@ -877,7 +877,7 @@ class VirtIODeviceBase : public SimObject
 class VirtIODummyDevice : public VirtIODeviceBase
 {
   public:
-    VirtIODummyDevice(VirtIODummyDeviceParams *params);
+    VirtIODummyDevice(const VirtIODummyDeviceParams &params);
 
   protected:
     /** VirtIO device ID */
index c03f9a577f3e9b86160fd48a4d33c0d2acacf7d6..e7d7c4164c0b125445187a7c0a02118734eee96c 100644 (file)
 #include "params/VirtIOBlock.hh"
 #include "sim/system.hh"
 
-VirtIOBlock::VirtIOBlock(Params *params)
+VirtIOBlock::VirtIOBlock(const Params &params)
     : VirtIODeviceBase(params, ID_BLOCK, sizeof(Config), 0),
-      qRequests(params->system->physProxy, byteOrder,
-                params->queueSize, *this),
-      image(*params->image)
+      qRequests(params.system->physProxy, byteOrder,
+                params.queueSize, *this),
+      image(*params.image)
 {
     registerQueue(qRequests);
 
@@ -166,7 +166,7 @@ VirtIOBlock::RequestQueue::onNotifyDescriptor(VirtDescriptor *desc)
 }
 
 VirtIOBlock *
-VirtIOBlockParams::create()
+VirtIOBlockParams::create() const
 {
-    return new VirtIOBlock(this);
+    return new VirtIOBlock(*this);
 }
index f160a18ca818ad00ef5a218a2bac66060f62e596..4e6dfb7937dacc03710ab87fd164152cba790370 100644 (file)
@@ -67,7 +67,7 @@ class VirtIOBlock : public VirtIODeviceBase
 {
   public:
     typedef VirtIOBlockParams Params;
-    VirtIOBlock(Params *params);
+    VirtIOBlock(const Params &params);
     virtual ~VirtIOBlock();
 
     void readConfig(PacketPtr pkt, Addr cfgOffset);
index 1bb6adabacd62d26c87619adee21150216683b40..eb4981fdbb68e7f24bece6fd950fe47fbc778826 100644 (file)
 #include "params/VirtIOConsole.hh"
 #include "sim/system.hh"
 
-VirtIOConsole::VirtIOConsole(Params *params)
+VirtIOConsole::VirtIOConsole(const Params &params)
     : VirtIODeviceBase(params, ID_CONSOLE, sizeof(Config), F_SIZE),
-      qRecv(params->system->physProxy, byteOrder, params->qRecvSize, *this),
-      qTrans(params->system->physProxy, byteOrder, params->qTransSize, *this),
-      device(*params->device)
+      qRecv(params.system->physProxy, byteOrder, params.qRecvSize, *this),
+      qTrans(params.system->physProxy, byteOrder, params.qTransSize, *this),
+      device(*params.device)
 {
     registerQueue(qRecv);
     registerQueue(qTrans);
@@ -114,7 +114,7 @@ VirtIOConsole::TermTransQueue::onNotifyDescriptor(VirtDescriptor *desc)
 }
 
 VirtIOConsole *
-VirtIOConsoleParams::create()
+VirtIOConsoleParams::create() const
 {
-    return new VirtIOConsole(this);
+    return new VirtIOConsole(*this);
 }
index 73afb9c0724595aa1d989d3eae0c8b994e888c0d..ef9a5cb29b1820d3af02f355f3b5b4634610189d 100644 (file)
@@ -65,7 +65,7 @@ class VirtIOConsole : public VirtIODeviceBase
 {
   public:
     typedef VirtIOConsoleParams Params;
-    VirtIOConsole(Params *params);
+    VirtIOConsole(const Params &params);
     virtual ~VirtIOConsole();
 
     void readConfig(PacketPtr pkt, Addr cfgOffset);
index 2392c0b91b43c467328af535039f1e12afaabcbb..18395f79de9a7aef9b30f9c81748586c826bb34e 100644 (file)
@@ -112,16 +112,16 @@ static const P9MsgInfoMap p9_msg_info {
 
 #undef P9MSG
 
-VirtIO9PBase::VirtIO9PBase(Params *params)
+VirtIO9PBase::VirtIO9PBase(const Params &params)
     : VirtIODeviceBase(params, ID_9P,
-                       sizeof(Config) + params->tag.size(),
+                       sizeof(Config) + params.tag.size(),
                        F_MOUNT_TAG),
-      queue(params->system->physProxy, byteOrder, params->queueSize, *this)
+      queue(params.system->physProxy, byteOrder, params.queueSize, *this)
 {
     config.reset((Config *)
                  operator new(configSize));
-    config->len = htog(params->tag.size(), byteOrder);
-    memcpy(config->tag, params->tag.c_str(), params->tag.size());
+    config->len = htog(params.tag.size(), byteOrder);
+    memcpy(config->tag, params.tag.c_str(), params.tag.size());
 
     registerQueue(queue);
 }
@@ -209,7 +209,7 @@ VirtIO9PBase::dumpMsg(const P9MsgHeader &header, const uint8_t *data, size_t siz
 }
 
 
-VirtIO9PProxy::VirtIO9PProxy(Params *params)
+VirtIO9PProxy::VirtIO9PProxy(const Params &params)
   : VirtIO9PBase(params), deviceUsed(false)
 {
 }
@@ -310,7 +310,7 @@ VirtIO9PProxy::writeAll(const uint8_t *data, size_t len)
 
 
 
-VirtIO9PDiod::VirtIO9PDiod(Params *params)
+VirtIO9PDiod::VirtIO9PDiod(const Params &params)
     : VirtIO9PProxy(params),
       fd_to_diod(-1), fd_from_diod(-1), diod_pid(-1)
 {
@@ -333,15 +333,15 @@ VirtIO9PDiod::startup()
 void
 VirtIO9PDiod::startDiod()
 {
-    const Params *p(dynamic_cast<const Params *>(params()));
+    const Params &p = dynamic_cast<const Params &>(params());
     int pipe_rfd[2];
     int pipe_wfd[2];
     const int DIOD_RFD = 3;
     const int DIOD_WFD = 4;
 
-    const char *diod(p->diod.c_str());
+    const char *diod(p.diod.c_str());
 
-    DPRINTF(VIO9P, "Using diod at %s \n", p->diod.c_str());
+    DPRINTF(VIO9P, "Using diod at %s \n", p.diod.c_str());
 
     if (pipe(pipe_rfd) == -1 || pipe(pipe_wfd) == -1)
         panic("Failed to create DIOD pipes: %i\n", errno);
@@ -359,7 +359,7 @@ VirtIO9PDiod::startDiod()
     memset(&socket_address, 0, sizeof(struct sockaddr_un));
     socket_address.sun_family = AF_UNIX;
 
-    const std::string socket_path = simout.resolve(p->socketPath);
+    const std::string socket_path = simout.resolve(p.socketPath);
     fatal_if(!OutputDirectory::isAbsolute(socket_path), "Please make the" \
              " output directory an absolute path, else diod will fail!\n");
 
@@ -394,7 +394,7 @@ VirtIO9PDiod::startDiod()
                "-f", // start in foreground
                "-r", "3", // setup read FD
                "-w", "4", // setup write FD
-               "-e", p->root.c_str(), // path to export
+               "-e", p.root.c_str(), // path to export
                "-n", // disable security
                "-S", // squash all users
                "-l", socket_path.c_str(), // pass the socket
@@ -475,15 +475,15 @@ VirtIO9PDiod::terminateDiod()
 
 }
 VirtIO9PDiod *
-VirtIO9PDiodParams::create()
+VirtIO9PDiodParams::create() const
 {
-    return new VirtIO9PDiod(this);
+    return new VirtIO9PDiod(*this);
 }
 
 
 
 
-VirtIO9PSocket::VirtIO9PSocket(Params *params)
+VirtIO9PSocket::VirtIO9PSocket(const Params &params)
     : VirtIO9PProxy(params), fdSocket(-1)
 {
 }
@@ -503,7 +503,7 @@ VirtIO9PSocket::startup()
 void
 VirtIO9PSocket::connectSocket()
 {
-    const Params &p(dynamic_cast<const Params &>(*params()));
+    const Params &p = dynamic_cast<const Params &>(params());
 
     int ret;
     struct addrinfo hints, *result;
@@ -572,7 +572,7 @@ VirtIO9PSocket::SocketDataEvent::process(int revent)
 
 
 VirtIO9PSocket *
-VirtIO9PSocketParams::create()
+VirtIO9PSocketParams::create() const
 {
-    return new VirtIO9PSocket(this);
+    return new VirtIO9PSocket(*this);
 }
index 7751b36c2b7f8ae183f23c5608fab61c54d01812..3ba499c5e4a3049590bfc2575e9767aacbd153e1 100644 (file)
@@ -108,7 +108,7 @@ class VirtIO9PBase : public VirtIODeviceBase
 {
   public:
     typedef VirtIO9PBaseParams Params;
-    VirtIO9PBase(Params *params);
+    VirtIO9PBase(const Params &params);
     virtual ~VirtIO9PBase();
 
     void readConfig(PacketPtr pkt, Addr cfgOffset);
@@ -212,7 +212,7 @@ class VirtIO9PProxy : public VirtIO9PBase
 {
   public:
     typedef VirtIO9PProxyParams Params;
-    VirtIO9PProxy(Params *params);
+    VirtIO9PProxy(const Params &params);
     virtual ~VirtIO9PProxy();
 
     void serialize(CheckpointOut &cp) const override;
@@ -291,7 +291,7 @@ class VirtIO9PDiod : public VirtIO9PProxy
 {
   public:
     typedef VirtIO9PDiodParams Params;
-    VirtIO9PDiod(Params *params);
+    VirtIO9PDiod(const Params &params);
     virtual ~VirtIO9PDiod();
 
     void startup();
@@ -343,7 +343,7 @@ class VirtIO9PSocket : public VirtIO9PProxy
 {
   public:
     typedef VirtIO9PSocketParams Params;
-    VirtIO9PSocket(Params *params);
+    VirtIO9PSocket(const Params &params);
     virtual ~VirtIO9PSocket();
 
     void startup();
index fdded203a8860f3ad3d1127ccf4a2aafe2d63ea2..34f27bb226db6d8036fd3fea6f9b2eab26f4283d 100644 (file)
@@ -42,9 +42,9 @@
 #include "mem/packet_access.hh"
 #include "params/PciVirtIO.hh"
 
-PciVirtIO::PciVirtIO(const Params *params)
+PciVirtIO::PciVirtIO(const Params &params)
     : PciDevice(params), queueNotify(0), interruptDeliveryPending(false),
-      vio(*params->vio)
+      vio(*params.vio)
 {
     // Override the subsystem ID with the device ID from VirtIO
     config.subsystemID = htole(vio.deviceId);
@@ -224,7 +224,7 @@ PciVirtIO::kick()
 }
 
 PciVirtIO *
-PciVirtIOParams::create()
+PciVirtIOParams::create() const
 {
-    return new PciVirtIO(this);
+    return new PciVirtIO(*this);
 }
index b6c162c79a20e12f16662f10b5f300fb9a66cc49..598f07e0ffdc70ac7e0e10b08d9be007b588e12e 100644 (file)
@@ -48,7 +48,7 @@ class PciVirtIO : public PciDevice
 {
   public:
     typedef PciVirtIOParams Params;
-    PciVirtIO(const Params *params);
+    PciVirtIO(const Params &params);
     virtual ~PciVirtIO();
 
     Tick read(PacketPtr pkt);
index 5d8c680377459b887c5f35af52c03d01f0b3668c..eab4ad2b7422567f1d32647ed015a0dfa2233b43 100644 (file)
@@ -140,7 +140,7 @@ X86ISA::Cmos::unserialize(CheckpointIn &cp)
 }
 
 X86ISA::Cmos *
-CmosParams::create()
+CmosParams::create() const
 {
-    return new X86ISA::Cmos(this);
+    return new X86ISA::Cmos(*this);
 }
index babbaa940b05580b661fa285e612d9d03ebe3cec..29a883b5b09b6218f16adc51159b374885356069 100644 (file)
@@ -72,9 +72,9 @@ class Cmos : public BasicPioDevice
   public:
     typedef CmosParams Params;
 
-    Cmos(const Params *p) : BasicPioDevice(p, 2), latency(p->pio_latency),
-        rtc(this, name() + ".rtc", p->time, true, ULL(5000000000),
-                p->port_int_pin_connection_count)
+    Cmos(const Params &p) : BasicPioDevice(p, 2), latency(p.pio_latency),
+        rtc(this, name() + ".rtc", p.time, true, ULL(5000000000),
+                p.port_int_pin_connection_count)
     {
         memset(regs, 0, numRegs * sizeof(uint8_t));
         address = 0;
index 35a86b2428232713530706f2bc8aaf276b56c151..3756cf9444b1c8492b56907df86b0de8f78009c8 100644 (file)
@@ -44,12 +44,12 @@ const uint8_t RamSize = 32;
 const uint8_t NumOutputBits = 14;
 
 
-X86ISA::I8042::I8042(Params *p)
+X86ISA::I8042::I8042(const Params &p)
     : BasicPioDevice(p, 0), // pioSize arg is dummy value... not used
-      latency(p->pio_latency),
-      dataPort(p->data_port), commandPort(p->command_port),
+      latency(p.pio_latency),
+      dataPort(p.data_port), commandPort(p.command_port),
       statusReg(0), commandByte(0), dataReg(0), lastCommand(NoCommand),
-      mouse(p->mouse), keyboard(p->keyboard)
+      mouse(p.mouse), keyboard(p.keyboard)
 {
     fatal_if(!mouse, "The i8042 model requires a mouse instance");
     fatal_if(!keyboard, "The i8042 model requires a keyboard instance");
@@ -62,11 +62,11 @@ X86ISA::I8042::I8042(Params *p)
     commandByte.passedSelfTest = 1;
     commandByte.keyboardFullInt = 1;
 
-    for (int i = 0; i < p->port_keyboard_int_pin_connection_count; i++) {
+    for (int i = 0; i < p.port_keyboard_int_pin_connection_count; i++) {
         keyboardIntPin.push_back(new IntSourcePin<I8042>(
                     csprintf("%s.keyboard_int_pin[%d]", name(), i), i, this));
     }
-    for (int i = 0; i < p->port_mouse_int_pin_connection_count; i++) {
+    for (int i = 0; i < p.port_mouse_int_pin_connection_count; i++) {
         mouseIntPin.push_back(new IntSourcePin<I8042>(
                     csprintf("%s.mouse_int_pin[%d]", name(), i), i, this));
     }
@@ -307,7 +307,7 @@ X86ISA::I8042::unserialize(CheckpointIn &cp)
 }
 
 X86ISA::I8042 *
-I8042Params::create()
+I8042Params::create() const
 {
-    return new X86ISA::I8042(this);
+    return new X86ISA::I8042(*this);
 }
index 83ca7d74eacdcabfebf572848f045ac5bb13d09a..10681da92d03c12acce38a16fd265ac9dd6d8027 100644 (file)
@@ -118,13 +118,13 @@ class I8042 : public BasicPioDevice
   public:
     typedef I8042Params Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    I8042(Params *p);
+    I8042(const Params &p);
 
     Port &
     getPort(const std::string &if_name, PortID idx=InvalidPortID) override
index bb28a8a3f5405547d4863306d679b503225c577c..12ac70ca8a2ac63d2d08a8a53d8a50cea01453d2 100644 (file)
 #include "mem/packet_access.hh"
 #include "sim/system.hh"
 
-X86ISA::I82094AA::I82094AA(Params *p)
-    : BasicPioDevice(p, 20), extIntPic(p->external_int_pic),
+X86ISA::I82094AA::I82094AA(const Params &p)
+    : BasicPioDevice(p, 20), extIntPic(p.external_int_pic),
       lowestPriorityOffset(0),
-      intRequestPort(name() + ".int_request", this, this, p->int_latency)
+      intRequestPort(name() + ".int_request", this, this, p.int_latency)
 {
     // This assumes there's only one I/O APIC in the system and since the apic
     // id is stored in a 8-bit field with 0xff meaning broadcast, the id must
     // be less than 0xff
 
-    assert(p->apic_id < 0xff);
-    initialApicId = id = p->apic_id;
+    assert(p.apic_id < 0xff);
+    initialApicId = id = p.apic_id;
     arbId = id;
     regSel = 0;
     RedirTableEntry entry = 0;
@@ -59,7 +59,7 @@ X86ISA::I82094AA::I82094AA(Params *p)
         pinStates[i] = false;
     }
 
-    for (int i = 0; i < p->port_inputs_connection_count; i++)
+    for (int i = 0; i < p.port_inputs_connection_count; i++)
         inputs.push_back(new IntSinkPin<I82094AA>(
                     csprintf("%s.inputs[%d]", name(), i), i, this));
 }
@@ -293,7 +293,7 @@ X86ISA::I82094AA::unserialize(CheckpointIn &cp)
 }
 
 X86ISA::I82094AA *
-I82094AAParams::create()
+I82094AAParams::create() const
 {
-    return new X86ISA::I82094AA(this);
+    return new X86ISA::I82094AA(*this);
 }
index a5263b37d65d436bdff8aa27b23e9620c152d520..517b8887017c0fe74fcbb23cd128376582dd2ecd 100644 (file)
@@ -87,13 +87,13 @@ class I82094AA : public BasicPioDevice
   public:
     typedef I82094AAParams Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    I82094AA(Params *p);
+    I82094AA(const Params &p);
 
     void init() override;
 
index 9724d6c2fda725885327222d20672bbd18b09d4f..2423c5175381fa9a38a6be36966a22ae5cd46c91 100644 (file)
@@ -137,7 +137,7 @@ X86ISA::I8237::unserialize(CheckpointIn &cp)
 }
 
 X86ISA::I8237 *
-I8237Params::create()
+I8237Params::create() const
 {
-    return new X86ISA::I8237(this);
+    return new X86ISA::I8237(*this);
 }
index ebca108f3f5d5911fa380d11f6f66490edd2d7e3..d5044d64837621f690f875e58ef3efd4772909b1 100644 (file)
@@ -39,22 +39,20 @@ class I8237 : public BasicPioDevice
 {
   protected:
     Tick latency;
-    uint8_t maskReg;
+    uint8_t maskReg = 0;
 
   public:
     typedef I8237Params Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    I8237(Params *p) : BasicPioDevice(p, 16), latency(p->pio_latency), maskReg(0)
-    {
-    }
-    Tick read(PacketPtr pkt) override;
+    I8237(const Params &p) : BasicPioDevice(p, 16), latency(p.pio_latency) {}
 
+    Tick read(PacketPtr pkt) override;
     Tick write(PacketPtr pkt) override;
 
     void serialize(CheckpointOut &cp) const override;
index 34f9632ffa07b8d1597a4eefdb6ce80822684692..b23f09af041a5ac38c1eeefa61e8d5282754b669 100644 (file)
@@ -97,7 +97,7 @@ X86ISA::I8254::startup()
 }
 
 X86ISA::I8254 *
-I8254Params::create()
+I8254Params::create() const
 {
-    return new X86ISA::I8254(this);
+    return new X86ISA::I8254(*this);
 }
index 2a7d7ad69bef94557d959e746af4a334d4d52b3e..cbde5fea3a162530aa20bc77871952732e6b773d 100644 (file)
@@ -77,22 +77,22 @@ class I8254 : public BasicPioDevice
             return BasicPioDevice::getPort(if_name, idx);
     }
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    I8254(Params *p) : BasicPioDevice(p, 4), latency(p->pio_latency),
-            pit(p->name, this)
+    I8254(const Params &p) : BasicPioDevice(p, 4), latency(p.pio_latency),
+            pit(p.name, this)
     {
-        for (int i = 0; i < p->port_int_pin_connection_count; i++) {
+        for (int i = 0; i < p.port_int_pin_connection_count; i++) {
             intPin.push_back(new IntSourcePin<I8254>(csprintf(
                             "%s.int_pin[%d]", name(), i), i, this));
         }
     }
-    Tick read(PacketPtr pkt) override;
 
+    Tick read(PacketPtr pkt) override;
     Tick write(PacketPtr pkt) override;
 
     bool
index 8ba1235a499010d49f807ce11b5496500c5d7b3c..780c8ddd03c9ec6e23201e3aceb26fb2de789a0b 100644 (file)
 #include "mem/packet.hh"
 #include "mem/packet_access.hh"
 
-X86ISA::I8259::I8259(Params * p)
+X86ISA::I8259::I8259(const Params &p)
     : BasicPioDevice(p, 2),
-      latency(p->pio_latency),
-      mode(p->mode), slave(p->slave),
+      latency(p.pio_latency),
+      mode(p.mode), slave(p.slave),
       IRR(0), ISR(0), IMR(0),
       readIRR(true), initControlWord(0), autoEOI(false)
 {
-    for (int i = 0; i < p->port_output_connection_count; i++) {
+    for (int i = 0; i < p.port_output_connection_count; i++) {
         output.push_back(new IntSourcePin<I8259>(
                     csprintf("%s.output[%d]", name(), i), i, this));
     }
 
-    int in_count = p->port_inputs_connection_count;
+    int in_count = p.port_inputs_connection_count;
     panic_if(in_count >= NumLines,
             "I8259 only supports 8 inputs, but there are %d.", in_count);
     for (int i = 0; i < in_count; i++) {
@@ -366,7 +366,7 @@ X86ISA::I8259::unserialize(CheckpointIn &cp)
 }
 
 X86ISA::I8259 *
-I8259Params::create()
+I8259Params::create() const
 {
-    return new X86ISA::I8259(this);
+    return new X86ISA::I8259(*this);
 }
index 889a8cb9c04b6d237c645c74ddc1057e92ce7263..9a82720b2f2e97977b5166ba45a1b2e3c7e9fa94 100644 (file)
@@ -83,13 +83,13 @@ class I8259 : public BasicPioDevice
   public:
     typedef I8259Params Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    I8259(Params * p);
+    I8259(const Params &p);
 
     Port &
     getPort(const std::string &if_name, PortID idx=InvalidPortID) override
index 38c0517cadcc01a0fcfce4917547eccbb1b36bb7..4001c202113d32f662b94ee63a4e0f5361739289 100644 (file)
@@ -45,8 +45,8 @@
 #include "dev/x86/south_bridge.hh"
 #include "sim/system.hh"
 
-Pc::Pc(const Params *p)
-    : Platform(p), system(p->system)
+Pc::Pc(const Params &p)
+    : Platform(p), system(p.system)
 {
     southBridge = NULL;
 }
@@ -136,7 +136,7 @@ Pc::clearPciInt(int line)
 }
 
 Pc *
-PcParams::create()
+PcParams::create() const
 {
-    return new Pc(this);
+    return new Pc(*this);
 }
index 8c43cec07fa945a70f87d524a59cb062a9bb4b17..74e37ddfb64e81d7eaf6805868450d8f4433c7e6 100644 (file)
@@ -57,7 +57,7 @@ class Pc : public Platform
      */
     void init() override;
 
-    Pc(const Params *p);
+    Pc(const Params &p);
 
   public:
     void postConsoleInt() override;
index 15f475f6869cd99b3a5b138a8de97077ee83a6af..4f713bd9d8259d11749915956219c6a4533d2156 100644 (file)
@@ -34,9 +34,9 @@
 
 using namespace X86ISA;
 
-SouthBridge::SouthBridge(const Params *p) : SimObject(p),
-    platform(p->platform), pit(p->pit), pic1(p->pic1), pic2(p->pic2),
-    cmos(p->cmos), speaker(p->speaker), ioApic(p->io_apic)
+SouthBridge::SouthBridge(const Params &p) : SimObject(p),
+    platform(p.platform), pit(p.pit), pic1(p.pic1), pic2(p.pic2),
+    cmos(p.cmos), speaker(p.speaker), ioApic(p.io_apic)
 {
     // Let the platform know where we are
     Pc * pc = dynamic_cast<Pc *>(platform);
@@ -45,7 +45,7 @@ SouthBridge::SouthBridge(const Params *p) : SimObject(p),
 }
 
 SouthBridge *
-SouthBridgeParams::create()
+SouthBridgeParams::create() const
 {
-    return new SouthBridge(this);
+    return new SouthBridge(*this);
 }
index 223b29b38f123c9bfdd4239c76351e1c794ddd0c..3a1b15ca66e14d71a89704a1f31609ba15d37ab1 100644 (file)
@@ -56,12 +56,12 @@ class SouthBridge : public SimObject
 
   public:
     typedef SouthBridgeParams Params;
-    SouthBridge(const Params *p);
+    SouthBridge(const Params &p);
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 };
 
index ed6805832b42af2b0f91a1a967d0c6277396ff01..90f30be2552367feff6f74251005fec4bf51f5b4 100644 (file)
@@ -85,7 +85,7 @@ X86ISA::Speaker::unserialize(CheckpointIn &cp)
 }
 
 X86ISA::Speaker *
-PcSpeakerParams::create()
+PcSpeakerParams::create() const
 {
-    return new X86ISA::Speaker(this);
+    return new X86ISA::Speaker(*this);
 }
index 134ea451e40fee0a1f5d46e56916a4ff71dced2e..d672048c135decbf312d242e68b35a2687f3998a 100644 (file)
@@ -56,14 +56,14 @@ class Speaker : public BasicPioDevice
   public:
     typedef PcSpeakerParams Params;
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    Speaker(Params *p) : BasicPioDevice(p, 1),
-        latency(p->pio_latency), controlVal(0), timer(p->i8254)
+    Speaker(const Params &p) : BasicPioDevice(p, 1),
+        latency(p.pio_latency), controlVal(0), timer(p.i8254)
     {
     }
 
index b1dd03143cc2c75e9415c90ac4caf09849cde96c..674f453ef21b8debf8d5ce326817bf914ad05854 100644 (file)
  * Scoreboard/Schedule stage interface.
  */
 ScoreboardCheckToSchedule::ScoreboardCheckToSchedule(const ComputeUnitParams
-                                                     *p)
+                                                     &p)
 {
-    int num_func_units = p->num_SIMDs + p->num_scalar_cores
-        + p->num_global_mem_pipes + p->num_shared_mem_pipes
-        + p->num_scalar_mem_pipes;
+    int num_func_units = p.num_SIMDs + p.num_scalar_cores
+        + p.num_global_mem_pipes + p.num_shared_mem_pipes
+        + p.num_scalar_mem_pipes;
     _readyWFs.resize(num_func_units);
 
     for (auto &func_unit_wf_list : _readyWFs) {
-        func_unit_wf_list.reserve(p->n_wf);
+        func_unit_wf_list.reserve(p.n_wf);
     }
 }
 
@@ -103,11 +103,11 @@ ScoreboardCheckToSchedule::updateReadyList(int func_unit_id)
 /**
  * Schedule/Execute stage interface.
  */
-ScheduleToExecute::ScheduleToExecute(const ComputeUnitParams *p)
+ScheduleToExecute::ScheduleToExecute(const ComputeUnitParams &p)
 {
-    int num_func_units = p->num_SIMDs + p->num_scalar_cores
-        + p->num_global_mem_pipes + p->num_shared_mem_pipes
-        + p->num_scalar_mem_pipes;
+    int num_func_units = p.num_SIMDs + p.num_scalar_cores
+        + p.num_global_mem_pipes + p.num_shared_mem_pipes
+        + p.num_scalar_mem_pipes;
     _readyInsts.resize(num_func_units, nullptr);
     _dispatchStatus.resize(num_func_units, EMPTY);
 }
index bc3ec7b865ee83473b2c0b20a1247d45d513146b..12c5f8a683bc308a50cc5d849d175db0d8d55115 100644 (file)
@@ -64,7 +64,7 @@ class ScoreboardCheckToSchedule : public PipeStageIFace
 {
   public:
     ScoreboardCheckToSchedule() = delete;
-    ScoreboardCheckToSchedule(const ComputeUnitParams *p);
+    ScoreboardCheckToSchedule(const ComputeUnitParams &p);
     void reset() override;
     /**
      * Mark the WF as ready for execution on a particular functional
@@ -100,7 +100,7 @@ class ScheduleToExecute : public PipeStageIFace
 {
   public:
     ScheduleToExecute() = delete;
-    ScheduleToExecute(const ComputeUnitParams *p);
+    ScheduleToExecute(const ComputeUnitParams &p);
     void reset() override;
     GPUDynInstPtr& readyInst(int func_unit_id);
     /**
index 81080297c54c5e44d80dad7a1385f901a8deacb5..d15c4328bd197207afc676ff69b3abacf8b0748e 100644 (file)
 #include "sim/process.hh"
 #include "sim/sim_exit.hh"
 
-ComputeUnit::ComputeUnit(const Params *p) : ClockedObject(p),
-    numVectorGlobalMemUnits(p->num_global_mem_pipes),
-    numVectorSharedMemUnits(p->num_shared_mem_pipes),
-    numScalarMemUnits(p->num_scalar_mem_pipes),
-    numVectorALUs(p->num_SIMDs),
-    numScalarALUs(p->num_scalar_cores),
-    vrfToCoalescerBusWidth(p->vrf_to_coalescer_bus_width),
-    coalescerToVrfBusWidth(p->coalescer_to_vrf_bus_width),
-    registerManager(p->register_manager),
+ComputeUnit::ComputeUnit(const Params &p) : ClockedObject(p),
+    numVectorGlobalMemUnits(p.num_global_mem_pipes),
+    numVectorSharedMemUnits(p.num_shared_mem_pipes),
+    numScalarMemUnits(p.num_scalar_mem_pipes),
+    numVectorALUs(p.num_SIMDs),
+    numScalarALUs(p.num_scalar_cores),
+    vrfToCoalescerBusWidth(p.vrf_to_coalescer_bus_width),
+    coalescerToVrfBusWidth(p.coalescer_to_vrf_bus_width),
+    registerManager(p.register_manager),
     fetchStage(p, *this),
     scoreboardCheckStage(p, *this, scoreboardCheckToSchedule),
     scheduleStage(p, *this, scoreboardCheckToSchedule, scheduleToExecute),
@@ -77,34 +77,34 @@ ComputeUnit::ComputeUnit(const Params *p) : ClockedObject(p),
     scalarMemoryPipe(p, *this),
     tickEvent([this]{ exec(); }, "Compute unit tick event",
           false, Event::CPU_Tick_Pri),
-    cu_id(p->cu_id),
-    vrf(p->vector_register_file), srf(p->scalar_register_file),
-    simdWidth(p->simd_width),
-    spBypassPipeLength(p->spbypass_pipe_length),
-    dpBypassPipeLength(p->dpbypass_pipe_length),
-    scalarPipeStages(p->scalar_pipe_length),
-    operandNetworkLength(p->operand_network_length),
-    issuePeriod(p->issue_period),
-    vrf_gm_bus_latency(p->vrf_gm_bus_latency),
-    srf_scm_bus_latency(p->srf_scm_bus_latency),
-    vrf_lm_bus_latency(p->vrf_lm_bus_latency),
-    perLaneTLB(p->perLaneTLB), prefetchDepth(p->prefetch_depth),
-    prefetchStride(p->prefetch_stride), prefetchType(p->prefetch_prev_type),
-    debugSegFault(p->debugSegFault),
-    functionalTLB(p->functionalTLB), localMemBarrier(p->localMemBarrier),
-    countPages(p->countPages),
-    req_tick_latency(p->mem_req_latency * p->clk_domain->clockPeriod()),
-    resp_tick_latency(p->mem_resp_latency * p->clk_domain->clockPeriod()),
-    _requestorId(p->system->getRequestorId(this, "ComputeUnit")),
-    lds(*p->localDataStore), gmTokenPort(name() + ".gmTokenPort", this),
+    cu_id(p.cu_id),
+    vrf(p.vector_register_file), srf(p.scalar_register_file),
+    simdWidth(p.simd_width),
+    spBypassPipeLength(p.spbypass_pipe_length),
+    dpBypassPipeLength(p.dpbypass_pipe_length),
+    scalarPipeStages(p.scalar_pipe_length),
+    operandNetworkLength(p.operand_network_length),
+    issuePeriod(p.issue_period),
+    vrf_gm_bus_latency(p.vrf_gm_bus_latency),
+    srf_scm_bus_latency(p.srf_scm_bus_latency),
+    vrf_lm_bus_latency(p.vrf_lm_bus_latency),
+    perLaneTLB(p.perLaneTLB), prefetchDepth(p.prefetch_depth),
+    prefetchStride(p.prefetch_stride), prefetchType(p.prefetch_prev_type),
+    debugSegFault(p.debugSegFault),
+    functionalTLB(p.functionalTLB), localMemBarrier(p.localMemBarrier),
+    countPages(p.countPages),
+    req_tick_latency(p.mem_req_latency * p.clk_domain->clockPeriod()),
+    resp_tick_latency(p.mem_resp_latency * p.clk_domain->clockPeriod()),
+    _requestorId(p.system->getRequestorId(this, "ComputeUnit")),
+    lds(*p.localDataStore), gmTokenPort(name() + ".gmTokenPort", this),
     ldsPort(csprintf("%s-port", name()), this),
     scalarDataPort(csprintf("%s-port", name()), this),
     scalarDTLBPort(csprintf("%s-port", name()), this),
     sqcPort(csprintf("%s-port", name()), this),
     sqcTLBPort(csprintf("%s-port", name()), this),
-    _cacheLineSize(p->system->cacheLineSize()),
-    _numBarrierSlots(p->num_barrier_slots),
-    globalSeqNum(0), wavefrontSize(p->wf_size),
+    _cacheLineSize(p.system->cacheLineSize()),
+    _numBarrierSlots(p.num_barrier_slots),
+    globalSeqNum(0), wavefrontSize(p.wf_size),
     scoreboardCheckToSchedule(p),
     scheduleToExecute(p)
 {
@@ -117,8 +117,8 @@ ComputeUnit::ComputeUnit(const Params *p) : ClockedObject(p),
      * to_long() or to_ullong() so we can have wavefrontSize greater than 64b,
      * however until that is done this assert is required.
      */
-    fatal_if(p->wf_size > std::numeric_limits<unsigned long long>::digits ||
-             p->wf_size <= 0,
+    fatal_if(p.wf_size > std::numeric_limits<unsigned long long>::digits ||
+             p.wf_size <= 0,
              "WF size is larger than the host can support");
     fatal_if(!isPowerOf2(wavefrontSize),
              "Wavefront size should be a power of 2");
@@ -132,23 +132,23 @@ ComputeUnit::ComputeUnit(const Params *p) : ClockedObject(p),
                                / coalescerToVrfBusWidth;
 
     // Initialization: all WF slots are assumed STOPPED
-    idleWfs = p->n_wf * numVectorALUs;
+    idleWfs = p.n_wf * numVectorALUs;
     lastVaddrWF.resize(numVectorALUs);
     wfList.resize(numVectorALUs);
 
-    wfBarrierSlots.resize(p->num_barrier_slots, WFBarrier());
+    wfBarrierSlots.resize(p.num_barrier_slots, WFBarrier());
 
-    for (int i = 0; i < p->num_barrier_slots; ++i) {
+    for (int i = 0; i < p.num_barrier_slots; ++i) {
         freeBarrierIds.insert(i);
     }
 
     for (int j = 0; j < numVectorALUs; ++j) {
-        lastVaddrWF[j].resize(p->n_wf);
+        lastVaddrWF[j].resize(p.n_wf);
 
-        for (int i = 0; i < p->n_wf; ++i) {
+        for (int i = 0; i < p.n_wf; ++i) {
             lastVaddrWF[j][i].resize(wfSize());
 
-            wfList[j].push_back(p->wavefronts[j * p->n_wf + i]);
+            wfList[j].push_back(p.wavefronts[j * p.n_wf + i]);
             wfList[j][i]->setParent(this);
 
             for (int k = 0; k < wfSize(); ++k) {
@@ -167,25 +167,25 @@ ComputeUnit::ComputeUnit(const Params *p) : ClockedObject(p),
 
     lds.setParent(this);
 
-    if (p->execPolicy == "OLDEST-FIRST") {
+    if (p.execPolicy == "OLDEST-FIRST") {
         exec_policy = EXEC_POLICY::OLDEST;
-    } else if (p->execPolicy == "ROUND-ROBIN") {
+    } else if (p.execPolicy == "ROUND-ROBIN") {
         exec_policy = EXEC_POLICY::RR;
     } else {
         fatal("Invalid WF execution policy (CU)\n");
     }
 
-    for (int i = 0; i < p->port_memory_port_connection_count; ++i) {
+    for (int i = 0; i < p.port_memory_port_connection_count; ++i) {
         memPort.emplace_back(csprintf("%s-port%d", name(), i), this, i);
     }
 
-    for (int i = 0; i < p->port_translation_port_connection_count; ++i) {
+    for (int i = 0; i < p.port_translation_port_connection_count; ++i) {
         tlbPort.emplace_back(csprintf("%s-port%d", name(), i), this, i);
     }
 
     // Setup tokens for response ports. The number of tokens in memPortTokens
     // is the total token count for the entire vector port (i.e., this CU).
-    memPortTokens = new TokenManager(p->max_cu_tokens);
+    memPortTokens = new TokenManager(p.max_cu_tokens);
 
     registerExitCallback([this]() { exitCallback(); });
 
@@ -1381,9 +1381,9 @@ ComputeUnit::DataPort::processMemRespEvent(PacketPtr pkt)
 }
 
 ComputeUnit*
-ComputeUnitParams::create()
+ComputeUnitParams::create() const
 {
-    return new ComputeUnit(this);
+    return new ComputeUnit(*this);
 }
 
 bool
index 2df4807d2c639fb7edb69fbdd9eb8d06ccd911bb..5b1e8de95fb67a5f3d01acf83b69783af88a1161 100644 (file)
@@ -383,7 +383,7 @@ class ComputeUnit : public ClockedObject
     void insertInPipeMap(Wavefront *w);
     void deleteFromPipeMap(Wavefront *w);
 
-    ComputeUnit(const Params *p);
+    ComputeUnit(const Params &p);
     ~ComputeUnit();
 
     // Timing Functions
index 6a8242f11e657363cd1b599dbf408e6643901db9..7c173e85596867a6ea30d505cfb2b04ce4a8b378 100644 (file)
@@ -44,7 +44,7 @@
 #include "sim/syscall_emul_buf.hh"
 #include "sim/system.hh"
 
-GPUDispatcher::GPUDispatcher(const Params *p)
+GPUDispatcher::GPUDispatcher(const Params &p)
     : SimObject(p), shader(nullptr), gpuCmdProc(nullptr),
       tickEvent([this]{ exec(); },
           "GPU Dispatcher tick", false, Event::CPU_Tick_Pri),
@@ -361,7 +361,8 @@ GPUDispatcher::scheduleDispatch()
     }
 }
 
-GPUDispatcher *GPUDispatcherParams::create()
+GPUDispatcher *
+GPUDispatcherParams::create() const
 {
-    return new GPUDispatcher(this);
+    return new GPUDispatcher(*this);
 }
index cd282b9cb418031740f654bdc806ae656fbc4839..b8cd3f1ef786d74d00793412846f92f0402f9bcf 100644 (file)
@@ -62,7 +62,7 @@ class GPUDispatcher : public SimObject
   public:
     typedef GPUDispatcherParams Params;
 
-    GPUDispatcher(const Params *p);
+    GPUDispatcher(const Params &p);
     ~GPUDispatcher();
 
     void serialize(CheckpointOut &cp) const override;
index 79fca724f9784657efbbd10f34c7aab81a6eaf54..81806270ced11b7754b2a8027189441cc88504f8 100644 (file)
@@ -41,7 +41,7 @@
 #include "gpu-compute/vector_register_file.hh"
 #include "gpu-compute/wavefront.hh"
 
-ExecStage::ExecStage(const ComputeUnitParams *p, ComputeUnit &cu,
+ExecStage::ExecStage(const ComputeUnitParams &p, ComputeUnit &cu,
                      ScheduleToExecute &from_schedule)
     : computeUnit(cu), fromSchedule(from_schedule),
       lastTimeInstExecuted(false),
index 23e9369b3d3285b2e927cc0340f14dc6bec3366f..4051b31d9c669122c06558e668c7914756d30be4 100644 (file)
@@ -71,7 +71,7 @@ enum DISPATCH_STATUS
 class ExecStage
 {
   public:
-    ExecStage(const ComputeUnitParamsp, ComputeUnit &cu,
+    ExecStage(const ComputeUnitParams &p, ComputeUnit &cu,
               ScheduleToExecute &from_schedule);
     ~ExecStage() { }
     void init();
index 6c3b8f40ca2f6c89a4aa4242828c3960549502de..8a37756dbc30e2bc8b3a1e37f52f91052575b928 100644 (file)
@@ -36,8 +36,8 @@
 #include "gpu-compute/compute_unit.hh"
 #include "gpu-compute/wavefront.hh"
 
-FetchStage::FetchStage(const ComputeUnitParamsp, ComputeUnit &cu)
-    : numVectorALUs(p->num_SIMDs), computeUnit(cu),
+FetchStage::FetchStage(const ComputeUnitParams &p, ComputeUnit &cu)
+    : numVectorALUs(p.num_SIMDs), computeUnit(cu),
       _name(cu.name() + ".FetchStage")
 {
     for (int j = 0; j < numVectorALUs; ++j) {
index ea556611a2761d9fb7f29b9e3000a26797900c87..16c35d8c721390ba7de4ffe0344dbbf82572a673 100644 (file)
@@ -51,7 +51,7 @@ class Wavefront;
 class FetchStage
 {
   public:
-    FetchStage(const ComputeUnitParamsp, ComputeUnit &cu);
+    FetchStage(const ComputeUnitParams &p, ComputeUnit &cu);
     ~FetchStage();
     void init();
     void exec();
index 5d982884517873ae11a26e296b8a3c3852c34149..62b9e73a14aee164b386d9f6e6c31c8db3a44812 100644 (file)
@@ -46,9 +46,9 @@
 
 uint32_t FetchUnit::globalFetchUnitID;
 
-FetchUnit::FetchUnit(const ComputeUnitParams *p, ComputeUnit &cu)
+FetchUnit::FetchUnit(const ComputeUnitParams &p, ComputeUnit &cu)
     : timingSim(true), computeUnit(cu), fetchScheduler(p),
-      waveList(nullptr), fetchDepth(p->fetch_depth)
+      waveList(nullptr), fetchDepth(p.fetch_depth)
 {
 }
 
index 36ab9c3656cf22c5abf1c7e3e9b7bddcd3f14241..ad341b3ee97e4d803d1a9623f04b19fee3e4ccea 100644 (file)
@@ -49,7 +49,7 @@ class Wavefront;
 class FetchUnit
 {
   public:
-    FetchUnit(const ComputeUnitParamsp, ComputeUnit &cu);
+    FetchUnit(const ComputeUnitParams &p, ComputeUnit &cu);
     ~FetchUnit();
     void init();
     void exec();
index 9fc515aef7359f320088fb0d8502c6353ea420d3..01f986c2539ab33a2e1bb9d8c37ba609f8db5b21 100644 (file)
 #include "gpu-compute/vector_register_file.hh"
 #include "gpu-compute/wavefront.hh"
 
-GlobalMemPipeline::GlobalMemPipeline(const ComputeUnitParamsp,
+GlobalMemPipeline::GlobalMemPipeline(const ComputeUnitParams &p,
                                      ComputeUnit &cu)
     : computeUnit(cu), _name(cu.name() + ".GlobalMemPipeline"),
-      gmQueueSize(p->global_mem_queue_size),
-      maxWaveRequests(p->max_wave_requests), inflightStores(0),
+      gmQueueSize(p.global_mem_queue_size),
+      maxWaveRequests(p.max_wave_requests), inflightStores(0),
       inflightLoads(0)
 {
 }
index c53789ee509865f50d95225d0f0bc29f9a1415f5..a1b652a7de4381026c2927fdef72ef47e87fe174 100644 (file)
@@ -56,7 +56,7 @@ class ComputeUnit;
 class GlobalMemPipeline
 {
   public:
-    GlobalMemPipeline(const ComputeUnitParams *p, ComputeUnit &cu);
+    GlobalMemPipeline(const ComputeUnitParams &p, ComputeUnit &cu);
     void init();
     void exec();
 
index fccc03582336b14f6b6c7ad2a18e504decc648d9..c2d07f795e7605e6c0dc6fe2244ed7959cee9931 100644 (file)
@@ -40,8 +40,8 @@
 #include "gpu-compute/dispatcher.hh"
 #include "params/GPUCommandProcessor.hh"
 
-GPUCommandProcessor::GPUCommandProcessor(const Params *p)
-    : HSADevice(p), dispatcher(*p->dispatcher)
+GPUCommandProcessor::GPUCommandProcessor(const Params &p)
+    : HSADevice(p), dispatcher(*p.dispatcher)
 {
     dispatcher.setCommandProcessor(this);
 }
@@ -223,7 +223,7 @@ GPUCommandProcessor::shader()
 }
 
 GPUCommandProcessor*
-GPUCommandProcessorParams::create()
+GPUCommandProcessorParams::create() const
 {
-    return new GPUCommandProcessor(this);
+    return new GPUCommandProcessor(*this);
 }
index 7253dd4216b80b6f886c99f92ba527914410abca..d38ee1f0b507b475bc3f07c9502c727b9e7d333e 100644 (file)
@@ -60,7 +60,7 @@ class GPUCommandProcessor : public HSADevice
     typedef GPUCommandProcessorParams Params;
 
     GPUCommandProcessor() = delete;
-    GPUCommandProcessor(const Params *p);
+    GPUCommandProcessor(const Params &p);
 
     void setShader(Shader *shader);
     Shader* shader();
index b4d65ce659e5dfd414fa05add688ac76fb8790e0..325a844dc4695c568d8744345461cc11ef889741 100644 (file)
@@ -44,7 +44,7 @@
 #include "params/GPUComputeDriver.hh"
 #include "sim/syscall_emul_buf.hh"
 
-GPUComputeDriver::GPUComputeDriver(Params *p)
+GPUComputeDriver::GPUComputeDriver(const Params &p)
     : HSADriver(p)
 {
     DPRINTF(GPUDriver, "Constructing KFD: device\n");
@@ -412,7 +412,7 @@ GPUComputeDriver::ldsApeLimit(Addr apeBase) const
 }
 
 GPUComputeDriver*
-GPUComputeDriverParams::create()
+GPUComputeDriverParams::create() const
 {
-    return new GPUComputeDriver(this);
+    return new GPUComputeDriver(*this);
 }
index b13531de4c99d370fb91e845b4082edea12d97c0..53dfb748fb52235d52305674def0027e98f16ad9 100644 (file)
@@ -53,7 +53,7 @@ class GPUComputeDriver final : public HSADriver
 {
   public:
     typedef GPUComputeDriverParams Params;
-    GPUComputeDriver(Params *p);
+    GPUComputeDriver(const Params &p);
     int ioctl(ThreadContext *tc, unsigned req, Addr ioc_buf) override;
 
   private:
index 54c3729e9eb6b9f2ceba1d2024c113d9cd34b8b1..c4450fabaa02b12f0bea806885a6b21a35892f9c 100644 (file)
 namespace X86ISA
 {
 
-    GpuTLB::GpuTLB(const Params *p)
-        : ClockedObject(p), configAddress(0), size(p->size),
+    GpuTLB::GpuTLB(const Params &p)
+        : ClockedObject(p), configAddress(0), size(p.size),
           cleanupEvent([this]{ cleanup(); }, name(), false,
                        Event::Maximum_Pri),
           exitEvent([this]{ exitCallback(); }, name())
     {
-        assoc = p->assoc;
+        assoc = p.assoc;
         assert(assoc <= size);
         numSets = size/assoc;
-        allocationPolicy = p->allocationPolicy;
+        allocationPolicy = p.allocationPolicy;
         hasMemSidePort = false;
-        accessDistance = p->accessDistance;
+        accessDistance = p.accessDistance;
 
         tlb.assign(size, TlbEntry());
 
@@ -100,7 +100,7 @@ namespace X86ISA
          */
         setMask = numSets - 1;
 
-        maxCoalescedReqs = p->maxOutstandingReqs;
+        maxCoalescedReqs = p.maxOutstandingReqs;
 
         // Do not allow maxCoalescedReqs to be more than the TLB associativity
         if (maxCoalescedReqs > assoc) {
@@ -109,18 +109,18 @@ namespace X86ISA
         }
 
         outstandingReqs = 0;
-        hitLatency = p->hitLatency;
-        missLatency1 = p->missLatency1;
-        missLatency2 = p->missLatency2;
+        hitLatency = p.hitLatency;
+        missLatency1 = p.missLatency1;
+        missLatency2 = p.missLatency2;
 
         // create the response ports based on the number of connected ports
-        for (size_t i = 0; i < p->port_cpu_side_ports_connection_count; ++i) {
+        for (size_t i = 0; i < p.port_cpu_side_ports_connection_count; ++i) {
             cpuSidePort.push_back(new CpuSidePort(csprintf("%s-port%d",
                                   name(), i), this, i));
         }
 
         // create the request ports based on the number of connected ports
-        for (size_t i = 0; i < p->port_mem_side_ports_connection_count; ++i) {
+        for (size_t i = 0; i < p.port_mem_side_ports_connection_count; ++i) {
             memSidePort.push_back(new MemSidePort(csprintf("%s-port%d",
                                   name(), i), this, i));
         }
@@ -1516,8 +1516,8 @@ namespace X86ISA
 } // namespace X86ISA
 
 X86ISA::GpuTLB*
-X86GPUTLBParams::create()
+X86GPUTLBParams::create() const
 {
-    return new X86ISA::GpuTLB(this);
+    return new X86ISA::GpuTLB(*this);
 }
 
index 03b22bd91206f0acf69db2c1ede977cc13608dd0..edf5914a79dc3327968a167bca8c451cb08e0cd9 100644 (file)
@@ -71,7 +71,7 @@ namespace X86ISA
 
       public:
         typedef X86GPUTLBParams Params;
-        GpuTLB(const Params *p);
+        GpuTLB(const Params &p);
         ~GpuTLB();
 
         typedef enum BaseTLB::Mode Mode;
index 58c5d986e2228b2bee9c43f4bf5a0f15e2b5d8c6..f07b9c297fef6e260567e06e7b6f8306a1f0c800 100644 (file)
 /**
  * the default constructor that works with SWIG
  */
-LdsState::LdsState(const Params *params) :
+LdsState::LdsState(const Params &params) :
     ClockedObject(params),
     tickEvent(this),
     cuPort(name() + ".port", this),
-    maximumSize(params->size),
-    range(params->range),
-    bankConflictPenalty(params->bankConflictPenalty),
-    banks(params->banks)
+    maximumSize(params.size),
+    range(params.range),
+    bankConflictPenalty(params.bankConflictPenalty),
+    banks(params.banks)
 {
-    fatal_if(params->banks <= 0,
+    fatal_if(params.banks <= 0,
              "Number of LDS banks should be positive number");
-    fatal_if((params->banks & (params->banks - 1)) != 0,
+    fatal_if((params.banks & (params.banks - 1)) != 0,
              "Number of LDS banks should be a power of 2");
-    fatal_if(params->size <= 0,
+    fatal_if(params.size <= 0,
              "cannot allocate an LDS with a size less than 1");
-    fatal_if(params->size % 2,
+    fatal_if(params.size % 2,
           "the LDS should be an even number");
 }
 
@@ -67,9 +67,9 @@ LdsState::LdsState(const Params *params) :
  * Needed by the SWIG compiler
  */
 LdsState *
-LdsStateParams::create()
+LdsStateParams::create() const
 {
-    return new LdsState(this);
+    return new LdsState(*this);
 }
 
 /**
index 1caf4129030920f0e4beb438eab02536d608c46e..9b13a8f77c38b26dfa0ff996bc766f2d1d7f3f8c 100644 (file)
@@ -261,7 +261,7 @@ class LdsState: public ClockedObject
   public:
     typedef LdsStateParams Params;
 
-    LdsState(const Params *params);
+    LdsState(const Params &params);
 
     // prevent copy construction
     LdsState(const LdsState&) = delete;
@@ -271,10 +271,10 @@ class LdsState: public ClockedObject
         parent = nullptr;
     }
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     bool
index ca090e956a9b04f4652c0f2e38bd219ebdece5a4..3b39820f33bf09ca62fae44e1c7b6f0c122f3f1f 100644 (file)
@@ -41,9 +41,9 @@
 #include "gpu-compute/vector_register_file.hh"
 #include "gpu-compute/wavefront.hh"
 
-LocalMemPipeline::LocalMemPipeline(const ComputeUnitParamsp, ComputeUnit &cu)
+LocalMemPipeline::LocalMemPipeline(const ComputeUnitParams &p, ComputeUnit &cu)
     : computeUnit(cu), _name(cu.name() + ".LocalMemPipeline"),
-      lmQueueSize(p->local_mem_queue_size)
+      lmQueueSize(p.local_mem_queue_size)
 {
 }
 
index 3ff3b79eccd2c7688460fc32b3a86c7245b7f713..98cc75b7ad64940de3bf13e3a9e2e96e5a27d8b5 100644 (file)
@@ -55,7 +55,7 @@ class Wavefront;
 class LocalMemPipeline
 {
   public:
-    LocalMemPipeline(const ComputeUnitParams *p, ComputeUnit &cu);
+    LocalMemPipeline(const ComputeUnitParams &p, ComputeUnit &cu);
     void exec();
     std::queue<GPUDynInstPtr> &getLMRespFIFO() { return lmReturnedRequests; }
 
index 6c95ca25a0a47ddf7da3a23226e9817a7b8e9b32..0a0911f80c3a6ede54c8fab87fab2b65d12506ca 100644 (file)
@@ -33,8 +33,8 @@
 
 #include "gpu-compute/pool_manager.hh"
 
-PoolManager::PoolManager(const PoolManagerParams *p)
-    : SimObject(p), _minAllocation(p->min_alloc), _poolSize(p->pool_size)
+PoolManager::PoolManager(const PoolManagerParams &p)
+    : SimObject(p), _minAllocation(p.min_alloc), _poolSize(p.pool_size)
 {
     assert(_poolSize > 0);
 }
index 9bbaa64594cf9b993b2b230d88ec6d5d0bfaf7c6..0f102c2d833e15beea99b8bd64288b7704d903b2 100644 (file)
@@ -45,7 +45,7 @@
 class PoolManager : public SimObject
 {
   public:
-    PoolManager(const PoolManagerParams *p);
+    PoolManager(const PoolManagerParams &p);
     virtual ~PoolManager() { _poolSize = 0; }
     uint32_t minAllocation() { return _minAllocation; }
     virtual std::string printRegion() = 0;
index eb6474cd219dbe97e146806e5ffcbc99169637ba..51d5693c1e3350f1ba1842379491e1a2e049f572 100644 (file)
@@ -48,8 +48,8 @@
 #include "gpu-compute/wavefront.hh"
 #include "params/RegisterFile.hh"
 
-RegisterFile::RegisterFile(const RegisterFileParams *p)
-    : SimObject(p), simdId(p->simd_id), _numRegs(p->num_regs)
+RegisterFile::RegisterFile(const RegisterFileParams &p)
+    : SimObject(p), simdId(p.simd_id), _numRegs(p.num_regs)
 {
     fatal_if((_numRegs % 2) != 0, "VRF size is illegal\n");
     fatal_if(simdId < 0, "Illegal SIMD id for VRF");
@@ -172,9 +172,9 @@ RegisterFile::waveExecuteInst(Wavefront *w, GPUDynInstPtr ii)
 }
 
 RegisterFile*
-RegisterFileParams::create()
+RegisterFileParams::create() const
 {
-    return new RegisterFile(this);
+    return new RegisterFile(*this);
 }
 
 // Events
index 4bd705a5edde62e12e2ea686925a3a472f3cfc5f..8a417a357447da39f412936698d551c1282d92db 100644 (file)
@@ -58,7 +58,7 @@ struct RegisterFileParams;
 class RegisterFile : public SimObject
 {
   public:
-    RegisterFile(const RegisterFileParams *p);
+    RegisterFile(const RegisterFileParams &p);
     virtual ~RegisterFile();
     virtual void setParent(ComputeUnit *_computeUnit);
     int numRegs() const { return _numRegs; }
index 65c126066f30a14a3e548b91d7f22e2f74be0bd9..fefb329609a3dd025381804e91bf85a1c7836cec 100644 (file)
 #include "gpu-compute/wavefront.hh"
 #include "params/RegisterManager.hh"
 
-RegisterManager::RegisterManager(const RegisterManagerParams *p)
-    : SimObject(p), srfPoolMgrs(p->srf_pool_managers),
-      vrfPoolMgrs(p->vrf_pool_managers)
+RegisterManager::RegisterManager(const RegisterManagerParams &p)
+    : SimObject(p), srfPoolMgrs(p.srf_pool_managers),
+      vrfPoolMgrs(p.vrf_pool_managers)
 {
-    if (p->policy == "static") {
+    if (p.policy == "static") {
         policy = new StaticRegisterManagerPolicy();
     } else {
         fatal("Unimplemented Register Manager Policy");
@@ -137,7 +137,7 @@ RegisterManager::regStats()
 }
 
 RegisterManager*
-RegisterManagerParams::create()
+RegisterManagerParams::create() const
 {
-    return new RegisterManager(this);
+    return new RegisterManager(*this);
 }
index 60acf9533d0dc94315f9d4c20d31ef0ea2dd1871..e09a748f131f71eaa9f6a4b100c49bbef4926e40 100644 (file)
@@ -58,7 +58,7 @@ struct RegisterManagerParams;
 class RegisterManager : public SimObject
 {
   public:
-    RegisterManager(const RegisterManagerParamsparams);
+    RegisterManager(const RegisterManagerParams &params);
     ~RegisterManager();
     void setParent(ComputeUnit *cu);
     void exec();
index 5e4496d51da52c9eea647c28cf18234bc7d16895..35db8a351579cc07f998ce7ce678e9d339fb1517 100644 (file)
 #include "gpu-compute/shader.hh"
 #include "gpu-compute/wavefront.hh"
 
-ScalarMemPipeline::ScalarMemPipeline(const ComputeUnitParamsp,
+ScalarMemPipeline::ScalarMemPipeline(const ComputeUnitParams &p,
                                      ComputeUnit &cu)
     : computeUnit(cu), _name(cu.name() + ".ScalarMemPipeline"),
-      queueSize(p->scalar_mem_queue_size),
+      queueSize(p.scalar_mem_queue_size),
       inflightStores(0), inflightLoads(0)
 {
 }
index b839701ae41b4d9be1cb67c4fc5024f167be3550..7f1acecbb657b12b9f62305da16fdc574ddcf583 100644 (file)
@@ -59,7 +59,7 @@ class ComputeUnit;
 class ScalarMemPipeline
 {
   public:
-    ScalarMemPipeline(const ComputeUnitParams *p, ComputeUnit &cu);
+    ScalarMemPipeline(const ComputeUnitParams &p, ComputeUnit &cu);
     void exec();
 
     std::queue<GPUDynInstPtr> &getGMReqFIFO() { return issuedRequests; }
index 150587676f90a5e906087d8497d89ef8d1a3610f..fbb81fe6948d24183008cc67a2722f636d45ab87 100644 (file)
@@ -44,7 +44,7 @@
 #include "gpu-compute/wavefront.hh"
 #include "params/ScalarRegisterFile.hh"
 
-ScalarRegisterFile::ScalarRegisterFile(const ScalarRegisterFileParams *p)
+ScalarRegisterFile::ScalarRegisterFile(const ScalarRegisterFileParams &p)
     : RegisterFile(p)
 {
     regFile.resize(numRegs(), 0);
@@ -158,7 +158,7 @@ ScalarRegisterFile::scheduleWriteOperandsFromLoad(Wavefront *w,
 }
 
 ScalarRegisterFile*
-ScalarRegisterFileParams::create()
+ScalarRegisterFileParams::create() const
 {
-    return new ScalarRegisterFile(this);
+    return new ScalarRegisterFile(*this);
 }
index 8002334b3d9c2b5c6bc70b1c8f360f3a58d21c05..8b1b126dcfedfc13ebc43fcadf9b21652ed60ec3 100644 (file)
@@ -53,7 +53,7 @@ class ScalarRegisterFile : public RegisterFile
   public:
     using ScalarRegU32 = TheGpuISA::ScalarRegU32;
 
-    ScalarRegisterFile(const ScalarRegisterFileParams *p);
+    ScalarRegisterFile(const ScalarRegisterFileParams &p);
     ~ScalarRegisterFile() { }
 
     virtual bool operandsReady(Wavefront *w, GPUDynInstPtr ii) const override;
index a311f5db491cd4198cde7c001db754798d8dc9b0..851cca81b58054ebe62ed95b14d6f87e0809b585 100644 (file)
@@ -43,7 +43,7 @@
 #include "gpu-compute/vector_register_file.hh"
 #include "gpu-compute/wavefront.hh"
 
-ScheduleStage::ScheduleStage(const ComputeUnitParams *p, ComputeUnit &cu,
+ScheduleStage::ScheduleStage(const ComputeUnitParams &p, ComputeUnit &cu,
                              ScoreboardCheckToSchedule &from_scoreboard_check,
                              ScheduleToExecute &to_execute)
     : computeUnit(cu), fromScoreboardCheck(from_scoreboard_check),
index c4dc28237845371ea77f2e4846acb2575a4a1ba2..1a9aca17e8ea3b6a750cce0c4ab5e10060d836a5 100644 (file)
@@ -59,7 +59,7 @@ struct ComputeUnitParams;
 class ScheduleStage
 {
   public:
-    ScheduleStage(const ComputeUnitParams *p, ComputeUnit &cu,
+    ScheduleStage(const ComputeUnitParams &p, ComputeUnit &cu,
                   ScoreboardCheckToSchedule &from_scoreboard_check,
                   ScheduleToExecute &to_execute);
     ~ScheduleStage();
index 3986658e0f4096611e74f37410a5df7d63894b2a..6b3de031366315d00728d9b1ed0f30f5d1fc063a 100644 (file)
 #include "gpu-compute/rr_scheduling_policy.hh"
 #include "params/ComputeUnit.hh"
 
-Scheduler::Scheduler(const ComputeUnitParams *p)
+Scheduler::Scheduler(const ComputeUnitParams &p)
 {
-    if (p->execPolicy == "OLDEST-FIRST") {
+    if (p.execPolicy == "OLDEST-FIRST") {
         schedPolicy = new OFSchedulingPolicy();
-    } else if (p->execPolicy == "ROUND-ROBIN") {
+    } else if (p.execPolicy == "ROUND-ROBIN") {
         schedPolicy = new RRSchedulingPolicy();
     } else {
         fatal("Unimplemented scheduling policy.\n");
index 630433595b478f72127f26245368420a79c06a9d..1acf643741d1f34eb66fd233f1f55893dee980c5 100644 (file)
@@ -43,7 +43,7 @@ class ComputeUnitParams;
 class Scheduler
 {
   public:
-    Scheduler(const ComputeUnitParams *params);
+    Scheduler(const ComputeUnitParams &params);
     Wavefront *chooseWave();
     void bindList(std::vector<Wavefront*> *sched_list);
 
index 0e52d310cec808d6fec1151ab681a5fb9abcd165..dfda0ad79022bd8656705b29bffe11d0718961d4 100644 (file)
@@ -44,7 +44,7 @@
 #include "gpu-compute/wavefront.hh"
 #include "params/ComputeUnit.hh"
 
-ScoreboardCheckStage::ScoreboardCheckStage(const ComputeUnitParams *p,
+ScoreboardCheckStage::ScoreboardCheckStage(const ComputeUnitParams &p,
                                            ComputeUnit &cu,
                                            ScoreboardCheckToSchedule
                                            &to_schedule)
index 87582759bdadeea76ed41724954e15dd031ba817..c45ea7571b28c01d0af717a2dd56f2784203473a 100644 (file)
@@ -71,7 +71,7 @@ class ScoreboardCheckStage
         NRDY_CONDITIONS
     };
 
-    ScoreboardCheckStage(const ComputeUnitParamsp, ComputeUnit &cu,
+    ScoreboardCheckStage(const ComputeUnitParams &p, ComputeUnit &cu,
                          ScoreboardCheckToSchedule &to_schedule);
     ~ScoreboardCheckStage();
     void exec();
index cc039d2f7c73347a04fc9321d278acff95ea585c..0b41193367a05a8d99a9c413d712aadcc30c3900 100644 (file)
 #include "mem/ruby/system/RubySystem.hh"
 #include "sim/sim_exit.hh"
 
-Shader::Shader(const Params *p) : ClockedObject(p),
+Shader::Shader(const Params &p) : ClockedObject(p),
     _activeCus(0), _lastInactiveTick(0), cpuThread(nullptr),
-    gpuTc(nullptr), cpuPointer(p->cpu_pointer),
+    gpuTc(nullptr), cpuPointer(p.cpu_pointer),
     tickEvent([this]{ execScheduledAdds(); }, "Shader scheduled adds event",
           false, Event::CPU_Tick_Pri),
-    timingSim(p->timing), hsail_mode(SIMT),
-    impl_kern_launch_acq(p->impl_kern_launch_acq),
-    impl_kern_end_rel(p->impl_kern_end_rel),
+    timingSim(p.timing), hsail_mode(SIMT),
+    impl_kern_launch_acq(p.impl_kern_launch_acq),
+    impl_kern_end_rel(p.impl_kern_end_rel),
     coissue_return(1),
-    trace_vgpr_all(1), n_cu((p->CUs).size()), n_wf(p->n_wf),
-    globalMemSize(p->globalmem),
-    nextSchedCu(0), sa_n(0), gpuCmdProc(*p->gpu_cmd_proc),
-    _dispatcher(*p->dispatcher),
-    max_valu_insts(p->max_valu_insts), total_valu_insts(0)
+    trace_vgpr_all(1), n_cu((p.CUs).size()), n_wf(p.n_wf),
+    globalMemSize(p.globalmem),
+    nextSchedCu(0), sa_n(0), gpuCmdProc(*p.gpu_cmd_proc),
+    _dispatcher(*p.dispatcher),
+    max_valu_insts(p.max_valu_insts), total_valu_insts(0)
 {
     gpuCmdProc.setShader(this);
     _dispatcher.setShader(this);
@@ -85,10 +85,10 @@ Shader::Shader(const Params *p) : ClockedObject(p),
     panic_if(n_wf <= 0, "Must have at least 1 WF Slot per SIMD");
 
     for (int i = 0; i < n_cu; ++i) {
-        cuList[i] = p->CUs[i];
+        cuList[i] = p.CUs[i];
         assert(i == cuList[i]->cu_id);
         cuList[i]->shader = this;
-        cuList[i]->idleCUTimeout = p->idlecu_timeout;
+        cuList[i]->idleCUTimeout = p.idlecu_timeout;
     }
 }
 
@@ -155,9 +155,9 @@ Shader::updateContext(int cid) {
 }
 
 Shader*
-ShaderParams::create()
+ShaderParams::create() const
 {
-    return new Shader(this);
+    return new Shader(*this);
 }
 
 void
index baf6df46c0c7a7e3f7ab34d85d6e6d6fcf827e26..76ee3c9f7c786bdbcec9dadf068930c8a04ed70c 100644 (file)
@@ -260,7 +260,7 @@ class Shader : public ClockedObject
     int64_t max_valu_insts;
     int64_t total_valu_insts;
 
-    Shader(const Params *p);
+    Shader(const Params &p);
     ~Shader();
     virtual void init();
 
index 1d0f1b8d7d4ab080d3e5dc637997a29da1f41db2..78f4907bd7556cfe5719e791678f34eb9d9dc426 100644 (file)
@@ -36,9 +36,9 @@
 #include "base/logging.hh"
 
 SimplePoolManager *
-SimplePoolManagerParams::create()
+SimplePoolManagerParams::create() const
 {
-    return new SimplePoolManager(this);
+    return new SimplePoolManager(*this);
 }
 
 // return the min number of elements that the manager can reserve given
index 9fd90a50558d55c33bbc3f6b01194574b1853f64..06b04e5f299df3d72292279b00ac8945fe2dc3de 100644 (file)
@@ -45,7 +45,7 @@
 class SimplePoolManager : public PoolManager
 {
   public:
-    SimplePoolManager(const PoolManagerParams *p)
+    SimplePoolManager(const PoolManagerParams &p)
         : PoolManager(p), _regionSize(0), _nxtFreeIdx(0),
           _reservedGroups(0)
     {
index da4030b7270637ad5fa23092eac1042df18ce133..55be11e063368ab44afd91693055799d1ee9b425 100644 (file)
 #include "debug/GPUTLB.hh"
 #include "sim/process.hh"
 
-TLBCoalescer::TLBCoalescer(const Params *p)
+TLBCoalescer::TLBCoalescer(const Params &p)
     : ClockedObject(p),
-      TLBProbesPerCycle(p->probesPerCycle),
-      coalescingWindow(p->coalescingWindow),
-      disableCoalescing(p->disableCoalescing),
+      TLBProbesPerCycle(p.probesPerCycle),
+      coalescingWindow(p.coalescingWindow),
+      disableCoalescing(p.disableCoalescing),
       probeTLBEvent([this]{ processProbeTLBEvent(); },
                     "Probe the TLB below",
                     false, Event::CPU_Tick_Pri),
@@ -53,13 +53,13 @@ TLBCoalescer::TLBCoalescer(const Params *p)
                    false, Event::Maximum_Pri)
 {
     // create the response ports based on the number of connected ports
-    for (size_t i = 0; i < p->port_cpu_side_ports_connection_count; ++i) {
+    for (size_t i = 0; i < p.port_cpu_side_ports_connection_count; ++i) {
         cpuSidePort.push_back(new CpuSidePort(csprintf("%s-port%d", name(), i),
                                               this, i));
     }
 
     // create the request ports based on the number of connected ports
-    for (size_t i = 0; i < p->port_mem_side_ports_connection_count; ++i) {
+    for (size_t i = 0; i < p.port_mem_side_ports_connection_count; ++i) {
         memSidePort.push_back(new MemSidePort(csprintf("%s-port%d", name(), i),
                                               this, i));
     }
@@ -555,8 +555,8 @@ TLBCoalescer::regStats()
 
 
 TLBCoalescer*
-TLBCoalescerParams::create()
+TLBCoalescerParams::create() const
 {
-    return new TLBCoalescer(this);
+    return new TLBCoalescer(*this);
 }
 
index 4ab76f61314223da85b707f3887ff9b94dbaadc1..8b71a982d20eb5aa0a0fde3996759df73a2c9d0e 100644 (file)
@@ -66,7 +66,7 @@ class TLBCoalescer : public ClockedObject
 {
   public:
     typedef TLBCoalescerParams Params;
-    TLBCoalescer(const Params *p);
+    TLBCoalescer(const Params &p);
     ~TLBCoalescer() { }
 
     // Number of TLB probes per cycle. Parameterizable - default 2.
index 3bddfccc115a43d122fe4b524f01b58d18e0b017..a4cc1275e900cea52aec20ca8cd070c26c9816f3 100644 (file)
@@ -44,7 +44,7 @@
 #include "gpu-compute/wavefront.hh"
 #include "params/VectorRegisterFile.hh"
 
-VectorRegisterFile::VectorRegisterFile(const VectorRegisterFileParams *p)
+VectorRegisterFile::VectorRegisterFile(const VectorRegisterFileParams &p)
     : RegisterFile(p)
 {
     regFile.resize(numRegs(), VecRegContainer());
@@ -209,7 +209,7 @@ VectorRegisterFile::scheduleWriteOperandsFromLoad(
 }
 
 VectorRegisterFile*
-VectorRegisterFileParams::create()
+VectorRegisterFileParams::create() const
 {
-    return new VectorRegisterFile(this);
+    return new VectorRegisterFile(*this);
 }
index 0ad086d682ac3c8dd39ff9536cb2e4d29f77b396..a9f60b4fb03da959cb54f45d512f304d767771c3 100644 (file)
@@ -48,7 +48,7 @@ class VectorRegisterFile : public RegisterFile
   public:
     using VecRegContainer = TheGpuISA::VecRegContainerU32;
 
-    VectorRegisterFile(const VectorRegisterFileParams *p);
+    VectorRegisterFile(const VectorRegisterFileParams &p);
     ~VectorRegisterFile() { }
 
     virtual bool operandsReady(Wavefront *w, GPUDynInstPtr ii) const override;
index dd914ca2e056ade8978b98f2f2e903ec7c5f2862..08acb5ed0e24e1c0106cf40aaccfa17d5ac66685 100644 (file)
 #include "gpu-compute/vector_register_file.hh"
 
 Wavefront*
-WavefrontParams::create()
+WavefrontParams::create() const
 {
-    return new Wavefront(this);
+    return new Wavefront(*this);
 }
 
-Wavefront::Wavefront(const Params *p)
-  : SimObject(p), wfSlotId(p->wf_slot_id), simdId(p->simdId),
-    maxIbSize(p->max_ib_size), _gpuISA(*this),
+Wavefront::Wavefront(const Params &p)
+  : SimObject(p), wfSlotId(p.wf_slot_id), simdId(p.simdId),
+    maxIbSize(p.max_ib_size), _gpuISA(*this),
     vmWaitCnt(-1), expWaitCnt(-1), lgkmWaitCnt(-1),
     vmemInstsIssued(0), expInstsIssued(0), lgkmInstsIssued(0),
     barId(WFBarrier::InvalidID)
@@ -83,18 +83,18 @@ Wavefront::Wavefront(const Params *p)
     memTraceBusy = 0;
     oldVgprTcnt = 0xffffffffffffffffll;
     oldDgprTcnt = 0xffffffffffffffffll;
-    oldVgpr.resize(p->wf_size);
+    oldVgpr.resize(p.wf_size);
 
     pendingFetch = false;
     dropFetch = false;
     maxVgprs = 0;
     maxSgprs = 0;
 
-    lastAddr.resize(p->wf_size);
-    workItemFlatId.resize(p->wf_size);
-    oldDgpr.resize(p->wf_size);
+    lastAddr.resize(p.wf_size);
+    workItemFlatId.resize(p.wf_size);
+    oldDgpr.resize(p.wf_size);
     for (int i = 0; i < 3; ++i) {
-        workItemId[i].resize(p->wf_size);
+        workItemId[i].resize(p.wf_size);
     }
 
     _execMask.set();
index 34e45facf31bd712dc7ec514d5a664ee3b7d595f..80fc3248ac54834ca9d7b9d8c2a5e61933ef4094 100644 (file)
@@ -273,7 +273,7 @@ class Wavefront : public SimObject
     uint8_t *context;
 
     typedef WavefrontParams Params;
-    Wavefront(const Params *p);
+    Wavefront(const Params &p);
     ~Wavefront();
     virtual void init();
 
index 090458db33f5ce1f8d13afa0b383e33cf705bf2c..4be0cc69e6042507806955bc57d519cca164236a 100644 (file)
@@ -32,9 +32,9 @@
 #include "debug/HelloExample.hh"
 #include "sim/sim_exit.hh"
 
-GoodbyeObject::GoodbyeObject(GoodbyeObjectParams *params) :
+GoodbyeObject::GoodbyeObject(const GoodbyeObjectParams &params) :
     SimObject(params), event([this]{ processEvent(); }, name() + ".event"),
-    bandwidth(params->write_bandwidth), bufferSize(params->buffer_size),
+    bandwidth(params.write_bandwidth), bufferSize(params.buffer_size),
     buffer(nullptr), bufferUsed(0)
 {
     buffer = new char[bufferSize]();
@@ -96,7 +96,7 @@ GoodbyeObject::fillBuffer()
 }
 
 GoodbyeObject*
-GoodbyeObjectParams::create()
+GoodbyeObjectParams::create() const
 {
-    return new GoodbyeObject(this);
+    return new GoodbyeObject(*this);
 }
index 1e6546bd6f70d94e63256fe59b2bceabf23f47b5..eaf3c5c8f7261aab8bab8ff40de8b332fe7a3445 100644 (file)
@@ -67,7 +67,7 @@ class GoodbyeObject : public SimObject
     int bufferUsed;
 
   public:
-    GoodbyeObject(GoodbyeObjectParams *p);
+    GoodbyeObject(const GoodbyeObjectParams &p);
     ~GoodbyeObject();
 
     /**
index 7207051da3762be724d0800e460195b2047ee1fe..b987c3807a29bf3850d3efae68dd09f35ac5c235 100644 (file)
 #include "base/trace.hh"
 #include "debug/HelloExample.hh"
 
-HelloObject::HelloObject(HelloObjectParams *params) :
+HelloObject::HelloObject(const HelloObjectParams &params) :
     SimObject(params),
     // This is a C++ lambda. When the event is triggered, it will call the
     // processEvent() function. (this must be captured)
     event([this]{ processEvent(); }, name() + ".event"),
-    goodbye(params->goodbye_object),
+    goodbye(params.goodbye_object),
     // Note: This is not needed as you can *always* reference this->name()
-    myName(params->name),
-    latency(params->time_to_wait),
-    timesLeft(params->number_of_fires)
+    myName(params.name),
+    latency(params.time_to_wait),
+    timesLeft(params.number_of_fires)
 {
     DPRINTF(HelloExample, "Created the hello object\n");
     panic_if(!goodbye, "HelloObject must have a non-null GoodbyeObject");
@@ -70,7 +70,7 @@ HelloObject::processEvent()
 }
 
 HelloObject*
-HelloObjectParams::create()
+HelloObjectParams::create() const
 {
-    return new HelloObject(this);
+    return new HelloObject(*this);
 }
index b1dd6cc3a507d9668fd994079c6a651df170ec1b..ce167ff1d6ed7bacc471f73fae25a8fbff8cece8 100644 (file)
@@ -59,7 +59,7 @@ class HelloObject : public SimObject
     int timesLeft;
 
   public:
-    HelloObject(HelloObjectParams *p);
+    HelloObject(const HelloObjectParams &p);
 
     /**
      * Part of a SimObject's initilaization. Startup is called after all
index d91eb3c62b3c7267103a110798c94e4430f5faa9..0565202043bc7ae35a65b14361c5bd99d5b492ec 100644 (file)
 #include "debug/SimpleCache.hh"
 #include "sim/system.hh"
 
-SimpleCache::SimpleCache(SimpleCacheParams *params) :
+SimpleCache::SimpleCache(const SimpleCacheParams &params) :
     ClockedObject(params),
-    latency(params->latency),
-    blockSize(params->system->cacheLineSize()),
-    capacity(params->size / blockSize),
-    memPort(params->name + ".mem_side", this),
+    latency(params.latency),
+    blockSize(params.system->cacheLineSize()),
+    capacity(params.size / blockSize),
+    memPort(params.name + ".mem_side", this),
     blocked(false), originalPacket(nullptr), waitingPortId(-1), stats(this)
 {
     // Since the CPU side ports are a vector of ports, create an instance of
     // the CPUSidePort for each connection. This member of params is
     // automatically created depending on the name of the vector port and
     // holds the number of connections to this port name
-    for (int i = 0; i < params->port_cpu_side_connection_count; ++i) {
-        cpuPorts.emplace_back(name() + csprintf(".cpu_side[%d]", i),
-                                                             i, this);
+    for (int i = 0; i < params.port_cpu_side_connection_count; ++i) {
+        cpuPorts.emplace_back(name() + csprintf(".cpu_side[%d]", i), i, this);
     }
 }
 
@@ -435,7 +434,7 @@ SimpleCache::SimpleCacheStats::SimpleCacheStats(Stats::Group *parent)
 
 
 SimpleCache*
-SimpleCacheParams::create()
+SimpleCacheParams::create() const
 {
-    return new SimpleCache(this);
+    return new SimpleCache(*this);
 }
index 2f39f3d00b96a6152b872f01eaccd32ed8cac2d7..68ab0012b167c945a2f10427cbc5481dafad8d9a 100644 (file)
@@ -306,7 +306,7 @@ class SimpleCache : public ClockedObject
 
     /** constructor
      */
-    SimpleCache(SimpleCacheParams *params);
+    SimpleCache(const SimpleCacheParams &params);
 
     /**
      * Get a port with a given name and index. This is used at
index 6fd287c9ebb7b0e802637e32314d1376943f9d7d..49032207042b7b54f525beaa9a720a43eb3ef386 100644 (file)
 #include "base/trace.hh"
 #include "debug/SimpleMemobj.hh"
 
-SimpleMemobj::SimpleMemobj(SimpleMemobjParams *params) :
+SimpleMemobj::SimpleMemobj(const SimpleMemobjParams &params) :
     SimObject(params),
-    instPort(params->name + ".inst_port", this),
-    dataPort(params->name + ".data_port", this),
-    memPort(params->name + ".mem_side", this),
+    instPort(params.name + ".inst_port", this),
+    dataPort(params.name + ".data_port", this),
+    memPort(params.name + ".mem_side", this),
     blocked(false)
 {
 }
@@ -232,7 +232,7 @@ SimpleMemobj::sendRangeChange()
 
 
 SimpleMemobj*
-SimpleMemobjParams::create()
+SimpleMemobjParams::create() const
 {
-    return new SimpleMemobj(this);
+    return new SimpleMemobj(*this);
 }
index 11a4b36ce023b31c5e6fd86eb97056bd353b7893..fb5295be841acce4f54a6cba803c920cadad320d 100644 (file)
@@ -231,7 +231,7 @@ class SimpleMemobj : public SimObject
 
     /** constructor
      */
-    SimpleMemobj(SimpleMemobjParams *params);
+    SimpleMemobj(const SimpleMemobjParams &params);
 
     /**
      * Get a port with a given name and index. This is used at
index 353fddfca16d331c24815076bb8f962a00ead889..4b482da90a64bd7265170be512d809058f672746 100644 (file)
 
 #include <iostream>
 
-SimpleObject::SimpleObject(SimpleObjectParams *params) :
+SimpleObject::SimpleObject(const SimpleObjectParams &params) :
     SimObject(params)
 {
     std::cout << "Hello World! From a SimObject!" << std::endl;
 }
 
 SimpleObject*
-SimpleObjectParams::create()
+SimpleObjectParams::create() const
 {
-    return new SimpleObject(this);
+    return new SimpleObject(*this);
 }
index b6e9ce1d448b99c5db008f68f0207ae189074dda..7d49fc884229f007ae46d37534513e3b856fd29c 100644 (file)
@@ -35,7 +35,7 @@
 class SimpleObject : public SimObject
 {
   public:
-    SimpleObject(SimpleObjectParams *p);
+    SimpleObject(const SimpleObjectParams &p);
 };
 
 #endif // __LEARNING_GEM5_SIMPLE_OBJECT_HH__
index 10aea37f12d6bcce70abc880a905a0a249db3c6f..3600f34fb4b76ae03b1687d2621b7df1c02c814f 100644 (file)
 
 using namespace std;
 
-AbstractMemory::AbstractMemory(const Params *p) :
-    ClockedObject(p), range(params()->range), pmemAddr(NULL),
-    backdoor(params()->range, nullptr,
+AbstractMemory::AbstractMemory(const Params &p) :
+    ClockedObject(p), range(p.range), pmemAddr(NULL),
+    backdoor(params().range, nullptr,
              (MemBackdoor::Flags)(MemBackdoor::Readable |
                                   MemBackdoor::Writeable)),
-    confTableReported(p->conf_table_reported), inAddrMap(p->in_addr_map),
-    kvmMap(p->kvm_map), _system(NULL),
+    confTableReported(p.conf_table_reported), inAddrMap(p.in_addr_map),
+    kvmMap(p.kvm_map), _system(NULL),
     stats(*this)
 {
     panic_if(!range.valid() || !range.size(),
@@ -72,7 +72,7 @@ AbstractMemory::initState()
 {
     ClockedObject::initState();
 
-    const auto &file = params()->image_file;
+    const auto &file = params().image_file;
     if (file == "")
         return;
 
index fe41ddcebcb5b0b5f16358d0d175520aed459bbb..cd18e0f96663efade89c424889b6e5c88381fc54 100644 (file)
@@ -206,7 +206,7 @@ class AbstractMemory : public ClockedObject
 
     typedef AbstractMemoryParams Params;
 
-    AbstractMemory(const Paramsp);
+    AbstractMemory(const Params &p);
     virtual ~AbstractMemory() {}
 
     void initState() override;
@@ -217,7 +217,7 @@ class AbstractMemory : public ClockedObject
      *
      * @return true if null
      */
-    bool isNull() const { return params()->null; }
+    bool isNull() const { return params().null; }
 
     /**
      * Set the host memory backing store to be used by this memory
@@ -251,10 +251,10 @@ class AbstractMemory : public ClockedObject
      */
     void system(System *sys) { _system = sys; }
 
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
     /**
index 08a5cacd3d20ca6fa06d1f8f6d232e8cc8eca20e..86a81e019047a32a4a2f18342a4dd23c2a77349c 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "mem/addr_mapper.hh"
 
-AddrMapper::AddrMapper(const AddrMapperParamsp)
+AddrMapper::AddrMapper(const AddrMapperParams &p)
     : SimObject(p),
       memSidePort(name() + "-mem_side_port", *this),
       cpuSidePort(name() + "-cpu_side_port", *this)
@@ -200,10 +200,10 @@ AddrMapper::recvRangeChange()
     cpuSidePort.sendRangeChange();
 }
 
-RangeAddrMapper::RangeAddrMapper(const RangeAddrMapperParamsp) :
+RangeAddrMapper::RangeAddrMapper(const RangeAddrMapperParams &p) :
     AddrMapper(p),
-    originalRanges(p->original_ranges),
-    remappedRanges(p->remapped_ranges)
+    originalRanges(p.original_ranges),
+    remappedRanges(p.remapped_ranges)
 {
     if (originalRanges.size() != remappedRanges.size())
         fatal("AddrMapper: original and shadowed range list must "
@@ -217,9 +217,9 @@ RangeAddrMapper::RangeAddrMapper(const RangeAddrMapperParams* p) :
 }
 
 RangeAddrMapper*
-RangeAddrMapperParams::create()
+RangeAddrMapperParams::create() const
 {
-    return new RangeAddrMapper(this);
+    return new RangeAddrMapper(*this);
 }
 
 Addr
index 39db25a8769e41335578057d6cb9a0bc1ba40935..2fad1330cae146fd2894bd349e690b691f88aa40 100644 (file)
@@ -57,7 +57,7 @@ class AddrMapper : public SimObject
 
   public:
 
-    AddrMapper(const AddrMapperParamsparams);
+    AddrMapper(const AddrMapperParams &params);
 
     virtual ~AddrMapper() { }
 
@@ -241,7 +241,7 @@ class RangeAddrMapper : public AddrMapper
 
   public:
 
-    RangeAddrMapper(const RangeAddrMapperParamsp);
+    RangeAddrMapper(const RangeAddrMapperParams &p);
 
     ~RangeAddrMapper() { }
 
index ae1b8eeb69055c537cfb9c63b7ad5d443184d3c6..135d32c42989c06497b16139c34b27de5feca82a 100644 (file)
@@ -74,12 +74,12 @@ Bridge::BridgeRequestPort::BridgeRequestPort(const std::string& _name,
 {
 }
 
-Bridge::Bridge(Params *p)
+Bridge::Bridge(const Params &p)
     : ClockedObject(p),
-      cpuSidePort(p->name + ".cpu_side_port", *this, memSidePort,
-                ticksToCycles(p->delay), p->resp_size, p->ranges),
-      memSidePort(p->name + ".mem_side_port", *this, cpuSidePort,
-                 ticksToCycles(p->delay), p->req_size)
+      cpuSidePort(p.name + ".cpu_side_port", *this, memSidePort,
+                ticksToCycles(p.delay), p.resp_size, p.ranges),
+      memSidePort(p.name + ".mem_side_port", *this, cpuSidePort,
+                 ticksToCycles(p.delay), p.req_size)
 {
 }
 
@@ -392,7 +392,7 @@ Bridge::BridgeResponsePort::getAddrRanges() const
 }
 
 Bridge *
-BridgeParams::create()
+BridgeParams::create() const
 {
-    return new Bridge(this);
+    return new Bridge(*this);
 }
index 2b03e136d92b4115782789d6d0438a23d6bd5b85..8f74478e1a72c8147a8a371666f2c5b4af76c969 100644 (file)
@@ -322,7 +322,7 @@ class Bridge : public ClockedObject
 
     typedef BridgeParams Params;
 
-    Bridge(Params *p);
+    Bridge(const Params &p);
 };
 
 #endif //__MEM_BRIDGE_HH__
index a24ffc765be31d74ad3793535f0d94aa97683e18..a86cc2e92829a3a27796b170ee15263ccb476676 100644 (file)
@@ -73,38 +73,38 @@ BaseCache::CacheResponsePort::CacheResponsePort(const std::string &_name,
 {
 }
 
-BaseCache::BaseCache(const BaseCacheParams *p, unsigned blk_size)
+BaseCache::BaseCache(const BaseCacheParams &p, unsigned blk_size)
     : ClockedObject(p),
-      cpuSidePort (p->name + ".cpu_side_port", this, "CpuSidePort"),
-      memSidePort(p->name + ".mem_side_port", this, "MemSidePort"),
-      mshrQueue("MSHRs", p->mshrs, 0, p->demand_mshr_reserve), // see below
-      writeBuffer("write buffer", p->write_buffers, p->mshrs), // see below
-      tags(p->tags),
-      compressor(p->compressor),
-      prefetcher(p->prefetcher),
-      writeAllocator(p->write_allocator),
-      writebackClean(p->writeback_clean),
+      cpuSidePort (p.name + ".cpu_side_port", this, "CpuSidePort"),
+      memSidePort(p.name + ".mem_side_port", this, "MemSidePort"),
+      mshrQueue("MSHRs", p.mshrs, 0, p.demand_mshr_reserve), // see below
+      writeBuffer("write buffer", p.write_buffers, p.mshrs), // see below
+      tags(p.tags),
+      compressor(p.compressor),
+      prefetcher(p.prefetcher),
+      writeAllocator(p.write_allocator),
+      writebackClean(p.writeback_clean),
       tempBlockWriteback(nullptr),
       writebackTempBlockAtomicEvent([this]{ writebackTempBlockAtomic(); },
                                     name(), false,
                                     EventBase::Delayed_Writeback_Pri),
       blkSize(blk_size),
-      lookupLatency(p->tag_latency),
-      dataLatency(p->data_latency),
-      forwardLatency(p->tag_latency),
-      fillLatency(p->data_latency),
-      responseLatency(p->response_latency),
-      sequentialAccess(p->sequential_access),
-      numTarget(p->tgts_per_mshr),
+      lookupLatency(p.tag_latency),
+      dataLatency(p.data_latency),
+      forwardLatency(p.tag_latency),
+      fillLatency(p.data_latency),
+      responseLatency(p.response_latency),
+      sequentialAccess(p.sequential_access),
+      numTarget(p.tgts_per_mshr),
       forwardSnoops(true),
-      clusivity(p->clusivity),
-      isReadOnly(p->is_read_only),
+      clusivity(p.clusivity),
+      isReadOnly(p.is_read_only),
       blocked(0),
       order(0),
       noTargetMSHR(nullptr),
-      missCount(p->max_miss_count),
-      addrRanges(p->addr_ranges.begin(), p->addr_ranges.end()),
-      system(p->system),
+      missCount(p.max_miss_count),
+      addrRanges(p.addr_ranges.begin(), p.addr_ranges.end()),
+      system(p.system),
       stats(*this)
 {
     // the MSHR queue has no reserve entries as we check the MSHR
@@ -2500,7 +2500,7 @@ WriteAllocator::updateMode(Addr write_addr, unsigned write_size,
 }
 
 WriteAllocator*
-WriteAllocatorParams::create()
+WriteAllocatorParams::create() const
 {
-    return new WriteAllocator(this);
+    return new WriteAllocator(*this);
 }
index 9986484926fb73f28558b27b1e3e72ddfdd02537..99b03abf542adf81b04a44050e90ab89bd38a4c7 100644 (file)
@@ -1074,7 +1074,7 @@ class BaseCache : public ClockedObject
     void regProbePoints() override;
 
   public:
-    BaseCache(const BaseCacheParams *p, unsigned blk_size);
+    BaseCache(const BaseCacheParams &p, unsigned blk_size);
     ~BaseCache();
 
     void init() override;
@@ -1301,11 +1301,11 @@ class BaseCache : public ClockedObject
  */
 class WriteAllocator : public SimObject {
   public:
-    WriteAllocator(const WriteAllocatorParams *p) :
+    WriteAllocator(const WriteAllocatorParams &p) :
         SimObject(p),
-        coalesceLimit(p->coalesce_limit * p->block_size),
-        noAllocateLimit(p->no_allocate_limit * p->block_size),
-        delayThreshold(p->delay_threshold)
+        coalesceLimit(p.coalesce_limit * p.block_size),
+        noAllocateLimit(p.no_allocate_limit * p.block_size),
+        delayThreshold(p.delay_threshold)
     {
         reset();
     }
index b9cf8308dcd125eff3887c6c98cc54035faa2a21..04156c8f8272afceab22d9d58ba3f401da97a6fa 100644 (file)
@@ -63,8 +63,8 @@
 #include "mem/request.hh"
 #include "params/Cache.hh"
 
-Cache::Cache(const CacheParams *p)
-    : BaseCache(p, p->system->cacheLineSize()),
+Cache::Cache(const CacheParams &p)
+    : BaseCache(p, p.system->cacheLineSize()),
       doFastWrites(true)
 {
 }
@@ -1431,10 +1431,10 @@ Cache::sendMSHRQueuePacket(MSHR* mshr)
 }
 
 Cache*
-CacheParams::create()
+CacheParams::create() const
 {
     assert(tags);
     assert(replacement_policy);
 
-    return new Cache(this);
+    return new Cache(*this);
 }
index 9fa25ee70ccd289b696b463b9b75f3e811b53106..d370d8bda2d6b2b3f737910f8d785b3c8d82101d 100644 (file)
@@ -155,7 +155,7 @@ class Cache : public BaseCache
 
   public:
     /** Instantiates a basic cache object. */
-    Cache(const CacheParams *p);
+    Cache(const CacheParams &p);
 
     /**
      * Take an MSHR, turn it into a suitable downstream packet, and
index 1408d2ddac917251d2b2e516fb55acc67974e2f2..3e392ae0b5db660f72df68d6c4df076d5d3e6462 100644 (file)
@@ -75,9 +75,9 @@ Base::CompressionData::getSize() const
     return std::ceil(_size/8);
 }
 
-Base::Base(const Params *p)
-  : SimObject(p), blkSize(p->block_size), chunkSizeBits(p->chunk_size_bits),
-    sizeThreshold((blkSize * p->size_threshold_percentage) / 100),
+Base::Base(const Params &p)
+  : SimObject(p), blkSize(p.block_size), chunkSizeBits(p.chunk_size_bits),
+    sizeThreshold((blkSize * p.size_threshold_percentage) / 100),
     stats(*this)
 {
     fatal_if(64 % chunkSizeBits,
index 2725f7189cfbbad2f31647c9e134bbe4d2da56d6..77dcc924824ef43a66690de2823bcf38d0793ec8 100644 (file)
@@ -166,7 +166,7 @@ class Base : public SimObject
 
   public:
     typedef BaseCacheCompressorParams Params;
-    Base(const Params *p);
+    Base(const Params &p);
     virtual ~Base() = default;
 
     /**
index 2d0aafe68b9c90d2d120646c3cf3663f7e194091..6901255b0f4bab7712a2819f80afdd76a9daa07e 100644 (file)
 
 namespace Compressor {
 
-Base64Delta8::Base64Delta8(const Params *p)
+Base64Delta8::Base64Delta8(const Params &p)
     : BaseDelta<uint64_t, 8>(p)
 {
 }
 
-Base64Delta16::Base64Delta16(const Params *p)
+Base64Delta16::Base64Delta16(const Params &p)
     : BaseDelta<uint64_t, 16>(p)
 {
 }
 
-Base64Delta32::Base64Delta32(const Params *p)
+Base64Delta32::Base64Delta32(const Params &p)
     : BaseDelta<uint64_t, 32>(p)
 {
 }
 
-Base32Delta8::Base32Delta8(const Params *p)
+Base32Delta8::Base32Delta8(const Params &p)
     : BaseDelta<uint32_t, 8>(p)
 {
 }
 
-Base32Delta16::Base32Delta16(const Params *p)
+Base32Delta16::Base32Delta16(const Params &p)
     : BaseDelta<uint32_t, 16>(p)
 {
 }
 
-Base16Delta8::Base16Delta8(const Params *p)
+Base16Delta8::Base16Delta8(const Params &p)
     : BaseDelta<uint16_t, 8>(p)
 {
 }
@@ -74,37 +74,37 @@ Base16Delta8::Base16Delta8(const Params *p)
 } // namespace Compressor
 
 Compressor::Base64Delta8*
-Base64Delta8Params::create()
+Base64Delta8Params::create() const
 {
-    return new Compressor::Base64Delta8(this);
+    return new Compressor::Base64Delta8(*this);
 }
 
 Compressor::Base64Delta16*
-Base64Delta16Params::create()
+Base64Delta16Params::create() const
 {
-    return new Compressor::Base64Delta16(this);
+    return new Compressor::Base64Delta16(*this);
 }
 
 Compressor::Base64Delta32*
-Base64Delta32Params::create()
+Base64Delta32Params::create() const
 {
-    return new Compressor::Base64Delta32(this);
+    return new Compressor::Base64Delta32(*this);
 }
 
 Compressor::Base32Delta8*
-Base32Delta8Params::create()
+Base32Delta8Params::create() const
 {
-    return new Compressor::Base32Delta8(this);
+    return new Compressor::Base32Delta8(*this);
 }
 
 Compressor::Base32Delta16*
-Base32Delta16Params::create()
+Base32Delta16Params::create() const
 {
-    return new Compressor::Base32Delta16(this);
+    return new Compressor::Base32Delta16(*this);
 }
 
 Compressor::Base16Delta8*
-Base16Delta8Params::create()
+Base16Delta8Params::create() const
 {
-    return new Compressor::Base16Delta8(this);
+    return new Compressor::Base16Delta8(*this);
 }
index 929b8d1c54e092d48aae86f7f7a9e12bbfde202a..73fa5b66329796cccc41872b8475952881258786 100644 (file)
@@ -121,7 +121,7 @@ class BaseDelta : public DictionaryCompressor<BaseType>
 
   public:
     typedef BaseDictionaryCompressorParams Params;
-    BaseDelta(const Params *p);
+    BaseDelta(const Params &p);
     ~BaseDelta() = default;
 };
 
@@ -159,7 +159,7 @@ class Base64Delta8 : public BaseDelta<uint64_t, 8>
 {
   public:
     typedef Base64Delta8Params Params;
-    Base64Delta8(const Params *p);
+    Base64Delta8(const Params &p);
     ~Base64Delta8() = default;
 };
 
@@ -167,7 +167,7 @@ class Base64Delta16 : public BaseDelta<uint64_t, 16>
 {
   public:
     typedef Base64Delta16Params Params;
-    Base64Delta16(const Params *p);
+    Base64Delta16(const Params &p);
     ~Base64Delta16() = default;
 };
 
@@ -175,7 +175,7 @@ class Base64Delta32 : public BaseDelta<uint64_t, 32>
 {
   public:
     typedef Base64Delta32Params Params;
-    Base64Delta32(const Params *p);
+    Base64Delta32(const Params &p);
     ~Base64Delta32() = default;
 };
 
@@ -183,7 +183,7 @@ class Base32Delta8 : public BaseDelta<uint32_t, 8>
 {
   public:
     typedef Base32Delta8Params Params;
-    Base32Delta8(const Params *p);
+    Base32Delta8(const Params &p);
     ~Base32Delta8() = default;
 };
 
@@ -191,7 +191,7 @@ class Base32Delta16 : public BaseDelta<uint32_t, 16>
 {
   public:
     typedef Base32Delta16Params Params;
-    Base32Delta16(const Params *p);
+    Base32Delta16(const Params &p);
     ~Base32Delta16() = default;
 };
 
@@ -199,7 +199,7 @@ class Base16Delta8 : public BaseDelta<uint16_t, 8>
 {
   public:
     typedef Base16Delta8Params Params;
-    Base16Delta8(const Params *p);
+    Base16Delta8(const Params &p);
     ~Base16Delta8() = default;
 };
 
index 46d62db4a854dcf15cba7c3a399abe00db70533a..9686cb75b2e3703672e56560e00d357166254c91 100644 (file)
@@ -40,7 +40,7 @@
 namespace Compressor {
 
 template <class BaseType, std::size_t DeltaSizeBits>
-BaseDelta<BaseType, DeltaSizeBits>::BaseDelta(const Params *p)
+BaseDelta<BaseType, DeltaSizeBits>::BaseDelta(const Params &p)
     : DictionaryCompressor<BaseType>(p)
 {
 }
index ebbfc1c6f5316ba7fba66b456fc1e17a31795599..16a7d402b738303bb90ec5cfe16334c2bdbefe91 100644 (file)
@@ -36,8 +36,8 @@
 
 namespace Compressor {
 
-BaseDictionaryCompressor::BaseDictionaryCompressor(const Params *p)
-  : Base(p), dictionarySize(p->dictionary_size),
+BaseDictionaryCompressor::BaseDictionaryCompressor(const Params &p)
+  : Base(p), dictionarySize(p.dictionary_size),
     numEntries(0), dictionaryStats(stats, *this)
 {
 }
index 4ba8c8467c7327b5f1ee15c7dce3d188a2f4cd52..fe8af164fe79c60619cb3948aeefd64e367df52a 100644 (file)
@@ -37,7 +37,7 @@
 
 namespace Compressor {
 
-CPack::CPack(const Params *p)
+CPack::CPack(const Params &p)
     : DictionaryCompressor<uint32_t>(p)
 {
 }
@@ -70,7 +70,7 @@ CPack::compress(const std::vector<Chunk>& chunks,
 } // namespace Compressor
 
 Compressor::CPack*
-CPackParams::create()
+CPackParams::create() const
 {
-    return new Compressor::CPack(this);
+    return new Compressor::CPack(*this);
 }
index a6d3e211c77296321015215dcf2761e9e160eb97..694ba816f6c4b0feb1b7c3bc15d4996b5f2ed1d1 100644 (file)
@@ -109,7 +109,7 @@ class CPack : public DictionaryCompressor<uint32_t>
     /**
      * Default constructor.
      */
-    CPack(const Params *p);
+    CPack(const Params &p);
 
     /**
      * Default destructor.
index 873843c318f2d5916b306aa1b49d5171110aabe7..bc9f49a1b552a7f49a2bffb26765793122f3b22e 100644 (file)
@@ -98,7 +98,7 @@ class BaseDictionaryCompressor : public Base
 
   public:
     typedef BaseDictionaryCompressorParams Params;
-    BaseDictionaryCompressor(const Params *p);
+    BaseDictionaryCompressor(const Params &p);
     ~BaseDictionaryCompressor() = default;
 };
 
@@ -266,7 +266,7 @@ class DictionaryCompressor : public BaseDictionaryCompressor
 
   public:
     typedef BaseDictionaryCompressorParams Params;
-    DictionaryCompressor(const Params *p);
+    DictionaryCompressor(const Params &p);
     ~DictionaryCompressor() = default;
 };
 
index 11495a3f56911d2a878624e3f2565b9034b2499f..36a58d085e4cf32c30f906854465042cb7ef1ee1 100644 (file)
@@ -60,7 +60,7 @@ DictionaryCompressor<T>::CompData::addEntry(std::unique_ptr<Pattern> pattern)
 }
 
 template <class T>
-DictionaryCompressor<T>::DictionaryCompressor(const Params *p)
+DictionaryCompressor<T>::DictionaryCompressor(const Params &p)
     : BaseDictionaryCompressor(p)
 {
     dictionary.resize(dictionarySize);
index fb22e7bba7092299b371084f854b37fd1b83d4df..29ee1d3bd85bdc3e9da1b3aa331802ef53799c77 100644 (file)
@@ -37,7 +37,7 @@
 
 namespace Compressor {
 
-FPCD::FPCD(const Params *p)
+FPCD::FPCD(const Params &p)
     : DictionaryCompressor<uint32_t>(p)
 {
 }
@@ -77,7 +77,7 @@ FPCD::compress(const std::vector<Chunk>& chunks,
 } // namespace Compressor
 
 Compressor::FPCD*
-FPCDParams::create()
+FPCDParams::create() const
 {
-    return new Compressor::FPCD(this);
+    return new Compressor::FPCD(*this);
 }
index 6d8f459dd5426276cdc698504528653beeb0f76f..6c4eac1b113355fd9ed38f9b1e2246f19b1fc793 100644 (file)
@@ -145,7 +145,7 @@ class FPCD : public DictionaryCompressor<uint32_t>
 
   public:
     typedef FPCDParams Params;
-    FPCD(const Params *p);
+    FPCD(const Params &p);
     ~FPCD() = default;
 };
 
index 76ec1dbdeeee8471735eaeb3fe11b7ee3d8d5fd2..241f5deccccf69e55758b50c46287988abd54402 100644 (file)
@@ -57,11 +57,11 @@ Multi::MultiCompData::getIndex() const
     return index;
 }
 
-Multi::Multi(const Params *p)
-  : Base(p), compressors(p->compressors),
-    numEncodingBits(p->encoding_in_tags ? 0 :
+Multi::Multi(const Params &p)
+  : Base(p), compressors(p.compressors),
+    numEncodingBits(p.encoding_in_tags ? 0 :
         std::log2(alignToPowerOfTwo(compressors.size()))),
-    extraDecompressionLatency(p->extra_decomp_lat),
+    extraDecompressionLatency(p.extra_decomp_lat),
     multiStats(stats, *this)
 {
     fatal_if(compressors.size() == 0, "There must be at least one compressor");
@@ -205,7 +205,7 @@ Multi::MultiStats::regStats()
 } // namespace Compressor
 
 Compressor::Multi*
-MultiCompressorParams::create()
+MultiCompressorParams::create() const
 {
-    return new Compressor::Multi(this);
+    return new Compressor::Multi(*this);
 }
index fe952d5226c82812e699e3ebc756290c1b57b55e..559501a65fb546129f8e409f21d031de49879831 100644 (file)
@@ -98,7 +98,7 @@ class Multi : public Base
 
   public:
     typedef MultiCompressorParams Params;
-    Multi(const Params *p);
+    Multi(const Params &p);
     ~Multi();
 
     std::unique_ptr<Base::CompressionData> compress(
index 58c4b0e2ae1a5882525fbd25b46f8e0befb2d57d..064ea33ae5bc5ca4716626de049338d6891cd063 100644 (file)
 
 namespace Compressor {
 
-Perfect::Perfect(const Params *p)
-  : Base(p), compressedSize(8 * blkSize / p->max_compression_ratio),
-    compressionLatency(p->compression_latency),
-    decompressionLatency(p->decompression_latency)
+Perfect::Perfect(const Params &p)
+  : Base(p), compressedSize(8 * blkSize / p.max_compression_ratio),
+    compressionLatency(p.compression_latency),
+    decompressionLatency(p.decompression_latency)
 {
 }
 
@@ -73,7 +73,7 @@ Perfect::decompress(const CompressionData* comp_data,
 } // namespace Compressor
 
 Compressor::Perfect*
-PerfectCompressorParams::create()
+PerfectCompressorParams::create() const
 {
-    return new Compressor::Perfect(this);
+    return new Compressor::Perfect(*this);
 }
index eccba6a470f50dcfe231ad501ebd57ccd6108eb4..7b89ca5853b12cea048d601a90f5c33618b813a7 100644 (file)
@@ -67,7 +67,7 @@ class Perfect : public Base
 
   public:
     typedef PerfectCompressorParams Params;
-    Perfect(const Params *p);
+    Perfect(const Params &p);
     ~Perfect() = default;
 };
 
index 1840a64caa563a5f4af654eaeefdd6d5eec0eb73..08020aae89a3088c338b3081e9a07918ac242a90 100644 (file)
@@ -40,7 +40,7 @@
 
 namespace Compressor {
 
-RepeatedQwords::RepeatedQwords(const Params *p)
+RepeatedQwords::RepeatedQwords(const Params &p)
     : DictionaryCompressor<uint64_t>(p)
 {
 }
@@ -80,7 +80,7 @@ RepeatedQwords::compress(const std::vector<Chunk>& chunks,
 } // namespace Compressor
 
 Compressor::RepeatedQwords*
-RepeatedQwordsCompressorParams::create()
+RepeatedQwordsCompressorParams::create() const
 {
-    return new Compressor::RepeatedQwords(this);
+    return new Compressor::RepeatedQwords(*this);
 }
index 31edd6eea46da40d9a5c7f3648d66e3440e136f6..583f70206d0074367ae3c6df1095ed10db825e8b 100644 (file)
@@ -97,7 +97,7 @@ class RepeatedQwords : public DictionaryCompressor<uint64_t>
 
   public:
     typedef RepeatedQwordsCompressorParams Params;
-    RepeatedQwords(const Params *p);
+    RepeatedQwords(const Params &p);
     ~RepeatedQwords() = default;
 };
 
index d5e0199350549f3aea85e22c8c0defc8e4f4ebc9..ad36b6f19a380fed4ae49706ebec2cf93ac694fd 100644 (file)
@@ -40,7 +40,7 @@
 
 namespace Compressor {
 
-Zero::Zero(const Params *p)
+Zero::Zero(const Params &p)
     : DictionaryCompressor<uint64_t>(p)
 {
 }
@@ -78,7 +78,7 @@ Zero::compress(const std::vector<Chunk>& chunks, Cycles& comp_lat,
 } // namespace Compressor
 
 Compressor::Zero*
-ZeroCompressorParams::create()
+ZeroCompressorParams::create() const
 {
-    return new Compressor::Zero(this);
+    return new Compressor::Zero(*this);
 }
index c839910665f0a969af18b60b53f1b68ad52d22b0..a213a3f865157d54ac0173e77e26104b6d31a654 100644 (file)
@@ -97,7 +97,7 @@ class Zero : public DictionaryCompressor<uint64_t>
 
   public:
     typedef ZeroCompressorParams Params;
-    Zero(const Params *p);
+    Zero(const Params &p);
     ~Zero() = default;
 };
 
index c09e9e107fbdec84218e80bc42377e6fa81a08f6..18a885a58e978e2ba0cb274adc8f9d6123964f4b 100644 (file)
@@ -56,8 +56,8 @@
 #include "mem/cache/mshr.hh"
 #include "params/NoncoherentCache.hh"
 
-NoncoherentCache::NoncoherentCache(const NoncoherentCacheParams *p)
-    : BaseCache(p, p->system->cacheLineSize())
+NoncoherentCache::NoncoherentCache(const NoncoherentCacheParams &p)
+    : BaseCache(p, p.system->cacheLineSize())
 {
 }
 
@@ -349,10 +349,10 @@ NoncoherentCache::evictBlock(CacheBlk *blk)
 }
 
 NoncoherentCache*
-NoncoherentCacheParams::create()
+NoncoherentCacheParams::create() const
 {
     assert(tags);
     assert(replacement_policy);
 
-    return new NoncoherentCache(this);
+    return new NoncoherentCache(*this);
 }
index 25c95cad262a511564c687d14449c4fc45a56229..4fade020146a0718c0df69540913f239894df185 100644 (file)
@@ -119,7 +119,7 @@ class NoncoherentCache : public BaseCache
     M5_NODISCARD PacketPtr evictBlock(CacheBlk *blk) override;
 
   public:
-    NoncoherentCache(const NoncoherentCacheParams *p);
+    NoncoherentCache(const NoncoherentCacheParams &p);
 };
 
 #endif // __MEM_CACHE_NONCOHERENTCACHE_HH__
index 28371c789e847f9df9d485960175244af9de12aa..6301c9d1b814d2de9e004a4d502ad32505369bbc 100644 (file)
 namespace Prefetcher {
 
 AccessMapPatternMatching::AccessMapPatternMatching(
-    const AccessMapPatternMatchingParams *p)
-    : ClockedObject(p), blkSize(p->block_size), limitStride(p->limit_stride),
-      startDegree(p->start_degree), hotZoneSize(p->hot_zone_size),
-      highCoverageThreshold(p->high_coverage_threshold),
-      lowCoverageThreshold(p->low_coverage_threshold),
-      highAccuracyThreshold(p->high_accuracy_threshold),
-      lowAccuracyThreshold(p->low_accuracy_threshold),
-      highCacheHitThreshold(p->high_cache_hit_threshold),
-      lowCacheHitThreshold(p->low_cache_hit_threshold),
-      epochCycles(p->epoch_cycles),
-      offChipMemoryLatency(p->offchip_memory_latency),
-      accessMapTable(p->access_map_table_assoc, p->access_map_table_entries,
-                     p->access_map_table_indexing_policy,
-                     p->access_map_table_replacement_policy,
+    const AccessMapPatternMatchingParams &p)
+    : ClockedObject(p), blkSize(p.block_size), limitStride(p.limit_stride),
+      startDegree(p.start_degree), hotZoneSize(p.hot_zone_size),
+      highCoverageThreshold(p.high_coverage_threshold),
+      lowCoverageThreshold(p.low_coverage_threshold),
+      highAccuracyThreshold(p.high_accuracy_threshold),
+      lowAccuracyThreshold(p.low_accuracy_threshold),
+      highCacheHitThreshold(p.high_cache_hit_threshold),
+      lowCacheHitThreshold(p.low_cache_hit_threshold),
+      epochCycles(p.epoch_cycles),
+      offChipMemoryLatency(p.offchip_memory_latency),
+      accessMapTable(p.access_map_table_assoc, p.access_map_table_entries,
+                     p.access_map_table_indexing_policy,
+                     p.access_map_table_replacement_policy,
                      AccessMapEntry(hotZoneSize / blkSize)),
       numGoodPrefetches(0), numTotalPrefetches(0), numRawCacheMisses(0),
       numRawCacheHits(0), degree(startDegree), usefulDegree(startDegree),
@@ -251,8 +251,8 @@ AccessMapPatternMatching::calculatePrefetch(const Base::PrefetchInfo &pfi,
     }
 }
 
-AMPM::AMPM(const AMPMPrefetcherParams *p)
-  : Queued(p), ampm(*p->ampm)
+AMPM::AMPM(const AMPMPrefetcherParams &p)
+  : Queued(p), ampm(*p.ampm)
 {
 }
 
@@ -266,13 +266,13 @@ AMPM::calculatePrefetch(const PrefetchInfo &pfi,
 } // namespace Prefetcher
 
 Prefetcher::AccessMapPatternMatching*
-AccessMapPatternMatchingParams::create()
+AccessMapPatternMatchingParams::create() const
 {
-    return new Prefetcher::AccessMapPatternMatching(this);
+    return new Prefetcher::AccessMapPatternMatching(*this);
 }
 
 Prefetcher::AMPM*
-AMPMPrefetcherParams::create()
+AMPMPrefetcherParams::create() const
 {
-    return new Prefetcher::AMPM(this);
+    return new Prefetcher::AMPM(*this);
 }
index 0064917aff3ab8a729000fab1c05c06980c01478..b9a053642879bdce70c7fbb25bdf8feaf95121a1 100644 (file)
@@ -181,7 +181,7 @@ class AccessMapPatternMatching : public ClockedObject
     EventFunctionWrapper epochEvent;
 
   public:
-    AccessMapPatternMatching(const AccessMapPatternMatchingParamsp);
+    AccessMapPatternMatching(const AccessMapPatternMatchingParams &p);
     ~AccessMapPatternMatching() = default;
 
     void startup() override;
@@ -193,7 +193,7 @@ class AMPM : public Queued
 {
     AccessMapPatternMatching &ampm;
   public:
-    AMPM(const AMPMPrefetcherParamsp);
+    AMPM(const AMPMPrefetcherParams &p);
     ~AMPM() = default;
 
     void calculatePrefetch(const PrefetchInfo &pfi,
index 2ff466b6a426fb7fa1825af5141510b63932422f..28aaa627d06a4d68a6f142386aa647093070d42a 100644 (file)
@@ -88,14 +88,14 @@ Base::PrefetchListener::notify(const PacketPtr &pkt)
     }
 }
 
-Base::Base(const BasePrefetcherParams *p)
-    : ClockedObject(p), listeners(), cache(nullptr), blkSize(p->block_size),
-      lBlkSize(floorLog2(blkSize)), onMiss(p->on_miss), onRead(p->on_read),
-      onWrite(p->on_write), onData(p->on_data), onInst(p->on_inst),
-      requestorId(p->sys->getRequestorId(this)),
-      pageBytes(p->sys->getPageBytes()),
-      prefetchOnAccess(p->prefetch_on_access),
-      useVirtualAddresses(p->use_virtual_addresses),
+Base::Base(const BasePrefetcherParams &p)
+    : ClockedObject(p), listeners(), cache(nullptr), blkSize(p.block_size),
+      lBlkSize(floorLog2(blkSize)), onMiss(p.on_miss), onRead(p.on_read),
+      onWrite(p.on_write), onData(p.on_data), onInst(p.on_inst),
+      requestorId(p.sys->getRequestorId(this)),
+      pageBytes(p.sys->getPageBytes()),
+      prefetchOnAccess(p.prefetch_on_access),
+      useVirtualAddresses(p.use_virtual_addresses),
       prefetchStats(this), issuedPrefetches(0),
       usefulPrefetches(0), tlb(nullptr)
 {
index cb52b5731fed231576c208610ab0ef0fa08792d1..2dcc95fdf87f94e4c89f5ee9be97cf35dd453d46 100644 (file)
@@ -332,7 +332,7 @@ class Base : public ClockedObject
     BaseTLB * tlb;
 
   public:
-    Base(const BasePrefetcherParams *p);
+    Base(const BasePrefetcherParams &p);
     virtual ~Base() = default;
 
     virtual void setCache(BaseCache *_cache);
index 83eeda1c4b48e922445dc5f148c2e4cb6d12bc58..1a5460be91dfef5455d6c324ae141b39e9af1503 100644 (file)
 
 namespace Prefetcher {
 
-BOP::BOP(const BOPPrefetcherParams *p)
+BOP::BOP(const BOPPrefetcherParams &p)
     : Queued(p),
-      scoreMax(p->score_max), roundMax(p->round_max),
-      badScore(p->bad_score), rrEntries(p->rr_size),
-      tagMask((1 << p->tag_bits) - 1),
-      delayQueueEnabled(p->delay_queue_enable),
-      delayQueueSize(p->delay_queue_size),
-      delayTicks(cyclesToTicks(p->delay_queue_cycles)),
+      scoreMax(p.score_max), roundMax(p.round_max),
+      badScore(p.bad_score), rrEntries(p.rr_size),
+      tagMask((1 << p.tag_bits) - 1),
+      delayQueueEnabled(p.delay_queue_enable),
+      delayQueueSize(p.delay_queue_size),
+      delayTicks(cyclesToTicks(p.delay_queue_cycles)),
       delayQueueEvent([this]{ delayQueueEventWrapper(); }, name()),
       issuePrefetchRequests(false), bestOffset(1), phaseBestOffset(0),
       bestScore(0), round(0)
@@ -51,7 +51,7 @@ BOP::BOP(const BOPPrefetcherParams *p)
     if (!isPowerOf2(blkSize)) {
         fatal("%s: cache line size is not power of 2\n", name());
     }
-    if (!(p->negative_offsets_enable && (p->offset_list_size % 2 == 0))) {
+    if (!(p.negative_offsets_enable && (p.offset_list_size % 2 == 0))) {
         fatal("%s: negative offsets enabled with odd offset list size\n",
               name());
     }
@@ -65,7 +65,7 @@ BOP::BOP(const BOPPrefetcherParams *p)
     unsigned int i = 0;
     int64_t offset_i = 1;
 
-    while (i < p->offset_list_size)
+    while (i < p.offset_list_size)
     {
         int64_t offset = offset_i;
 
@@ -80,7 +80,7 @@ BOP::BOP(const BOPPrefetcherParams *p)
             i++;
             // If we want to use negative offsets, add also the negative value
             // of the offset just calculated
-            if (p->negative_offsets_enable)  {
+            if (p.negative_offsets_enable)  {
                 offsetsList.push_back(OffsetListEntry(-offset_i, 0));
                 i++;
             }
@@ -263,7 +263,7 @@ BOP::notifyFill(const PacketPtr& pkt)
 } // namespace Prefetcher
 
 Prefetcher::BOP*
-BOPPrefetcherParams::create()
+BOPPrefetcherParams::create() const
 {
-   return new Prefetcher::BOP(this);
+   return new Prefetcher::BOP(*this);
 }
index d4252af1a088b90bd9d7c50c375ccbeb9bfc69d0..d32101b0255907c6a586c4757dd114648f268cc0 100644 (file)
@@ -147,7 +147,7 @@ class BOP : public Queued
 
     public:
 
-        BOP(const BOPPrefetcherParams *p);
+        BOP(const BOPPrefetcherParams &p);
         ~BOP() = default;
 
         void calculatePrefetch(const PrefetchInfo &pfi,
index 11ea89d6d023c98a364cb5b99d0a705df1fa5e34..985fa5de1fa5b4a45f5e5ac4d972f6bfd2a336a7 100644 (file)
 namespace Prefetcher {
 
 DeltaCorrelatingPredictionTables::DeltaCorrelatingPredictionTables(
-   DeltaCorrelatingPredictionTablesParams *p) : SimObject(p),
-   deltaBits(p->delta_bits), deltaMaskBits(p->delta_mask_bits),
-   table(p->table_assoc, p->table_entries, p->table_indexing_policy,
-         p->table_replacement_policy, DCPTEntry(p->deltas_per_entry))
+   const DeltaCorrelatingPredictionTablesParams &p) : SimObject(p),
+   deltaBits(p.delta_bits), deltaMaskBits(p.delta_mask_bits),
+   table(p.table_assoc, p.table_entries, p.table_indexing_policy,
+         p.table_replacement_policy, DCPTEntry(p.deltas_per_entry))
 {
 }
 
@@ -145,8 +145,8 @@ DeltaCorrelatingPredictionTables::calculatePrefetch(
     }
 }
 
-DCPT::DCPT(const DCPTPrefetcherParams *p)
-  : Queued(p), dcpt(*p->dcpt)
+DCPT::DCPT(const DCPTPrefetcherParams &p)
+  : Queued(p), dcpt(*p.dcpt)
 {
 }
 
@@ -160,13 +160,13 @@ DCPT::calculatePrefetch(const PrefetchInfo &pfi,
 } // namespace Prefetcher
 
 Prefetcher::DeltaCorrelatingPredictionTables*
-DeltaCorrelatingPredictionTablesParams::create()
+DeltaCorrelatingPredictionTablesParams::create() const
 {
-   return new Prefetcher::DeltaCorrelatingPredictionTables(this);
+   return new Prefetcher::DeltaCorrelatingPredictionTables(*this);
 }
 
 Prefetcher::DCPT*
-DCPTPrefetcherParams::create()
+DCPTPrefetcherParams::create() const
 {
-    return new Prefetcher::DCPT(this);
+    return new Prefetcher::DCPT(*this);
 }
index 28c99875d72a65316281e512a08ce4c1b0b77793..a0e434b9e184961d2334ff080cb446d575d5105a 100644 (file)
@@ -103,7 +103,7 @@ class DeltaCorrelatingPredictionTables : public SimObject
 
   public:
     DeltaCorrelatingPredictionTables(
-        DeltaCorrelatingPredictionTablesParams *p);
+        const DeltaCorrelatingPredictionTablesParams &p);
     ~DeltaCorrelatingPredictionTables() = default;
 
     /**
@@ -122,7 +122,7 @@ class DCPT : public Queued
     /** DCPT object */
     DeltaCorrelatingPredictionTables &dcpt;
   public:
-    DCPT(const DCPTPrefetcherParams *p);
+    DCPT(const DCPTPrefetcherParams &p);
     ~DCPT() = default;
 
     void calculatePrefetch(const PrefetchInfo &pfi,
index f6f0354130ec4f245e0bd4a57a4cae45c6cfb2a9..1ad0707a81f85aca68560e7a8c2f864c184cd424 100644 (file)
 
 namespace Prefetcher {
 
-IndirectMemory::IndirectMemory(const IndirectMemoryPrefetcherParams *p)
+IndirectMemory::IndirectMemory(const IndirectMemoryPrefetcherParams &p)
   : Queued(p),
-    maxPrefetchDistance(p->max_prefetch_distance),
-    shiftValues(p->shift_values), prefetchThreshold(p->prefetch_threshold),
-    streamCounterThreshold(p->stream_counter_threshold),
-    streamingDistance(p->streaming_distance),
-    prefetchTable(p->pt_table_assoc, p->pt_table_entries,
-                  p->pt_table_indexing_policy, p->pt_table_replacement_policy,
-                  PrefetchTableEntry(p->num_indirect_counter_bits)),
-    ipd(p->ipd_table_assoc, p->ipd_table_entries, p->ipd_table_indexing_policy,
-        p->ipd_table_replacement_policy,
-        IndirectPatternDetectorEntry(p->addr_array_len, shiftValues.size())),
-    ipdEntryTrackingMisses(nullptr), byteOrder(p->sys->getGuestByteOrder())
+    maxPrefetchDistance(p.max_prefetch_distance),
+    shiftValues(p.shift_values), prefetchThreshold(p.prefetch_threshold),
+    streamCounterThreshold(p.stream_counter_threshold),
+    streamingDistance(p.streaming_distance),
+    prefetchTable(p.pt_table_assoc, p.pt_table_entries,
+                  p.pt_table_indexing_policy, p.pt_table_replacement_policy,
+                  PrefetchTableEntry(p.num_indirect_counter_bits)),
+    ipd(p.ipd_table_assoc, p.ipd_table_entries, p.ipd_table_indexing_policy,
+        p.ipd_table_replacement_policy,
+        IndirectPatternDetectorEntry(p.addr_array_len, shiftValues.size())),
+    ipdEntryTrackingMisses(nullptr), byteOrder(p.sys->getGuestByteOrder())
 {
 }
 
@@ -257,7 +257,7 @@ IndirectMemory::checkAccessMatchOnActiveEntries(Addr addr)
 } // namespace Prefetcher
 
 Prefetcher::IndirectMemory*
-IndirectMemoryPrefetcherParams::create()
+IndirectMemoryPrefetcherParams::create() const
 {
-    return new Prefetcher::IndirectMemory(this);
+    return new Prefetcher::IndirectMemory(*this);
 }
index e5bc1e778d4417fd323c8baa326e3ae6a150f0a5..a41f56acbc8f89b896f18f0859854f0d43319914 100644 (file)
@@ -193,7 +193,7 @@ class IndirectMemory : public Queued
     void checkAccessMatchOnActiveEntries(Addr addr);
 
   public:
-    IndirectMemory(const IndirectMemoryPrefetcherParams *p);
+    IndirectMemory(const IndirectMemoryPrefetcherParams &p);
     ~IndirectMemory() = default;
 
     void calculatePrefetch(const PrefetchInfo &pfi,
index 9c83ec8dd612065ac3be454b8cca3792b80a2cac..2e7c0b336dce9271cc175f14e5c523e680a04eca 100644 (file)
 namespace Prefetcher {
 
 IrregularStreamBuffer::IrregularStreamBuffer(
-    const IrregularStreamBufferPrefetcherParams *p)
+    const IrregularStreamBufferPrefetcherParams &p)
   : Queued(p),
-    chunkSize(p->chunk_size),
-    prefetchCandidatesPerEntry(p->prefetch_candidates_per_entry),
-    degree(p->degree),
-    trainingUnit(p->training_unit_assoc, p->training_unit_entries,
-                 p->training_unit_indexing_policy,
-                 p->training_unit_replacement_policy),
-    psAddressMappingCache(p->address_map_cache_assoc,
-                          p->address_map_cache_entries,
-                          p->ps_address_map_cache_indexing_policy,
-                          p->ps_address_map_cache_replacement_policy,
+    chunkSize(p.chunk_size),
+    prefetchCandidatesPerEntry(p.prefetch_candidates_per_entry),
+    degree(p.degree),
+    trainingUnit(p.training_unit_assoc, p.training_unit_entries,
+                 p.training_unit_indexing_policy,
+                 p.training_unit_replacement_policy),
+    psAddressMappingCache(p.address_map_cache_assoc,
+                          p.address_map_cache_entries,
+                          p.ps_address_map_cache_indexing_policy,
+                          p.ps_address_map_cache_replacement_policy,
                           AddressMappingEntry(prefetchCandidatesPerEntry,
-                                              p->num_counter_bits)),
-    spAddressMappingCache(p->address_map_cache_assoc,
-                          p->address_map_cache_entries,
-                          p->sp_address_map_cache_indexing_policy,
-                          p->sp_address_map_cache_replacement_policy,
+                                              p.num_counter_bits)),
+    spAddressMappingCache(p.address_map_cache_assoc,
+                          p.address_map_cache_entries,
+                          p.sp_address_map_cache_indexing_policy,
+                          p.sp_address_map_cache_replacement_policy,
                           AddressMappingEntry(prefetchCandidatesPerEntry,
-                                              p->num_counter_bits)),
+                                              p.num_counter_bits)),
     structuralAddressCounter(0)
 {
     assert(isPowerOf2(prefetchCandidatesPerEntry));
@@ -211,7 +211,7 @@ IrregularStreamBuffer::addStructuralToPhysicalEntry(
 } // namespace Prefetcher
 
 Prefetcher::IrregularStreamBuffer*
-IrregularStreamBufferPrefetcherParams::create()
+IrregularStreamBufferPrefetcherParams::create() const
 {
-    return new Prefetcher::IrregularStreamBuffer(this);
+    return new Prefetcher::IrregularStreamBuffer(*this);
 }
index 47969027f19f2b401db0db10a99e83106d766ea6..ce040d1e59a101b171bb1fa4cdcb9909679d85a8 100644 (file)
@@ -127,7 +127,7 @@ class IrregularStreamBuffer : public Queued
      */
     AddressMapping& getPSMapping(Addr paddr, bool is_secure);
   public:
-    IrregularStreamBuffer(const IrregularStreamBufferPrefetcherParams *p);
+    IrregularStreamBuffer(const IrregularStreamBufferPrefetcherParams &p);
     ~IrregularStreamBuffer() = default;
 
     void calculatePrefetch(const PrefetchInfo &pfi,
index fd2263652b4549a659ce5776cb1c6b295bcd0182..9bddd4d044112c9a8d385927a4ce571b3741224d 100644 (file)
@@ -41,9 +41,9 @@
 
 namespace Prefetcher {
 
-Multi::Multi(const MultiPrefetcherParams *p)
+Multi::Multi(const MultiPrefetcherParams &p)
   : Base(p),
-    prefetchers(p->prefetchers.begin(), p->prefetchers.end())
+    prefetchers(p.prefetchers.begin(), p.prefetchers.end())
 {
 }
 
@@ -82,7 +82,7 @@ Multi::getPacket()
 } // namespace Prefetcher
 
 Prefetcher::Multi*
-MultiPrefetcherParams::create()
+MultiPrefetcherParams::create() const
 {
-    return new Prefetcher::Multi(this);
+    return new Prefetcher::Multi(*this);
 }
index c01d0c2efe69f3d36dc8ab6bde11f9ef05f0eb14..58e57943a6ebad01b9bb5b0bde1c9138cf080ccc 100644 (file)
@@ -47,7 +47,7 @@ namespace Prefetcher {
 class Multi : public Base
 {
   public: // SimObject
-    Multi(const MultiPrefetcherParams *p);
+    Multi(const MultiPrefetcherParams &p);
 
   public:
     void setCache(BaseCache *_cache) override;
index c557bd29f15eea138418ab1404585f331e05b968..a73ba65d4e3ea610fa0cc3ebcf62b682f8a83eaf 100644 (file)
 
 namespace Prefetcher {
 
-PIF::PIF(const PIFPrefetcherParams *p)
+PIF::PIF(const PIFPrefetcherParams &p)
     : Queued(p),
-      precSize(p->prec_spatial_region_bits),
-      succSize(p->succ_spatial_region_bits),
-      maxCompactorEntries(p->compactor_entries),
-      historyBuffer(p->history_buffer_size),
-      index(p->index_assoc, p->index_entries, p->index_indexing_policy,
-            p->index_replacement_policy),
-      streamAddressBuffer(p->stream_address_buffer_entries),
+      precSize(p.prec_spatial_region_bits),
+      succSize(p.succ_spatial_region_bits),
+      maxCompactorEntries(p.compactor_entries),
+      historyBuffer(p.history_buffer_size),
+      index(p.index_assoc, p.index_entries, p.index_indexing_policy,
+            p.index_replacement_policy),
+      streamAddressBuffer(p.stream_address_buffer_entries),
       listenersPC()
 {
 }
@@ -246,7 +246,7 @@ PIF::addEventProbeRetiredInsts(SimObject *obj, const char *name)
 } // namespace Prefetcher
 
 Prefetcher::PIF*
-PIFPrefetcherParams::create()
+PIFPrefetcherParams::create() const
 {
-    return new Prefetcher::PIF(this);
+    return new Prefetcher::PIF(*this);
 }
index e3d34fbebed4ad053862fb88d485ebf5b458a069..fffa39b504c70c0b4694d3db669eb31ed25c6bb9 100644 (file)
@@ -173,7 +173,7 @@ class PIF : public Queued
 
 
     public:
-        PIF(const PIFPrefetcherParams *p);
+        PIF(const PIFPrefetcherParams &p);
         ~PIF() = default;
 
         void calculatePrefetch(const PrefetchInfo &pfi,
index 90491a7e7194cefa3bfa6e8717a01c3aeff0207a..6ab56ea99369e0f34b5f238aa2fb691ef811413c 100644 (file)
@@ -92,14 +92,14 @@ Queued::DeferredPacket::finish(const Fault &fault,
     owner->translationComplete(this, failed);
 }
 
-Queued::Queued(const QueuedPrefetcherParams *p)
-    : Base(p), queueSize(p->queue_size),
+Queued::Queued(const QueuedPrefetcherParams &p)
+    : Base(p), queueSize(p.queue_size),
       missingTranslationQueueSize(
-        p->max_prefetch_requests_with_pending_translation),
-      latency(p->latency), queueSquash(p->queue_squash),
-      queueFilter(p->queue_filter), cacheSnoop(p->cache_snoop),
-      tagPrefetch(p->tag_prefetch),
-      throttleControlPct(p->throttle_control_percentage), statsQueued(this)
+        p.max_prefetch_requests_with_pending_translation),
+      latency(p.latency), queueSquash(p.queue_squash),
+      queueFilter(p.queue_filter), cacheSnoop(p.cache_snoop),
+      tagPrefetch(p.tag_prefetch),
+      throttleControlPct(p.throttle_control_percentage), statsQueued(this)
 {
 }
 
index 0627c5c0432acd59e427ad6b22ef79e6a339d3c2..7bf491d5730c8cbbf1c61f5361112b5c30846d93 100644 (file)
@@ -181,7 +181,7 @@ class Queued : public Base
   public:
     using AddrPriority = std::pair<Addr, int32_t>;
 
-    Queued(const QueuedPrefetcherParams *p);
+    Queued(const QueuedPrefetcherParams &p);
     virtual ~Queued();
 
     void notify(const PacketPtr &pkt, const PrefetchInfo &pfi) override;
index 2faa1378a1b67187f8fbbed20518dd25bbb8ba2e..5ab68c74ba4fe9b1afabc88ad123988aeaaaa11c 100644 (file)
 
 namespace Prefetcher {
 
-SBOOE::SBOOE(const SBOOEPrefetcherParams *p)
+SBOOE::SBOOE(const SBOOEPrefetcherParams &p)
     : Queued(p),
-      sequentialPrefetchers(p->sequential_prefetchers),
-      scoreThreshold((p->sandbox_entries*p->score_threshold_pct)/100),
-      latencyBuffer(p->latency_buffer_size),
+      sequentialPrefetchers(p.sequential_prefetchers),
+      scoreThreshold((p.sandbox_entries*p.score_threshold_pct)/100),
+      latencyBuffer(p.latency_buffer_size),
       averageAccessLatency(0), latencyBufferSum(0),
       bestSandbox(NULL),
       accesses(0)
@@ -45,7 +45,7 @@ SBOOE::SBOOE(const SBOOEPrefetcherParams *p)
     // Initialize a sandbox for every sequential prefetcher between
     // -1 and the number of sequential prefetchers defined
     for (int i = 0; i < sequentialPrefetchers; i++) {
-        sandboxes.push_back(Sandbox(p->sandbox_entries, i-1));
+        sandboxes.push_back(Sandbox(p.sandbox_entries, i-1));
     }
 }
 
@@ -135,7 +135,7 @@ SBOOE::calculatePrefetch(const PrefetchInfo &pfi,
 } // namespace Prefetcher
 
 Prefetcher::SBOOE*
-SBOOEPrefetcherParams::create()
+SBOOEPrefetcherParams::create() const
 {
-    return new Prefetcher::SBOOE(this);
+    return new Prefetcher::SBOOE(*this);
 }
index 42deaf3872a692631062eec89ec7be4f60e1f11a..1230d527d2d86cf35580fb4834c3e06076b53712 100644 (file)
@@ -151,7 +151,7 @@ class SBOOE : public Queued
         void notifyFill(const PacketPtr& pkt) override;
 
     public:
-        SBOOE(const SBOOEPrefetcherParams *p);
+        SBOOE(const SBOOEPrefetcherParams &p);
 
         void calculatePrefetch(const PrefetchInfo &pfi,
                                std::vector<AddrPriority> &addresses) override;
index 556a003a5cd8fbcaf218efae08e37726899c57ca..207557fb7980bd42619015471b3ee09589cdc68e 100644 (file)
 
 namespace Prefetcher {
 
-SignaturePath::SignaturePath(const SignaturePathPrefetcherParams *p)
+SignaturePath::SignaturePath(const SignaturePathPrefetcherParams &p)
     : Queued(p),
-      stridesPerPatternEntry(p->strides_per_pattern_entry),
-      signatureShift(p->signature_shift),
-      signatureBits(p->signature_bits),
-      prefetchConfidenceThreshold(p->prefetch_confidence_threshold),
-      lookaheadConfidenceThreshold(p->lookahead_confidence_threshold),
-      signatureTable(p->signature_table_assoc, p->signature_table_entries,
-                     p->signature_table_indexing_policy,
-                     p->signature_table_replacement_policy),
-      patternTable(p->pattern_table_assoc, p->pattern_table_entries,
-                   p->pattern_table_indexing_policy,
-                   p->pattern_table_replacement_policy,
-                   PatternEntry(stridesPerPatternEntry, p->num_counter_bits))
+      stridesPerPatternEntry(p.strides_per_pattern_entry),
+      signatureShift(p.signature_shift),
+      signatureBits(p.signature_bits),
+      prefetchConfidenceThreshold(p.prefetch_confidence_threshold),
+      lookaheadConfidenceThreshold(p.lookahead_confidence_threshold),
+      signatureTable(p.signature_table_assoc, p.signature_table_entries,
+                     p.signature_table_indexing_policy,
+                     p.signature_table_replacement_policy),
+      patternTable(p.pattern_table_assoc, p.pattern_table_entries,
+                   p.pattern_table_indexing_policy,
+                   p.pattern_table_replacement_policy,
+                   PatternEntry(stridesPerPatternEntry, p.num_counter_bits))
 {
     fatal_if(prefetchConfidenceThreshold < 0,
         "The prefetch confidence threshold must be greater than 0\n");
@@ -319,7 +319,7 @@ SignaturePath::auxiliaryPrefetcher(Addr ppn, stride_t current_block,
 } // namespace Prefetcher
 
 Prefetcher::SignaturePath*
-SignaturePathPrefetcherParams::create()
+SignaturePathPrefetcherParams::create() const
 {
-    return new Prefetcher::SignaturePath(this);
+    return new Prefetcher::SignaturePath(*this);
 }
index 1456d8e42f0d623bf9527bd61b152fbc19f9707c..8d61a5c49022e6e74b2f5418d92ae58c0413f41b 100644 (file)
@@ -279,7 +279,7 @@ class SignaturePath : public Queued
     }
 
   public:
-    SignaturePath(const SignaturePathPrefetcherParamsp);
+    SignaturePath(const SignaturePathPrefetcherParams &p);
     ~SignaturePath() = default;
 
     void calculatePrefetch(const PrefetchInfo &pfi,
index 588536c3ccaf54d136388b370b24cc747e3d4889..a4c9e03f6f946b2586c67dae4791b398732de6ae 100644 (file)
 
 namespace Prefetcher {
 
-SignaturePathV2::SignaturePathV2(const SignaturePathPrefetcherV2Params *p)
+SignaturePathV2::SignaturePathV2(const SignaturePathPrefetcherV2Params &p)
     : SignaturePath(p),
-      globalHistoryRegister(p->global_history_register_entries,
-                            p->global_history_register_entries,
-                            p->global_history_register_indexing_policy,
-                            p->global_history_register_replacement_policy,
+      globalHistoryRegister(p.global_history_register_entries,
+                            p.global_history_register_entries,
+                            p.global_history_register_indexing_policy,
+                            p.global_history_register_replacement_policy,
                             GlobalHistoryEntry())
 {
 }
@@ -131,7 +131,7 @@ SignaturePathV2::handlePageCrossingLookahead(signature_t signature,
 } // namespace Prefetcher
 
 Prefetcher::SignaturePathV2*
-SignaturePathPrefetcherV2Params::create()
+SignaturePathPrefetcherV2Params::create() const
 {
-    return new Prefetcher::SignaturePathV2(this);
+    return new Prefetcher::SignaturePathV2(*this);
 }
index 583c57a45eccaacda9b435187825987a2842a5c7..efa597c9d6b58c9a8d0cbb67039bed85cc9164c6 100644 (file)
@@ -90,7 +90,7 @@ class SignaturePathV2 : public SignaturePath
             override;
 
   public:
-    SignaturePathV2(const SignaturePathPrefetcherV2Paramsp);
+    SignaturePathV2(const SignaturePathPrefetcherV2Params &p);
     ~SignaturePathV2() = default;
 };
 
index 0da18505afd490f1e09d70222f910bfe3bf1e29b..2119b6a2ad72cbe43f0e5e5460063230725af173 100644 (file)
@@ -32,8 +32,8 @@
 
 namespace Prefetcher {
 
-SlimAMPM::SlimAMPM(const SlimAMPMPrefetcherParamsp)
-  : Queued(p), ampm(*p->ampm), dcpt(*p->dcpt)
+SlimAMPM::SlimAMPM(const SlimAMPMPrefetcherParams &p)
+  : Queued(p), ampm(*p.ampm), dcpt(*p.dcpt)
 {
 }
 
@@ -50,7 +50,7 @@ SlimAMPM::calculatePrefetch(const PrefetchInfo &pfi,
 } // namespace Prefetcher
 
 Prefetcher::SlimAMPM*
-SlimAMPMPrefetcherParams::create()
+SlimAMPMPrefetcherParams::create() const
 {
-    return new Prefetcher::SlimAMPM(this);
+    return new Prefetcher::SlimAMPM(*this);
 }
index cbcc7c77ff7faee7dbb3ba7d2bf8473ba31d6407..e067ded7cb50aac59dc5ea8e202bf79409e949f1 100644 (file)
@@ -54,7 +54,7 @@ class SlimAMPM : public Queued
    /** DCPT prefetcher object */
    DeltaCorrelatingPredictionTables &dcpt;
  public:
-   SlimAMPM(const SlimAMPMPrefetcherParams *p);
+   SlimAMPM(const SlimAMPMPrefetcherParams &p);
    ~SlimAMPM() = default;
 
    void calculatePrefetch(const PrefetchInfo &pfi,
index dd15012ccf505939e5512d38105eb0265f2b5d50..4c58ab083959a8cddea6cf1d9c2fd3bbe8283994 100644 (file)
 
 namespace Prefetcher {
 
-STeMS::STeMS(const STeMSPrefetcherParams *p)
-  : Queued(p), spatialRegionSize(p->spatial_region_size),
-    spatialRegionSizeBits(floorLog2(p->spatial_region_size)),
-    reconstructionEntries(p->reconstruction_entries),
-    activeGenerationTable(p->active_generation_table_assoc,
-                          p->active_generation_table_entries,
-                          p->active_generation_table_indexing_policy,
-                          p->active_generation_table_replacement_policy,
+STeMS::STeMS(const STeMSPrefetcherParams &p)
+  : Queued(p), spatialRegionSize(p.spatial_region_size),
+    spatialRegionSizeBits(floorLog2(p.spatial_region_size)),
+    reconstructionEntries(p.reconstruction_entries),
+    activeGenerationTable(p.active_generation_table_assoc,
+                          p.active_generation_table_entries,
+                          p.active_generation_table_indexing_policy,
+                          p.active_generation_table_replacement_policy,
                           ActiveGenerationTableEntry(
                               spatialRegionSize / blkSize)),
-    patternSequenceTable(p->pattern_sequence_table_assoc,
-                         p->pattern_sequence_table_entries,
-                         p->pattern_sequence_table_indexing_policy,
-                         p->pattern_sequence_table_replacement_policy,
+    patternSequenceTable(p.pattern_sequence_table_assoc,
+                         p.pattern_sequence_table_entries,
+                         p.pattern_sequence_table_indexing_policy,
+                         p.pattern_sequence_table_replacement_policy,
                          ActiveGenerationTableEntry(
                              spatialRegionSize / blkSize)),
-    rmob(p->region_miss_order_buffer_entries)
+    rmob(p.region_miss_order_buffer_entries)
 {
     fatal_if(!isPowerOf2(spatialRegionSize),
         "The spatial region size must be a power of 2.");
@@ -249,7 +249,7 @@ STeMS::reconstructSequence(
 } // namespace Prefetcher
 
 Prefetcher::STeMS*
-STeMSPrefetcherParams::create()
+STeMSPrefetcherParams::create() const
 {
-   return new Prefetcher::STeMS(this);
+   return new Prefetcher::STeMS(*this);
 }
index 4e0ca28c101f28fe0b592233affc22e43d134435..8e3b202f4ce674be3d61d782c3763ead080cac1a 100644 (file)
@@ -192,7 +192,7 @@ class STeMS : public Queued
         std::vector<AddrPriority> &addresses);
 
   public:
-    STeMS(const STeMSPrefetcherParamsp);
+    STeMS(const STeMSPrefetcherParams &p);
     ~STeMS() = default;
 
     void calculatePrefetch(const PrefetchInfo &pfi,
index 8141af2e5e257c7ff8f0ed2a239ce38a1b040f70..b7aa64d404704cbc3cd825fc658193e144b5fff9 100644 (file)
@@ -74,14 +74,14 @@ Stride::StrideEntry::invalidate()
     confidence.reset();
 }
 
-Stride::Stride(const StridePrefetcherParams *p)
+Stride::Stride(const StridePrefetcherParams &p)
   : Queued(p),
-    initConfidence(p->confidence_counter_bits, p->initial_confidence),
-    threshConf(p->confidence_threshold/100.0),
-    useRequestorId(p->use_requestor_id),
-    degree(p->degree),
-    pcTableInfo(p->table_assoc, p->table_entries, p->table_indexing_policy,
-        p->table_replacement_policy)
+    initConfidence(p.confidence_counter_bits, p.initial_confidence),
+    threshConf(p.confidence_threshold/100.0),
+    useRequestorId(p.use_requestor_id),
+    degree(p.degree),
+    pcTableInfo(p.table_assoc, p.table_entries, p.table_indexing_policy,
+        p.table_replacement_policy)
 {
 }
 
@@ -204,13 +204,13 @@ StridePrefetcherHashedSetAssociative::extractTag(const Addr addr) const
 } // namespace Prefetcher
 
 Prefetcher::StridePrefetcherHashedSetAssociative*
-StridePrefetcherHashedSetAssociativeParams::create()
+StridePrefetcherHashedSetAssociativeParams::create() const
 {
-    return new Prefetcher::StridePrefetcherHashedSetAssociative(this);
+    return new Prefetcher::StridePrefetcherHashedSetAssociative(*this);
 }
 
 Prefetcher::Stride*
-StridePrefetcherParams::create()
+StridePrefetcherParams::create() const
 {
-    return new Prefetcher::Stride(this);
+    return new Prefetcher::Stride(*this);
 }
index 57179fdb5f808604cf7e980a8edbcce888d614a1..982f33e5ee280fb7d18d78d36215356f9fdfc35c 100644 (file)
@@ -80,7 +80,7 @@ class StridePrefetcherHashedSetAssociative : public SetAssociative
 
   public:
     StridePrefetcherHashedSetAssociative(
-        const StridePrefetcherHashedSetAssociativeParams *p)
+        const StridePrefetcherHashedSetAssociativeParams &p)
       : SetAssociative(p)
     {
     }
@@ -153,7 +153,7 @@ class Stride : public Queued
     PCTable* allocateNewContext(int context);
 
   public:
-    Stride(const StridePrefetcherParams *p);
+    Stride(const StridePrefetcherParams &p);
 
     void calculatePrefetch(const PrefetchInfo &pfi,
                            std::vector<AddrPriority> &addresses) override;
index 55b8710d25412405eace1fd4fb7630952f9db103..f626a8991426951602ef1bec8225b1ee537d4007 100644 (file)
@@ -37,8 +37,8 @@
 
 namespace Prefetcher {
 
-Tagged::Tagged(const TaggedPrefetcherParams *p)
-    : Queued(p), degree(p->degree)
+Tagged::Tagged(const TaggedPrefetcherParams &p)
+    : Queued(p), degree(p.degree)
 {
 
 }
@@ -58,7 +58,7 @@ Tagged::calculatePrefetch(const PrefetchInfo &pfi,
 } // namespace Prefetcher
 
 Prefetcher::Tagged*
-TaggedPrefetcherParams::create()
+TaggedPrefetcherParams::create() const
 {
-   return new Prefetcher::Tagged(this);
+   return new Prefetcher::Tagged(*this);
 }
index e8b7505427e62a1623190de121fab300a0d471e5..5a84646cb068c6acbf5727a8dc64cd3bbeddf06b 100644 (file)
@@ -47,7 +47,7 @@ class Tagged : public Queued
       const int degree;
 
   public:
-    Tagged(const TaggedPrefetcherParams *p);
+    Tagged(const TaggedPrefetcherParams &p);
     ~Tagged() = default;
 
     void calculatePrefetch(const PrefetchInfo &pfi,
index f00ab67d5e0f04ed30dedfde5134ae23c86a0237..147885df67a256dcf6b655a6afd0a1bf2e58f181 100644 (file)
@@ -49,7 +49,7 @@ class Base : public SimObject
 {
   public:
     typedef BaseReplacementPolicyParams Params;
-    Base(const Params *p) : SimObject(p) {}
+    Base(const Params &p) : SimObject(p) {}
     virtual ~Base() = default;
 
     /**
index 0086136d59559d046ad34ad062f4db1fdecc0cef..06b31b6da594324f3a71cce88eaeffa29b7832d0 100644 (file)
@@ -36,8 +36,8 @@
 
 namespace ReplacementPolicy {
 
-BIP::BIP(const Params *p)
-  : LRU(p), btp(p->btp)
+BIP::BIP(const Params &p)
+  : LRU(p), btp(p.btp)
 {
 }
 
@@ -59,7 +59,7 @@ BIP::reset(const std::shared_ptr<ReplacementData>& replacement_data) const
 } // namespace ReplacementPolicy
 
 ReplacementPolicy::BIP*
-BIPRPParams::create()
+BIPRPParams::create() const
 {
-    return new ReplacementPolicy::BIP(this);
+    return new ReplacementPolicy::BIP(*this);
 }
index 9d91f8fc83d723daadec50505165539c75b3dff5..0d9f97a7695e374031c376382f31ba172e207839 100644 (file)
@@ -59,7 +59,7 @@ class BIP : public LRU
 
   public:
     typedef BIPRPParams Params;
-    BIP(const Params *p);
+    BIP(const Params &p);
     ~BIP() = default;
 
     /**
index fca1cc190d55c524f8722eea18a6403a11d1a1d0..2aeade138716abec4bdcc72c7dea870607167d57 100644 (file)
@@ -37,9 +37,9 @@
 
 namespace ReplacementPolicy {
 
-BRRIP::BRRIP(const Params *p)
-  : Base(p), numRRPVBits(p->num_bits), hitPriority(p->hit_priority),
-    btp(p->btp)
+BRRIP::BRRIP(const Params &p)
+  : Base(p), numRRPVBits(p.num_bits), hitPriority(p.hit_priority),
+    btp(p.btp)
 {
     fatal_if(numRRPVBits <= 0, "There should be at least one bit per RRPV.\n");
 }
@@ -147,7 +147,7 @@ BRRIP::instantiateEntry()
 } // namespace ReplacementPolicy
 
 ReplacementPolicy::BRRIP*
-BRRIPRPParams::create()
+BRRIPRPParams::create() const
 {
-    return new ReplacementPolicy::BRRIP(this);
+    return new ReplacementPolicy::BRRIP(*this);
 }
index c84e9d596abb4757d356f25b5e67d3d1d0903d0e..a9ddfe45c0493c80ee0aeed43498fc6f749e0d98 100644 (file)
@@ -109,7 +109,7 @@ class BRRIP : public Base
 
   public:
     typedef BRRIPRPParams Params;
-    BRRIP(const Params *p);
+    BRRIP(const Params &p);
     ~BRRIP() = default;
 
     /**
index 2371d76590d641c196c576ec6e1ff544bc2ea6fb..9d869732a1609c11d9833b664880a47cb4d408f9 100644 (file)
@@ -36,7 +36,7 @@
 
 namespace ReplacementPolicy {
 
-FIFO::FIFO(const Params *p)
+FIFO::FIFO(const Params &p)
   : Base(p)
 {
 }
@@ -94,7 +94,7 @@ FIFO::instantiateEntry()
 } // namespace ReplacementPolicy
 
 ReplacementPolicy::FIFO*
-FIFORPParams::create()
+FIFORPParams::create() const
 {
-    return new ReplacementPolicy::FIFO(this);
+    return new ReplacementPolicy::FIFO(*this);
 }
index 03a4aec10085762bfb6c8f302e28150ac1a2a09b..ae9f317627a7ac80b8bde4e12ac55dd5938b69ad 100644 (file)
@@ -60,7 +60,7 @@ class FIFO : public Base
 
   public:
     typedef FIFORPParams Params;
-    FIFO(const Params *p);
+    FIFO(const Params &p);
     ~FIFO() = default;
 
     /**
index 0f3b242492aa9a2efa24506ecfecce9aa6ae2fdb..054ef617313c3deba8b9e595dad7f1eae0830156 100644 (file)
@@ -35,7 +35,7 @@
 
 namespace ReplacementPolicy {
 
-LFU::LFU(const Params *p)
+LFU::LFU(const Params &p)
   : Base(p)
 {
 }
@@ -92,7 +92,7 @@ LFU::instantiateEntry()
 } // namespace ReplacementPolicy
 
 ReplacementPolicy::LFU*
-LFURPParams::create()
+LFURPParams::create() const
 {
-    return new ReplacementPolicy::LFU(this);
+    return new ReplacementPolicy::LFU(*this);
 }
index 36640e7de702bcea9ffab52eacbb18cb240442ee..4f233a43e4f81f997eff53705e7d85e3267733a7 100644 (file)
@@ -60,7 +60,7 @@ class LFU : public Base
 
   public:
     typedef LFURPParams Params;
-    LFU(const Params *p);
+    LFU(const Params &p);
     ~LFU() = default;
 
     /**
index 9775c154cc85ad644945f92fe1fe34de5ad0a3c2..798c9649771e4970eb1892a96b63e00599285437 100644 (file)
@@ -36,7 +36,7 @@
 
 namespace ReplacementPolicy {
 
-LRU::LRU(const Params *p)
+LRU::LRU(const Params &p)
   : Base(p)
 {
 }
@@ -96,7 +96,7 @@ LRU::instantiateEntry()
 } // namespace ReplacementPolicy
 
 ReplacementPolicy::LRU*
-LRURPParams::create()
+LRURPParams::create() const
 {
-    return new ReplacementPolicy::LRU(this);
+    return new ReplacementPolicy::LRU(*this);
 }
index bb1b314c54870718ef5127b2d14200079a1b6dac..033816f5dca430d3b0674dcb802a17224918d538 100644 (file)
@@ -58,7 +58,7 @@ class LRU : public Base
 
   public:
     typedef LRURPParams Params;
-    LRU(const Params *p);
+    LRU(const Params &p);
     ~LRU() = default;
 
     /**
index 04a7770738dccc890376f2a92bf78e59bd0f254b..1dab0653fb3b85d411adb5d052634c86c026405b 100644 (file)
@@ -36,7 +36,7 @@
 
 namespace ReplacementPolicy {
 
-MRU::MRU(const Params *p)
+MRU::MRU(const Params &p)
   : Base(p)
 {
 }
@@ -101,7 +101,7 @@ MRU::instantiateEntry()
 } // namespace ReplacementPolicy
 
 ReplacementPolicy::MRU*
-MRURPParams::create()
+MRURPParams::create() const
 {
-    return new ReplacementPolicy::MRU(this);
+    return new ReplacementPolicy::MRU(*this);
 }
index 2561556eb13d2f28bfba30f17b09d35f434a803a..d5ef19bc078d6b113243b653c04d164f2b012f3b 100644 (file)
@@ -60,7 +60,7 @@ class MRU : public Base
 
   public:
     typedef MRURPParams Params;
-    MRU(const Params *p);
+    MRU(const Params &p);
     ~MRU() = default;
 
     /**
index 314e861d4b6f7e12b9cbba78fb921e667d481d34..959baafbc5ff04f0495f8adece9e8ca0c6d755f6 100644 (file)
@@ -36,7 +36,7 @@
 
 namespace ReplacementPolicy {
 
-Random::Random(const Params *p)
+Random::Random(const Params &p)
   : Base(p)
 {
 }
@@ -95,7 +95,7 @@ Random::instantiateEntry()
 } // namespace ReplacementPolicy
 
 ReplacementPolicy::Random*
-RandomRPParams::create()
+RandomRPParams::create() const
 {
-    return new ReplacementPolicy::Random(this);
+    return new ReplacementPolicy::Random(*this);
 }
index a499211603411a3b1af10b2f4cd7b5a6c73d5057..a8896e3545a617e3be91efcf31f3fbbfa01c6b1d 100644 (file)
@@ -61,7 +61,7 @@ class Random : public Base
 
   public:
     typedef RandomRPParams Params;
-    Random(const Params *p);
+    Random(const Params &p);
     ~Random() = default;
 
     /**
index ddc68d76eec809d89a7a4bab4f3ac6a6a0661dfb..a55994e41e7e0735789beabf6f329baff493e8dd 100644 (file)
@@ -34,7 +34,7 @@
 
 namespace ReplacementPolicy {
 
-SecondChance::SecondChance(const Params *p)
+SecondChance::SecondChance(const Params &p)
   : FIFO(p)
 {
 }
@@ -136,7 +136,7 @@ SecondChance::instantiateEntry()
 } // namespace ReplacementPolicy
 
 ReplacementPolicy::SecondChance*
-SecondChanceRPParams::create()
+SecondChanceRPParams::create() const
 {
-    return new ReplacementPolicy::SecondChance(this);
+    return new ReplacementPolicy::SecondChance(*this);
 }
index d13ea7bc770d8b13127348970c90132db8d41853..29a3ed537736b04a20434cd3c369257313b60087 100644 (file)
@@ -74,7 +74,7 @@ class SecondChance : public FIFO
 
   public:
     typedef SecondChanceRPParams Params;
-    SecondChance(const Params *p);
+    SecondChance(const Params &p);
     ~SecondChance() = default;
 
     /**
index eaf5cb488120593dba116e21235afd5871b5c68b..ada9eeedb589e5adf55119353218fdaf4926dd31 100644 (file)
@@ -97,8 +97,8 @@ TreePLRU::TreePLRUReplData::TreePLRUReplData(
 {
 }
 
-TreePLRU::TreePLRU(const Params *p)
-  : Base(p), numLeaves(p->num_leaves), count(0), treeInstance(nullptr)
+TreePLRU::TreePLRU(const Params &p)
+  : Base(p), numLeaves(p.num_leaves), count(0), treeInstance(nullptr)
 {
     fatal_if(!isPowerOf2(numLeaves),
              "Number of leaves must be non-zero and a power of 2");
@@ -214,7 +214,7 @@ TreePLRU::instantiateEntry()
 } // namespace ReplacementPolicy
 
 ReplacementPolicy::TreePLRU*
-TreePLRURPParams::create()
+TreePLRURPParams::create() const
 {
-    return new ReplacementPolicy::TreePLRU(this);
+    return new ReplacementPolicy::TreePLRU(*this);
 }
index 709f0a202b39a538da024c3a3c23d62e880bdc77..372439285990a81d635c00761582f84754dba2b5 100644 (file)
@@ -152,7 +152,7 @@ class TreePLRU : public Base
 
   public:
     typedef TreePLRURPParams Params;
-    TreePLRU(const Params *p);
+    TreePLRU(const Params &p);
     ~TreePLRU() = default;
 
     /**
index 3044ce70140bf0c0988b57ea01f50d9af9102c5b..5b45e32cca0c2b116ac5cc261e9a8023bddb4a83 100644 (file)
@@ -40,7 +40,7 @@
 
 namespace ReplacementPolicy {
 
-WeightedLRU::WeightedLRU(const Paramsp)
+WeightedLRU::WeightedLRU(const Params &p)
   : Base(p)
 {
 }
@@ -124,7 +124,7 @@ WeightedLRU::invalidate(const std::shared_ptr<ReplacementData>&
 } // namespace ReplacementPolicy
 
 ReplacementPolicy::WeightedLRU*
-WeightedLRURPParams::create()
+WeightedLRURPParams::create() const
 {
-    return new ReplacementPolicy::WeightedLRU(this);
+    return new ReplacementPolicy::WeightedLRU(*this);
 }
index 74e926eaf217805999fca5946c132e3aef3c82b1..71156d35982ad437f4361adc4345b416ff590aa3 100644 (file)
@@ -63,7 +63,7 @@ class WeightedLRU : public Base
     };
   public:
     typedef WeightedLRURPParams Params;
-    WeightedLRU(const Paramsp);
+    WeightedLRU(const Params &p);
     ~WeightedLRU() = default;
 
     /**
index 09de5fc5f12c32515def2c8ced18d3890aba51c2..b00ad49211ebf416ba72f5ba0ac5f267bc6213bf 100644 (file)
 #include "sim/sim_exit.hh"
 #include "sim/system.hh"
 
-BaseTags::BaseTags(const Params *p)
-    : ClockedObject(p), blkSize(p->block_size), blkMask(blkSize - 1),
-      size(p->size), lookupLatency(p->tag_latency),
-      system(p->system), indexingPolicy(p->indexing_policy),
-      warmupBound((p->warmup_percentage/100.0) * (p->size / p->block_size)),
-      warmedUp(false), numBlocks(p->size / p->block_size),
-      dataBlks(new uint8_t[p->size]), // Allocate data storage in one big chunk
+BaseTags::BaseTags(const Params &p)
+    : ClockedObject(p), blkSize(p.block_size), blkMask(blkSize - 1),
+      size(p.size), lookupLatency(p.tag_latency),
+      system(p.system), indexingPolicy(p.indexing_policy),
+      warmupBound((p.warmup_percentage/100.0) * (p.size / p.block_size)),
+      warmedUp(false), numBlocks(p.size / p.block_size),
+      dataBlks(new uint8_t[p.size]), // Allocate data storage in one big chunk
       stats(*this)
 {
     registerExitCallback([this]() { cleanupRefs(); });
index 35e984ac2328cdb99afb9be70d1b5f41b926ae5a..deda63ec251805c3923fa47e7ff6a9878603d3d7 100644 (file)
@@ -156,7 +156,7 @@ class BaseTags : public ClockedObject
 
   public:
     typedef BaseTagsParams Params;
-    BaseTags(const Params *p);
+    BaseTags(const Params &p);
 
     /**
      * Destructor.
index ba6919d4fe4a181307d33ed77da059f4f65386f2..cc2fac62bb4ccfabb814ac9eb941a8c978b9f531 100644 (file)
 
 #include "base/intmath.hh"
 
-BaseSetAssoc::BaseSetAssoc(const Params *p)
-    :BaseTags(p), allocAssoc(p->assoc), blks(p->size / p->block_size),
-     sequentialAccess(p->sequential_access),
-     replacementPolicy(p->replacement_policy)
+BaseSetAssoc::BaseSetAssoc(const Params &p)
+    :BaseTags(p), allocAssoc(p.assoc), blks(p.size / p.block_size),
+     sequentialAccess(p.sequential_access),
+     replacementPolicy(p.replacement_policy)
 {
     // Check parameters
     if (blkSize < 4 || !isPowerOf2(blkSize)) {
@@ -92,10 +92,10 @@ BaseSetAssoc::invalidate(CacheBlk *blk)
 }
 
 BaseSetAssoc *
-BaseSetAssocParams::create()
+BaseSetAssocParams::create() const
 {
     // There must be a indexing policy
     fatal_if(!indexing_policy, "An indexing policy is required");
 
-    return new BaseSetAssoc(this);
+    return new BaseSetAssoc(*this);
 }
index b48428b6eda690038c1fc470a95c348af4eaf9fd..787cc6bd0132870c81d2cb6f68626d1264933789 100644 (file)
@@ -91,7 +91,7 @@ class BaseSetAssoc : public BaseTags
     /**
      * Construct and initialize this tag store.
      */
-    BaseSetAssoc(const Params *p);
+    BaseSetAssoc(const Params &p);
 
     /**
      * Destructor
index f86d1a5db595bd1818416800ece0f5af3cc5cf5e..64a7102d1874c2b7284f53e58d468f4411d68059 100644 (file)
@@ -41,7 +41,7 @@
 #include "mem/packet.hh"
 #include "params/CompressedTags.hh"
 
-CompressedTags::CompressedTags(const Params *p)
+CompressedTags::CompressedTags(const Params &p)
     : SectorTags(p)
 {
 }
@@ -206,7 +206,7 @@ CompressedTags::anyBlk(std::function<bool(CacheBlk &)> visitor)
 }
 
 CompressedTags *
-CompressedTagsParams::create()
+CompressedTagsParams::create() const
 {
-    return new CompressedTags(this);
+    return new CompressedTags(*this);
 }
index 0a4afb17233425e23b1a1223f91f1e20a0735037..73231f2f5665499f049f7acba91954121282680a 100644 (file)
@@ -83,7 +83,7 @@ class CompressedTags : public SectorTags
     /**
      * Construct and initialize this tag store.
      */
-    CompressedTags(const Params *p);
+    CompressedTags(const Params &p);
 
     /**
      * Destructor.
index 82f95197082540550942ea39388891ec469b3630..fc69bda645b664d3c141ef341e87f026101c9977 100644 (file)
@@ -60,10 +60,10 @@ FALRUBlk::print() const
     return csprintf("%s inCachesMask: %#x", CacheBlk::print(), inCachesMask);
 }
 
-FALRU::FALRU(const Params *p)
+FALRU::FALRU(const Params &p)
     : BaseTags(p),
 
-      cacheTracking(p->min_tracked_cache_size, size, blkSize)
+      cacheTracking(p.min_tracked_cache_size, size, blkSize)
 {
     if (!isPowerOf2(blkSize))
         fatal("cache block size (in bytes) `%d' must be a power of two",
@@ -280,9 +280,9 @@ FALRU::moveToTail(FALRUBlk *blk)
 }
 
 FALRU *
-FALRUParams::create()
+FALRUParams::create() const
 {
-    return new FALRU(this);
+    return new FALRU(*this);
 }
 
 void
index 5feb518f44e88f3bdbc8b71a5d3db6d864794bca..f03ecee582cecf510b0e241014340b30099a65e3 100644 (file)
@@ -153,7 +153,7 @@ class FALRU : public BaseTags
     /**
      * Construct and initialize this cache tagstore.
      */
-    FALRU(const Params *p);
+    FALRU(const Params &p);
     ~FALRU();
 
     /**
index 6a799e6dc1d4f366d9823405473f93244516fce3..7b63c3d0c29b6c319f995af7139e55c7aa22aee4 100644 (file)
 #include "base/logging.hh"
 #include "mem/cache/replacement_policies/replaceable_entry.hh"
 
-BaseIndexingPolicy::BaseIndexingPolicy(const Params *p)
-    : SimObject(p), assoc(p->assoc),
-      numSets(p->size / (p->entry_size * assoc)),
-      setShift(floorLog2(p->entry_size)), setMask(numSets - 1), sets(numSets),
+BaseIndexingPolicy::BaseIndexingPolicy(const Params &p)
+    : SimObject(p), assoc(p.assoc),
+      numSets(p.size / (p.entry_size * assoc)),
+      setShift(floorLog2(p.entry_size)), setMask(numSets - 1), sets(numSets),
       tagShift(setShift + floorLog2(numSets))
 {
     fatal_if(!isPowerOf2(numSets), "# of sets must be non-zero and a power " \
index 9a56b54f63a83a7a370f0bbefe1532297963c63f..20b0390fc4edc2304e41d3bbc3056325e70a3f27 100644 (file)
@@ -102,7 +102,7 @@ class BaseIndexingPolicy : public SimObject
     /**
      * Construct and initialize this policy.
      */
-    BaseIndexingPolicy(const Params *p);
+    BaseIndexingPolicy(const Params &p);
 
     /**
      * Destructor.
index 05b37dd25ad8891038f71225dbf197c7f5db3343..ab4a86febe6ddda72afb658acc320c38040286e4 100644 (file)
@@ -48,7 +48,7 @@
 
 #include "mem/cache/replacement_policies/replaceable_entry.hh"
 
-SetAssociative::SetAssociative(const Params *p)
+SetAssociative::SetAssociative(const Params &p)
     : BaseIndexingPolicy(p)
 {
 }
@@ -73,7 +73,7 @@ SetAssociative::getPossibleEntries(const Addr addr) const
 }
 
 SetAssociative*
-SetAssociativeParams::create()
+SetAssociativeParams::create() const
 {
-    return new SetAssociative(this);
+    return new SetAssociative(*this);
 }
index e7126c39c3ffd4cb846b5a0b604b617863906844..75b45f68f5c271ce537435cf31e37269f07d2534 100644 (file)
@@ -96,7 +96,7 @@ class SetAssociative : public BaseIndexingPolicy
     /**
      * Construct and initialize this policy.
      */
-    SetAssociative(const Params *p);
+    SetAssociative(const Params &p);
 
     /**
      * Destructor.
index 57c389b77f80340527edb1fff1d6d187b1ef117b..5938916c632ed620b07b9d36e3ad394f9d6f6647 100644 (file)
@@ -38,7 +38,7 @@
 #include "base/logging.hh"
 #include "mem/cache/replacement_policies/replaceable_entry.hh"
 
-SkewedAssociative::SkewedAssociative(const Params *p)
+SkewedAssociative::SkewedAssociative(const Params &p)
     : BaseIndexingPolicy(p), msbShift(floorLog2(numSets) - 1)
 {
     if (assoc > NUM_SKEWING_FUNCTIONS) {
@@ -218,7 +218,7 @@ SkewedAssociative::getPossibleEntries(const Addr addr) const
 }
 
 SkewedAssociative *
-SkewedAssociativeParams::create()
+SkewedAssociativeParams::create() const
 {
-    return new SkewedAssociative(this);
+    return new SkewedAssociative(*this);
 }
index cff3b3c6c6d8a71342ebfcc3ce50633f9740eb64..6992c71d29679f470fdb26669ed2c55be6a191fe 100644 (file)
@@ -142,7 +142,7 @@ class SkewedAssociative : public BaseIndexingPolicy
     /**
      * Construct and initialize this policy.
      */
-    SkewedAssociative(const Params *p);
+    SkewedAssociative(const Params &p);
 
     /**
      * Destructor.
index 43020aa2860d78f6fcb9eb7e5a1f45ef7596e4db..aa6cb24ac70f36f98efcbfde38f571e934decdb4 100644 (file)
 #include "mem/cache/replacement_policies/replaceable_entry.hh"
 #include "mem/cache/tags/indexing_policies/base.hh"
 
-SectorTags::SectorTags(const SectorTagsParams *p)
-    : BaseTags(p), allocAssoc(p->assoc),
-      sequentialAccess(p->sequential_access),
-      replacementPolicy(p->replacement_policy),
-      numBlocksPerSector(p->num_blocks_per_sector),
+SectorTags::SectorTags(const SectorTagsParams &p)
+    : BaseTags(p), allocAssoc(p.assoc),
+      sequentialAccess(p.sequential_access),
+      replacementPolicy(p.replacement_policy),
+      numBlocksPerSector(p.num_blocks_per_sector),
       numSectors(numBlocks / numBlocksPerSector),
       sectorShift(floorLog2(blkSize)), sectorMask(numBlocksPerSector - 1),
       sectorStats(stats, *this)
@@ -325,10 +325,10 @@ SectorTags::anyBlk(std::function<bool(CacheBlk &)> visitor)
 }
 
 SectorTags *
-SectorTagsParams::create()
+SectorTagsParams::create() const
 {
     // There must be a indexing policy
     fatal_if(!indexing_policy, "An indexing policy is required");
 
-    return new SectorTags(this);
+    return new SectorTags(*this);
 }
index 380b3c1c8897178069f78216efb720f454299845..c56ef2409e38ce34a1085b0cceb3978e225a52e1 100644 (file)
@@ -108,7 +108,7 @@ class SectorTags : public BaseTags
     /**
      * Construct and initialize this tag store.
      */
-    SectorTags(const Params *p);
+    SectorTags(const Params &p);
 
     /**
      * Destructor.
index 14392b5f4d3847c35ecad136d8111333302d9adf..cbab90632aa994c67ea321b7c579eeb352b515a4 100644 (file)
 #include "debug/CoherentXBar.hh"
 #include "sim/system.hh"
 
-CoherentXBar::CoherentXBar(const CoherentXBarParams *p)
-    : BaseXBar(p), system(p->system), snoopFilter(p->snoop_filter),
-      snoopResponseLatency(p->snoop_response_latency),
-      maxOutstandingSnoopCheck(p->max_outstanding_snoops),
-      maxRoutingTableSizeCheck(p->max_routing_table_size),
-      pointOfCoherency(p->point_of_coherency),
-      pointOfUnification(p->point_of_unification),
+CoherentXBar::CoherentXBar(const CoherentXBarParams &p)
+    : BaseXBar(p), system(p.system), snoopFilter(p.snoop_filter),
+      snoopResponseLatency(p.snoop_response_latency),
+      maxOutstandingSnoopCheck(p.max_outstanding_snoops),
+      maxRoutingTableSizeCheck(p.max_routing_table_size),
+      pointOfCoherency(p.point_of_coherency),
+      pointOfUnification(p.point_of_unification),
 
       snoops(this, "snoops", "Total snoops (count)"),
       snoopTraffic(this, "snoopTraffic", "Total snoop traffic (bytes)"),
@@ -66,7 +66,7 @@ CoherentXBar::CoherentXBar(const CoherentXBarParams *p)
     // create the ports based on the size of the memory-side port and
     // CPU-side port vector ports, and the presence of the default port,
     // the ports are enumerated starting from zero
-    for (int i = 0; i < p->port_mem_side_ports_connection_count; ++i) {
+    for (int i = 0; i < p.port_mem_side_ports_connection_count; ++i) {
         std::string portName = csprintf("%s.mem_side_port[%d]", name(), i);
         RequestPort* bp = new CoherentXBarRequestPort(portName, *this, i);
         memSidePorts.push_back(bp);
@@ -78,7 +78,7 @@ CoherentXBar::CoherentXBar(const CoherentXBarParams *p)
 
     // see if we have a default CPU-side-port device connected and if so add
     // our corresponding memory-side port
-    if (p->port_default_connection_count) {
+    if (p.port_default_connection_count) {
         defaultPortID = memSidePorts.size();
         std::string portName = name() + ".default";
         RequestPort* bp = new CoherentXBarRequestPort(portName, *this,
@@ -92,7 +92,7 @@ CoherentXBar::CoherentXBar(const CoherentXBarParams *p)
     }
 
     // create the CPU-side ports, once again starting at zero
-    for (int i = 0; i < p->port_cpu_side_ports_connection_count; ++i) {
+    for (int i = 0; i < p.port_cpu_side_ports_connection_count; ++i) {
         std::string portName = csprintf("%s.cpu_side_port[%d]", name(), i);
         QueuedResponsePort* bp = new CoherentXBarResponsePort(portName,
                                                             *this, i);
@@ -1119,7 +1119,7 @@ CoherentXBar::regStats()
 }
 
 CoherentXBar *
-CoherentXBarParams::create()
+CoherentXBarParams::create() const
 {
-    return new CoherentXBar(this);
+    return new CoherentXBar(*this);
 }
index 81e2dc4cd139e5c5072a7195d64a3783b8015105..0295c4495d2b2ae2687b64c82ed5068e0764677c 100644 (file)
@@ -423,7 +423,7 @@ class CoherentXBar : public BaseXBar
 
     virtual void init();
 
-    CoherentXBar(const CoherentXBarParams *p);
+    CoherentXBar(const CoherentXBarParams &p);
 
     virtual ~CoherentXBar();
 
index 14df955c1b4336bfb8468cb41ef6fd7165b4ad53..99edd99d8600d447380c6e63ab28b56b889183c5 100644 (file)
 #include "debug/CommMonitor.hh"
 #include "sim/stats.hh"
 
-CommMonitor::CommMonitor(Params* params)
+CommMonitor::CommMonitor(const Params &params)
     : SimObject(params),
       memSidePort(name() + "-mem_side_port", *this),
       cpuSidePort(name() + "-cpu_side_port", *this),
       samplePeriodicEvent([this]{ samplePeriodic(); }, name()),
-      samplePeriodTicks(params->sample_period),
-      samplePeriod(params->sample_period / SimClock::Float::s),
+      samplePeriodTicks(params.sample_period),
+      samplePeriod(params.sample_period / SimClock::Float::s),
       stats(this, params)
 {
     DPRINTF(CommMonitor,
@@ -58,9 +58,9 @@ CommMonitor::CommMonitor(Params* params)
 }
 
 CommMonitor*
-CommMonitorParams::create()
+CommMonitorParams::create() const
 {
-    return new CommMonitor(this);
+    return new CommMonitor(*this);
 }
 
 void
@@ -103,16 +103,16 @@ CommMonitor::recvFunctionalSnoop(PacketPtr pkt)
 }
 
 CommMonitor::MonitorStats::MonitorStats(Stats::Group *parent,
-                                        const CommMonitorParams *params)
+                                        const CommMonitorParams &params)
     : Stats::Group(parent),
 
-      disableBurstLengthHists(params->disable_burst_length_hists),
+      disableBurstLengthHists(params.disable_burst_length_hists),
       ADD_STAT(readBurstLengthHist,
                "Histogram of burst lengths of transmitted packets"),
       ADD_STAT(writeBurstLengthHist,
                "Histogram of burst lengths of transmitted packets"),
 
-      disableBandwidthHists(params->disable_bandwidth_hists),
+      disableBandwidthHists(params.disable_bandwidth_hists),
       readBytes(0),
       ADD_STAT(readBandwidthHist,
                "Histogram of read bandwidth per sample period (bytes/s)"),
@@ -126,23 +126,23 @@ CommMonitor::MonitorStats::MonitorStats(Stats::Group *parent,
       ADD_STAT(averageWriteBandwidth, "Average write bandwidth (bytes/s)",
                totalWrittenBytes / simSeconds),
 
-      disableLatencyHists(params->disable_latency_hists),
+      disableLatencyHists(params.disable_latency_hists),
       ADD_STAT(readLatencyHist, "Read request-response latency"),
       ADD_STAT(writeLatencyHist, "Write request-response latency"),
 
-      disableITTDists(params->disable_itt_dists),
+      disableITTDists(params.disable_itt_dists),
       ADD_STAT(ittReadRead, "Read-to-read inter transaction time"),
       ADD_STAT(ittWriteWrite , "Write-to-write inter transaction time"),
       ADD_STAT(ittReqReq, "Request-to-request inter transaction time"),
       timeOfLastRead(0), timeOfLastWrite(0), timeOfLastReq(0),
 
-      disableOutstandingHists(params->disable_outstanding_hists),
+      disableOutstandingHists(params.disable_outstanding_hists),
       ADD_STAT(outstandingReadsHist, "Outstanding read transactions"),
       outstandingReadReqs(0),
       ADD_STAT(outstandingWritesHist, "Outstanding write transactions"),
       outstandingWriteReqs(0),
 
-      disableTransactionHists(params->disable_transaction_hists),
+      disableTransactionHists(params.disable_transaction_hists),
       ADD_STAT(readTransHist,
                "Histogram of read transactions per sample period"),
       readTrans(0),
@@ -150,25 +150,25 @@ CommMonitor::MonitorStats::MonitorStats(Stats::Group *parent,
                "Histogram of write transactions per sample period"),
       writeTrans(0),
 
-      disableAddrDists(params->disable_addr_dists),
-      readAddrMask(params->read_addr_mask),
-      writeAddrMask(params->write_addr_mask),
+      disableAddrDists(params.disable_addr_dists),
+      readAddrMask(params.read_addr_mask),
+      writeAddrMask(params.write_addr_mask),
       ADD_STAT(readAddrDist, "Read address distribution"),
       ADD_STAT(writeAddrDist, "Write address distribution")
 {
     using namespace Stats;
 
     readBurstLengthHist
-        .init(params->burst_length_bins)
+        .init(params.burst_length_bins)
         .flags(disableBurstLengthHists ? nozero : pdf);
 
     writeBurstLengthHist
-        .init(params->burst_length_bins)
+        .init(params.burst_length_bins)
         .flags(disableBurstLengthHists ? nozero : pdf);
 
     // Stats based on received responses
     readBandwidthHist
-        .init(params->bandwidth_bins)
+        .init(params.bandwidth_bins)
         .flags(disableBandwidthHists ? nozero : pdf);
 
     averageReadBandwidth
@@ -179,7 +179,7 @@ CommMonitor::MonitorStats::MonitorStats(Stats::Group *parent,
 
     // Stats based on successfully sent requests
     writeBandwidthHist
-        .init(params->bandwidth_bins)
+        .init(params.bandwidth_bins)
         .flags(disableBandwidthHists ? (pdf | nozero) : pdf);
 
     averageWriteBandwidth
@@ -190,42 +190,42 @@ CommMonitor::MonitorStats::MonitorStats(Stats::Group *parent,
 
 
     readLatencyHist
-        .init(params->latency_bins)
+        .init(params.latency_bins)
         .flags(disableLatencyHists ? nozero : pdf);
 
     writeLatencyHist
-        .init(params->latency_bins)
+        .init(params.latency_bins)
         .flags(disableLatencyHists ? nozero : pdf);
 
     ittReadRead
-        .init(1, params->itt_max_bin, params->itt_max_bin /
-              params->itt_bins)
+        .init(1, params.itt_max_bin, params.itt_max_bin /
+              params.itt_bins)
         .flags(disableITTDists ? nozero : pdf);
 
     ittWriteWrite
-        .init(1, params->itt_max_bin, params->itt_max_bin /
-              params->itt_bins)
+        .init(1, params.itt_max_bin, params.itt_max_bin /
+              params.itt_bins)
         .flags(disableITTDists ? nozero : pdf);
 
     ittReqReq
-        .init(1, params->itt_max_bin, params->itt_max_bin /
-              params->itt_bins)
+        .init(1, params.itt_max_bin, params.itt_max_bin /
+              params.itt_bins)
         .flags(disableITTDists ? nozero : pdf);
 
     outstandingReadsHist
-        .init(params->outstanding_bins)
+        .init(params.outstanding_bins)
         .flags(disableOutstandingHists ? nozero : pdf);
 
     outstandingWritesHist
-        .init(params->outstanding_bins)
+        .init(params.outstanding_bins)
         .flags(disableOutstandingHists ? nozero : pdf);
 
     readTransHist
-        .init(params->transaction_bins)
+        .init(params.transaction_bins)
         .flags(disableTransactionHists ? nozero : pdf);
 
     writeTransHist
-        .init(params->transaction_bins)
+        .init(params.transaction_bins)
         .flags(disableTransactionHists ? nozero : pdf);
 
     readAddrDist
index ed6936246f21a51e8d81e6e483d9469429ce0183..9912baabd907800cb26247198c78d3b4add6e3ea 100644 (file)
@@ -64,15 +64,18 @@ class CommMonitor : public SimObject
 
     /** Parameters of communication monitor */
     typedef CommMonitorParams Params;
-    const Params* params() const
-    { return reinterpret_cast<const Params*>(_params); }
+    const Params &
+    params() const
+    {
+        return reinterpret_cast<const Params &>(_params);
+    }
 
     /**
      * Constructor based on the Python params
      *
      * @param params Python parameters
      */
-    CommMonitor(Params* params);
+    CommMonitor(const Params &params);
 
     void init() override;
     void startup() override;
@@ -382,7 +385,7 @@ class CommMonitor : public SimObject
          * that are not statistics themselves, but used to control the
          * stats or track values during a sample period.
          */
-        MonitorStats(Stats::Group *parent, const CommMonitorParamsparams);
+        MonitorStats(Stats::Group *parent, const CommMonitorParams &params);
 
         void updateReqStats(const ProbePoints::PacketInfo& pkt, bool is_atomic,
                             bool expects_response);
index 96dcb5518d209f6ad5385efbe8c36cb43d0219a5..ef38a67c081c0f34bb00fa2847411df7f2dc0fbb 100644 (file)
 #include "base/intmath.hh"
 #include "sim/core.hh"
 
-DRAMPower::DRAMPower(const DRAMInterfaceParamsp, bool include_io) :
+DRAMPower::DRAMPower(const DRAMInterfaceParams &p, bool include_io) :
     powerlib(libDRAMPower(getMemSpec(p), include_io))
 {
 }
 
 Data::MemArchitectureSpec
-DRAMPower::getArchParams(const DRAMInterfaceParamsp)
+DRAMPower::getArchParams(const DRAMInterfaceParams &p)
 {
     Data::MemArchitectureSpec archSpec;
-    archSpec.burstLength = p->burst_length;
-    archSpec.nbrOfBanks = p->banks_per_rank;
+    archSpec.burstLength = p.burst_length;
+    archSpec.nbrOfBanks = p.banks_per_rank;
     // One DRAMPower instance per rank, hence set this to 1
     archSpec.nbrOfRanks = 1;
-    archSpec.dataRate = p->beats_per_clock;
+    archSpec.dataRate = p.beats_per_clock;
     // For now we can ignore the number of columns and rows as they
     // are not used in the power calculation.
     archSpec.nbrOfColumns = 0;
     archSpec.nbrOfRows = 0;
-    archSpec.width = p->device_bus_width;
-    archSpec.nbrOfBankGroups = p->bank_groups_per_rank;
-    archSpec.dll = p->dll;
+    archSpec.width = p.device_bus_width;
+    archSpec.nbrOfBankGroups = p.bank_groups_per_rank;
+    archSpec.dll = p.dll;
     archSpec.twoVoltageDomains = hasTwoVDD(p);
     // Keep this disabled for now until the model is firmed up.
     archSpec.termination = false;
@@ -68,71 +68,71 @@ DRAMPower::getArchParams(const DRAMInterfaceParams* p)
 }
 
 Data::MemTimingSpec
-DRAMPower::getTimingParams(const DRAMInterfaceParamsp)
+DRAMPower::getTimingParams(const DRAMInterfaceParams &p)
 {
     // Set the values that are used for power calculations and ignore
     // the ones only used by the controller functionality in DRAMPower
 
     // All DRAMPower timings are in clock cycles
     Data::MemTimingSpec timingSpec;
-    timingSpec.RC = divCeil((p->tRAS + p->tRP), p->tCK);
-    timingSpec.RCD = divCeil(p->tRCD, p->tCK);
-    timingSpec.RL = divCeil(p->tCL, p->tCK);
-    timingSpec.RP = divCeil(p->tRP, p->tCK);
-    timingSpec.RFC = divCeil(p->tRFC, p->tCK);
-    timingSpec.RAS = divCeil(p->tRAS, p->tCK);
+    timingSpec.RC = divCeil((p.tRAS + p.tRP), p.tCK);
+    timingSpec.RCD = divCeil(p.tRCD, p.tCK);
+    timingSpec.RL = divCeil(p.tCL, p.tCK);
+    timingSpec.RP = divCeil(p.tRP, p.tCK);
+    timingSpec.RFC = divCeil(p.tRFC, p.tCK);
+    timingSpec.RAS = divCeil(p.tRAS, p.tCK);
     // Write latency is read latency - 1 cycle
     // Source: B.Jacob Memory Systems Cache, DRAM, Disk
     timingSpec.WL = timingSpec.RL - 1;
     timingSpec.DQSCK = 0; // ignore for now
-    timingSpec.RTP = divCeil(p->tRTP, p->tCK);
-    timingSpec.WR = divCeil(p->tWR, p->tCK);
-    timingSpec.XP = divCeil(p->tXP, p->tCK);
-    timingSpec.XPDLL = divCeil(p->tXPDLL, p->tCK);
-    timingSpec.XS = divCeil(p->tXS, p->tCK);
-    timingSpec.XSDLL = divCeil(p->tXSDLL, p->tCK);
+    timingSpec.RTP = divCeil(p.tRTP, p.tCK);
+    timingSpec.WR = divCeil(p.tWR, p.tCK);
+    timingSpec.XP = divCeil(p.tXP, p.tCK);
+    timingSpec.XPDLL = divCeil(p.tXPDLL, p.tCK);
+    timingSpec.XS = divCeil(p.tXS, p.tCK);
+    timingSpec.XSDLL = divCeil(p.tXSDLL, p.tCK);
 
     // Clock period in ns
-    timingSpec.clkPeriod = (p->tCK / (double)(SimClock::Int::ns));
+    timingSpec.clkPeriod = (p.tCK / (double)(SimClock::Int::ns));
     assert(timingSpec.clkPeriod != 0);
     timingSpec.clkMhz = (1 / timingSpec.clkPeriod) * 1000;
     return timingSpec;
 }
 
 Data::MemPowerSpec
-DRAMPower::getPowerParams(const DRAMInterfaceParamsp)
+DRAMPower::getPowerParams(const DRAMInterfaceParams &p)
 {
     // All DRAMPower currents are in mA
     Data::MemPowerSpec powerSpec;
-    powerSpec.idd0 = p->IDD0 * 1000;
-    powerSpec.idd02 = p->IDD02 * 1000;
-    powerSpec.idd2p0 = p->IDD2P0 * 1000;
-    powerSpec.idd2p02 = p->IDD2P02 * 1000;
-    powerSpec.idd2p1 = p->IDD2P1 * 1000;
-    powerSpec.idd2p12 = p->IDD2P12 * 1000;
-    powerSpec.idd2n = p->IDD2N * 1000;
-    powerSpec.idd2n2 = p->IDD2N2 * 1000;
-    powerSpec.idd3p0 = p->IDD3P0 * 1000;
-    powerSpec.idd3p02 = p->IDD3P02 * 1000;
-    powerSpec.idd3p1 = p->IDD3P1 * 1000;
-    powerSpec.idd3p12 = p->IDD3P12 * 1000;
-    powerSpec.idd3n = p->IDD3N * 1000;
-    powerSpec.idd3n2 = p->IDD3N2 * 1000;
-    powerSpec.idd4r = p->IDD4R * 1000;
-    powerSpec.idd4r2 = p->IDD4R2 * 1000;
-    powerSpec.idd4w = p->IDD4W * 1000;
-    powerSpec.idd4w2 = p->IDD4W2 * 1000;
-    powerSpec.idd5 = p->IDD5 * 1000;
-    powerSpec.idd52 = p->IDD52 * 1000;
-    powerSpec.idd6 = p->IDD6 * 1000;
-    powerSpec.idd62 = p->IDD62 * 1000;
-    powerSpec.vdd = p->VDD;
-    powerSpec.vdd2 = p->VDD2;
+    powerSpec.idd0 = p.IDD0 * 1000;
+    powerSpec.idd02 = p.IDD02 * 1000;
+    powerSpec.idd2p0 = p.IDD2P0 * 1000;
+    powerSpec.idd2p02 = p.IDD2P02 * 1000;
+    powerSpec.idd2p1 = p.IDD2P1 * 1000;
+    powerSpec.idd2p12 = p.IDD2P12 * 1000;
+    powerSpec.idd2n = p.IDD2N * 1000;
+    powerSpec.idd2n2 = p.IDD2N2 * 1000;
+    powerSpec.idd3p0 = p.IDD3P0 * 1000;
+    powerSpec.idd3p02 = p.IDD3P02 * 1000;
+    powerSpec.idd3p1 = p.IDD3P1 * 1000;
+    powerSpec.idd3p12 = p.IDD3P12 * 1000;
+    powerSpec.idd3n = p.IDD3N * 1000;
+    powerSpec.idd3n2 = p.IDD3N2 * 1000;
+    powerSpec.idd4r = p.IDD4R * 1000;
+    powerSpec.idd4r2 = p.IDD4R2 * 1000;
+    powerSpec.idd4w = p.IDD4W * 1000;
+    powerSpec.idd4w2 = p.IDD4W2 * 1000;
+    powerSpec.idd5 = p.IDD5 * 1000;
+    powerSpec.idd52 = p.IDD52 * 1000;
+    powerSpec.idd6 = p.IDD6 * 1000;
+    powerSpec.idd62 = p.IDD62 * 1000;
+    powerSpec.vdd = p.VDD;
+    powerSpec.vdd2 = p.VDD2;
     return powerSpec;
 }
 
 Data::MemorySpecification
-DRAMPower::getMemSpec(const DRAMInterfaceParamsp)
+DRAMPower::getMemSpec(const DRAMInterfaceParams &p)
 {
     Data::MemorySpecification memSpec;
     memSpec.memArchSpec = getArchParams(p);
@@ -142,16 +142,16 @@ DRAMPower::getMemSpec(const DRAMInterfaceParams* p)
 }
 
 bool
-DRAMPower::hasTwoVDD(const DRAMInterfaceParamsp)
+DRAMPower::hasTwoVDD(const DRAMInterfaceParams &p)
 {
-    return p->VDD2 == 0 ? false : true;
+    return p.VDD2 == 0 ? false : true;
 }
 
 uint8_t
-DRAMPower::getDataRate(const DRAMInterfaceParamsp)
+DRAMPower::getDataRate(const DRAMInterfaceParams &p)
 {
-    uint32_t burst_cycles = divCeil(p->tBURST_MAX, p->tCK);
-    uint8_t data_rate = p->burst_length / burst_cycles;
+    uint32_t burst_cycles = divCeil(p.tBURST_MAX, p.tCK);
+    uint8_t data_rate = p.burst_length / burst_cycles;
     // 4 for GDDR5
     if (data_rate != 1 && data_rate != 2 && data_rate != 4 && data_rate != 8)
         fatal("Got unexpected data rate %d, should be 1 or 2 or 4 or 8\n");
index da68a787f151c462a42fa42c22c8656c37341cde..0d736665587ef575471957e40af417992abf15c7 100644 (file)
@@ -60,41 +60,41 @@ class DRAMPower
      * DRAMInterfaceParams to the memSpec of DRAMPower
      */
     static Data::MemArchitectureSpec getArchParams(
-                                     const DRAMInterfaceParamsp);
+                                     const DRAMInterfaceParams &p);
 
     /**
      * Transforms the timing parameters defined in DRAMInterfaceParams to
      * the memSpec of DRAMPower
      */
-    static Data::MemTimingSpec getTimingParams(const DRAMInterfaceParamsp);
+    static Data::MemTimingSpec getTimingParams(const DRAMInterfaceParams &p);
 
     /**
      * Transforms the power and current parameters defined in
      * DRAMInterfaceParams to the memSpec of DRAMPower
      */
-    static Data::MemPowerSpec getPowerParams(const DRAMInterfaceParamsp);
+    static Data::MemPowerSpec getPowerParams(const DRAMInterfaceParams &p);
 
     /**
      * Determine data rate, either one or two.
      */
-    static uint8_t getDataRate(const DRAMInterfaceParamsp);
+    static uint8_t getDataRate(const DRAMInterfaceParams &p);
 
     /**
      * Determine if DRAM has two voltage domains (or one)
      */
-    static bool hasTwoVDD(const DRAMInterfaceParamsp);
+    static bool hasTwoVDD(const DRAMInterfaceParams &p);
 
     /**
      * Return an instance of MemSpec based on the DRAMInterfaceParams
      */
-    static Data::MemorySpecification getMemSpec(const DRAMInterfaceParamsp);
+    static Data::MemorySpecification getMemSpec(const DRAMInterfaceParams &p);
 
  public:
 
     // Instance of DRAMPower Library
     libDRAMPower powerlib;
 
-    DRAMPower(const DRAMInterfaceParamsp, bool include_io);
+    DRAMPower(const DRAMInterfaceParams &p, bool include_io);
 
 };
 
index b09138cefe0179fc0a1cdfcee4c31db018a58be7..0eaf33687de06809b66b8542a60f5e47430f0360 100644 (file)
 #include "debug/Drain.hh"
 #include "sim/system.hh"
 
-DRAMSim2::DRAMSim2(const Paramsp) :
+DRAMSim2::DRAMSim2(const Params &p) :
     AbstractMemory(p),
     port(name() + ".port", *this),
-    wrapper(p->deviceConfigFile, p->systemConfigFile, p->filePath,
-            p->traceFile, p->range.size() / 1024 / 1024, p->enableDebug),
+    wrapper(p.deviceConfigFile, p.systemConfigFile, p.filePath,
+            p.traceFile, p.range.size() / 1024 / 1024, p.enableDebug),
     retryReq(false), retryResp(false), startTick(0),
     nbrOutstandingReads(0), nbrOutstandingWrites(0),
     sendResponseEvent([this]{ sendResponse(); }, name()),
@@ -389,7 +389,7 @@ DRAMSim2::MemoryPort::recvRespRetry()
 }
 
 DRAMSim2*
-DRAMSim2Params::create()
+DRAMSim2Params::create() const
 {
-    return new DRAMSim2(this);
+    return new DRAMSim2(*this);
 }
index 3259e8513b83e793129e8c22e96453a189f1cfd2..a417c070dbfb580e55690663edb1efe1ea9a953b 100644 (file)
@@ -167,7 +167,7 @@ class DRAMSim2 : public AbstractMemory
   public:
 
     typedef DRAMSim2Params Params;
-    DRAMSim2(const Params *p);
+    DRAMSim2(const Params &p);
 
     /**
      * Read completion callback.
index 4b2f796769f51003273d1598ae9807ee285743cf..36bd371d69884a591767f937d7609a54a33f6c0e 100644 (file)
 #include "debug/Drain.hh"
 #include "sim/system.hh"
 
-DRAMsim3::DRAMsim3(const Paramsp) :
+DRAMsim3::DRAMsim3(const Params &p) :
     AbstractMemory(p),
     port(name() + ".port", *this),
     read_cb(std::bind(&DRAMsim3::readComplete,
                       this, 0, std::placeholders::_1)),
     write_cb(std::bind(&DRAMsim3::writeComplete,
                        this, 0, std::placeholders::_1)),
-    wrapper(p->configFile, p->filePath, read_cb, write_cb),
+    wrapper(p.configFile, p.filePath, read_cb, write_cb),
     retryReq(false), retryResp(false), startTick(0),
     nbrOutstandingReads(0), nbrOutstandingWrites(0),
     sendResponseEvent([this]{ sendResponse(); }, name()),
@@ -389,7 +389,7 @@ DRAMsim3::MemoryPort::recvRespRetry()
 }
 
 DRAMsim3*
-DRAMsim3Params::create()
+DRAMsim3Params::create() const
 {
-    return new DRAMsim3(this);
+    return new DRAMsim3(*this);
 }
index fc3cd1a28455e1d025c8dae30875031a1b843024..f667c4d1996ded0c7bc26c5538cb7200538bb136 100644 (file)
@@ -176,7 +176,7 @@ class DRAMsim3 : public AbstractMemory
   public:
 
     typedef DRAMsim3Params Params;
-    DRAMsim3(const Params *p);
+    DRAMsim3(const Params &p);
 
     /**
      * Read completion callback.
index 81b7a52c3a5c793b1dc0053616f57e1f65b3435d..d7a081f6cf48329df64b8612836ad872b0e23db8 100644 (file)
 std::map<std::string, ExternalMaster::Handler *>
     ExternalMaster::portHandlers;
 
-ExternalMaster::ExternalMaster(ExternalMasterParams *params) :
+ExternalMaster::ExternalMaster(const ExternalMasterParams &params) :
     SimObject(params),
     externalPort(NULL),
-    portName(params->name + ".port"),
-    portType(params->port_type),
-    portData(params->port_data),
-    id(params->system->getRequestorId(this))
+    portName(params.name + ".port"),
+    portType(params.port_type),
+    portData(params.port_data),
+    id(params.system->getRequestorId(this))
 {}
 
 Port &
@@ -94,9 +94,9 @@ ExternalMaster::init()
 }
 
 ExternalMaster *
-ExternalMasterParams::create()
+ExternalMasterParams::create() const
 {
-    return new ExternalMaster(this);
+    return new ExternalMaster(*this);
 }
 
 void
index a4d5b031cd17f6978f63e7018cf72a6425e83edf..0ca19363e9c6e4f0206be9f4b42d988953e2951f 100644 (file)
@@ -115,7 +115,7 @@ class ExternalMaster : public SimObject
     static std::map<std::string, Handler *> portHandlers;
 
   public:
-    ExternalMaster(ExternalMasterParams *params);
+    ExternalMaster(const ExternalMasterParams &params);
 
     /** Port interface.  Responds only to port "port" */
     Port &getPort(const std::string &if_name,
index a40e5595cdac5c938b51c035837cd3f716c81263..1559a3c61d21aa94ed15e5083adb68c97d9090ac 100644 (file)
@@ -178,13 +178,13 @@ ExternalSlave::ExternalPort::getAddrRanges() const
     return owner.addrRanges;
 }
 
-ExternalSlave::ExternalSlave(ExternalSlaveParams *params) :
+ExternalSlave::ExternalSlave(const ExternalSlaveParams &params) :
     SimObject(params),
     externalPort(NULL),
-    portName(params->name + ".port"),
-    portType(params->port_type),
-    portData(params->port_data),
-    addrRanges(params->addr_ranges.begin(), params->addr_ranges.end())
+    portName(params.name + ".port"),
+    portType(params.port_type),
+    portData(params.port_data),
+    addrRanges(params.addr_ranges.begin(), params.addr_ranges.end())
 {
     /* Register the stub handler if it hasn't already been registered */
     if (portHandlers.find("stub") == portHandlers.end())
@@ -231,9 +231,9 @@ ExternalSlave::init()
 }
 
 ExternalSlave *
-ExternalSlaveParams::create()
+ExternalSlaveParams::create() const
 {
-    return new ExternalSlave(this);
+    return new ExternalSlave(*this);
 }
 
 void
index c0f01f85e53af35f83692143cbb57659f2140a64..ebb355475cd2bc5a5c28e1e112df7f9c13005020 100644 (file)
@@ -123,7 +123,7 @@ class ExternalSlave : public SimObject
     static std::map<std::string, Handler *> portHandlers;
 
   public:
-    ExternalSlave(ExternalSlaveParams *params);
+    ExternalSlave(const ExternalSlaveParams &params);
 
     /** Port interface.  Responds only to port "port" */
     Port &getPort(const std::string &if_name,
index 20f6725359359acb18defda4f04eb8fea783557d..55017dad101f8bcbb522997592e82a57581a410c 100644 (file)
@@ -4,18 +4,18 @@
 #include "base/trace.hh"
 #include "debug/HMCController.hh"
 
-HMCController::HMCController(const HMCControllerParamsp) :
+HMCController::HMCController(const HMCControllerParams &p) :
     NoncoherentXBar(p),
-    numMemSidePorts(p->port_mem_side_ports_connection_count),
+    numMemSidePorts(p.port_mem_side_ports_connection_count),
     rr_counter(0)
 {
-    assert(p->port_cpu_side_ports_connection_count == 1);
+    assert(p.port_cpu_side_ports_connection_count == 1);
 }
 
 HMCController*
-HMCControllerParams::create()
+HMCControllerParams::create() const
 {
-    return new HMCController(this);
+    return new HMCController(*this);
 }
 
 // Since this module is a load distributor, all its request ports have the same
index 8206ee007e3ed4755ea8f244150b9ffc412f040d..8474277ed737683354f724c1f23de8a24642df04 100644 (file)
@@ -74,7 +74,7 @@ class HMCController : public NoncoherentXBar
 {
 public:
 
-    HMCController(const HMCControllerParams *p);
+    HMCController(const HMCControllerParams &p);
 
 private:
 
index 79e52362498a5422f87f9c33e17080d99b0604fc..c6d916420b185fffda24d481c438b30c0a887977 100644 (file)
@@ -345,7 +345,7 @@ MemChecker::reset(Addr addr, size_t size)
 }
 
 MemChecker*
-MemCheckerParams::create()
+MemCheckerParams::create() const
 {
-    return new MemChecker(this);
+    return new MemChecker(*this);
 }
index f82538f48ae056b5f4657798e85f002391ecb66d..41aa691e7325ba1ca7d1c027bf3624eea2e3a373 100644 (file)
@@ -369,7 +369,7 @@ class MemChecker : public SimObject
 
   public:
 
-    MemChecker(const MemCheckerParams *p)
+    MemChecker(const MemCheckerParams &p)
         : SimObject(p),
           nextSerial(SERIAL_INITIAL)
     {}
index 82ca83b0900a9a8e4988637bb3213f19b50b25c1..6a975f37a95864c439c7652231407d2b856e63df 100644 (file)
 #include "base/trace.hh"
 #include "debug/MemCheckerMonitor.hh"
 
-MemCheckerMonitor::MemCheckerMonitor(Params* params)
+MemCheckerMonitor::MemCheckerMonitor(const Params &params)
     : SimObject(params),
       memSidePort(name() + "-memSidePort", *this),
       cpuSidePort(name() + "-cpuSidePort", *this),
-      warnOnly(params->warn_only),
-      memchecker(params->memchecker)
+      warnOnly(params.warn_only),
+      memchecker(params.memchecker)
 {}
 
 MemCheckerMonitor::~MemCheckerMonitor()
 {}
 
 MemCheckerMonitor*
-MemCheckerMonitorParams::create()
+MemCheckerMonitorParams::create() const
 {
-    return new MemCheckerMonitor(this);
+    return new MemCheckerMonitor(*this);
 }
 
 void
index 8e5dab1a26eaf9797c2c5261df108df224fff080..6092fe7217280c1de3f81190ead133cdacaf2a4a 100644 (file)
@@ -53,15 +53,18 @@ class MemCheckerMonitor : public SimObject
 
     /** Parameters of memchecker monitor */
     typedef MemCheckerMonitorParams Params;
-    const Params* params() const
-    { return reinterpret_cast<const Params*>(_params); }
+    const Params &
+    params() const
+    {
+        return reinterpret_cast<const Params &>(_params);
+    }
 
     /**
      * Constructor based on the Python params
      *
      * @param params Python parameters
      */
-    MemCheckerMonitor(Params* params);
+    MemCheckerMonitor(const Params &params);
 
     /** Destructor */
     ~MemCheckerMonitor();
index 1c0d4b1b6a56c66733aed4938d1c09b212d8e3f3..76d2e9759dcdd19fb5ef9215dfb12c9d82379fbc 100644 (file)
 
 using namespace std;
 
-MemCtrl::MemCtrl(const MemCtrlParamsp) :
+MemCtrl::MemCtrl(const MemCtrlParams &p) :
     QoS::MemCtrl(p),
     port(name() + ".port", *this), isTimingMode(false),
     retryRdReq(false), retryWrReq(false),
     nextReqEvent([this]{ processNextReqEvent(); }, name()),
     respondEvent([this]{ processRespondEvent(); }, name()),
-    dram(p->dram), nvm(p->nvm),
+    dram(p.dram), nvm(p.nvm),
     readBufferSize((dram ? dram->readBufferSize : 0) +
                    (nvm ? nvm->readBufferSize : 0)),
     writeBufferSize((dram ? dram->writeBufferSize : 0) +
                     (nvm ? nvm->writeBufferSize : 0)),
-    writeHighThreshold(writeBufferSize * p->write_high_thresh_perc / 100.0),
-    writeLowThreshold(writeBufferSize * p->write_low_thresh_perc / 100.0),
-    minWritesPerSwitch(p->min_writes_per_switch),
+    writeHighThreshold(writeBufferSize * p.write_high_thresh_perc / 100.0),
+    writeLowThreshold(writeBufferSize * p.write_low_thresh_perc / 100.0),
+    minWritesPerSwitch(p.min_writes_per_switch),
     writesThisTime(0), readsThisTime(0),
-    memSchedPolicy(p->mem_sched_policy),
-    frontendLatency(p->static_frontend_latency),
-    backendLatency(p->static_backend_latency),
-    commandWindow(p->command_window),
+    memSchedPolicy(p.mem_sched_policy),
+    frontendLatency(p.static_frontend_latency),
+    backendLatency(p.static_backend_latency),
+    commandWindow(p.command_window),
     nextBurstAt(0), prevArrival(0),
     nextReqTime(0),
     stats(*this)
 {
     DPRINTF(MemCtrl, "Setting up controller\n");
-    readQueue.resize(p->qos_priorities);
-    writeQueue.resize(p->qos_priorities);
+    readQueue.resize(p.qos_priorities);
+    writeQueue.resize(p.qos_priorities);
 
     // Hook up interfaces to the controller
     if (dram)
@@ -87,10 +87,10 @@ MemCtrl::MemCtrl(const MemCtrlParams* p) :
     fatal_if(!dram && !nvm, "Memory controller must have an interface");
 
     // perform a basic check of the write thresholds
-    if (p->write_low_thresh_perc >= p->write_high_thresh_perc)
+    if (p.write_low_thresh_perc >= p.write_high_thresh_perc)
         fatal("Write buffer low threshold %d must be smaller than the "
-              "high threshold %d\n", p->write_low_thresh_perc,
-              p->write_high_thresh_perc);
+              "high threshold %d\n", p.write_low_thresh_perc,
+              p.write_high_thresh_perc);
 }
 
 void
@@ -1469,7 +1469,7 @@ MemCtrl::MemoryPort::recvTimingReq(PacketPtr pkt)
 }
 
 MemCtrl*
-MemCtrlParams::create()
+MemCtrlParams::create() const
 {
-    return new MemCtrl(this);
+    return new MemCtrl(*this);
 }
index 2e3cf8c6a9de96153ad636ce85ec2783140ce8e1..e6ae0abe387401ec037a2d9bb1581af650ee9b59 100644 (file)
@@ -609,7 +609,7 @@ class MemCtrl : public QoS::MemCtrl
 
   public:
 
-    MemCtrl(const MemCtrlParamsp);
+    MemCtrl(const MemCtrlParams &p);
 
     /**
      * Ensure that all interfaced have drained commands
index 8120a99d67ca05d06689638f165d50270d734bfc..f51dd2fe63230a41f06b9c525da2273e5f184fb8 100644 (file)
@@ -40,7 +40,7 @@
 #include "params/MemDelay.hh"
 #include "params/SimpleMemDelay.hh"
 
-MemDelay::MemDelay(const MemDelayParams *p)
+MemDelay::MemDelay(const MemDelayParams &p)
     : ClockedObject(p),
       requestPort(name() + "-mem_side_port", *this),
       responsePort(name() + "-cpu_side_port", *this),
@@ -177,12 +177,12 @@ MemDelay::ResponsePort::recvTimingSnoopResp(PacketPtr pkt)
 
 
 
-SimpleMemDelay::SimpleMemDelay(const SimpleMemDelayParams *p)
+SimpleMemDelay::SimpleMemDelay(const SimpleMemDelayParams &p)
     : MemDelay(p),
-      readReqDelay(p->read_req),
-      readRespDelay(p->read_resp),
-      writeReqDelay(p->write_req),
-      writeRespDelay(p->write_resp)
+      readReqDelay(p.read_req),
+      readRespDelay(p.read_resp),
+      writeReqDelay(p.write_req),
+      writeRespDelay(p.write_resp)
 {
 }
 
@@ -212,7 +212,7 @@ SimpleMemDelay::delayResp(PacketPtr pkt)
 
 
 SimpleMemDelay *
-SimpleMemDelayParams::create()
+SimpleMemDelayParams::create() const
 {
-    return new SimpleMemDelay(this);
+    return new SimpleMemDelay(*this);
 }
index 50929eaf587ed14bb7a3960596db29968c274ae0..9bdb3c33045bda73581fdd0cc13d7ee93f42e353 100644 (file)
@@ -63,7 +63,7 @@ class MemDelay : public ClockedObject
 {
 
   public:
-    MemDelay(const MemDelayParams *params);
+    MemDelay(const MemDelayParams &params);
 
     void init() override;
 
@@ -163,7 +163,7 @@ class MemDelay : public ClockedObject
 class SimpleMemDelay : public MemDelay
 {
   public:
-    SimpleMemDelay(const SimpleMemDelayParams *params);
+    SimpleMemDelay(const SimpleMemDelayParams &params);
 
   protected:
     Tick delayReq(PacketPtr pkt) override;
index d65c5d9dbf69e2dfd00ad69453db29880c4bf01a..8aa8cef88841a8d36230a4bf1a8b9599903adfe4 100644 (file)
 using namespace std;
 using namespace Data;
 
-MemInterface::MemInterface(const MemInterfaceParams_p)
+MemInterface::MemInterface(const MemInterfaceParams &_p)
     : AbstractMemory(_p),
-      addrMapping(_p->addr_mapping),
-      burstSize((_p->devices_per_rank * _p->burst_length *
-                 _p->device_bus_width) / 8),
-      deviceSize(_p->device_size),
-      deviceRowBufferSize(_p->device_rowbuffer_size),
-      devicesPerRank(_p->devices_per_rank),
+      addrMapping(_p.addr_mapping),
+      burstSize((_p.devices_per_rank * _p.burst_length *
+                 _p.device_bus_width) / 8),
+      deviceSize(_p.device_size),
+      deviceRowBufferSize(_p.device_rowbuffer_size),
+      devicesPerRank(_p.devices_per_rank),
       rowBufferSize(devicesPerRank * deviceRowBufferSize),
       burstsPerRowBuffer(rowBufferSize / burstSize),
       burstsPerStripe(range.interleaved() ?
                       range.granularity() / burstSize : 1),
-      ranksPerChannel(_p->ranks_per_channel),
-      banksPerRank(_p->banks_per_rank), rowsPerBank(0),
-      tCK(_p->tCK), tCS(_p->tCS), tBURST(_p->tBURST),
-      tRTW(_p->tRTW),
-      tWTR(_p->tWTR),
-      readBufferSize(_p->read_buffer_size),
-      writeBufferSize(_p->write_buffer_size)
+      ranksPerChannel(_p.ranks_per_channel),
+      banksPerRank(_p.banks_per_rank), rowsPerBank(0),
+      tCK(_p.tCK), tCS(_p.tCS), tBURST(_p.tBURST),
+      tRTW(_p.tRTW),
+      tWTR(_p.tWTR),
+      readBufferSize(_p.read_buffer_size),
+      writeBufferSize(_p.write_buffer_size)
 {}
 
 void
@@ -730,28 +730,28 @@ DRAMInterface::addRankToRankDelay(Tick cmd_at)
     }
 }
 
-DRAMInterface::DRAMInterface(const DRAMInterfaceParams_p)
+DRAMInterface::DRAMInterface(const DRAMInterfaceParams &_p)
     : MemInterface(_p),
-      bankGroupsPerRank(_p->bank_groups_per_rank),
-      bankGroupArch(_p->bank_groups_per_rank > 0),
-      tCL(_p->tCL),
-      tBURST_MIN(_p->tBURST_MIN), tBURST_MAX(_p->tBURST_MAX),
-      tCCD_L_WR(_p->tCCD_L_WR), tCCD_L(_p->tCCD_L), tRCD(_p->tRCD),
-      tRP(_p->tRP), tRAS(_p->tRAS), tWR(_p->tWR), tRTP(_p->tRTP),
-      tRFC(_p->tRFC), tREFI(_p->tREFI), tRRD(_p->tRRD), tRRD_L(_p->tRRD_L),
-      tPPD(_p->tPPD), tAAD(_p->tAAD),
-      tXAW(_p->tXAW), tXP(_p->tXP), tXS(_p->tXS),
-      clkResyncDelay(tCL + _p->tBURST_MAX),
-      dataClockSync(_p->data_clock_sync),
+      bankGroupsPerRank(_p.bank_groups_per_rank),
+      bankGroupArch(_p.bank_groups_per_rank > 0),
+      tCL(_p.tCL),
+      tBURST_MIN(_p.tBURST_MIN), tBURST_MAX(_p.tBURST_MAX),
+      tCCD_L_WR(_p.tCCD_L_WR), tCCD_L(_p.tCCD_L), tRCD(_p.tRCD),
+      tRP(_p.tRP), tRAS(_p.tRAS), tWR(_p.tWR), tRTP(_p.tRTP),
+      tRFC(_p.tRFC), tREFI(_p.tREFI), tRRD(_p.tRRD), tRRD_L(_p.tRRD_L),
+      tPPD(_p.tPPD), tAAD(_p.tAAD),
+      tXAW(_p.tXAW), tXP(_p.tXP), tXS(_p.tXS),
+      clkResyncDelay(tCL + _p.tBURST_MAX),
+      dataClockSync(_p.data_clock_sync),
       burstInterleave(tBURST != tBURST_MIN),
-      twoCycleActivate(_p->two_cycle_activate),
-      activationLimit(_p->activation_limit),
-      wrToRdDlySameBG(tCL + _p->tBURST_MAX + _p->tWTR_L),
-      rdToWrDlySameBG(_p->tRTW + _p->tBURST_MAX),
-      pageMgmt(_p->page_policy),
-      maxAccessesPerRow(_p->max_accesses_per_row),
+      twoCycleActivate(_p.two_cycle_activate),
+      activationLimit(_p.activation_limit),
+      wrToRdDlySameBG(tCL + _p.tBURST_MAX + _p.tWTR_L),
+      rdToWrDlySameBG(_p.tRTW + _p.tBURST_MAX),
+      pageMgmt(_p.page_policy),
+      maxAccessesPerRow(_p.max_accesses_per_row),
       timeStampOffset(0), activeRank(0),
-      enableDRAMPowerdown(_p->enable_dram_powerdown),
+      enableDRAMPowerdown(_p.enable_dram_powerdown),
       lastStatsResetTick(0),
       stats(*this)
 {
@@ -1119,20 +1119,20 @@ DRAMInterface::minBankPrep(const MemPacketQueue& queue,
 }
 
 DRAMInterface*
-DRAMInterfaceParams::create()
+DRAMInterfaceParams::create() const
 {
-    return new DRAMInterface(this);
+    return new DRAMInterface(*this);
 }
 
-DRAMInterface::Rank::Rank(const DRAMInterfaceParams_p,
+DRAMInterface::Rank::Rank(const DRAMInterfaceParams &_p,
                          int _rank, DRAMInterface& _dram)
     : EventManager(&_dram), dram(_dram),
       pwrStateTrans(PWR_IDLE), pwrStatePostRefresh(PWR_IDLE),
       pwrStateTick(0), refreshDueAt(0), pwrState(PWR_IDLE),
       refreshState(REF_IDLE), inLowPowerState(false), rank(_rank),
       readEntries(0), writeEntries(0), outstandingEvents(0),
-      wakeUpAllowedAt(0), power(_p, false), banks(_p->banks_per_rank),
-      numBanksActive(0), actTicks(_p->activation_limit, 0), lastBurstTick(0),
+      wakeUpAllowedAt(0), power(_p, false), banks(_p.banks_per_rank),
+      numBanksActive(0), actTicks(_p.activation_limit, 0), lastBurstTick(0),
       writeDoneEvent([this]{ processWriteDoneEvent(); }, name()),
       activateEvent([this]{ processActivateEvent(); }, name()),
       prechargeEvent([this]{ processPrechargeEvent(); }, name()),
@@ -1141,12 +1141,12 @@ DRAMInterface::Rank::Rank(const DRAMInterfaceParams* _p,
       wakeUpEvent([this]{ processWakeUpEvent(); }, name()),
       stats(_dram, *this)
 {
-    for (int b = 0; b < _p->banks_per_rank; b++) {
+    for (int b = 0; b < _p.banks_per_rank; b++) {
         banks[b].bank = b;
         // GDDR addressing of banks to BG is linear.
         // Here we assume that all DRAM generations address bank groups as
         // follows:
-        if (_p->bank_groups_per_rank > 0) {
+        if (_p.bank_groups_per_rank > 0) {
             // Simply assign lower bits to bank group in order to
             // rotate across bank groups as banks are incremented
             // e.g. with 4 banks per bank group and 16 banks total:
@@ -1154,7 +1154,7 @@ DRAMInterface::Rank::Rank(const DRAMInterfaceParams* _p,
             //    banks 1,5,9,13  are in bank group 1
             //    banks 2,6,10,14 are in bank group 2
             //    banks 3,7,11,15 are in bank group 3
-            banks[b].bankgr = b % _p->bank_groups_per_rank;
+            banks[b].bankgr = b % _p.bank_groups_per_rank;
         } else {
             // No bank groups; simply assign to bank number
             banks[b].bankgr = b;
@@ -1996,12 +1996,12 @@ DRAMInterface::RankStats::preDumpStats()
     rank.computeStats();
 }
 
-NVMInterface::NVMInterface(const NVMInterfaceParams_p)
+NVMInterface::NVMInterface(const NVMInterfaceParams &_p)
     : MemInterface(_p),
-      maxPendingWrites(_p->max_pending_writes),
-      maxPendingReads(_p->max_pending_reads),
-      twoCycleRdWr(_p->two_cycle_rdwr),
-      tREAD(_p->tREAD), tWRITE(_p->tWRITE), tSEND(_p->tSEND),
+      maxPendingWrites(_p.max_pending_writes),
+      maxPendingReads(_p.max_pending_reads),
+      twoCycleRdWr(_p.two_cycle_rdwr),
+      tREAD(_p.tREAD), tWRITE(_p.tWRITE), tSEND(_p.tSEND),
       stats(*this),
       writeRespondEvent([this]{ processWriteRespondEvent(); }, name()),
       readReadyEvent([this]{ processReadReadyEvent(); }, name()),
@@ -2036,16 +2036,16 @@ NVMInterface::NVMInterface(const NVMInterfaceParams* _p)
 }
 
 NVMInterface*
-NVMInterfaceParams::create()
+NVMInterfaceParams::create() const
 {
-    return new NVMInterface(this);
+    return new NVMInterface(*this);
 }
 
-NVMInterface::Rank::Rank(const NVMInterfaceParams_p,
+NVMInterface::Rank::Rank(const NVMInterfaceParams &_p,
                          int _rank, NVMInterface& _nvm)
-    : EventManager(&_nvm), rank(_rank), banks(_p->banks_per_rank)
+    : EventManager(&_nvm), rank(_rank), banks(_p.banks_per_rank)
 {
-    for (int b = 0; b < _p->banks_per_rank; b++) {
+    for (int b = 0; b < _p.banks_per_rank; b++) {
         banks[b].bank = b;
         // No bank groups; simply assign to bank number
         banks[b].bankgr = b;
index 9f5fbc496ef31a49e13dd1a3b9651da5f537e962..d1bf671e88bf9731ba3142418a5254468f9096bf 100644 (file)
@@ -289,7 +289,7 @@ class MemInterface : public AbstractMemory
     virtual void addRankToRankDelay(Tick cmd_at) = 0;
 
     typedef MemInterfaceParams Params;
-    MemInterface(const Params_p);
+    MemInterface(const Params &_p);
 };
 
 /**
@@ -583,7 +583,7 @@ class DRAMInterface : public MemInterface
          */
         Tick lastBurstTick;
 
-        Rank(const DRAMInterfaceParams_p, int _rank,
+        Rank(const DRAMInterfaceParams &_p, int _rank,
              DRAMInterface& _dram);
 
         const std::string name() const { return csprintf("%d", rank); }
@@ -1009,7 +1009,7 @@ class DRAMInterface : public MemInterface
      */
     void checkRefreshState(uint8_t rank);
 
-    DRAMInterface(const DRAMInterfaceParams_p);
+    DRAMInterface(const DRAMInterfaceParams &_p);
 };
 
 /**
@@ -1039,7 +1039,7 @@ class NVMInterface : public MemInterface
          */
         std::vector<Bank> banks;
 
-        Rank(const NVMInterfaceParams_p, int _rank,
+        Rank(const NVMInterfaceParams &_p, int _rank,
              NVMInterface& _nvm);
     };
 
@@ -1256,7 +1256,7 @@ class NVMInterface : public MemInterface
     std::pair<Tick, Tick>
     doBurstAccess(MemPacket* pkt, Tick next_burst_at);
 
-    NVMInterface(const NVMInterfaceParams_p);
+    NVMInterface(const NVMInterfaceParams &_p);
 };
 
 #endif //__MEM_INTERFACE_HH__
index 52208361947cb233eda8ef7c232546ab5f014a86..916eb264f2485d9afc0e0407a9c4c5c6dc53dcd7 100644 (file)
@@ -57,7 +57,7 @@ class MemObject : public ClockedObject
   public:
     [[deprecated(
         "MemObject is deprecated. Use ClockedObject or SimObject instead")]]
-        MemObject(const MemObjectParams *params) : ClockedObject(params)
+        MemObject(const MemObjectParams &params) : ClockedObject(params)
     {}
 };
 
index 72d894fbb144b66056fc24256fdb4e2ff25159dc..2b82ca7842d4ddfdeea12fe2687e48a8c3b2d891 100644 (file)
 #include "debug/NoncoherentXBar.hh"
 #include "debug/XBar.hh"
 
-NoncoherentXBar::NoncoherentXBar(const NoncoherentXBarParams *p)
+NoncoherentXBar::NoncoherentXBar(const NoncoherentXBarParams &p)
     : BaseXBar(p)
 {
     // create the ports based on the size of the memory-side port and
     // CPU-side port vector ports, and the presence of the default port,
     // the ports are enumerated starting from zero
-    for (int i = 0; i < p->port_mem_side_ports_connection_count; ++i) {
+    for (int i = 0; i < p.port_mem_side_ports_connection_count; ++i) {
         std::string portName = csprintf("%s.mem_side_port[%d]", name(), i);
         RequestPort* bp = new NoncoherentXBarRequestPort(portName, *this, i);
         memSidePorts.push_back(bp);
@@ -66,7 +66,7 @@ NoncoherentXBar::NoncoherentXBar(const NoncoherentXBarParams *p)
 
     // see if we have a default CPU-side-port device connected and if so add
     // our corresponding memory-side port
-    if (p->port_default_connection_count) {
+    if (p.port_default_connection_count) {
         defaultPortID = memSidePorts.size();
         std::string portName = name() + ".default";
         RequestPort* bp = new NoncoherentXBarRequestPort(portName, *this,
@@ -77,7 +77,7 @@ NoncoherentXBar::NoncoherentXBar(const NoncoherentXBarParams *p)
     }
 
     // create the CPU-side ports, once again starting at zero
-    for (int i = 0; i < p->port_cpu_side_ports_connection_count; ++i) {
+    for (int i = 0; i < p.port_cpu_side_ports_connection_count; ++i) {
         std::string portName = csprintf("%s.cpu_side_ports[%d]", name(), i);
         QueuedResponsePort* bp = new NoncoherentXBarResponsePort(portName,
                                                                 *this, i);
@@ -312,7 +312,7 @@ NoncoherentXBar::recvFunctional(PacketPtr pkt, PortID cpu_side_port_id)
 }
 
 NoncoherentXBar*
-NoncoherentXBarParams::create()
+NoncoherentXBarParams::create() const
 {
-    return new NoncoherentXBar(this);
+    return new NoncoherentXBar(*this);
 }
index c2fd95ae3c9ef1f4d3115d1839caee6d22d098dd..dc527dd861493bd84484666f9d4299047017e5ed 100644 (file)
@@ -179,7 +179,7 @@ class NoncoherentXBar : public BaseXBar
 
   public:
 
-    NoncoherentXBar(const NoncoherentXBarParams *p);
+    NoncoherentXBar(const NoncoherentXBarParams &p);
 
     virtual ~NoncoherentXBar();
 };
index 86a805fc0c256b9883701e1103b04e00de0a32c5..7ea63dc433365adccb477b51998a1a9cc6615a6a 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "params/BaseMemProbe.hh"
 
-BaseMemProbe::BaseMemProbe(BaseMemProbeParams *p)
+BaseMemProbe::BaseMemProbe(const BaseMemProbeParams &p)
     : SimObject(p)
 {
 }
@@ -47,13 +47,12 @@ BaseMemProbe::BaseMemProbe(BaseMemProbeParams *p)
 void
 BaseMemProbe::regProbeListeners()
 {
-    const BaseMemProbeParams *p(
-        dynamic_cast<const BaseMemProbeParams *>(params()));
-    assert(p);
+    const BaseMemProbeParams &p =
+        dynamic_cast<const BaseMemProbeParams &>(params());
 
-    listeners.resize(p->manager.size());
-    for (int i = 0; i < p->manager.size(); i++) {
-        ProbeManager *const mgr(p->manager[i]->getProbeManager());
-        listeners[i].reset(new PacketListener(*this, mgr, p->probe_name));
+    listeners.resize(p.manager.size());
+    for (int i = 0; i < p.manager.size(); i++) {
+        ProbeManager *const mgr(p.manager[i]->getProbeManager());
+        listeners[i].reset(new PacketListener(*this, mgr, p.probe_name));
     }
 }
index 2030ce561d886e11888a3f609347feb6bc037827..64b8a56bcc62c22a2e3135e01ecf871dbe45d063 100644 (file)
@@ -61,7 +61,7 @@ struct BaseMemProbeParams;
 class BaseMemProbe : public SimObject
 {
   public:
-    BaseMemProbe(BaseMemProbeParams *params);
+    BaseMemProbe(const BaseMemProbeParams &params);
 
     void regProbeListeners() override;
 
index 970756803342b610508467c8c2fb4c6b6927bab6..eb684a75e42c04537e12bbdfcf926e436a5c313e 100644 (file)
 #include "base/intmath.hh"
 #include "params/MemFootprintProbe.hh"
 
-MemFootprintProbe::MemFootprintProbe(MemFootprintProbeParams *p)
+MemFootprintProbe::MemFootprintProbe(const MemFootprintProbeParams &p)
     : BaseMemProbe(p),
-      cacheLineSizeLg2(floorLog2(p->system->cacheLineSize())),
-      pageSizeLg2(floorLog2(p->page_size)),
-      totalCacheLinesInMem(p->system->memSize() / p->system->cacheLineSize()),
-      totalPagesInMem(p->system->memSize() / p->page_size),
+      cacheLineSizeLg2(floorLog2(p.system->cacheLineSize())),
+      pageSizeLg2(floorLog2(p.page_size)),
+      totalCacheLinesInMem(p.system->memSize() / p.system->cacheLineSize()),
+      totalPagesInMem(p.system->memSize() / p.page_size),
       cacheLines(),
       cacheLinesAll(),
       pages(),
       pagesAll(),
-      system(p->system)
+      system(p.system)
 {
     fatal_if(!isPowerOf2(system->cacheLineSize()),
              "MemFootprintProbe expects cache line size is power of 2.");
-    fatal_if(!isPowerOf2(p->page_size),
+    fatal_if(!isPowerOf2(p.page_size),
              "MemFootprintProbe expects page size parameter is power of 2");
 }
 
@@ -122,7 +122,7 @@ MemFootprintProbe::statReset()
 }
 
 MemFootprintProbe *
-MemFootprintProbeParams::create()
+MemFootprintProbeParams::create() const
 {
-    return new MemFootprintProbe(this);
+    return new MemFootprintProbe(*this);
 }
index a08a4b58cc09f72dcbef147e0a8176ba00a4b125..71438c05db5233a3e1c359a6686a2812a5f90abd 100644 (file)
@@ -56,7 +56,7 @@ class MemFootprintProbe : public BaseMemProbe
   public:
     typedef std::unordered_set<Addr> AddrSet;
 
-    MemFootprintProbe(MemFootprintProbeParams *p);
+    MemFootprintProbe(const MemFootprintProbeParams &p);
     void regStats() override;
     // Fix footprint tracking state on stat reset
     void statReset();
index dbfb685bcb51b5f214a572a5d29c07a429c4e0c6..351b2da327e365cdc7dcdbdfd8396fd4bacc3838 100644 (file)
 #include "proto/packet.pb.h"
 #include "sim/system.hh"
 
-MemTraceProbe::MemTraceProbe(MemTraceProbeParams *p)
+MemTraceProbe::MemTraceProbe(const MemTraceProbeParams &p)
     : BaseMemProbe(p),
       traceStream(nullptr),
-      system(p->system),
-      withPC(p->with_pc)
+      system(p.system),
+      withPC(p.with_pc)
 {
     std::string filename;
-    if (p->trace_file != "") {
+    if (p.trace_file != "") {
         // If the trace file is not specified as an absolute path,
         // append the current simulation output directory
-        filename = simout.resolve(p->trace_file);
+        filename = simout.resolve(p.trace_file);
 
         const std::string suffix = ".gz";
         // If trace_compress has been set, check the suffix. Append
         // accordingly.
-        if (p->trace_compress &&
+        if (p.trace_compress &&
             filename.compare(filename.size() - suffix.size(), suffix.size(),
                              suffix) != 0)
             filename = filename + suffix;
@@ -66,7 +66,7 @@ MemTraceProbe::MemTraceProbe(MemTraceProbeParams *p)
         // Generate a filename from the name of the SimObject. Append .trc
         // and .gz if we want compression enabled.
         filename = simout.resolve(name() + ".trc" +
-                                  (p->trace_compress ? ".gz" : ""));
+                                  (p.trace_compress ? ".gz" : ""));
     }
 
     traceStream = new ProtoOutputStream(filename);
@@ -121,7 +121,7 @@ MemTraceProbe::handleRequest(const ProbePoints::PacketInfo &pkt_info)
 
 
 MemTraceProbe *
-MemTraceProbeParams::create()
+MemTraceProbeParams::create() const
 {
-    return new MemTraceProbe(this);
+    return new MemTraceProbe(*this);
 }
index 40ac7d91dcbe8663392fbee3888d48059d2157c8..84be9cba1735a1fc22213c86725ef4cc0cfb1bcb 100644 (file)
@@ -48,7 +48,7 @@ class System;
 class MemTraceProbe : public BaseMemProbe
 {
   public:
-    MemTraceProbe(MemTraceProbeParams *params);
+    MemTraceProbe(const MemTraceProbeParams &params);
 
   protected:
     void handleRequest(const ProbePoints::PacketInfo &pkt_info) override;
index 57270b00c371ea502bd82f2c4f1a12f60a63bde3..ec2be989f01cfa7f1b74a340e439110bf325f0aa 100644 (file)
 #include "params/StackDistProbe.hh"
 #include "sim/system.hh"
 
-StackDistProbe::StackDistProbe(StackDistProbeParams *p)
+StackDistProbe::StackDistProbe(const StackDistProbeParams &p)
     : BaseMemProbe(p),
-      lineSize(p->line_size),
-      disableLinearHists(p->disable_linear_hists),
-      disableLogHists(p->disable_log_hists),
-      calc(p->verify)
+      lineSize(p.line_size),
+      disableLinearHists(p.disable_linear_hists),
+      disableLogHists(p.disable_log_hists),
+      calc(p.verify)
 {
-    fatal_if(p->system->cacheLineSize() > p->line_size,
+    fatal_if(p.system->cacheLineSize() > p.line_size,
              "The stack distance probe must use a cache line size that is "
              "larger or equal to the system's cahce line size.");
 }
@@ -57,32 +57,31 @@ StackDistProbe::regStats()
 {
     BaseMemProbe::regStats();
 
-    const StackDistProbeParams *p(
-        dynamic_cast<const StackDistProbeParams *>(params()));
-    assert(p);
+    const StackDistProbeParams &p =
+        dynamic_cast<const StackDistProbeParams &>(params());
 
     using namespace Stats;
 
     readLinearHist
-        .init(p->linear_hist_bins)
+        .init(p.linear_hist_bins)
         .name(name() + ".readLinearHist")
         .desc("Reads linear distribution")
         .flags(disableLinearHists ? nozero : pdf);
 
     readLogHist
-        .init(p->log_hist_bins)
+        .init(p.log_hist_bins)
         .name(name() + ".readLogHist")
         .desc("Reads logarithmic distribution")
         .flags(disableLogHists ? nozero : pdf);
 
     writeLinearHist
-        .init(p->linear_hist_bins)
+        .init(p.linear_hist_bins)
         .name(name() + ".writeLinearHist")
         .desc("Writes linear distribution")
         .flags(disableLinearHists ? nozero : pdf);
 
     writeLogHist
-        .init(p->log_hist_bins)
+        .init(p.log_hist_bins)
         .name(name() + ".writeLogHist")
         .desc("Writes logarithmic distribution")
         .flags(disableLogHists ? nozero : pdf);
@@ -132,7 +131,7 @@ StackDistProbe::handleRequest(const ProbePoints::PacketInfo &pkt_info)
 
 
 StackDistProbe *
-StackDistProbeParams::create()
+StackDistProbeParams::create() const
 {
-    return new StackDistProbe(this);
+    return new StackDistProbe(*this);
 }
index 7b9d0cdd86c87e2a991fab0566764217431e8210..4a6ae547d63ee23d551980b525673926fcd5db1b 100644 (file)
@@ -48,7 +48,7 @@ struct StackDistProbeParams;
 class StackDistProbe : public BaseMemProbe
 {
   public:
-    StackDistProbe(StackDistProbeParams *params);
+    StackDistProbe(const StackDistProbeParams &params);
 
     void regStats() override;
 
index b5caf6ef64b7fc1936eb7fcc94b8815945cd259b..352d40a16803a53e171a8cd67915d68743538cc5 100644 (file)
 
 namespace QoS {
 
-MemCtrl::MemCtrl(const QoSMemCtrlParams p)
+MemCtrl::MemCtrl(const QoSMemCtrlParams &p)
   : ClockedObject(p),
-    policy(p->qos_policy),
-    turnPolicy(p->qos_turnaround_policy),
+    policy(p.qos_policy),
+    turnPolicy(p.qos_turnaround_policy),
     queuePolicy(QueuePolicy::create(p)),
-    _numPriorities(p->qos_priorities),
-    qosPriorityEscalation(p->qos_priority_escalation),
-    qosSyncroScheduler(p->qos_syncro_scheduler),
+    _numPriorities(p.qos_priorities),
+    qosPriorityEscalation(p.qos_priority_escalation),
+    qosSyncroScheduler(p.qos_syncro_scheduler),
     totalReadQueueSize(0), totalWriteQueueSize(0),
     busState(READ), busStateNext(READ),
     stats(*this),
-    _system(p->system)
+    _system(p.system)
 {
     // Set the priority policy
     if (policy) {
index d472f200e6b84b7dc1cb4e1da6e1f03664e897b5..02954d20d5371a9976191ca5836a60619b52f9aa 100644 (file)
@@ -264,7 +264,7 @@ class MemCtrl : public ClockedObject
      *
      * @param p pointer to QoSMemCtrl parameters
      */
-    MemCtrl(const QoSMemCtrlParams*);
+    MemCtrl(const QoSMemCtrlParams &);
 
     virtual ~MemCtrl();
 
index e931429a824c19f852c794b1c8653fdf8e65630f..db4f881e089da08ce92fd467072807bfdc421bdd 100644 (file)
 
 namespace QoS {
 
-MemSinkCtrl::MemSinkCtrl(const QoSMemSinkCtrlParamsp)
-  : MemCtrl(p), requestLatency(p->request_latency),
-    responseLatency(p->response_latency),
-    memoryPacketSize(p->memory_packet_size),
-    readBufferSize(p->read_buffer_size),
-    writeBufferSize(p->write_buffer_size), port(name() + ".port", *this),
-    interface(p->interface),
+MemSinkCtrl::MemSinkCtrl(const QoSMemSinkCtrlParams &p)
+  : MemCtrl(p), requestLatency(p.request_latency),
+    responseLatency(p.response_latency),
+    memoryPacketSize(p.memory_packet_size),
+    readBufferSize(p.read_buffer_size),
+    writeBufferSize(p.write_buffer_size), port(name() + ".port", *this),
+    interface(p.interface),
     retryRdReq(false), retryWrReq(false), nextRequest(0), nextReqEvent(this)
 {
     // Resize read and write queue to allocate space
@@ -390,18 +390,18 @@ MemSinkCtrl::MemoryPort::recvTimingReq(PacketPtr pkt)
 } // namespace QoS
 
 QoS::MemSinkCtrl*
-QoSMemSinkCtrlParams::create()
+QoSMemSinkCtrlParams::create() const
 {
-    return new QoS::MemSinkCtrl(this);
+    return new QoS::MemSinkCtrl(*this);
 }
 
-QoSMemSinkInterface::QoSMemSinkInterface(const QoSMemSinkInterfaceParams_p)
+QoSMemSinkInterface::QoSMemSinkInterface(const QoSMemSinkInterfaceParams &_p)
     : AbstractMemory(_p)
 {
 }
 
 QoSMemSinkInterface*
-QoSMemSinkInterfaceParams::create()
+QoSMemSinkInterfaceParams::create() const
 {
-    return new QoSMemSinkInterface(this);
+    return new QoSMemSinkInterface(*this);
 }
index 93783ae107d0250ec4fd046bf8152656880aaf92..e9c3e74163f62e77acf122c71cd62bbdefb55ac6 100644 (file)
@@ -124,7 +124,7 @@ class MemSinkCtrl : public MemCtrl
      *
      * @param p QoS Memory Sink configuration parameters
      */
-    MemSinkCtrl(const QoSMemSinkCtrlParams*);
+    MemSinkCtrl(const QoSMemSinkCtrlParams &);
 
     virtual ~MemSinkCtrl();
 
@@ -262,7 +262,7 @@ class QoSMemSinkInterface : public AbstractMemory
     /** Pointer to the controller */
     QoS::MemSinkCtrl* ctrl;
 
-    QoSMemSinkInterface(const QoSMemSinkInterfaceParams_p);
+    QoSMemSinkInterface(const QoSMemSinkInterfaceParams &_p);
 };
 
 
index 93c841d27ab64f062c39c2a49a4ff1ab4b10e5e8..c864cf9c69b177c37cba0746e5c23d82b9b9a931 100644 (file)
@@ -41,7 +41,7 @@
 
 namespace QoS {
 
-Policy::Policy(const Paramsp)
+Policy::Policy(const Params &p)
   : SimObject(p)
 {}
 
index 7bf6c128b42ccdc16d3fcfc416057a463fe28e2b..d7e3967251b3e2c317966de7d47ea7252cb4c3a8 100644 (file)
@@ -59,7 +59,7 @@ class Policy : public SimObject
 {
   public:
     using Params = QoSPolicyParams;
-    Policy(const Paramsp);
+    Policy(const Params &p);
 
     virtual ~Policy();
 
index d00048b0b1e862ef97bfe83ebc8c59f3c4b233cc..124d49a2f2d62d780e2d9f80488884a6670f865c 100644 (file)
@@ -46,8 +46,8 @@
 
 namespace QoS {
 
-FixedPriorityPolicy::FixedPriorityPolicy(const Paramsp)
-  : Policy(p), defaultPriority(p->qos_fixed_prio_default_prio)
+FixedPriorityPolicy::FixedPriorityPolicy(const Params &p)
+  : Policy(p), defaultPriority(p.qos_fixed_prio_default_prio)
 {}
 
 FixedPriorityPolicy::~FixedPriorityPolicy()
@@ -96,7 +96,7 @@ FixedPriorityPolicy::schedule(const RequestorID id, const uint64_t data)
 } // namespace QoS
 
 QoS::FixedPriorityPolicy *
-QoSFixedPriorityPolicyParams::create()
+QoSFixedPriorityPolicyParams::create() const
 {
-    return new QoS::FixedPriorityPolicy(this);
+    return new QoS::FixedPriorityPolicy(*this);
 }
index b25c34b3597fb6439011821aea379e4a253c4738..14b611efca6d7d49684f9b9f41b36d0e3a15fe28 100644 (file)
@@ -56,7 +56,7 @@ class FixedPriorityPolicy : public Policy
     using Params = QoSFixedPriorityPolicyParams;
 
   public:
-    FixedPriorityPolicy(const Params*);
+    FixedPriorityPolicy(const Params &);
     virtual ~FixedPriorityPolicy();
 
     void init() override;
index 47e2096a5b1576f59fa83e415531e1ce06fb854a..988749d82859a35de43489a939f544e69bc7df74 100644 (file)
@@ -43,8 +43,8 @@
 
 namespace QoS {
 
-PropFairPolicy::PropFairPolicy(const Paramsp)
-  : Policy(p), weight(p->weight)
+PropFairPolicy::PropFairPolicy(const Params &p)
+  : Policy(p), weight(p.weight)
 {
     fatal_if(weight < 0 || weight > 1,
         "weight must be a value between 0 and 1");
@@ -124,7 +124,7 @@ PropFairPolicy::schedule(const RequestorID pkt_id, const uint64_t pkt_size)
 } // namespace QoS
 
 QoS::PropFairPolicy *
-QoSPropFairPolicyParams::create()
+QoSPropFairPolicyParams::create() const
 {
-    return new QoS::PropFairPolicy(this);
+    return new QoS::PropFairPolicy(*this);
 }
index 429e85bcb1664357583c62a190f3a774044c89d5..ec40953e8b325edca02a76b2539bc69d04f53d8e 100644 (file)
@@ -59,11 +59,14 @@ namespace QoS {
 class PropFairPolicy : public Policy
 {
     using Params = QoSPropFairPolicyParams;
-    const Params *params() const
-    { return static_cast<const Params *>(_params); }
+    const Params &
+    params() const
+    {
+        return static_cast<const Params &>(_params);
+    }
 
   public:
-    PropFairPolicy(const Params*);
+    PropFairPolicy(const Params &);
     virtual ~PropFairPolicy();
 
     /**
index df16c5176ba34b7a7f857ee455eca6849a5937e2..6c415b80e9f0fe749fcfbf5d622fd62a50aeff96 100644 (file)
@@ -49,9 +49,9 @@
 namespace QoS {
 
 QueuePolicy*
-QueuePolicy::create(const QoSMemCtrlParamsp)
+QueuePolicy::create(const QoSMemCtrlParams &p)
 {
-    switch (p->qos_q_policy) {
+    switch (p.qos_q_policy) {
       case Enums::QoSQPolicy::fifo:
         return new FifoQueuePolicy(p);
       case Enums::QoSQPolicy::lrg:
index f932b91149ccf3296386ef68e4bd70b8fe1019ec..dc412084ad2af472c7dfdc20cfe50cd3bc65341a 100644 (file)
@@ -70,7 +70,7 @@ class QueuePolicy
      * @param p QoS::MemCtrl parameter variable
      * @return Pointer to the QueuePolicy
      */
-    static QueuePolicy* create(const QoSMemCtrlParamsp);
+    static QueuePolicy* create(const QoSMemCtrlParams &p);
 
     /**
      * This method is called by the memory controller after it enqueues a
@@ -102,7 +102,7 @@ class QueuePolicy
     virtual ~QueuePolicy() {};
 
   protected:
-    QueuePolicy(const QoSMemCtrlParamsp)
+    QueuePolicy(const QoSMemCtrlParams &p)
       : memCtrl(nullptr)
     {}
 
@@ -114,7 +114,7 @@ class QueuePolicy
 class LifoQueuePolicy : public QueuePolicy
 {
   public:
-    LifoQueuePolicy(const QoSMemCtrlParamsp)
+    LifoQueuePolicy(const QoSMemCtrlParams &p)
       : QueuePolicy(p)
     {}
 
@@ -135,7 +135,7 @@ class LifoQueuePolicy : public QueuePolicy
 class FifoQueuePolicy : public QueuePolicy
 {
   public:
-    FifoQueuePolicy(const QoSMemCtrlParamsp)
+    FifoQueuePolicy(const QoSMemCtrlParams &p)
       : QueuePolicy(p)
     {}
 
@@ -161,7 +161,7 @@ class FifoQueuePolicy : public QueuePolicy
 class LrgQueuePolicy : public QueuePolicy
 {
   public:
-    LrgQueuePolicy(const QoSMemCtrlParamsp)
+    LrgQueuePolicy(const QoSMemCtrlParams &p)
       : QueuePolicy(p)
     {}
 
index f4e27425bd96cd0e19c603a49028ff0b3421406b..0b0a571a7d78f178718e65e9f1729bb5a5d6a7e4 100644 (file)
@@ -51,7 +51,7 @@ class TurnaroundPolicy : public SimObject
     using Params = QoSTurnaroundPolicyParams;
 
   public:
-    TurnaroundPolicy(const Paramsp) : SimObject(p) {};
+    TurnaroundPolicy(const Params &p) : SimObject(p) {};
 
     virtual ~TurnaroundPolicy() {};
 
index 312a7bb24951f3cde6f64b37e5486eec1d79c326..22b12e0844de3cd4a7bc22aeffdcfa90c4206b50 100644 (file)
@@ -41,7 +41,7 @@
 
 namespace QoS {
 
-TurnaroundPolicyIdeal::TurnaroundPolicyIdeal(const Paramsp)
+TurnaroundPolicyIdeal::TurnaroundPolicyIdeal(const Params &p)
   : TurnaroundPolicy(p)
 {}
 
@@ -98,7 +98,7 @@ TurnaroundPolicyIdeal::selectBusState()
 } // namespace QoS
 
 QoS::TurnaroundPolicyIdeal *
-QoSTurnaroundPolicyIdealParams::create()
+QoSTurnaroundPolicyIdealParams::create() const
 {
-    return new QoS::TurnaroundPolicyIdeal(this);
+    return new QoS::TurnaroundPolicyIdeal(*this);
 }
index 3624dc49c3d736b06c3d94c3f883e134f760c58d..b8c85c8894aafa713a59b136ef0e180f2418a637 100644 (file)
@@ -53,7 +53,7 @@ namespace QoS {
 class TurnaroundPolicyIdeal: public TurnaroundPolicy
 {
   public:
-    TurnaroundPolicyIdeal(const Params*);
+    TurnaroundPolicyIdeal(const Params &);
 
     virtual ~TurnaroundPolicyIdeal();
 
index b1691cd55208b87e9848e0b4a7a97b8a49f1c7ba..c5311ae02773a5975ef445cae2a11a6035958997 100644 (file)
 
 #include "mem/ruby/network/BasicLink.hh"
 
-BasicLink::BasicLink(const Params *p)
+BasicLink::BasicLink(const Params &p)
     : SimObject(p)
 {
-    m_latency = p->latency;
-    m_bandwidth_factor = p->bandwidth_factor;
-    m_weight = p->weight;
-    mVnets = p->supported_vnets;
+    m_latency = p.latency;
+    m_bandwidth_factor = p.bandwidth_factor;
+    m_weight = p.weight;
+    mVnets = p.supported_vnets;
 }
 
 void
@@ -49,29 +49,29 @@ BasicLink::print(std::ostream& out) const
 }
 
 BasicLink *
-BasicLinkParams::create()
+BasicLinkParams::create() const
 {
-    return new BasicLink(this);
+    return new BasicLink(*this);
 }
 
-BasicExtLink::BasicExtLink(const Params *p)
+BasicExtLink::BasicExtLink(const Params &p)
     : BasicLink(p)
 {
 }
 
 BasicExtLink *
-BasicExtLinkParams::create()
+BasicExtLinkParams::create() const
 {
-    return new BasicExtLink(this);
+    return new BasicExtLink(*this);
 }
 
-BasicIntLink::BasicIntLink(const Params *p)
+BasicIntLink::BasicIntLink(const Params &p)
     : BasicLink(p)
 {
 }
 
 BasicIntLink *
-BasicIntLinkParams::create()
+BasicIntLinkParams::create() const
 {
-    return new BasicIntLink(this);
+    return new BasicIntLink(*this);
 }
index dfa94b8500afcbe50857730a77748f4273556ae8..b16b53c8d82528a779ed7d7141f09187d5aaa9d9 100644 (file)
@@ -46,8 +46,8 @@ class BasicLink : public SimObject
 {
   public:
     typedef BasicLinkParams Params;
-    BasicLink(const Params *p);
-    const Params *params() const { return (const Params *)_params; }
+    BasicLink(const Params &p);
+    const Params &params() const { return (const Params &)_params; }
 
     void init();
 
@@ -71,8 +71,8 @@ class BasicExtLink : public BasicLink
 {
   public:
     typedef BasicExtLinkParams Params;
-    BasicExtLink(const Params *p);
-    const Params *params() const { return (const Params *)_params; }
+    BasicExtLink(const Params &p);
+    const Params &params() const { return (const Params &)_params; }
 
     friend class Topology;
 };
@@ -81,8 +81,8 @@ class BasicIntLink : public BasicLink
 {
   public:
     typedef BasicIntLinkParams Params;
-    BasicIntLink(const Params *p);
-    const Params *params() const { return (const Params *)_params; }
+    BasicIntLink(const Params &p);
+    const Params &params() const { return (const Params &)_params; }
 
     friend class Topology;
 };
index 644d3599ac16f0807fd054310bec1436f65dbbe8..450ca36300ce6e7ef33f0372152c2079b9532efe 100644 (file)
 
 #include "mem/ruby/network/BasicRouter.hh"
 
-BasicRouter::BasicRouter(const Params *p)
+BasicRouter::BasicRouter(const Params &p)
     : ClockedObject(p)
 {
-    m_id = p->router_id;
-    m_latency = p->latency;
+    m_id = p.router_id;
+    m_latency = p.latency;
 }
 
 void
@@ -47,7 +47,7 @@ BasicRouter::print(std::ostream& out) const
 }
 
 BasicRouter *
-BasicRouterParams::create()
+BasicRouterParams::create() const
 {
-    return new BasicRouter(this);
+    return new BasicRouter(*this);
 }
index a74dadb219156834d2773d3754cf5d5f5525ccbe..3e6f1030a91a3db00aa4c59a08f352ae2023298d 100644 (file)
@@ -40,8 +40,8 @@ class BasicRouter : public ClockedObject
 {
   public:
     typedef BasicRouterParams Params;
-    BasicRouter(const Params *p);
-    const Params *params() const { return (const Params *)_params; }
+    BasicRouter(const Params &p);
+    const Params &params() const { return (const Params &)_params; }
 
     void init();
 
index 00e8fea22448a89a6765bb979680c0162c3c1097..b3631f1927b1e54c348fed2197f42a6e657c73b9 100644 (file)
 using namespace std;
 using m5::stl_helpers::operator<<;
 
-MessageBuffer::MessageBuffer(const Params *p)
+MessageBuffer::MessageBuffer(const Params &p)
     : SimObject(p), m_stall_map_size(0),
-    m_max_size(p->buffer_size), m_time_last_time_size_checked(0),
+    m_max_size(p.buffer_size), m_time_last_time_size_checked(0),
     m_time_last_time_enqueue(0), m_time_last_time_pop(0),
-    m_last_arrival_time(0), m_strict_fifo(p->ordered),
-    m_randomization(p->randomization),
-    m_allow_zero_latency(p->allow_zero_latency)
+    m_last_arrival_time(0), m_strict_fifo(p.ordered),
+    m_randomization(p.randomization),
+    m_allow_zero_latency(p.allow_zero_latency)
 {
     m_msg_counter = 0;
     m_consumer = NULL;
@@ -530,7 +530,7 @@ MessageBuffer::functionalAccess(Packet *pkt, bool is_read)
 }
 
 MessageBuffer *
-MessageBufferParams::create()
+MessageBufferParams::create() const
 {
-    return new MessageBuffer(this);
+    return new MessageBuffer(*this);
 }
index fc69d34fdc2d35046adceb6e52b1688fd006e29b..65bae7943120cf8a958b38300f1ef53abfe15ca0 100644 (file)
@@ -69,7 +69,7 @@ class MessageBuffer : public SimObject
 {
   public:
     typedef MessageBufferParams Params;
-    MessageBuffer(const Params *p);
+    MessageBuffer(const Params &p);
 
     void reanalyzeMessages(Addr addr, Tick current_time);
     void reanalyzeAllMessages(Tick current_time);
index a676a38277e50c6ea5d2edbf7ef1ddb0df9d9a4e..8be4acef111d2f44acd6da5d51935925325f198a 100644 (file)
@@ -49,17 +49,17 @@ uint32_t Network::m_virtual_networks;
 uint32_t Network::m_control_msg_size;
 uint32_t Network::m_data_msg_size;
 
-Network::Network(const Params *p)
+Network::Network(const Params &p)
     : ClockedObject(p)
 {
-    m_virtual_networks = p->number_of_virtual_networks;
-    m_control_msg_size = p->control_msg_size;
+    m_virtual_networks = p.number_of_virtual_networks;
+    m_control_msg_size = p.control_msg_size;
 
-    fatal_if(p->data_msg_size > p->ruby_system->getBlockSizeBytes(),
+    fatal_if(p.data_msg_size > p.ruby_system->getBlockSizeBytes(),
              "%s: data message size > cache line size", name());
-    m_data_msg_size = p->data_msg_size + m_control_msg_size;
+    m_data_msg_size = p.data_msg_size + m_control_msg_size;
 
-    params()->ruby_system->registerNetwork(this);
+    params().ruby_system->registerNetwork(this);
 
     // Populate localNodeVersions with the version of each MachineType in
     // this network. This will be used to compute a global to local ID.
@@ -67,10 +67,10 @@ Network::Network(const Params *p)
     // ext_node per ext_link and it points to an AbstractController.
     // For RubySystems with one network global and local ID are the same.
     std::unordered_map<MachineType, std::vector<NodeID>> localNodeVersions;
-    for (auto &it : params()->ext_links) {
-        AbstractController *cntrl = it->params()->ext_node;
+    for (auto &it : params().ext_links) {
+        AbstractController *cntrl = it->params().ext_node;
         localNodeVersions[cntrl->getType()].push_back(cntrl->getVersion());
-        params()->ruby_system->registerMachineID(cntrl->getMachineID(), this);
+        params().ruby_system->registerMachineID(cntrl->getMachineID(), this);
     }
 
     // Compute a local ID for each MachineType using the same order as SLICC
@@ -94,9 +94,9 @@ Network::Network(const Params *p)
     assert(m_nodes != 0);
     assert(m_virtual_networks != 0);
 
-    m_topology_ptr = new Topology(m_nodes, p->routers.size(),
+    m_topology_ptr = new Topology(m_nodes, p.routers.size(),
                                   m_virtual_networks,
-                                  p->ext_links, p->int_links);
+                                  p.ext_links, p.int_links);
 
     // Allocate to and from queues
     // Queues that are getting messages from protocol
@@ -113,10 +113,10 @@ Network::Network(const Params *p)
     }
 
     // Initialize the controller's network pointers
-    for (std::vector<BasicExtLink*>::const_iterator i = p->ext_links.begin();
-         i != p->ext_links.end(); ++i) {
+    for (std::vector<BasicExtLink*>::const_iterator i = p.ext_links.begin();
+         i != p.ext_links.end(); ++i) {
         BasicExtLink *ext_link = (*i);
-        AbstractController *abs_cntrl = ext_link->params()->ext_node;
+        AbstractController *abs_cntrl = ext_link->params().ext_node;
         abs_cntrl->initNetworkPtr(this);
         const AddrRangeList &ranges = abs_cntrl->getAddrRanges();
         if (!ranges.empty()) {
@@ -132,8 +132,8 @@ Network::Network(const Params *p)
     // Register a callback function for combining the statistics
     Stats::registerDumpCallback([this]() { collateStats(); });
 
-    for (auto &it : dynamic_cast<Network *>(this)->params()->ext_links) {
-        it->params()->ext_node->initNetQueues();
+    for (auto &it : dynamic_cast<Network *>(this)->params().ext_links) {
+        it->params().ext_node->initNetQueues();
     }
 }
 
index 371ceb8bb18209d8d29dd842dc0f2263779f1c31..8af1610a188f04153b14ca5113cab8925ce1f875 100644 (file)
@@ -77,9 +77,12 @@ class Network : public ClockedObject
 {
   public:
     typedef RubyNetworkParams Params;
-    Network(const Params *p);
-    const Params * params() const
-    { return dynamic_cast<const Params *>(_params); }
+    Network(const Params &p);
+    const Params &
+    params() const
+    {
+        return dynamic_cast<const Params &>(_params);
+    }
 
     virtual ~Network();
 
index c9a5811065ca5a34d764a6d3dd8673ba5ac462ac..dc68b702c43a7fa731777b16dd3950065eddaaf6 100644 (file)
@@ -71,13 +71,13 @@ Topology::Topology(uint32_t num_nodes, uint32_t num_routers,
     for (vector<BasicExtLink*>::const_iterator i = ext_links.begin();
          i != ext_links.end(); ++i) {
         BasicExtLink *ext_link = (*i);
-        AbstractController *abs_cntrl = ext_link->params()->ext_node;
-        BasicRouter *router = ext_link->params()->int_node;
+        AbstractController *abs_cntrl = ext_link->params().ext_node;
+        BasicRouter *router = ext_link->params().int_node;
 
         int machine_base_idx = MachineType_base_number(abs_cntrl->getType());
         int ext_idx1 = machine_base_idx + abs_cntrl->getVersion();
         int ext_idx2 = ext_idx1 + m_nodes;
-        int int_idx = router->params()->router_id + 2*m_nodes;
+        int int_idx = router->params().router_id + 2*m_nodes;
 
         // create the internal uni-directional links in both directions
         // ext to int
@@ -90,17 +90,17 @@ Topology::Topology(uint32_t num_nodes, uint32_t num_routers,
     for (vector<BasicIntLink*>::const_iterator i = int_links.begin();
          i != int_links.end(); ++i) {
         BasicIntLink *int_link = (*i);
-        BasicRouter *router_src = int_link->params()->src_node;
-        BasicRouter *router_dst = int_link->params()->dst_node;
+        BasicRouter *router_src = int_link->params().src_node;
+        BasicRouter *router_dst = int_link->params().dst_node;
 
-        PortDirection src_outport = int_link->params()->src_outport;
-        PortDirection dst_inport = int_link->params()->dst_inport;
+        PortDirection src_outport = int_link->params().src_outport;
+        PortDirection dst_inport = int_link->params().dst_inport;
 
         // Store the IntLink pointers for later
         m_int_link_vector.push_back(int_link);
 
-        int src = router_src->params()->router_id + 2*m_nodes;
-        int dst = router_dst->params()->router_id + 2*m_nodes;
+        int src = router_src->params().router_id + 2*m_nodes;
+        int dst = router_dst->params().router_id + 2*m_nodes;
 
         // create the internal uni-directional link from src to dst
         addLink(src, dst, int_link, src_outport, dst_inport);
index 2c3dd8aada5087a546f3ae4aae4e2623970a2c6b..147b7361117fa215037ce0b46acc8b11efb458bc 100644 (file)
@@ -50,7 +50,7 @@ using namespace std;
 #define MAX(a,b) ((a > b) ? (a) : (b))
 
 
-FaultModel::FaultModel(const Params *p) : SimObject(p)
+FaultModel::FaultModel(const Params &p) : SimObject(p)
 {
     // read configurations into "configurations" vector
     // format: <buff/vc> <vcs> <10 fault types>
@@ -58,17 +58,17 @@ FaultModel::FaultModel(const Params *p) : SimObject(p)
     for (int i = 0; more_records; i += (fields_per_conf_record)){
         system_conf configuration;
         configuration.buff_per_vc =
-            p->baseline_fault_vector_database[i + conf_record_buff_per_vc];
+            p.baseline_fault_vector_database[i + conf_record_buff_per_vc];
         configuration.vcs =
-            p->baseline_fault_vector_database[i + conf_record_vcs];
+            p.baseline_fault_vector_database[i + conf_record_vcs];
         for (int fault_index = 0; fault_index < number_of_fault_types;
             fault_index++){
             configuration.fault_type[fault_index] =
-                p->baseline_fault_vector_database[i +
+                p.baseline_fault_vector_database[i +
                    conf_record_first_fault_type + fault_index] / 100;
         }
         configurations.push_back(configuration);
-        if (p->baseline_fault_vector_database[i+fields_per_conf_record] < 0){
+        if (p.baseline_fault_vector_database[i+fields_per_conf_record] < 0){
             more_records = false;
         }
     }
@@ -78,9 +78,9 @@ FaultModel::FaultModel(const Params *p) : SimObject(p)
     more_records = true;
     for (int i = 0; more_records; i += (fields_per_temperature_record)){
         int record_temperature =
-               p->temperature_weights_database[i + temperature_record_temp];
+               p.temperature_weights_database[i + temperature_record_temp];
         int record_weight =
-               p->temperature_weights_database[i + temperature_record_weight];
+               p.temperature_weights_database[i + temperature_record_weight];
         static int first_record = true;
         if (first_record){
             for (int temperature = 0; temperature < record_temperature;
@@ -91,7 +91,7 @@ FaultModel::FaultModel(const Params *p) : SimObject(p)
         }
         assert(record_temperature == temperature_weights.size());
         temperature_weights.push_back(record_weight);
-        if (p->temperature_weights_database[i +
+        if (p.temperature_weights_database[i +
                fields_per_temperature_record] < 0){
             more_records = false;
         }
@@ -269,7 +269,7 @@ FaultModel::print(void)
 }
 
 FaultModel *
-FaultModelParams::create()
+FaultModelParams::create() const
 {
-    return new FaultModel(this);
+    return new FaultModel(*this);
 }
index 183360f52b2eb50dd9cc37d3b3f8ab27e83fdd8f..fa446c6b980d4732831e20c723632fb9b7a46464 100644 (file)
@@ -54,8 +54,8 @@ class FaultModel : public SimObject
 {
   public:
     typedef FaultModelParams Params;
-    FaultModel(const Params *p);
-    const Params *params() const { return (const Params *)_params; }
+    FaultModel(const Params &p);
+    const Params &params() const { return (const Params &)_params; }
 
     /************************************************************************/
     /**********  THE FAULT TYPES SUPPORTED BY THE FAULT MODEL ***************/
index 87358247bcef390816031d7082cc6528d63c60fa..998a004da41d2af87a2eac4e7610bd248fdcfb49 100644 (file)
@@ -38,7 +38,7 @@ class CreditLink : public NetworkLink
 {
   public:
     typedef CreditLinkParams Params;
-    CreditLink(const Params *p) : NetworkLink(p) {}
+    CreditLink(const Params &p) : NetworkLink(p) {}
 };
 
 #endif // __MEM_RUBY_NETWORK_GARNET_0_CREDITLINK_HH__
index ae969330db0285f442f05e30393984505fb2f798..0bbc5b1c7fe3302f83cb8e68cc9bb8884eccf694 100644 (file)
 #include "mem/ruby/network/garnet/NetworkBridge.hh"
 #include "mem/ruby/network/garnet/NetworkLink.hh"
 
-GarnetIntLink::GarnetIntLink(const Params *p)
+GarnetIntLink::GarnetIntLink(const Params &p)
     : BasicIntLink(p)
 {
     // Uni-directional
 
-    m_network_link = p->network_link;
-    m_credit_link = p->credit_link;
+    m_network_link = p.network_link;
+    m_credit_link = p.credit_link;
 
-    srcCdcEn = p->src_cdc;
-    dstCdcEn = p->dst_cdc;
+    srcCdcEn = p.src_cdc;
+    dstCdcEn = p.dst_cdc;
 
-    srcSerdesEn = p->src_serdes;
-    dstSerdesEn = p->dst_serdes;
+    srcSerdesEn = p.src_serdes;
+    dstSerdesEn = p.dst_serdes;
 
     srcBridgeEn = false;
     dstBridgeEn = false;
 
     if (srcCdcEn || srcSerdesEn) {
         srcBridgeEn = true;
-        srcNetBridge = p->src_net_bridge;
-        srcCredBridge = p->src_cred_bridge;
+        srcNetBridge = p.src_net_bridge;
+        srcCredBridge = p.src_cred_bridge;
     }
     if (dstCdcEn || dstSerdesEn) {
         dstBridgeEn = true;
-        dstNetBridge = p->dst_net_bridge;
-        dstCredBridge = p->dst_cred_bridge;
+        dstNetBridge = p.dst_net_bridge;
+        dstCredBridge = p.dst_cred_bridge;
     }
-
 }
 
 void
@@ -88,50 +87,49 @@ GarnetIntLink::print(std::ostream& out) const
 }
 
 GarnetIntLink *
-GarnetIntLinkParams::create()
+GarnetIntLinkParams::create() const
 {
-    return new GarnetIntLink(this);
+    return new GarnetIntLink(*this);
 }
 
-GarnetExtLink::GarnetExtLink(const Params *p)
+GarnetExtLink::GarnetExtLink(const Params &p)
     : BasicExtLink(p)
 {
     // Bi-directional
 
     // In
-    m_network_links[0] = p->network_links[0];
-    m_credit_links[0] = p->credit_links[0];
+    m_network_links[0] = p.network_links[0];
+    m_credit_links[0] = p.credit_links[0];
 
     // Out
-    m_network_links[1] = p->network_links[1];
-    m_credit_links[1] = p->credit_links[1];
+    m_network_links[1] = p.network_links[1];
+    m_credit_links[1] = p.credit_links[1];
 
 
-    extCdcEn = p->ext_cdc;
-    intCdcEn = p->int_cdc;
+    extCdcEn = p.ext_cdc;
+    intCdcEn = p.int_cdc;
 
-    extSerdesEn = p->ext_serdes;
-    intSerdesEn = p->int_serdes;
+    extSerdesEn = p.ext_serdes;
+    intSerdesEn = p.int_serdes;
 
     extBridgeEn = false;
     intBridgeEn = false;
 
     if (extCdcEn || extSerdesEn) {
         extBridgeEn = true;
-        extNetBridge[0] = p->ext_net_bridge[0];
-        extCredBridge[0] = p->ext_cred_bridge[0];
-        extNetBridge[1] = p->ext_net_bridge[1];
-        extCredBridge[1] = p->ext_cred_bridge[1];
+        extNetBridge[0] = p.ext_net_bridge[0];
+        extCredBridge[0] = p.ext_cred_bridge[0];
+        extNetBridge[1] = p.ext_net_bridge[1];
+        extCredBridge[1] = p.ext_cred_bridge[1];
     }
 
     if (intCdcEn || intSerdesEn) {
         intBridgeEn = true;
-        intNetBridge[0] = p->int_net_bridge[0];
-        intNetBridge[1] = p->int_net_bridge[1];
-        intCredBridge[0] = p->int_cred_bridge[0];
-        intCredBridge[1] = p->int_cred_bridge[1];
+        intNetBridge[0] = p.int_net_bridge[0];
+        intNetBridge[1] = p.int_net_bridge[1];
+        intCredBridge[0] = p.int_cred_bridge[0];
+        intCredBridge[1] = p.int_cred_bridge[1];
     }
-
 }
 
 void
@@ -163,7 +161,7 @@ GarnetExtLink::print(std::ostream& out) const
 }
 
 GarnetExtLink *
-GarnetExtLinkParams::create()
+GarnetExtLinkParams::create() const
 {
-    return new GarnetExtLink(this);
+    return new GarnetExtLink(*this);
 }
index 554a0da5b6f20fb8adc94f0973dd38268d8a7f50..6abecd0b3da1210d09a3b3c2b81068840b131159 100644 (file)
@@ -46,7 +46,7 @@ class GarnetIntLink : public BasicIntLink
 {
   public:
     typedef GarnetIntLinkParams Params;
-    GarnetIntLink(const Params *p);
+    GarnetIntLink(const Params &p);
 
     void init();
 
@@ -86,7 +86,7 @@ class GarnetExtLink : public BasicExtLink
 {
   public:
     typedef GarnetExtLinkParams Params;
-    GarnetExtLink(const Params *p);
+    GarnetExtLink(const Params &p);
 
     void init();
 
index 4e3ef1d8e9ea96833723c84789b51743a14a1174..ec733185191cda26a2b933f566909a138ed25883 100644 (file)
@@ -53,19 +53,19 @@ using namespace std;
  * (see configs/network/Network.py)
  */
 
-GarnetNetwork::GarnetNetwork(const Params *p)
+GarnetNetwork::GarnetNetwork(const Params &p)
     : Network(p)
 {
-    m_num_rows = p->num_rows;
-    m_ni_flit_size = p->ni_flit_size;
+    m_num_rows = p.num_rows;
+    m_ni_flit_size = p.ni_flit_size;
     m_max_vcs_per_vnet = 0;
-    m_buffers_per_data_vc = p->buffers_per_data_vc;
-    m_buffers_per_ctrl_vc = p->buffers_per_ctrl_vc;
-    m_routing_algorithm = p->routing_algorithm;
+    m_buffers_per_data_vc = p.buffers_per_data_vc;
+    m_buffers_per_ctrl_vc = p.buffers_per_ctrl_vc;
+    m_routing_algorithm = p.routing_algorithm;
 
-    m_enable_fault_model = p->enable_fault_model;
+    m_enable_fault_model = p.enable_fault_model;
     if (m_enable_fault_model)
-        fault_model = p->fault_model;
+        fault_model = p.fault_model;
 
     m_vnet_type.resize(m_virtual_networks);
 
@@ -77,8 +77,8 @@ GarnetNetwork::GarnetNetwork(const Params *p)
     }
 
     // record the routers
-    for (vector<BasicRouter*>::const_iterator i =  p->routers.begin();
-         i != p->routers.end(); ++i) {
+    for (vector<BasicRouter*>::const_iterator i =  p.routers.begin();
+         i != p.routers.end(); ++i) {
         Router* router = safe_cast<Router*>(*i);
         m_routers.push_back(router);
 
@@ -87,8 +87,8 @@ GarnetNetwork::GarnetNetwork(const Params *p)
     }
 
     // record the network interfaces
-    for (vector<ClockedObject*>::const_iterator i = p->netifs.begin();
-         i != p->netifs.end(); ++i) {
+    for (vector<ClockedObject*>::const_iterator i = p.netifs.begin();
+         i != p.netifs.end(); ++i) {
         NetworkInterface *ni = safe_cast<NetworkInterface *>(*i);
         m_nis.push_back(ni);
         ni->init_net_ptr(this);
@@ -507,7 +507,7 @@ GarnetNetwork::regStats()
 void
 GarnetNetwork::collateStats()
 {
-    RubySystem *rs = params()->ruby_system;
+    RubySystem *rs = params().ruby_system;
     double time_delta = double(curCycle() - rs->getStartCycle());
 
     for (int i = 0; i < m_networklinks.size(); i++) {
@@ -557,9 +557,9 @@ GarnetNetwork::print(ostream& out) const
 }
 
 GarnetNetwork *
-GarnetNetworkParams::create()
+GarnetNetworkParams::create() const
 {
-    return new GarnetNetwork(this);
+    return new GarnetNetwork(*this);
 }
 
 uint32_t
index 2f9f543bc271077dbd2bd8743b7a8e236252aff6..63c1a2c685badf0b3bcf98c63b2ec99cb17d58bb 100644 (file)
@@ -51,7 +51,7 @@ class GarnetNetwork : public Network
 {
   public:
     typedef GarnetNetworkParams Params;
-    GarnetNetwork(const Params *p);
+    GarnetNetwork(const Params &p);
     ~GarnetNetwork() = default;
 
     void init();
index 9a1490c643498ae54f8a10de76100f5389f95353..ec23aea86dea01589447630cb7e23bb25fa877c6 100644 (file)
 #include "debug/RubyNetwork.hh"
 #include "params/GarnetIntLink.hh"
 
-NetworkBridge::NetworkBridge(const Params *p)
+NetworkBridge::NetworkBridge(const Params &p)
     :CreditLink(p)
 {
     enCdc = true;
     enSerDes = true;
-    mType = p->vtype;
+    mType = p.vtype;
 
-    cdcLatency = p->cdc_latency;
-    serDesLatency = p->serdes_latency;
+    cdcLatency = p.cdc_latency;
+    serDesLatency = p.serdes_latency;
     lastScheduledAt = 0;
 
-    nLink = p->link;
+    nLink = p.link;
     if (mType == Enums::LINK_OBJECT) {
         nLink->setLinkConsumer(this);
         setSourceQueue(nLink->getBuffer(), nLink);
@@ -265,7 +265,7 @@ NetworkBridge::wakeup()
 }
 
 NetworkBridge *
-NetworkBridgeParams::create()
+NetworkBridgeParams::create() const
 {
-    return new NetworkBridge(this);
+    return new NetworkBridge(*this);
 }
index c6c37cb79c0bb750f0edc2176ede10b82a988cb3..8003c614c6afee62e291e07029f61f2fdce99358 100644 (file)
@@ -54,7 +54,7 @@ class NetworkBridge: public CreditLink
 {
   public:
     typedef NetworkBridgeParams Params;
-    NetworkBridge(const Params *p);
+    NetworkBridge(const Params &p);
     ~NetworkBridge();
 
     void initBridge(NetworkBridge *coBrid, bool cdc_en, bool serdes_en);
index 6dbe0d99986f21d3775eadaad266c11c4069cb7e..bbff5b416bedcd8c01d00d3fb97e2f2bc89f7375 100644 (file)
 
 using namespace std;
 
-NetworkInterface::NetworkInterface(const Params *p)
-  : ClockedObject(p), Consumer(this), m_id(p->id),
-    m_virtual_networks(p->virt_nets), m_vc_per_vnet(0),
+NetworkInterface::NetworkInterface(const Params &p)
+  : ClockedObject(p), Consumer(this), m_id(p.id),
+    m_virtual_networks(p.virt_nets), m_vc_per_vnet(0),
     m_vc_allocator(m_virtual_networks, 0),
-    m_deadlock_threshold(p->garnet_deadlock_threshold),
+    m_deadlock_threshold(p.garnet_deadlock_threshold),
     vc_busy_counter(m_virtual_networks, 0)
 {
     m_stall_count.resize(m_virtual_networks);
@@ -673,7 +673,7 @@ NetworkInterface::functionalWrite(Packet *pkt)
 }
 
 NetworkInterface *
-GarnetNetworkInterfaceParams::create()
+GarnetNetworkInterfaceParams::create() const
 {
-    return new NetworkInterface(this);
+    return new NetworkInterface(*this);
 }
index 2f90772202ce231640ff337eb2e3a9b0e668b1bc..51347cc28018529c7635c8755faa9b5cc0ef17bf 100644 (file)
@@ -53,7 +53,7 @@ class NetworkInterface : public ClockedObject, public Consumer
 {
   public:
     typedef GarnetNetworkInterfaceParams Params;
-    NetworkInterface(const Params *p);
+    NetworkInterface(const Params &p);
     ~NetworkInterface() = default;
 
     void addInPort(NetworkLink *in_link, CreditLink *credit_link);
index 872159db5f499a1125e9958dffa3429bc6e4a754..24c23c12708194d8f502d0bf24fe542d67df5b27 100644 (file)
 #include "debug/RubyNetwork.hh"
 #include "mem/ruby/network/garnet/CreditLink.hh"
 
-NetworkLink::NetworkLink(const Params *p)
-    : ClockedObject(p), Consumer(this), m_id(p->link_id),
+NetworkLink::NetworkLink(const Params &p)
+    : ClockedObject(p), Consumer(this), m_id(p.link_id),
       m_type(NUM_LINK_TYPES_),
-      m_latency(p->link_latency), m_link_utilized(0),
-      m_virt_nets(p->virt_nets), linkBuffer(),
+      m_latency(p.link_latency), m_link_utilized(0),
+      m_virt_nets(p.virt_nets), linkBuffer(),
       link_consumer(nullptr), link_srcQueue(nullptr)
 {
-    int num_vnets = (p->supported_vnets).size();
+    int num_vnets = (p.supported_vnets).size();
     mVnets.resize(num_vnets);
-    bitWidth = p->width;
+    bitWidth = p.width;
     for (int i = 0; i < num_vnets; i++) {
-        mVnets[i] = p->supported_vnets[i];
+        mVnets[i] = p.supported_vnets[i];
     }
 }
 
@@ -111,15 +111,15 @@ NetworkLink::resetStats()
 }
 
 NetworkLink *
-NetworkLinkParams::create()
+NetworkLinkParams::create() const
 {
-    return new NetworkLink(this);
+    return new NetworkLink(*this);
 }
 
 CreditLink *
-CreditLinkParams::create()
+CreditLinkParams::create() const
 {
-    return new CreditLink(this);
+    return new CreditLink(*this);
 }
 
 uint32_t
index 22b1a7c72a54f39a7f22dc437f80c3eb25b9ff7e..20e0904044e1cf8fe7af07607bf7816e30a464de 100644 (file)
@@ -48,7 +48,7 @@ class NetworkLink : public ClockedObject, public Consumer
 {
   public:
     typedef NetworkLinkParams Params;
-    NetworkLink(const Params *p);
+    NetworkLink(const Params &p);
     ~NetworkLink() = default;
 
     void setLinkConsumer(Consumer *consumer);
index 47cb9be08f679639199f8d9621bbe5b731bc0dac..311564fc52ed760af3061e4a18402255d5c4a7fe 100644 (file)
 
 using namespace std;
 
-Router::Router(const Params *p)
-  : BasicRouter(p), Consumer(this), m_latency(p->latency),
-    m_virtual_networks(p->virt_nets), m_vc_per_vnet(p->vcs_per_vnet),
-    m_num_vcs(m_virtual_networks * m_vc_per_vnet), m_bit_width(p->width),
+Router::Router(const Params &p)
+  : BasicRouter(p), Consumer(this), m_latency(p.latency),
+    m_virtual_networks(p.virt_nets), m_vc_per_vnet(p.vcs_per_vnet),
+    m_num_vcs(m_virtual_networks * m_vc_per_vnet), m_bit_width(p.width),
     m_network_ptr(nullptr), routingUnit(this), switchAllocator(this),
     crossbarSwitch(this)
 {
@@ -285,7 +285,7 @@ Router::functionalWrite(Packet *pkt)
 }
 
 Router *
-GarnetRouterParams::create()
+GarnetRouterParams::create() const
 {
-    return new Router(this);
+    return new Router(*this);
 }
index 59d16bdf0930348c94816c45a47f481074303f39..31cdd7592448e772a97e3a328c4ef8d919c9525e 100644 (file)
@@ -57,7 +57,7 @@ class Router : public BasicRouter, public Consumer
 {
   public:
     typedef GarnetRouterParams Params;
-    Router(const Params *p);
+    Router(const Params &p);
 
     ~Router() = default;
 
index 04a60d88822b7126363f80bb34532372b972dbd4..70437624fb210a55fa17d5f11f08738a81dc062e 100644 (file)
 
 #include "mem/ruby/network/simple/SimpleLink.hh"
 
-SimpleExtLink::SimpleExtLink(const Params *p)
+SimpleExtLink::SimpleExtLink(const Params &p)
     : BasicExtLink(p)
 {
     // For the simple links, the bandwidth factor translates to the
     // bandwidth multiplier.  The multipiler, in combination with the
     // endpoint bandwidth multiplier - message size multiplier ratio,
     // determines the link bandwidth in bytes
-    m_bw_multiplier = p->bandwidth_factor;
+    m_bw_multiplier = p.bandwidth_factor;
 }
 
 void
@@ -45,19 +45,19 @@ SimpleExtLink::print(std::ostream& out) const
 }
 
 SimpleExtLink *
-SimpleExtLinkParams::create()
+SimpleExtLinkParams::create() const
 {
-    return new SimpleExtLink(this);
+    return new SimpleExtLink(*this);
 }
 
-SimpleIntLink::SimpleIntLink(const Params *p)
+SimpleIntLink::SimpleIntLink(const Params &p)
     : BasicIntLink(p)
 {
     // For the simple links, the bandwidth factor translates to the
     // bandwidth multiplier.  The multipiler, in combination with the
     // endpoint bandwidth multiplier - message size multiplier ratio,
     // determines the link bandwidth in bytes
-    m_bw_multiplier = p->bandwidth_factor;
+    m_bw_multiplier = p.bandwidth_factor;
 }
 
 void
@@ -67,7 +67,7 @@ SimpleIntLink::print(std::ostream& out) const
 }
 
 SimpleIntLink *
-SimpleIntLinkParams::create()
+SimpleIntLinkParams::create() const
 {
-    return new SimpleIntLink(this);
+    return new SimpleIntLink(*this);
 }
index 3ca2356bad590bd4de0a78d666c471148df36b5a..68465e018cf1e1f1e54a4eaf809a663651c41686 100644 (file)
@@ -41,8 +41,8 @@ class SimpleExtLink : public BasicExtLink
 {
   public:
     typedef SimpleExtLinkParams Params;
-    SimpleExtLink(const Params *p);
-    const Params *params() const { return (const Params *)_params; }
+    SimpleExtLink(const Params &p);
+    const Params &params() const { return (const Params &)_params; }
 
     friend class Topology;
     void print(std::ostream& out) const;
@@ -62,8 +62,8 @@ class SimpleIntLink : public BasicIntLink
 {
   public:
     typedef SimpleIntLinkParams Params;
-    SimpleIntLink(const Params *p);
-    const Params *params() const { return (const Params *)_params; }
+    SimpleIntLink(const Params &p);
+    const Params &params() const { return (const Params &)_params; }
 
     friend class Topology;
     void print(std::ostream& out) const;
index edffc3d92c8a1fb419fff2a9a587d4915d1dda6b..86d04321082226697ea9898f8d4270b58e294759 100644 (file)
 
 using namespace std;
 
-SimpleNetwork::SimpleNetwork(const Params *p)
-    : Network(p), m_buffer_size(p->buffer_size),
-      m_endpoint_bandwidth(p->endpoint_bandwidth),
-      m_adaptive_routing(p->adaptive_routing)
+SimpleNetwork::SimpleNetwork(const Params &p)
+    : Network(p), m_buffer_size(p.buffer_size),
+      m_endpoint_bandwidth(p.endpoint_bandwidth),
+      m_adaptive_routing(p.adaptive_routing)
 {
     // record the routers
-    for (vector<BasicRouter*>::const_iterator i = p->routers.begin();
-         i != p->routers.end(); ++i) {
+    for (vector<BasicRouter*>::const_iterator i = p.routers.begin();
+         i != p.routers.end(); ++i) {
         Switch* s = safe_cast<Switch*>(*i);
         m_switches.push_back(s);
         s->init_net_ptr(this);
     }
 
-    m_int_link_buffers = p->int_link_buffers;
+    m_int_link_buffers = p.int_link_buffers;
     m_num_connected_buffers = 0;
 }
 
@@ -180,9 +180,9 @@ SimpleNetwork::print(ostream& out) const
 }
 
 SimpleNetwork *
-SimpleNetworkParams::create()
+SimpleNetworkParams::create() const
 {
-    return new SimpleNetwork(this);
+    return new SimpleNetwork(*this);
 }
 
 /*
index 90e26128fd3ad84fc59de9aac81db21d4bf17d90..aee5ef5530ccbe8be1f2f47cbf7b5f83444243eb 100644 (file)
@@ -44,7 +44,7 @@ class SimpleNetwork : public Network
 {
   public:
     typedef SimpleNetworkParams Params;
-    SimpleNetwork(const Params *p);
+    SimpleNetwork(const Params &p);
     ~SimpleNetwork() = default;
 
     void init();
index d1e5026b12efce5d8e732453c66385158f2349de..67b452413f56dccad8f079c3103fab86b6663819 100644 (file)
 using namespace std;
 using m5::stl_helpers::operator<<;
 
-Switch::Switch(const Params *p)
-  : BasicRouter(p), perfectSwitch(m_id, this, p->virt_nets),
+Switch::Switch(const Params &p)
+  : BasicRouter(p), perfectSwitch(m_id, this, p.virt_nets),
     m_num_connected_buffers(0)
 {
-    m_port_buffers.reserve(p->port_buffers.size());
-    for (auto& buffer : p->port_buffers) {
+    m_port_buffers.reserve(p.port_buffers.size());
+    for (auto& buffer : p.port_buffers) {
         m_port_buffers.emplace_back(buffer);
     }
 }
@@ -80,7 +80,7 @@ Switch::addOutPort(const vector<MessageBuffer*>& out,
                    Cycles link_latency, int bw_multiplier)
 {
     // Create a throttle
-    throttles.emplace_back(m_id, m_network_ptr->params()->ruby_system,
+    throttles.emplace_back(m_id, m_network_ptr->params().ruby_system,
         throttles.size(), link_latency, bw_multiplier,
         m_network_ptr->getEndpointBandwidth(), this);
 
@@ -185,7 +185,7 @@ Switch::functionalWrite(Packet *pkt)
 }
 
 Switch *
-SwitchParams::create()
+SwitchParams::create() const
 {
-    return new Switch(this);
+    return new Switch(*this);
 }
index 5d2690621ac89fc4164c242e5e7969b25afd964f..aac595206d5b07e246e20bf09c6cd5a52559da53 100644 (file)
@@ -60,7 +60,7 @@ class Switch : public BasicRouter
 {
   public:
     typedef SwitchParams Params;
-    Switch(const Params *p);
+    Switch(const Params &p);
     ~Switch() = default;
     void init();
 
index 505e3a17d184941271d11c78148f59018ea1baba..a6933b03ffc2544257c5eba2953e6ba729e748d2 100644 (file)
 using namespace std;
 using m5::stl_helpers::operator<<;
 
-Profiler::Profiler(const RubySystemParams *p, RubySystem *rs)
-    : m_ruby_system(rs), m_hot_lines(p->hot_lines),
-      m_all_instructions(p->all_instructions),
-      m_num_vnets(p->number_of_virtual_networks)
+Profiler::Profiler(const RubySystemParams &p, RubySystem *rs)
+    : m_ruby_system(rs), m_hot_lines(p.hot_lines),
+      m_all_instructions(p.all_instructions),
+      m_num_vnets(p.number_of_virtual_networks)
 {
-    m_address_profiler_ptr = new AddressProfiler(p->num_of_sequencers, this);
+    m_address_profiler_ptr = new AddressProfiler(p.num_of_sequencers, this);
     m_address_profiler_ptr->setHotLines(m_hot_lines);
     m_address_profiler_ptr->setAllInstructions(m_all_instructions);
 
     if (m_all_instructions) {
-        m_inst_profiler_ptr = new AddressProfiler(p->num_of_sequencers, this);
+        m_inst_profiler_ptr = new AddressProfiler(p.num_of_sequencers, this);
         m_inst_profiler_ptr->setHotLines(m_hot_lines);
         m_inst_profiler_ptr->setAllInstructions(m_all_instructions);
     }
index 5632b8490c11604db1ca419f6377fad4f2caa03f..c1d08e4e474ac7a09b3e884b65d0135c649094aa 100644 (file)
@@ -64,7 +64,7 @@ class AddressProfiler;
 class Profiler
 {
   public:
-    Profiler(const RubySystemParams *params, RubySystem *rs);
+    Profiler(const RubySystemParams &params, RubySystem *rs);
     ~Profiler();
 
     RubySystem *m_ruby_system;
index a211c558aaef3ec342e321dd37f7b814db419bff..1e8d8e09f3eaa79664b22b2473a51f264adb502f 100644 (file)
 #include "mem/ruby/system/Sequencer.hh"
 #include "sim/system.hh"
 
-AbstractController::AbstractController(const Params *p)
-    : ClockedObject(p), Consumer(this), m_version(p->version),
-      m_clusterID(p->cluster_id),
-      m_id(p->system->getRequestorId(this)), m_is_blocking(false),
-      m_number_of_TBEs(p->number_of_TBEs),
-      m_transitions_per_cycle(p->transitions_per_cycle),
-      m_buffer_size(p->buffer_size), m_recycle_latency(p->recycle_latency),
-      m_mandatory_queue_latency(p->mandatory_queue_latency),
+AbstractController::AbstractController(const Params &p)
+    : ClockedObject(p), Consumer(this), m_version(p.version),
+      m_clusterID(p.cluster_id),
+      m_id(p.system->getRequestorId(this)), m_is_blocking(false),
+      m_number_of_TBEs(p.number_of_TBEs),
+      m_transitions_per_cycle(p.transitions_per_cycle),
+      m_buffer_size(p.buffer_size), m_recycle_latency(p.recycle_latency),
+      m_mandatory_queue_latency(p.mandatory_queue_latency),
       memoryPort(csprintf("%s.memory", name()), this),
-      addrRanges(p->addr_ranges.begin(), p->addr_ranges.end())
+      addrRanges(p.addr_ranges.begin(), p.addr_ranges.end())
 {
     if (m_version == 0) {
         // Combine the statistics from all controllers
@@ -84,7 +84,7 @@ AbstractController::init()
     // different types. If this is the case, mapAddressToDownstreamMachine
     // needs to specify the machine type
     downstreamDestinations.resize();
-    for (auto abs_cntrl : params()->downstream_destinations) {
+    for (auto abs_cntrl : params().downstream_destinations) {
         MachineID mid = abs_cntrl->getMachineID();
         const AddrRangeList &ranges = abs_cntrl->getAddrRanges();
         for (const auto addr_range : ranges) {
index 2f3355686726f1e974d4c87b0be86536d9ea35ed..8e19195dd7b0ba644e065e6f7a2fe1add020b6d6 100644 (file)
@@ -77,9 +77,9 @@ class AbstractController : public ClockedObject, public Consumer
 {
   public:
     typedef RubyControllerParams Params;
-    AbstractController(const Params *p);
+    AbstractController(const Params &p);
     void init();
-    const Params *params() const { return (const Params *)_params; }
+    const Params &params() const { return (const Params &)_params; }
 
     NodeID getVersion() const { return m_machineID.getNum(); }
     MachineType getType() const { return m_machineID.getType(); }
index 0024d8a3be57ec667fe80757a53fe8a99ac39d4d..51a38c495ffaa18a3bb52479dbebe4a52bbc7f1f 100644 (file)
@@ -63,25 +63,25 @@ operator<<(ostream& out, const CacheMemory& obj)
 }
 
 CacheMemory *
-RubyCacheParams::create()
+RubyCacheParams::create() const
 {
-    return new CacheMemory(this);
+    return new CacheMemory(*this);
 }
 
-CacheMemory::CacheMemory(const Params *p)
+CacheMemory::CacheMemory(const Params &p)
     : SimObject(p),
-    dataArray(p->dataArrayBanks, p->dataAccessLatency,
-              p->start_index_bit, p->ruby_system),
-    tagArray(p->tagArrayBanks, p->tagAccessLatency,
-             p->start_index_bit, p->ruby_system)
-{
-    m_cache_size = p->size;
-    m_cache_assoc = p->assoc;
-    m_replacementPolicy_ptr = p->replacement_policy;
-    m_start_index_bit = p->start_index_bit;
-    m_is_instruction_only_cache = p->is_icache;
-    m_resource_stalls = p->resourceStalls;
-    m_block_size = p->block_size;  // may be 0 at this point. Updated in init()
+    dataArray(p.dataArrayBanks, p.dataAccessLatency,
+              p.start_index_bit, p.ruby_system),
+    tagArray(p.tagArrayBanks, p.tagAccessLatency,
+             p.start_index_bit, p.ruby_system)
+{
+    m_cache_size = p.size;
+    m_cache_assoc = p.assoc;
+    m_replacementPolicy_ptr = p.replacement_policy;
+    m_start_index_bit = p.start_index_bit;
+    m_is_instruction_only_cache = p.is_icache;
+    m_resource_stalls = p.resourceStalls;
+    m_block_size = p.block_size;  // may be 0 at this point. Updated in init()
     m_use_occupancy = dynamic_cast<ReplacementPolicy::WeightedLRU*>(
                                     m_replacementPolicy_ptr) ? true : false;
 }
index 245cfa94adf7d91968e93d37b0749d592edc6ac1..9434660cb64ddea6e04ab8adf85eee38bd1335c6 100644 (file)
@@ -65,7 +65,7 @@ class CacheMemory : public SimObject
   public:
     typedef RubyCacheParams Params;
     typedef std::shared_ptr<ReplacementPolicy::ReplacementData> ReplData;
-    CacheMemory(const Params *p);
+    CacheMemory(const Params &p);
     ~CacheMemory();
 
     void init();
index c6e3ccf5402eb6a7c8a185b6bceec0a8579ef252..bfb661147b380406c969af0471d4012a6e8d6362 100644 (file)
@@ -51,8 +51,8 @@
 
 using namespace std;
 
-DirectoryMemory::DirectoryMemory(const Params *p)
-    : SimObject(p), addrRanges(p->addr_ranges.begin(), p->addr_ranges.end())
+DirectoryMemory::DirectoryMemory(const Params &p)
+    : SimObject(p), addrRanges(p.addr_ranges.begin(), p.addr_ranges.end())
 {
     m_size_bytes = 0;
     for (const auto &r: addrRanges) {
@@ -160,7 +160,7 @@ DirectoryMemory::recordRequestType(DirectoryRequestType requestType) {
 }
 
 DirectoryMemory *
-RubyDirectoryMemoryParams::create()
+RubyDirectoryMemoryParams::create() const
 {
-    return new DirectoryMemory(this);
+    return new DirectoryMemory(*this);
 }
index 3dd0e95668b12b00e46092805241e724a8817263..80ed6abf660f950665fab432bb36d01367349061 100644 (file)
@@ -55,7 +55,7 @@ class DirectoryMemory : public SimObject
 {
   public:
     typedef RubyDirectoryMemoryParams Params;
-    DirectoryMemory(const Params *p);
+    DirectoryMemory(const Params &p);
     ~DirectoryMemory();
 
     void init();
index aa6c7cd7bba5a34c9a06e10fc2dded841af46d8d..04225c843050d89b0c2bf50998470215b31cb5e3 100644 (file)
 #include "mem/ruby/system/RubySystem.hh"
 
 RubyPrefetcher*
-RubyPrefetcherParams::create()
+RubyPrefetcherParams::create() const
 {
-    return new RubyPrefetcher(this);
+    return new RubyPrefetcher(*this);
 }
 
-RubyPrefetcher::RubyPrefetcher(const Params *p)
-    : SimObject(p), m_num_streams(p->num_streams),
-    m_array(p->num_streams), m_train_misses(p->train_misses),
-    m_num_startup_pfs(p->num_startup_pfs),
-    unitFilter(p->unit_filter),
-    negativeFilter(p->unit_filter),
-    nonUnitFilter(p->nonunit_filter),
-    m_prefetch_cross_pages(p->cross_page),
-    m_page_shift(p->sys->getPageShift())
+RubyPrefetcher::RubyPrefetcher(const Params &p)
+    : SimObject(p), m_num_streams(p.num_streams),
+    m_array(p.num_streams), m_train_misses(p.train_misses),
+    m_num_startup_pfs(p.num_startup_pfs),
+    unitFilter(p.unit_filter),
+    negativeFilter(p.unit_filter),
+    nonUnitFilter(p.nonunit_filter),
+    m_prefetch_cross_pages(p.cross_page),
+    m_page_shift(p.sys->getPageShift())
 {
     assert(m_num_streams > 0);
     assert(m_num_startup_pfs <= MAX_PF_INFLIGHT);
index b640cc3f324e52299b73ee12b45891750b8051ca..89acb3b8b1240b57ce9b7d9cbf6a79cf24bc966b 100644 (file)
@@ -96,7 +96,7 @@ class RubyPrefetcher : public SimObject
 {
     public:
         typedef RubyPrefetcherParams Params;
-        RubyPrefetcher(const Params *p);
+        RubyPrefetcher(const Params &p);
         ~RubyPrefetcher() = default;
 
         void issueNextPrefetch(Addr address, PrefetchEntry *stream);
index 15398d8c0cb415a5be40aa4ab66c92516f0d03de..1d91463db2baef4528f246b86055de71372ad1c4 100644 (file)
@@ -54,7 +54,7 @@ operator<<(ostream& out, const WireBuffer& obj)
 // ****************************************************************
 
 // CONSTRUCTOR
-WireBuffer::WireBuffer(const Params *p)
+WireBuffer::WireBuffer(const Params &p)
     : SimObject(p)
 {
     m_msg_counter = 0;
@@ -143,7 +143,7 @@ WireBuffer::wakeup()
 }
 
 WireBuffer *
-RubyWireBufferParams::create()
+RubyWireBufferParams::create() const
 {
-    return new WireBuffer(this);
+    return new WireBuffer(*this);
 }
index f038705d93ffedbbb67b5ce96b977bd3b95cadc2..be861ec842581954c56c231abb4dbdb5955d8674 100644 (file)
@@ -57,7 +57,7 @@ class WireBuffer : public SimObject
 {
   public:
     typedef RubyWireBufferParams Params;
-    WireBuffer(const Params *p);
+    WireBuffer(const Params &p);
     void init();
 
     ~WireBuffer();
index 4c61dd29680a63ef5c059714f357bb1053256c13..62b24eda1fbc8bc3bca30d207a99aa103d356b0f 100644 (file)
@@ -45,9 +45,9 @@ DMARequest::DMARequest(uint64_t start_paddr, int len, bool write,
 {
 }
 
-DMASequencer::DMASequencer(const Params *p)
+DMASequencer::DMASequencer(const Params &p)
     : RubyPort(p), m_outstanding_count(0),
-      m_max_outstanding_requests(p->max_outstanding_requests)
+      m_max_outstanding_requests(p.max_outstanding_requests)
 {
 }
 
@@ -201,7 +201,7 @@ DMASequencer::recordRequestType(DMASequencerRequestType requestType)
 }
 
 DMASequencer *
-DMASequencerParams::create()
+DMASequencerParams::create() const
 {
-    return new DMASequencer(this);
+    return new DMASequencer(*this);
 }
index a3ee8afa79eb29d7d07ff66b61947e85bbf1bfba..2fa3f2afb90ec65b40f59555aaeed0a26f700e23 100644 (file)
@@ -57,7 +57,7 @@ class DMASequencer : public RubyPort
 {
   public:
     typedef DMASequencerParams Params;
-    DMASequencer(const Params *);
+    DMASequencer(const Params &);
     void init() override;
 
     /* external interface */
index 310ba72fc77703fe3aac73bbcb60f0459a2af93e..d9df1d89313a734ce50ed4d4194a0a9a9b06f0c0 100644 (file)
@@ -182,7 +182,7 @@ UncoalescedTable::checkDeadlock(Tick threshold)
     }
 }
 
-GPUCoalescer::GPUCoalescer(const Params *p)
+GPUCoalescer::GPUCoalescer(const Params &p)
     : RubyPort(p),
       issueEvent([this]{ completeIssue(); }, "Issue coalesced request",
                  false, Event::Progress_Event_Pri),
@@ -197,23 +197,23 @@ GPUCoalescer::GPUCoalescer(const Params *p)
 
     m_outstanding_count = 0;
 
-    coalescingWindow = p->max_coalesces_per_cycle;
+    coalescingWindow = p.max_coalesces_per_cycle;
 
     m_max_outstanding_requests = 0;
     m_instCache_ptr = nullptr;
     m_dataCache_ptr = nullptr;
 
-    m_instCache_ptr = p->icache;
-    m_dataCache_ptr = p->dcache;
-    m_max_outstanding_requests = p->max_outstanding_requests;
-    m_deadlock_threshold = p->deadlock_threshold;
+    m_instCache_ptr = p.icache;
+    m_dataCache_ptr = p.dcache;
+    m_max_outstanding_requests = p.max_outstanding_requests;
+    m_deadlock_threshold = p.deadlock_threshold;
 
     assert(m_max_outstanding_requests > 0);
     assert(m_deadlock_threshold > 0);
     assert(m_instCache_ptr);
     assert(m_dataCache_ptr);
 
-    m_runningGarnetStandalone = p->garnet_standalone;
+    m_runningGarnetStandalone = p.garnet_standalone;
 }
 
 GPUCoalescer::~GPUCoalescer()
index 2684d51bdf047592ed4f0fd1fa03cab0a402e8b1..086cc6da3ba34ccaf890d689b4c3a73b2801f6f4 100644 (file)
@@ -230,7 +230,7 @@ class GPUCoalescer : public RubyPort
     };
 
     typedef RubyGPUCoalescerParams Params;
-    GPUCoalescer(const Params *);
+    GPUCoalescer(const Params &);
     ~GPUCoalescer();
 
     Port &getPort(const std::string &if_name,
index 87bc7d74e15716381ac62118a9ea3ac897e422d5..8c6afd04fcc518e78f83747374c3f4fdfbc01059 100644 (file)
@@ -63,12 +63,12 @@ HTMSequencer::htmRetCodeConversion(
 }
 
 HTMSequencer *
-RubyHTMSequencerParams::create()
+RubyHTMSequencerParams::create() const
 {
-    return new HTMSequencer(this);
+    return new HTMSequencer(*this);
 }
 
-HTMSequencer::HTMSequencer(const RubyHTMSequencerParams *p)
+HTMSequencer::HTMSequencer(const RubyHTMSequencerParams &p)
     : Sequencer(p)
 {
     m_htmstart_tick = 0;
index 5add836ef081884c81fefbae9c0c00f4099d5e19..e24cb57ee7b5a65bbec452350a8aec75dc60ab80 100644 (file)
@@ -51,7 +51,7 @@
 class HTMSequencer : public Sequencer
 {
   public:
-    HTMSequencer(const RubyHTMSequencerParams *p);
+    HTMSequencer(const RubyHTMSequencerParams &p);
     ~HTMSequencer();
 
     // callback to acknowledge HTM requests and
index 246971005d64da9a1f70c3582363bb16d9fa2175..9a6434ab50a367f09748800edcda281c9d57615b 100644 (file)
 #include "sim/full_system.hh"
 #include "sim/system.hh"
 
-RubyPort::RubyPort(const Params *p)
-    : ClockedObject(p), m_ruby_system(p->ruby_system), m_version(p->version),
+RubyPort::RubyPort(const Params &p)
+    : ClockedObject(p), m_ruby_system(p.ruby_system), m_version(p.version),
       m_controller(NULL), m_mandatory_q_ptr(NULL),
-      m_usingRubyTester(p->using_ruby_tester), system(p->system),
+      m_usingRubyTester(p.using_ruby_tester), system(p.system),
       pioRequestPort(csprintf("%s.pio-request-port", name()), this),
       pioResponsePort(csprintf("%s.pio-response-port", name()), this),
       memRequestPort(csprintf("%s.mem-request-port", name()), this),
       memResponsePort(csprintf("%s-mem-response-port", name()), this,
-                   p->ruby_system->getAccessBackingStore(), -1,
-                   p->no_retry_on_stall),
-      gotAddrRanges(p->port_interrupt_out_port_connection_count),
-      m_isCPUSequencer(p->is_cpu_sequencer)
+                   p.ruby_system->getAccessBackingStore(), -1,
+                   p.no_retry_on_stall),
+      gotAddrRanges(p.port_interrupt_out_port_connection_count),
+      m_isCPUSequencer(p.is_cpu_sequencer)
 {
     assert(m_version != -1);
 
     // create the response ports based on the number of connected ports
-    for (size_t i = 0; i < p->port_in_ports_connection_count; ++i) {
+    for (size_t i = 0; i < p.port_in_ports_connection_count; ++i) {
         response_ports.push_back(new MemResponsePort(csprintf
             ("%s.response_ports%d", name(), i), this,
-            p->ruby_system->getAccessBackingStore(),
-            i, p->no_retry_on_stall));
+            p.ruby_system->getAccessBackingStore(),
+            i, p.no_retry_on_stall));
     }
 
     // create the request ports based on the number of connected ports
-    for (size_t i = 0; i < p->port_interrupt_out_port_connection_count; ++i) {
+    for (size_t i = 0; i < p.port_interrupt_out_port_connection_count; ++i) {
         request_ports.push_back(new PioRequestPort(csprintf(
                     "%s.request_ports%d", name(), i), this));
     }
index 73c4557c269973a990dbbdd375ff50ddfb7d4e8e..1d25ae9a254c346d3519df3a64765cab1c7b21de 100644 (file)
@@ -144,7 +144,7 @@ class RubyPort : public ClockedObject
      };
 
     typedef RubyPortParams Params;
-    RubyPort(const Params *p);
+    RubyPort(const Params &p);
     virtual ~RubyPort() {}
 
     void init() override;
index 7401a631632f2f663b657635c4cb3f894e4d1207..2badffa648e54ac39e5ca538e742070370a85e68 100644 (file)
@@ -37,8 +37,9 @@
 
 #include "mem/ruby/system/RubyPortProxy.hh"
 
-RubyPortProxy::RubyPortProxy(const RubyPortProxyParams* p) :
-    RubyPort(p) {
+RubyPortProxy::RubyPortProxy(const RubyPortProxyParams &p) :
+    RubyPort(p)
+{
 }
 
 RubyPortProxy::~RubyPortProxy()
@@ -62,7 +63,7 @@ RubyPortProxy::makeRequest(PacketPtr pkt)
 }
 
 RubyPortProxy*
-RubyPortProxyParams::create()
+RubyPortProxyParams::create() const
 {
-    return new RubyPortProxy(this);
+    return new RubyPortProxy(*this);
 }
index 2d9e1d6933cc6c240e50689ca3bda897769bf90c..59673172df7004e468f7e14ef2a386a4a9248c77 100644 (file)
@@ -59,7 +59,7 @@ class RubyPortProxy : public RubyPort
      *
      * @param p Parameters inherited from the RubyPort
      */
-    RubyPortProxy(const RubyPortProxyParamsp);
+    RubyPortProxy(const RubyPortProxyParams &p);
 
     /**
      * Destruct a RubyPortProxy.
index 565b4266ddede4624d1faa296ef33228bf2a1982..8a6c35417e9503b6bf7dd451a6c7297e3bfae7d1 100644 (file)
@@ -71,16 +71,16 @@ bool RubySystem::m_warmup_enabled = false;
 unsigned RubySystem::m_systems_to_warmup = 0;
 bool RubySystem::m_cooldown_enabled = false;
 
-RubySystem::RubySystem(const Params *p)
-    : ClockedObject(p), m_access_backing_store(p->access_backing_store),
+RubySystem::RubySystem(const Params &p)
+    : ClockedObject(p), m_access_backing_store(p.access_backing_store),
       m_cache_recorder(NULL)
 {
-    m_randomization = p->randomization;
+    m_randomization = p.randomization;
 
-    m_block_size_bytes = p->block_size_bytes;
+    m_block_size_bytes = p.block_size_bytes;
     assert(isPowerOf2(m_block_size_bytes));
     m_block_size_bits = floorLog2(m_block_size_bytes);
-    m_memory_size_bits = p->memory_size_bits;
+    m_memory_size_bits = p.memory_size_bits;
 
     // Resize to the size of different machine types
     m_abstract_controls.resize(MachineType_NUM);
@@ -89,7 +89,7 @@ RubySystem::RubySystem(const Params *p)
     Stats::registerDumpCallback([this]() { collateStats(); });
     // Create the profiler
     m_profiler = new Profiler(p, this);
-    m_phys_mem = p->phys_mem;
+    m_phys_mem = p.phys_mem;
 }
 
 void
@@ -155,7 +155,7 @@ RubySystem::registerRequestorIDs()
     }
 
     // Default all other requestor IDs to network 0
-    for (auto id = 0; id < params()->system->maxRequestors(); ++id) {
+    for (auto id = 0; id < params().system->maxRequestors(); ++id) {
         if (!requestorToNetwork.count(id)) {
             requestorToNetwork.insert(std::make_pair(id, 0));
         }
@@ -640,7 +640,7 @@ RubySystem::functionalWrite(PacketPtr pkt)
 }
 
 RubySystem *
-RubySystemParams::create()
+RubySystemParams::create() const
 {
-    return new RubySystem(this);
+    return new RubySystem(*this);
 }
index cdd2b5cfb2d21ad25083643787941498a965114a..0c4ffc163c368d024eafda42f3f7260a2e2d49ec 100644 (file)
@@ -53,9 +53,9 @@ class RubySystem : public ClockedObject
 {
   public:
     typedef RubySystemParams Params;
-    RubySystem(const Params *p);
+    RubySystem(const Params &p);
     ~RubySystem();
-    const Params *params() const { return (const Params *)_params; }
+    const Params &params() const { return (const Params &)_params; }
 
     // config accessors
     static int getRandomization() { return m_randomization; }
index 6b50636d97a7f7344f49a4bb10d02cdd6fe773c0..27fb2575ff95e2e537b211d236eb38b7764776aa 100644 (file)
 using namespace std;
 
 Sequencer *
-RubySequencerParams::create()
+RubySequencerParams::create() const
 {
-    return new Sequencer(this);
+    return new Sequencer(*this);
 }
 
-Sequencer::Sequencer(const Params *p)
+Sequencer::Sequencer(const Params &p)
     : RubyPort(p), m_IncompleteTimes(MachineType_NUM),
       deadlockCheckEvent([this]{ wakeup(); }, "Sequencer deadlock check")
 {
     m_outstanding_count = 0;
 
-    m_dataCache_ptr = p->dcache;
-    m_max_outstanding_requests = p->max_outstanding_requests;
-    m_deadlock_threshold = p->deadlock_threshold;
+    m_dataCache_ptr = p.dcache;
+    m_max_outstanding_requests = p.max_outstanding_requests;
+    m_deadlock_threshold = p.deadlock_threshold;
 
-    m_coreId = p->coreid; // for tracking the two CorePair sequencers
+    m_coreId = p.coreid; // for tracking the two CorePair sequencers
     assert(m_max_outstanding_requests > 0);
     assert(m_deadlock_threshold > 0);
 
-    m_runningGarnetStandalone = p->garnet_standalone;
+    m_runningGarnetStandalone = p.garnet_standalone;
 }
 
 Sequencer::~Sequencer()
index e1a3c2df1061ce34e4191945a2c8d272fca18659..83eea68b6ee725ee586e73fdc5c140a1d18552c4 100644 (file)
@@ -81,7 +81,7 @@ class Sequencer : public RubyPort
 {
   public:
     typedef RubySequencerParams Params;
-    Sequencer(const Params *);
+    Sequencer(const Params &);
     ~Sequencer();
 
     /**
index 82c7f005254ef0c2136854a815b1740f5fe6f693..6589a7d764e2e1d410a5a6e83bb8a6880cbb3ce0 100644 (file)
 using namespace std;
 
 VIPERCoalescer *
-VIPERCoalescerParams::create()
+VIPERCoalescerParams::create() const
 {
-    return new VIPERCoalescer(this);
+    return new VIPERCoalescer(*this);
 }
 
-VIPERCoalescer::VIPERCoalescer(const Params *p)
+VIPERCoalescer::VIPERCoalescer(const Params &p)
     : GPUCoalescer(p),
       m_cache_inv_pkt(nullptr),
       m_num_pending_invs(0)
index 2f68c10bcc6f39d076649f311eeb67548b6b3aae..213a67557dbb5d33ea8bdfdf549485b7a03147ce 100644 (file)
@@ -55,7 +55,7 @@ class VIPERCoalescer : public GPUCoalescer
 {
   public:
     typedef VIPERCoalescerParams Params;
-    VIPERCoalescer(const Params *);
+    VIPERCoalescer(const Params &);
     ~VIPERCoalescer();
     void writeCompleteCallback(Addr address, uint64_t instSeqNum);
     void invTCPCallback(Addr address);
index 74ac43f54e2baa19d2ebb0b2db47529b69bd5bf3..1b07770d69f9f680737424ee8dc85eb47b4e4b00 100644 (file)
@@ -78,15 +78,14 @@ SerialLink::SerialLinkRequestPort::SerialLinkRequestPort(const std::string&
 {
 }
 
-SerialLink::SerialLink(SerialLinkParams *p)
+SerialLink::SerialLink(const SerialLinkParams &p)
     : ClockedObject(p),
-      cpu_side_port(p->name + ".cpu_side_port", *this, mem_side_port,
-                ticksToCycles(p->delay), p->resp_size, p->ranges),
-      mem_side_port(p->name + ".mem_side_port", *this, cpu_side_port,
-                 ticksToCycles(p->delay), p->req_size),
-      num_lanes(p->num_lanes),
-      link_speed(p->link_speed)
-
+      cpu_side_port(p.name + ".cpu_side_port", *this, mem_side_port,
+                ticksToCycles(p.delay), p.resp_size, p.ranges),
+      mem_side_port(p.name + ".mem_side_port", *this, cpu_side_port,
+                 ticksToCycles(p.delay), p.req_size),
+      num_lanes(p.num_lanes),
+      link_speed(p.link_speed)
 {
 }
 
@@ -423,7 +422,7 @@ SerialLink::SerialLinkResponsePort::getAddrRanges() const
 }
 
 SerialLink *
-SerialLinkParams::create()
+SerialLinkParams::create() const
 {
-    return new SerialLink(this);
+    return new SerialLink(*this);
 }
index 903387e9121b90dbabc36af86da97f67e39a7339..ad76c9ebc39f93fe30981ac763884233ad7989f0 100644 (file)
@@ -319,7 +319,7 @@ class SerialLink : public ClockedObject
 
     typedef SerialLinkParams Params;
 
-    SerialLink(SerialLinkParams *p);
+    SerialLink(const SerialLinkParams &p);
 };
 
 #endif //__MEM_SERIAL_LINK_HH__
index c593a276a3d5802224c1b1e5e73ad523a57651e6..80e4cb392c8aa7db5eb3702cdb3a416bf4582906 100644 (file)
 #include "base/trace.hh"
 #include "debug/Drain.hh"
 
-SimpleMemory::SimpleMemory(const SimpleMemoryParamsp) :
+SimpleMemory::SimpleMemory(const SimpleMemoryParams &p) :
     AbstractMemory(p),
-    port(name() + ".port", *this), latency(p->latency),
-    latency_var(p->latency_var), bandwidth(p->bandwidth), isBusy(false),
+    port(name() + ".port", *this), latency(p.latency),
+    latency_var(p.latency_var), bandwidth(p.bandwidth), isBusy(false),
     retryReq(false), retryResp(false),
     releaseEvent([this]{ release(); }, name()),
     dequeueEvent([this]{ dequeue(); }, name())
@@ -303,7 +303,7 @@ SimpleMemory::MemoryPort::recvRespRetry()
 }
 
 SimpleMemory*
-SimpleMemoryParams::create()
+SimpleMemoryParams::create() const
 {
-    return new SimpleMemory(this);
+    return new SimpleMemory(*this);
 }
index e80c88fd40a2809e517b3973a90ba5a94faffaa4..22b23239aabb6c4ad10de545359a97bbb920a743 100644 (file)
@@ -173,7 +173,7 @@ class SimpleMemory : public AbstractMemory
 
   public:
 
-    SimpleMemory(const SimpleMemoryParams *p);
+    SimpleMemory(const SimpleMemoryParams &p);
 
     DrainState drain() override;
 
index f4b4dfaaac586de8d9df229f4b7018a9b010816b..371b40e1bb6a0ee907dacada255a252a010de205 100644 (file)
@@ -307,7 +307,7 @@ class $c_ident : public AbstractController
 {
   public:
     typedef ${c_ident}Params Params;
-    $c_ident(const Params *p);
+    $c_ident(const Params &p);
     static int getNumControllers();
     void init();
 
@@ -540,9 +540,9 @@ using namespace std;
 
         code('''
 $c_ident *
-${c_ident}Params::create()
+${c_ident}Params::create() const
 {
-    return new $c_ident(this);
+    return new $c_ident(*this);
 }
 
 int $c_ident::m_num_controllers = 0;
@@ -559,13 +559,13 @@ stringstream ${ident}_transitionComment;
 #endif
 
 /** \\brief constructor */
-$c_ident::$c_ident(const Params *p)
+$c_ident::$c_ident(const Params &p)
     : AbstractController(p)
 {
     m_machineID.type = MachineType_${ident};
     m_machineID.num = m_version;
     m_num_controllers++;
-    p->ruby_system->registerAbstractController(this);
+    p.ruby_system->registerAbstractController(this);
 
     m_in_ports = $num_in_ports;
 ''')
@@ -578,9 +578,9 @@ $c_ident::$c_ident(const Params *p)
         #
         for param in self.config_parameters:
             if param.pointer:
-                code('m_${{param.ident}}_ptr = p->${{param.ident}};')
+                code('m_${{param.ident}}_ptr = p.${{param.ident}};')
             else:
-                code('m_${{param.ident}} = p->${{param.ident}};')
+                code('m_${{param.ident}} = p.${{param.ident}};')
 
             if re.compile("sequencer").search(param.ident) or \
                    param.type_ast.type.c_ident == "GPUCoalescer" or \
@@ -826,7 +826,7 @@ $c_ident::regStats()
              event < ${ident}_Event_NUM; ++event) {
             Stats::Vector *t = new Stats::Vector();
             t->init(m_num_controllers);
-            t->name(params()->ruby_system->name() + ".${c_ident}." +
+            t->name(params().ruby_system->name() + ".${c_ident}." +
                 ${ident}_Event_to_string(event));
             t->flags(Stats::pdf | Stats::total | Stats::oneline |
                      Stats::nozero);
@@ -844,7 +844,7 @@ $c_ident::regStats()
 
                 Stats::Vector *t = new Stats::Vector();
                 t->init(m_num_controllers);
-                t->name(params()->ruby_system->name() + ".${c_ident}." +
+                t->name(params().ruby_system->name() + ".${c_ident}." +
                         ${ident}_State_to_string(state) +
                         "." + ${ident}_Event_to_string(event));
 
@@ -892,7 +892,7 @@ $c_ident::collateStats()
     for (${ident}_Event event = ${ident}_Event_FIRST;
          event < ${ident}_Event_NUM; ++event) {
         for (unsigned int i = 0; i < m_num_controllers; ++i) {
-            RubySystem *rs = params()->ruby_system;
+            RubySystem *rs = params().ruby_system;
             std::map<uint32_t, AbstractController *>::iterator it =
                      rs->m_abstract_controls[MachineType_${ident}].find(i);
             assert(it != rs->m_abstract_controls[MachineType_${ident}].end());
@@ -908,7 +908,7 @@ $c_ident::collateStats()
              event < ${ident}_Event_NUM; ++event) {
 
             for (unsigned int i = 0; i < m_num_controllers; ++i) {
-                RubySystem *rs = params()->ruby_system;
+                RubySystem *rs = params().ruby_system;
                 std::map<uint32_t, AbstractController *>::iterator it =
                          rs->m_abstract_controls[MachineType_${ident}].find(i);
                 assert(it != rs->m_abstract_controls[MachineType_${ident}].end());
index d1a62dc2bdf5bb6ef1d850a6f168b42eb5619d84..7fa1f4e9997cf632625cb389448a7bfbf21f3395 100644 (file)
@@ -422,7 +422,7 @@ SnoopFilter::regStats()
 }
 
 SnoopFilter *
-SnoopFilterParams::create()
+SnoopFilterParams::create() const
 {
-    return new SnoopFilter(this);
+    return new SnoopFilter(*this);
 }
index 6a38325590ad466217e7b9b8de27994f878043cd..815049435d4fe74db9549e89e27169df8139865a 100644 (file)
@@ -91,10 +91,10 @@ class SnoopFilter : public SimObject {
 
     typedef std::vector<QueuedResponsePort*> SnoopList;
 
-    SnoopFilter (const SnoopFilterParams *p) :
+    SnoopFilter (const SnoopFilterParams &p) :
         SimObject(p), reqLookupResult(cachedLocations.end()),
-        linesize(p->system->cacheLineSize()), lookupLatency(p->lookup_latency),
-        maxEntryCount(p->max_capacity / p->system->cacheLineSize())
+        linesize(p.system->cacheLineSize()), lookupLatency(p.lookup_latency),
+        maxEntryCount(p.max_capacity / p.system->cacheLineSize())
     {
     }
 
index f9544f8a67a6fb9c6a4ff3cbd05194d2ff9482e6..49ee8ac548fa183c1994a2f4463eff33973aca31 100644 (file)
 #include "debug/Drain.hh"
 #include "debug/XBar.hh"
 
-BaseXBar::BaseXBar(const BaseXBarParams *p)
+BaseXBar::BaseXBar(const BaseXBarParams &p)
     : ClockedObject(p),
-      frontendLatency(p->frontend_latency),
-      forwardLatency(p->forward_latency),
-      responseLatency(p->response_latency),
-      headerLatency(p->header_latency),
-      width(p->width),
-      gotAddrRanges(p->port_default_connection_count +
-                          p->port_mem_side_ports_connection_count, false),
+      frontendLatency(p.frontend_latency),
+      forwardLatency(p.forward_latency),
+      responseLatency(p.response_latency),
+      headerLatency(p.header_latency),
+      width(p.width),
+      gotAddrRanges(p.port_default_connection_count +
+                          p.port_mem_side_ports_connection_count, false),
       gotAllAddrRanges(false), defaultPortID(InvalidPortID),
-      useDefaultRange(p->use_default_range),
+      useDefaultRange(p.use_default_range),
 
       transDist(this, "trans_dist", "Transaction distribution"),
       pktCount(this, "pkt_count",
index cf067423e7eed7bfe8a1c3b448324224e1826a4a..88be87f59c9dd8a82c8985a98573a709bff4f9eb 100644 (file)
@@ -385,7 +385,7 @@ class BaseXBar : public ClockedObject
        addresses not handled by another port to default device. */
     const bool useDefaultRange;
 
-    BaseXBar(const BaseXBarParams *p);
+    BaseXBar(const BaseXBarParams &p);
 
     /**
      * Stats for transaction distribution and data passing through the
index 9c9a9ed0fe2b9a18a59648076e0b9b82248c018f..458942103ce430407aa27958fcee7e6c4461e861 100644 (file)
@@ -936,7 +936,7 @@ module_init(py::module &m_internal)
         code("{")
         if not hasattr(cls, 'abstract') or not cls.abstract:
             if 'type' in cls.__dict__:
-                code("    ${{cls.cxx_type}} create();")
+                code("    ${{cls.cxx_type}} create() const;")
 
         code.indent()
         if cls == SimObject:
index a61934b3add804e07bc8934c27fd1ceaf6b6cba1..e591b8c1d9d0ccd1e03e23ceaf2d1d0bff4b1a47 100644 (file)
@@ -58,7 +58,7 @@ ClockDomain::ClockDomainStats::ClockDomainStats(ClockDomain &cd)
     clock.scalar(cd._clockPeriod);
 }
 
-ClockDomain::ClockDomain(const Params *p, VoltageDomain *voltage_domain)
+ClockDomain::ClockDomain(const Params &p, VoltageDomain *voltage_domain)
     : SimObject(p),
       _clockPeriod(0),
       _voltageDomain(voltage_domain),
@@ -72,13 +72,13 @@ ClockDomain::voltage() const
     return _voltageDomain->voltage();
 }
 
-SrcClockDomain::SrcClockDomain(const Params *p) :
-    ClockDomain(p, p->voltage_domain),
-    freqOpPoints(p->clock),
-    _domainID(p->domain_id),
-    _perfLevel(p->init_perf_level)
+SrcClockDomain::SrcClockDomain(const Params &p) :
+    ClockDomain(p, p.voltage_domain),
+    freqOpPoints(p.clock),
+    _domainID(p.domain_id),
+    _perfLevel(p.init_perf_level)
 {
-    VoltageDomain *vdom = p->voltage_domain;
+    VoltageDomain *vdom = p.voltage_domain;
 
     fatal_if(freqOpPoints.empty(), "DVFS: Empty set of frequencies for "\
              "domain %d %s\n", _domainID, name());
@@ -182,15 +182,15 @@ SrcClockDomain::startup()
 }
 
 SrcClockDomain *
-SrcClockDomainParams::create()
+SrcClockDomainParams::create() const
 {
-    return new SrcClockDomain(this);
+    return new SrcClockDomain(*this);
 }
 
-DerivedClockDomain::DerivedClockDomain(const Params *p) :
-    ClockDomain(p, p->clk_domain->voltageDomain()),
-    parent(*p->clk_domain),
-    clockDivider(p->clk_divider)
+DerivedClockDomain::DerivedClockDomain(const Params &p) :
+    ClockDomain(p, p.clk_domain->voltageDomain()),
+    parent(*p.clk_domain),
+    clockDivider(p.clk_divider)
 {
     // Ensure that clock divider setting works as frequency divider and never
     // work as frequency multiplier
@@ -229,7 +229,7 @@ DerivedClockDomain::updateClockPeriod()
 }
 
 DerivedClockDomain *
-DerivedClockDomainParams::create()
+DerivedClockDomainParams::create() const
 {
-    return new DerivedClockDomain(this);
+    return new DerivedClockDomain(*this);
 }
index 05d1a216df9a79778b6fa09ca947f739cb9876f4..9296c1ada6e9a2d2befe459b3566e37a40930443 100644 (file)
@@ -95,7 +95,7 @@ class ClockDomain : public SimObject
   public:
 
     typedef ClockDomainParams Params;
-    ClockDomain(const Params *p, VoltageDomain *voltage_domain);
+    ClockDomain(const Params &p, VoltageDomain *voltage_domain);
 
     /**
      * Get the clock period.
@@ -166,7 +166,7 @@ class SrcClockDomain : public ClockDomain
   public:
 
     typedef SrcClockDomainParams Params;
-    SrcClockDomain(const Params *p);
+    SrcClockDomain(const Params &p);
 
     /**
      * Set new clock value
@@ -275,7 +275,7 @@ class DerivedClockDomain: public ClockDomain
   public:
 
     typedef DerivedClockDomainParams Params;
-    DerivedClockDomain(const Params *p);
+    DerivedClockDomain(const Params &p);
 
     /**
      * Called by the parent clock domain to propagate changes. This
index e7aaca7db9a878ad1fecb55f32343d1bc7177a76..e40751992924135ed684270fd87507850acd03db 100644 (file)
 #include "base/logging.hh"
 #include "sim/power/power_model.hh"
 
-ClockedObject::ClockedObject(const ClockedObjectParams *p) :
-    SimObject(p), Clocked(*p->clk_domain), powerState(p->power_state)
+ClockedObject::ClockedObject(const ClockedObjectParams &p) :
+    SimObject(p), Clocked(*p.clk_domain), powerState(p.power_state)
 {
     // Register the power_model with the object
     // Slightly counter-intuitively, power models need to to register with the
     // clocked object and not the power stated object because the power model
     // needs information from the clock domain, which is an attribute of the
     // clocked object.
-    for (auto & power_model: p->power_model)
+    for (auto & power_model: p.power_model)
         power_model->setClockedObject(this);
 }
 
index 4f94df80b9c64f9b6e95424c39cd171c379482f9..14cd4053e98e8d8b88ef9131aa60dd7e27efd531 100644 (file)
@@ -231,14 +231,14 @@ class Clocked
 class ClockedObject : public SimObject, public Clocked
 {
   public:
-    ClockedObject(const ClockedObjectParams *p);
+    ClockedObject(const ClockedObjectParams &p);
 
     /** Parameters of ClockedObject */
     typedef ClockedObjectParams Params;
-    const Params *
+    const Params &
     params() const
     {
-        return reinterpret_cast<const Params*>(_params);
+        return reinterpret_cast<const Params&>(_params);
     }
 
     void serialize(CheckpointOut &cp) const override;
index 9591d8f4196ebb1e16698abf6c761ef083ece5fe..224acde0329c72ae6bde38457b1e56e4265553bf 100644 (file)
 // DVFSHandler methods implementation
 //
 
-DVFSHandler::DVFSHandler(const Params *p)
+DVFSHandler::DVFSHandler(const Params &p)
     : SimObject(p),
-      sysClkDomain(p->sys_clk_domain),
-      enableHandler(p->enable),
-      _transLatency(p->transition_latency)
+      sysClkDomain(p.sys_clk_domain),
+      enableHandler(p.enable),
+      _transLatency(p.transition_latency)
 {
     // Check supplied list of domains for sanity and add them to the
     // domain ID -> domain* hash
-    for (auto dit = p->domains.begin(); dit != p->domains.end(); ++dit) {
+    for (auto dit = p.domains.begin(); dit != p.domains.end(); ++dit) {
         SrcClockDomain *d = *dit;
         DomainID domain_id = d->domainID();
 
@@ -253,7 +253,7 @@ DVFSHandler::unserialize(CheckpointIn &cp)
 }
 
 DVFSHandler*
-DVFSHandlerParams::create()
+DVFSHandlerParams::create() const
 {
-    return new DVFSHandler(this);
+    return new DVFSHandler(*this);
 }
index 4bb8d8335402eb6849f187c1ccb732e26d034f98..da04fc5c974f5146451889b93edef2e2538e7dd8 100644 (file)
@@ -68,7 +68,7 @@ class DVFSHandler : public SimObject
 {
   public:
     typedef DVFSHandlerParams Params;
-    DVFSHandler(const Params *p);
+    DVFSHandler(const Params &p);
 
     typedef SrcClockDomain::DomainID DomainID;
     typedef SrcClockDomain::PerfLevel PerfLevel;
index 9921d15b833b26e5f9afa2c1238078bbe2ef014b..69d25ef619fe3c6b2c0ab97d538b3476ae1bf6e0 100644 (file)
@@ -58,8 +58,8 @@ class EmulatedDriver : public SimObject
     const std::string &filename;
 
   public:
-    EmulatedDriver(EmulatedDriverParams *p)
-        : SimObject(p), filename(p->filename)
+    EmulatedDriver(const EmulatedDriverParams &p)
+        : SimObject(p), filename(p.filename)
     {
     }
 
index 284e04a53174788f14ef59bbd9ed1bc5113abd3e..22e24891032bcf15bca59b1f45a355c856480430 100644 (file)
@@ -257,7 +257,7 @@ class InstRecord
 class InstTracer : public SimObject
 {
   public:
-    InstTracer(const Params *p) : SimObject(p)
+    InstTracer(const Params &p) : SimObject(p)
     {}
 
     virtual ~InstTracer()
index d144872b1d4ed5acc11787b884c902d4cc1628a1..9791dfc22be5cdf86ec43e783e0f373a41a53626 100644 (file)
@@ -31,7 +31,7 @@
 #include "params/KernelWorkload.hh"
 #include "sim/system.hh"
 
-KernelWorkload::KernelWorkload(const Params &p) : Workload(&p), _params(p),
+KernelWorkload::KernelWorkload(const Params &p) : Workload(p), _params(p),
     _loadAddrMask(p.load_addr_mask), _loadAddrOffset(p.load_addr_offset),
     commandLine(p.command_line)
 {
@@ -137,7 +137,7 @@ KernelWorkload::unserialize(CheckpointIn &cp)
 }
 
 KernelWorkload *
-KernelWorkloadParams::create()
+KernelWorkloadParams::create() const
 {
     return new KernelWorkload(*this);
 }
index 71131f58f3d1c4309235acef13743d4e499b6f3d..2f48034be9d599754391fba9556c8987c64896ee 100644 (file)
@@ -45,8 +45,8 @@
 #include "sim/power/thermal_model.hh"
 #include "sim/sim_object.hh"
 
-MathExprPowerModel::MathExprPowerModel(const Params *p)
-    : PowerModelState(p), dyn_expr(p->dyn), st_expr(p->st)
+MathExprPowerModel::MathExprPowerModel(const Params &p)
+    : PowerModelState(p), dyn_expr(p.dyn), st_expr(p.st)
 {
 }
 
@@ -115,7 +115,7 @@ MathExprPowerModel::regStats()
 }
 
 MathExprPowerModel*
-MathExprPowerModelParams::create()
+MathExprPowerModelParams::create() const
 {
-    return new MathExprPowerModel(this);
+    return new MathExprPowerModel(*this);
 }
index 37ea1901de05a37c943be224ce76769c031a16a7..deb425978a92d2e85ee8ee60966a87662ec01354 100644 (file)
@@ -57,7 +57,7 @@ class MathExprPowerModel : public PowerModelState
   public:
 
     typedef MathExprPowerModelParams Params;
-    MathExprPowerModel(const Params *p);
+    MathExprPowerModel(const Params &p);
 
     /**
      * Get the dynamic power consumption.
index ec1b62d1e3f8cb6f2b5166005b6357359ad1a9bb..fa179e088bf4d96cd4f9cf4fde722c01f6de12c4 100644 (file)
 #include "sim/clocked_object.hh"
 #include "sim/sub_system.hh"
 
-PowerModelState::PowerModelState(const Params *p)
+PowerModelState::PowerModelState(const Params &p)
     : SimObject(p), _temp(0), clocked_object(NULL)
 {
 }
 
-PowerModel::PowerModel(const Params *p)
-    : SimObject(p), states_pm(p->pm), subsystem(p->subsystem),
-      clocked_object(NULL), power_model_type(p->pm_type)
+PowerModel::PowerModel(const Params &p)
+    : SimObject(p), states_pm(p.pm), subsystem(p.subsystem),
+      clocked_object(NULL), power_model_type(p.pm_type)
 {
     panic_if(subsystem == NULL,
              "Subsystem is NULL! This is not acceptable for a PowerModel!\n");
@@ -58,7 +58,7 @@ PowerModel::PowerModel(const Params *p)
     // The temperature passed here will be overwritten, if there is
     // a thermal model present
     for (auto & pms: states_pm){
-        pms->setTemperature(p->ambient_temp);
+        pms->setTemperature(p.ambient_temp);
     }
 
 }
@@ -88,9 +88,9 @@ PowerModel::regProbePoints()
 }
 
 PowerModel*
-PowerModelParams::create()
+PowerModelParams::create() const
 {
-    return new PowerModel(this);
+    return new PowerModel(*this);
 }
 
 double
index 918b2d2b37ffb12ea8cbbf815a05e33fbba560b5..c8625ac96c3879429a9a3129de60721fa20cbeea 100644 (file)
@@ -56,7 +56,7 @@ class PowerModelState : public SimObject
   public:
 
     typedef PowerModelStateParams Params;
-    PowerModelState(const Params *p);
+    PowerModelState(const Params &p);
 
     /**
      * Get the dynamic power consumption.
@@ -88,13 +88,13 @@ class PowerModelState : public SimObject
 
         dynamicPower
           .method(this, &PowerModelState::getDynamicPower)
-          .name(params()->name + ".dynamic_power")
+          .name(params().name + ".dynamic_power")
           .desc("Dynamic power for this object (Watts)")
         ;
 
         staticPower
           .method(this, &PowerModelState::getStaticPower)
-          .name(params()->name + ".static_power")
+          .name(params().name + ".static_power")
           .desc("Static power for this object (Watts)")
         ;
     }
@@ -120,7 +120,7 @@ class PowerModel : public SimObject
   public:
 
     typedef PowerModelParams Params;
-    PowerModel(const Params *p);
+    PowerModel(const Params &p);
 
     /**
      * Get the dynamic power consumption.
@@ -141,13 +141,13 @@ class PowerModel : public SimObject
 
         dynamicPower
           .method(this, &PowerModel::getDynamicPower)
-          .name(params()->name + ".dynamic_power")
+          .name(params().name + ".dynamic_power")
           .desc("Dynamic power for this power state")
         ;
 
         staticPower
           .method(this, &PowerModel::getStaticPower)
-          .name(params()->name + ".static_power")
+          .name(params().name + ".static_power")
           .desc("Static power for this power state")
         ;
     }
index 5b7263a7b601b40733af1db35885bfc07640c96b..11a9ca969025944c0c99afc54b1dd7418e52c77b 100644 (file)
@@ -48,8 +48,8 @@
 #include "sim/probe/probe.hh"
 #include "sim/sub_system.hh"
 
-ThermalDomain::ThermalDomain(const Params *p)
-    : SimObject(p), _initTemperature(p->initial_temperature),
+ThermalDomain::ThermalDomain(const Params &p)
+    : SimObject(p), _initTemperature(p.initial_temperature),
     node(NULL), subsystem(NULL)
 {
 }
@@ -77,7 +77,7 @@ ThermalDomain::regStats()
 
     currentTemp
         .method(this, &ThermalDomain::currentTemperature)
-        .name(params()->name + ".temp")
+        .name(params().name + ".temp")
         .desc("Temperature in centigrate degrees")
         ;
 }
@@ -89,9 +89,9 @@ ThermalDomain::emitUpdate()
 }
 
 ThermalDomain *
-ThermalDomainParams::create()
+ThermalDomainParams::create() const
 {
-    return new ThermalDomain(this);
+    return new ThermalDomain(*this);
 }
 
 void
index 31996d95f9492c5f3932f06ff503c8635a9d506a..323ba2b605040f4017b193c9d34e953e5320b985 100644 (file)
@@ -59,7 +59,7 @@ class ThermalDomain : public SimObject, public ThermalEntity
   public:
 
     typedef ThermalDomainParams Params;
-    ThermalDomain(const Params *p);
+    ThermalDomain(const Params &p);
 
     /**
      * Get the startup temperature.
index 98af021859feb8cb272ca273b935c09fd486c40a..c6a50ad4767520da151c00205793770f646ef668 100644 (file)
 /**
  * ThermalReference
  */
-ThermalReference::ThermalReference(const Params *p)
-    : SimObject(p), _temperature(p->temperature), node(NULL)
+ThermalReference::ThermalReference(const Params &p)
+    : SimObject(p), _temperature(p.temperature), node(NULL)
 {
 }
 
 ThermalReference *
-ThermalReferenceParams::create()
+ThermalReferenceParams::create() const
 {
-    return new ThermalReference(this);
+    return new ThermalReference(*this);
 }
 
 void
@@ -82,15 +82,15 @@ ThermalReference::getEquation(ThermalNode * n, unsigned nnodes,
 /**
  * ThermalResistor
  */
-ThermalResistor::ThermalResistor(const Params *p)
-    : SimObject(p), _resistance(p->resistance), node1(NULL), node2(NULL)
+ThermalResistor::ThermalResistor(const Params &p)
+    : SimObject(p), _resistance(p.resistance), node1(NULL), node2(NULL)
 {
 }
 
 ThermalResistor *
-ThermalResistorParams::create()
+ThermalResistorParams::create() const
 {
-    return new ThermalResistor(this);
+    return new ThermalResistor(*this);
 }
 
 void
@@ -135,15 +135,15 @@ ThermalResistor::getEquation(ThermalNode * n, unsigned nnodes,
 /**
  * ThermalCapacitor
  */
-ThermalCapacitor::ThermalCapacitor(const Params *p)
-    : SimObject(p), _capacitance(p->capacitance), node1(NULL), node2(NULL)
+ThermalCapacitor::ThermalCapacitor(const Params &p)
+    : SimObject(p), _capacitance(p.capacitance), node1(NULL), node2(NULL)
 {
 }
 
 ThermalCapacitor *
-ThermalCapacitorParams::create()
+ThermalCapacitorParams::create() const
 {
-    return new ThermalCapacitor(this);
+    return new ThermalCapacitor(*this);
 }
 
 void
@@ -191,15 +191,15 @@ ThermalCapacitor::getEquation(ThermalNode * n, unsigned nnodes,
 /**
  * ThermalModel
  */
-ThermalModel::ThermalModel(const Params *p)
-    : ClockedObject(p), stepEvent([this]{ doStep(); }, name()), _step(p->step)
+ThermalModel::ThermalModel(const Params &p)
+    : ClockedObject(p), stepEvent([this]{ doStep(); }, name()), _step(p.step)
 {
 }
 
 ThermalModel *
-ThermalModelParams::create()
+ThermalModelParams::create() const
 {
-    return new ThermalModel(this);
+    return new ThermalModel(*this);
 }
 
 void
index c0408d92926234781e3545194b70df673c818b68..81c1de8f2149086d1b5473462f1e296cd4564e7b 100644 (file)
@@ -60,7 +60,7 @@ class ThermalResistor : public SimObject, public ThermalEntity
 {
   public:
     typedef ThermalResistorParams Params;
-    ThermalResistor(const Params *p);
+    ThermalResistor(const Params &p);
 
     void serialize(CheckpointOut &cp) const override;
     void unserialize(CheckpointIn &cp) override;
@@ -89,7 +89,7 @@ class ThermalCapacitor : public SimObject, public ThermalEntity
 {
   public:
     typedef ThermalCapacitorParams Params;
-    ThermalCapacitor(const Params *p);
+    ThermalCapacitor(const Params &p);
 
     void serialize(CheckpointOut &cp) const override;
     void unserialize(CheckpointIn &cp) override;
@@ -117,9 +117,11 @@ class ThermalReference : public SimObject, public ThermalEntity
 {
   public:
     typedef ThermalReferenceParams Params;
-    ThermalReference(const Params *p);
+    ThermalReference(const Params &p);
 
-    void setNode(ThermalNode * n) {
+    void
+    setNode(ThermalNode *n)
+    {
         node = n;
     }
 
@@ -148,7 +150,7 @@ class ThermalModel : public ClockedObject
 {
   public:
     typedef ThermalModelParams Params;
-    ThermalModel(const Params *p);
+    ThermalModel(const Params &p);
 
     void addDomain(ThermalDomain * d);
     void addReference(ThermalReference * r);
index abd23109a3c1361aeb4264fa028e7e560b794782..d2d05e6194a09d8a6d1188aebe5262aab5f8cb32 100644 (file)
 /**
  * ThermalNode
  */
-ThermalNode::ThermalNode(const ThermalNodeParams *p)
+ThermalNode::ThermalNode(const ThermalNodeParams &p)
     : SimObject(p), id(-1), isref(false), temp(0.0f)
 {
 }
 
 ThermalNode *
-ThermalNodeParams::create()
+ThermalNodeParams::create() const
 {
-    return new ThermalNode(this);
+    return new ThermalNode(*this);
 }
index 5ef602eb1ee632781e7f28645743d1e4fffdae24..68867b39eab72242dec6ea29ead5c933c082ec5b 100644 (file)
@@ -50,7 +50,7 @@ struct ThermalNodeParams;
 class ThermalNode : public SimObject
 {
   public:
-    ThermalNode(const ThermalNodeParams *p);
+    ThermalNode(const ThermalNodeParams &p);
 
     int id;
     bool isref;
index 0434e1eb2f581f0f2a5a61799846f961cfc3e456..c7a6b08993526190317b0a7f682c3401e584991f 100644 (file)
@@ -42,9 +42,9 @@
 #include "base/trace.hh"
 #include "debug/PowerDomain.hh"
 
-PowerDomain::PowerDomain(const PowerDomainParamsp) :
+PowerDomain::PowerDomain(const PowerDomainParams &p) :
     PowerState(p),
-    leaders(p->leaders),
+    leaders(p.leaders),
     pwrStateUpdateEvent(*this),
     stats(*this)
 {
@@ -265,7 +265,7 @@ PowerDomain::PowerDomainStats::regStats()
 }
 
 PowerDomain*
-PowerDomainParams::create()
+PowerDomainParams::create() const
 {
-    return new PowerDomain(this);
+    return new PowerDomain(*this);
 }
index c5294a6e29fbb550b7273844136ed9d63bde38de..b07b6de1396ff10ffb386cc5214552ca304ffcb2 100644 (file)
@@ -56,7 +56,7 @@
 class PowerDomain : public PowerState
 {
   public:
-    PowerDomain(const PowerDomainParamsp);
+    PowerDomain(const PowerDomainParams &p);
     typedef PowerDomainParams Params;
     ~PowerDomain() override {};
 
index cb748730017610b2db0d8be9ca7299e44ea7fc8b..37ab87fac85168b1210b750c6f420c76bd1150e4 100644 (file)
 #include "debug/PowerDomain.hh"
 #include "sim/power_domain.hh"
 
-PowerState::PowerState(const PowerStateParams *p) :
-    SimObject(p), _currState(p->default_state),
-    possibleStates(p->possible_states.begin(),
-                   p->possible_states.end()),
+PowerState::PowerState(const PowerStateParams &p) :
+    SimObject(p), _currState(p.default_state),
+    possibleStates(p.possible_states.begin(),
+                   p.possible_states.end()),
     stats(*this)
 {
-    for (auto &pm: p->leaders) {
+    for (auto &pm: p.leaders) {
         // Register this object as a follower. This object is
         // dependent on pm for power state transitions
         pm->addFollower(this);
@@ -235,16 +235,15 @@ PowerState::PowerStateStats::regStats()
 
     using namespace Stats;
 
-    const PowerStateParams *p = powerState.params();
+    const PowerStateParams &p = powerState.params();
 
     numTransitions.flags(nozero);
     numPwrMatchStateTransitions.flags(nozero);
 
     // Each sample is time in ticks
-    unsigned num_bins = std::max(p->clk_gate_bins, 10U);
+    unsigned num_bins = std::max(p.clk_gate_bins, 10U);
     ticksClkGated
-        .init(p->clk_gate_min, p->clk_gate_max,
-              (p->clk_gate_max / num_bins))
+        .init(p.clk_gate_min, p.clk_gate_max, (p.clk_gate_max / num_bins))
         .flags(pdf | nozero | nonan)
         ;
 
@@ -276,7 +275,7 @@ PowerState::PowerStateStats::preDumpStats()
 }
 
 PowerState*
-PowerStateParams::create()
+PowerStateParams::create() const
 {
-    return new PowerState(this);
+    return new PowerState(*this);
 }
index 13e36e5854e4f1cbf2da83c996250a8af7780898..fe869ff716af4f41999dac459a9a48a8ac9de5d3 100644 (file)
@@ -61,13 +61,14 @@ class PowerDomain;
 class PowerState : public SimObject
 {
   public:
-    PowerState(const PowerStateParams *p);
+    PowerState(const PowerStateParams &p);
 
     /** Parameters of PowerState object */
     typedef PowerStateParams Params;
-    const Params* params() const
+    const Params &
+    params() const
     {
-        return reinterpret_cast<const Params*>(_params);
+        return reinterpret_cast<const Params &>(_params);
     }
 
     virtual void addFollower(PowerState* pwr_obj) {};
index 097b93e46adeb16e25a906bfd204c1fb8c3cf431..27067adabb0ab9e56b5fc2a519d664611dcce73c 100644 (file)
@@ -48,9 +48,10 @@ ProbePoint::ProbePoint(ProbeManager *manager, const std::string& _name)
     }
 }
 
-ProbeListenerObject::ProbeListenerObject(const ProbeListenerObjectParams *params)
+ProbeListenerObject::ProbeListenerObject(
+        const ProbeListenerObjectParams &params)
     : SimObject(params),
-      manager(params->manager->getProbeManager())
+      manager(params.manager->getProbeManager())
 {
 }
 
@@ -74,9 +75,9 @@ ProbeListener::~ProbeListener()
 }
 
 ProbeListenerObject*
-ProbeListenerObjectParams::create()
+ProbeListenerObjectParams::create() const
 {
-    return new ProbeListenerObject(this);
+    return new ProbeListenerObject(*this);
 }
 
 bool
index bc73eb01b3c99a6e4003559c7bb0b344e8760de8..97edf0bd752a41e6d067524fbedc84ae26bd7580 100644 (file)
@@ -102,7 +102,7 @@ class ProbeListenerObject : public SimObject
     std::vector<ProbeListener *> listeners;
 
   public:
-    ProbeListenerObject(const ProbeListenerObjectParams *params);
+    ProbeListenerObject(const ProbeListenerObjectParams &params);
     virtual ~ProbeListenerObject();
     ProbeManager* getProbeManager() { return manager; }
 };
index 9cf52aa2362dceb2e29e8eb4103f98ad70b9b80b..3968adbd39a7e80050cb5f2d85a09d55ee2431a8 100644 (file)
@@ -90,7 +90,8 @@ Process::Loader::Loader()
 }
 
 Process *
-Process::tryLoaders(ProcessParams *params, ::Loader::ObjectFile *obj_file)
+Process::tryLoaders(const ProcessParams &params,
+                    ::Loader::ObjectFile *obj_file)
 {
     for (auto &loader: process_loaders()) {
         Process *p = loader->load(params, obj_file);
@@ -102,31 +103,31 @@ Process::tryLoaders(ProcessParams *params, ::Loader::ObjectFile *obj_file)
 }
 
 static std::string
-normalize(std::string& directory)
+normalize(const std::string& directory)
 {
     if (directory.back() != '/')
-        directory += '/';
+        return directory + '/';
     return directory;
 }
 
-Process::Process(ProcessParams *params, EmulationPageTable *pTable,
+Process::Process(const ProcessParams &params, EmulationPageTable *pTable,
                  ::Loader::ObjectFile *obj_file)
-    : SimObject(params), system(params->system),
-      useArchPT(params->useArchPT),
-      kvmInSE(params->kvmInSE),
+    : SimObject(params), system(params.system),
+      useArchPT(params.useArchPT),
+      kvmInSE(params.kvmInSE),
       useForClone(false),
       pTable(pTable),
       objFile(obj_file),
-      argv(params->cmd), envp(params->env),
-      executable(params->executable),
-      tgtCwd(normalize(params->cwd)),
+      argv(params.cmd), envp(params.env),
+      executable(params.executable == "" ? params.cmd[0] : params.executable),
+      tgtCwd(normalize(params.cwd)),
       hostCwd(checkPathRedirect(tgtCwd)),
-      release(params->release),
-      _uid(params->uid), _euid(params->euid),
-      _gid(params->gid), _egid(params->egid),
-      _pid(params->pid), _ppid(params->ppid),
-      _pgid(params->pgid), drivers(params->drivers),
-      fds(make_shared<FDArray>(params->input, params->output, params->errout)),
+      release(params.release),
+      _uid(params.uid), _euid(params.euid),
+      _gid(params.gid), _egid(params.egid),
+      _pid(params.pid), _ppid(params.ppid),
+      _pgid(params.pgid), drivers(params.drivers),
+      fds(make_shared<FDArray>(params.input, params.output, params.errout)),
       childClearTID(0)
 {
     if (_pid >= System::maxPID)
@@ -148,7 +149,7 @@ Process::Process(ProcessParams *params, EmulationPageTable *pTable,
      * with a new, equivalent value. If CLONE_THREAD is specified, patch
      * the tgid value with the old process' value.
      */
-    _tgid = params->pid;
+    _tgid = params.pid;
 
     exitGroup = new bool();
     sigchld = new bool();
@@ -508,18 +509,16 @@ Process::absolutePath(const std::string &filename, bool host_filesystem)
 }
 
 Process *
-ProcessParams::create()
+ProcessParams::create() const
 {
     // If not specified, set the executable parameter equal to the
     // simulated system's zeroth command line parameter
-    if (executable == "") {
-        executable = cmd[0];
-    }
+    const std::string &exec = (executable == "") ? cmd[0] : executable;
 
-    auto *obj_file = Loader::createObjectFile(executable);
-    fatal_if(!obj_file, "Cannot load object file %s.", executable);
+    auto *obj_file = Loader::createObjectFile(exec);
+    fatal_if(!obj_file, "Cannot load object file %s.", exec);
 
-    Process *process = Process::tryLoaders(this, obj_file);
+    Process *process = Process::tryLoaders(*this, obj_file);
     fatal_if(!process, "Unknown error creating process object.");
 
     return process;
index 449e0a5aa4add54fb642c333cbeb7e1c577eec8a..2234cb03e66aee9b3c031e5b3d66022023d7f2d4 100644 (file)
@@ -65,7 +65,7 @@ class ThreadContext;
 class Process : public SimObject
 {
   public:
-    Process(ProcessParams *params, EmulationPageTable *pTable,
+    Process(const ProcessParams &params, EmulationPageTable *pTable,
             ::Loader::ObjectFile *obj_file);
 
     void serialize(CheckpointOut &cp) const override;
@@ -201,13 +201,13 @@ class Process : public SimObject
          * error like file IO errors, etc., those should fail non-silently
          * with a panic or fail as normal.
          */
-        virtual Process *load(ProcessParams *params,
+        virtual Process *load(const ProcessParams &params,
                               ::Loader::ObjectFile *obj_file) = 0;
     };
 
     // Try all the Loader instance's "load" methods one by one until one is
     // successful. If none are, complain and fail.
-    static Process *tryLoaders(ProcessParams *params,
+    static Process *tryLoaders(const ProcessParams &params,
                                ::Loader::ObjectFile *obj_file);
 
     ::Loader::ObjectFile *objFile;
index aacca73267be01cff438b74152480e3a286cfa4a..a50937438e8c9f641607fdac333329884da97714 100644 (file)
@@ -214,7 +214,7 @@ loadsymbol(ThreadContext *tc)
     if (!FullSystem)
         panicFsOnlyPseudoInst("loadsymbol");
 
-    const string &filename = tc->getCpuPtr()->system->params()->symbolfile;
+    const string &filename = tc->getCpuPtr()->system->params().symbolfile;
     if (filename.empty()) {
         return;
     }
@@ -318,7 +318,7 @@ void
 resetstats(ThreadContext *tc, Tick delay, Tick period)
 {
     DPRINTF(PseudoInst, "PseudoInst::resetstats(%i, %i)\n", delay, period);
-    if (!tc->getCpuPtr()->params()->do_statistics_insts)
+    if (!tc->getCpuPtr()->params().do_statistics_insts)
         return;
 
 
@@ -332,7 +332,7 @@ void
 dumpstats(ThreadContext *tc, Tick delay, Tick period)
 {
     DPRINTF(PseudoInst, "PseudoInst::dumpstats(%i, %i)\n", delay, period);
-    if (!tc->getCpuPtr()->params()->do_statistics_insts)
+    if (!tc->getCpuPtr()->params().do_statistics_insts)
         return;
 
 
@@ -346,7 +346,7 @@ void
 dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
 {
     DPRINTF(PseudoInst, "PseudoInst::dumpresetstats(%i, %i)\n", delay, period);
-    if (!tc->getCpuPtr()->params()->do_statistics_insts)
+    if (!tc->getCpuPtr()->params().do_statistics_insts)
         return;
 
 
@@ -360,7 +360,7 @@ void
 m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
 {
     DPRINTF(PseudoInst, "PseudoInst::m5checkpoint(%i, %i)\n", delay, period);
-    if (!tc->getCpuPtr()->params()->do_checkpoint_insts)
+    if (!tc->getCpuPtr()->params().do_checkpoint_insts)
         return;
 
     if (DistIface::readyToCkpt(delay, period)) {
@@ -380,7 +380,7 @@ readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
         return 0;
     }
 
-    const string &file = tc->getSystemPtr()->params()->readfile;
+    const string &file = tc->getSystemPtr()->params().readfile;
     if (file.empty()) {
         return ULL(0);
     }
@@ -499,9 +499,9 @@ workbegin(ThreadContext *tc, uint64_t workid, uint64_t threadid)
 {
     DPRINTF(PseudoInst, "PseudoInst::workbegin(%i, %i)\n", workid, threadid);
     System *sys = tc->getSystemPtr();
-    const System::Params *params = sys->params();
+    const System::Params &params = sys->params();
 
-    if (params->exit_on_work_items) {
+    if (params.exit_on_work_items) {
         exitSimLoop("workbegin", static_cast<int>(workid));
         return;
     }
@@ -515,20 +515,20 @@ workbegin(ThreadContext *tc, uint64_t workid, uint64_t threadid)
     // If specified, determine if this is the specific work item the user
     // identified
     //
-    if (params->work_item_id == -1 || params->work_item_id == workid) {
+    if (params.work_item_id == -1 || params.work_item_id == workid) {
 
         uint64_t systemWorkBeginCount = sys->incWorkItemsBegin();
         int cpuId = tc->getCpuPtr()->cpuId();
 
-        if (params->work_cpus_ckpt_count != 0 &&
-            sys->markWorkItem(cpuId) >= params->work_cpus_ckpt_count) {
+        if (params.work_cpus_ckpt_count != 0 &&
+            sys->markWorkItem(cpuId) >= params.work_cpus_ckpt_count) {
             //
             // If active cpus equals checkpoint count, create checkpoint
             //
             exitSimLoop("checkpoint");
         }
 
-        if (systemWorkBeginCount == params->work_begin_ckpt_count) {
+        if (systemWorkBeginCount == params.work_begin_ckpt_count) {
             //
             // Note: the string specified as the cause of the exit event must
             // exactly equal "checkpoint" inorder to create a checkpoint
@@ -536,14 +536,14 @@ workbegin(ThreadContext *tc, uint64_t workid, uint64_t threadid)
             exitSimLoop("checkpoint");
         }
 
-        if (systemWorkBeginCount == params->work_begin_exit_count) {
+        if (systemWorkBeginCount == params.work_begin_exit_count) {
             //
             // If a certain number of work items started, exit simulation
             //
             exitSimLoop("work started count reach");
         }
 
-        if (cpuId == params->work_begin_cpu_id_exit) {
+        if (cpuId == params.work_begin_cpu_id_exit) {
             //
             // If work started on the cpu id specified, exit simulation
             //
@@ -562,9 +562,9 @@ workend(ThreadContext *tc, uint64_t workid, uint64_t threadid)
 {
     DPRINTF(PseudoInst, "PseudoInst::workend(%i, %i)\n", workid, threadid);
     System *sys = tc->getSystemPtr();
-    const System::Params *params = sys->params();
+    const System::Params &params = sys->params();
 
-    if (params->exit_on_work_items) {
+    if (params.exit_on_work_items) {
         exitSimLoop("workend", static_cast<int>(workid));
         return;
     }
@@ -577,21 +577,21 @@ workend(ThreadContext *tc, uint64_t workid, uint64_t threadid)
     // If specified, determine if this is the specific work item the user
     // identified
     //
-    if (params->work_item_id == -1 || params->work_item_id == workid) {
+    if (params.work_item_id == -1 || params.work_item_id == workid) {
 
         uint64_t systemWorkEndCount = sys->incWorkItemsEnd();
         int cpuId = tc->getCpuPtr()->cpuId();
 
-        if (params->work_cpus_ckpt_count != 0 &&
-            sys->markWorkItem(cpuId) >= params->work_cpus_ckpt_count) {
+        if (params.work_cpus_ckpt_count != 0 &&
+            sys->markWorkItem(cpuId) >= params.work_cpus_ckpt_count) {
             //
             // If active cpus equals checkpoint count, create checkpoint
             //
             exitSimLoop("checkpoint");
         }
 
-        if (params->work_end_ckpt_count != 0 &&
-            systemWorkEndCount == params->work_end_ckpt_count) {
+        if (params.work_end_ckpt_count != 0 &&
+            systemWorkEndCount == params.work_end_ckpt_count) {
             //
             // If total work items completed equals checkpoint count, create
             // checkpoint
@@ -599,8 +599,8 @@ workend(ThreadContext *tc, uint64_t workid, uint64_t threadid)
             exitSimLoop("checkpoint");
         }
 
-        if (params->work_end_exit_count != 0 &&
-            systemWorkEndCount == params->work_end_exit_count) {
+        if (params.work_end_exit_count != 0 &&
+            systemWorkEndCount == params.work_end_exit_count) {
             //
             // If total work items completed equals exit count, exit simulation
             //
index f911daf823ad0822433772f71b4e7fa973b5b3da..912c4585a8c7f1322842159da8a7de6eda48f42d 100644 (file)
@@ -44,18 +44,18 @@ normalizePath(std::string path)
     return path;
 }
 
-RedirectPath::RedirectPath(const RedirectPathParams *p)
+RedirectPath::RedirectPath(const RedirectPathParams &p)
     : SimObject(p)
 {
-    _appPath = normalizePath(p->app_path);
+    _appPath = normalizePath(p.app_path);
 
-    for (auto hp : p->host_paths) {
+    for (auto hp : p.host_paths) {
         _hostPaths.push_back(normalizePath(hp));
     }
 }
 
 RedirectPath*
-RedirectPathParams::create()
+RedirectPathParams::create() const
 {
-    return new RedirectPath(this);
+    return new RedirectPath(*this);
 }
index b98f54d60e28124b743264fecec81e2d5e8a138f..e7e684b8c34c70f3e61fdbbbcba038c9b1a8d1a3 100644 (file)
@@ -43,7 +43,7 @@
 class RedirectPath : public SimObject
 {
   public:
-    RedirectPath(const RedirectPathParams *p);
+    RedirectPath(const RedirectPathParams &p);
 
     const std::string& appPath() { return _appPath; };
     const std::vector<std::string>& hostPaths() { return _hostPaths; };
index e1c6a7b6ff82cfe18b090a1bee26a259864c1901..d9098a671b0eb88775e9dc6ac2d25174cc3c9ba0 100644 (file)
@@ -163,18 +163,18 @@ Root::timeSyncSpinThreshold(Time newThreshold)
     timeSyncEnable(en);
 }
 
-Root::Root(RootParams *p)
-    : SimObject(p), _enabled(false), _periodTick(p->time_sync_period),
+Root::Root(const RootParams &p)
+    : SimObject(p), _enabled(false), _periodTick(p.time_sync_period),
       syncEvent([this]{ timeSync(); }, name())
 {
-    _period.setTick(p->time_sync_period);
-    _spinThreshold.setTick(p->time_sync_spin_threshold);
+    _period.setTick(p.time_sync_period);
+    _spinThreshold.setTick(p.time_sync_spin_threshold);
 
     assert(_root == NULL);
     _root = this;
     lastTime.setTimer();
 
-    simQuantum = p->sim_quantum;
+    simQuantum = p.sim_quantum;
 
     // Some of the statistics are global and need to be accessed by
     // stat formulas. The most convenient way to implement that is by
@@ -186,7 +186,7 @@ Root::Root(RootParams *p)
 void
 Root::startup()
 {
-    timeSyncEnable(params()->time_sync_enable);
+    timeSyncEnable(params().time_sync_enable);
 }
 
 void
@@ -202,7 +202,7 @@ bool FullSystem;
 unsigned int FullSystemInt;
 
 Root *
-RootParams::create()
+RootParams::create() const
 {
     static bool created = false;
     if (created)
@@ -213,5 +213,5 @@ RootParams::create()
     FullSystem = full_system;
     FullSystemInt = full_system ? 1 : 0;
 
-    return new Root(this);
+    return new Root(*this);
 }
index a88673a7b746909dfac847887fe12f425251ca3b..fa152ff2df74372d0d348776d5d182f5c0211eb8 100644 (file)
@@ -132,13 +132,13 @@ class Root : public SimObject
     void timeSyncSpinThreshold(Time newThreshold);
 
     typedef RootParams Params;
-    const Params *
+    const Params &
     params() const
     {
-        return dynamic_cast<const Params *>(_params);
+        return dynamic_cast<const Params &>(_params);
     }
 
-    Root(Params *p);
+    Root(const Params &p);
 
     /** Schedule the timesync event at startup().
      */
index dccd7ca5c53b97840c20c5adf29a902a52cf434b..2cd383897d40dda6f59abfbe961459446d991407 100644 (file)
@@ -31,7 +31,7 @@
 #include "params/SEWorkload.hh"
 #include "sim/process.hh"
 
-SEWorkload::SEWorkload(const Params &p) : Workload(&p), _params(p)
+SEWorkload::SEWorkload(const Params &p) : Workload(p), _params(p)
 {}
 
 void
@@ -41,7 +41,7 @@ SEWorkload::syscall(ThreadContext *tc)
 }
 
 SEWorkload *
-SEWorkloadParams::create()
+SEWorkloadParams::create() const
 {
     return new SEWorkload(*this);
 }
index 7a4b24e7a943f9e600c391b928e0bbf508c39b9e..58780b2d73c9c413a9a9f37627e96a36c5711166 100644 (file)
@@ -52,8 +52,8 @@ SimObject::SimObjectList SimObject::simObjectList;
 //
 // SimObject constructor: used to maintain static simObjectList
 //
-SimObject::SimObject(const Params *p)
-    : EventManager(getEventQueue(p->eventq_index)),
+SimObject::SimObject(const Params &p)
+    : EventManager(getEventQueue(p.eventq_index)),
       Stats::Group(nullptr),
       _params(p)
 {
index 2b94ca4cf7d9ed4ed3cd3aef49fddefd188a4d4b..ca2e1d5c3d563c177f3e13a4de2634df66eeadee 100644 (file)
@@ -107,7 +107,7 @@ class SimObject : public EventManager, public Serializable, public Drainable,
      *
      * @ingroup api_simobject
      */
-    const SimObjectParams *_params;
+    const SimObjectParams &_params;
 
   public:
     typedef SimObjectParams Params;
@@ -116,12 +116,12 @@ class SimObject : public EventManager, public Serializable, public Drainable,
      *
      * @ingroup api_simobject
      */
-    const Params *params() const { return _params; }
+    const Params &params() const { return _params; }
 
     /**
      * @ingroup api_simobject
      */
-    SimObject(const Params *_params);
+    SimObject(const Params &_params);
 
     virtual ~SimObject();
 
@@ -130,7 +130,7 @@ class SimObject : public EventManager, public Serializable, public Drainable,
     /**
      * @ingroup api_simobject
      */
-    virtual const std::string name() const { return params()->name; }
+    virtual const std::string name() const { return params().name; }
 
     /**
      * init() is called after all C++ SimObjects have been created and
index 294d1b4f53781dbcb18244e236213a53d8234388..2c0b1aa35d7487086eacbb9f8a15cda2ed667e2c 100644 (file)
 #include "sim/power/power_model.hh"
 #include "sim/power/thermal_domain.hh"
 
-SubSystem::SubSystem(const Params *p)
+SubSystem::SubSystem(const Params &p)
  : SimObject(p)
 {
     // Link thermalDomain <-> SubSystem
-    if (p->thermal_domain)
-        p->thermal_domain->setSubSystem(this);
+    if (p.thermal_domain)
+        p.thermal_domain->setSubSystem(this);
 }
 
 double
@@ -68,7 +68,7 @@ SubSystem::getStaticPower() const
 }
 
 SubSystem *
-SubSystemParams::create()
+SubSystemParams::create() const
 {
-    return new SubSystem(this);
+    return new SubSystem(*this);
 }
index 548e735488f532bcfb8cd95acc3e946a1bd0fe14..dfa97612ea56cd85d129e9bced1cf8245c3ea677 100644 (file)
@@ -58,7 +58,7 @@ class SubSystem : public SimObject
 {
   public:
     typedef SubSystemParams Params;
-    SubSystem(const Params *p);
+    SubSystem(const Params &p);
 
     double getDynamicPower() const;
 
index 9011a75a5fa29c91dd5d342be64b794a8c480365..46b92622b35ae9a7616005b3a0f4b49681618611 100644 (file)
@@ -205,32 +205,32 @@ System::Threads::quiesceTick(ContextID id, Tick when)
 
 int System::numSystemsRunning = 0;
 
-System::System(Params *p)
+System::System(const Params &p)
     : SimObject(p), _systemPort("system_port", this),
-      multiThread(p->multi_thread),
+      multiThread(p.multi_thread),
       pagePtr(0),
-      init_param(p->init_param),
-      physProxy(_systemPort, p->cache_line_size),
-      workload(p->workload),
+      init_param(p.init_param),
+      physProxy(_systemPort, p.cache_line_size),
+      workload(p.workload),
 #if USE_KVM
-      kvmVM(p->kvm_vm),
+      kvmVM(p.kvm_vm),
 #else
       kvmVM(nullptr),
 #endif
-      physmem(name() + ".physmem", p->memories, p->mmap_using_noreserve,
-              p->shared_backstore),
-      memoryMode(p->mem_mode),
-      _cacheLineSize(p->cache_line_size),
+      physmem(name() + ".physmem", p.memories, p.mmap_using_noreserve,
+              p.shared_backstore),
+      memoryMode(p.mem_mode),
+      _cacheLineSize(p.cache_line_size),
       workItemsBegin(0),
       workItemsEnd(0),
-      numWorkIds(p->num_work_ids),
-      thermalModel(p->thermal_model),
+      numWorkIds(p.num_work_ids),
+      thermalModel(p.thermal_model),
       _params(p),
-      _m5opRange(p->m5ops_base ?
-                 RangeSize(p->m5ops_base, 0x10000) :
+      _m5opRange(p.m5ops_base ?
+                 RangeSize(p.m5ops_base, 0x10000) :
                  AddrRange(1, 0)), // Create an empty range if disabled
       totalNumInsts(0),
-      redirectPaths(p->redirect_paths)
+      redirectPaths(p.redirect_paths)
 {
     if (workload)
         workload->system = this;
@@ -262,8 +262,8 @@ System::System(Params *p)
     numSystemsRunning++;
 
     // Set back pointers to the system in all memories
-    for (int x = 0; x < params()->memories.size(); x++)
-        params()->memories[x]->system(this);
+    for (int x = 0; x < params().memories.size(); x++)
+        params().memories[x]->system(this);
 }
 
 System::~System()
@@ -653,7 +653,7 @@ System::getRequestorName(RequestorID requestor_id)
 }
 
 System *
-SystemParams::create()
+SystemParams::create() const
 {
-    return new System(this);
+    return new System(*this);
 }
index e5d4ec625644182e609242dc35accd8be313a536..4b446168664bb960fe6a3705a6b4b40a074ed461 100644 (file)
@@ -381,7 +381,7 @@ class System : public SimObject, public PCEventScope
     ByteOrder
     getGuestByteOrder() const
     {
-        return _params->byte_order;
+        return _params.byte_order;
     }
 
      /**
@@ -558,7 +558,7 @@ class System : public SimObject, public PCEventScope
     typedef SystemParams Params;
 
   protected:
-    Params *_params;
+    const Params &_params;
 
     /**
      * Range for memory-mapped m5 pseudo ops. The range will be
@@ -567,10 +567,10 @@ class System : public SimObject, public PCEventScope
     const AddrRange _m5opRange;
 
   public:
-    System(Params *p);
+    System(const Params &p);
     ~System();
 
-    const Params *params() const { return (const Params *)_params; }
+    const Params &params() const { return (const Params &)_params; }
 
     /**
      * Range used by memory-mapped m5 pseudo-ops if enabled. Returns
index 7af439cd56010e66e3bb5db8dba2ffa8db44ac54..3564b4d03b5257cb8c6984263b18ed1636bb63ff 100644 (file)
@@ -106,7 +106,7 @@ Ticked::unserialize(CheckpointIn &cp)
     lastStopped = Cycles(lastStoppedUint);
 }
 
-TickedObject::TickedObject(const TickedObjectParams *params,
+TickedObject::TickedObject(const TickedObjectParams &params,
     Event::Priority priority) :
     ClockedObject(params),
     /* Make numCycles in Ticked */
index 91a85edcf5b9430479c64f21afdaeecd6497839b..39916180815c8c3b9dc9edc3b77bc4e74a63b3f1 100644 (file)
@@ -163,7 +163,7 @@ class Ticked : public Serializable
 class TickedObject : public ClockedObject, public Ticked
 {
   public:
-    TickedObject(const TickedObjectParams *params,
+    TickedObject(const TickedObjectParams &params,
         Event::Priority priority = Event::CPU_Tick_Pri);
 
     /** Disambiguate to make these functions overload correctly */
index 5a973fa5f359877abc6d86d5ebfc32d28cd6549e..14d7c869f53a09dabfb005c0938b8c62c1e8254e 100644 (file)
@@ -45,8 +45,8 @@
 #include "params/VoltageDomain.hh"
 #include "sim/sim_object.hh"
 
-VoltageDomain::VoltageDomain(const Params *p)
-    : SimObject(p), voltageOpPoints(p->voltage), _perfLevel(0), stats(*this)
+VoltageDomain::VoltageDomain(const Params &p)
+    : SimObject(p), voltageOpPoints(p.voltage), _perfLevel(0), stats(*this)
 {
     fatal_if(voltageOpPoints.empty(), "DVFS: Empty set of voltages for "\
              "voltage domain %s\n", name());
@@ -125,9 +125,9 @@ VoltageDomain::startup() {
 }
 
 VoltageDomain *
-VoltageDomainParams::create()
+VoltageDomainParams::create() const
 {
-    return new VoltageDomain(this);
+    return new VoltageDomain(*this);
 }
 
 void
index 5ab8c60600efa27444ffdddf932311eaad04b87e..ebda786b578740f421ec99e2c3a1ab0449b3274d 100644 (file)
@@ -55,7 +55,7 @@ class VoltageDomain : public SimObject
   public:
 
     typedef VoltageDomainParams Params;
-    VoltageDomain(const Params *p);
+    VoltageDomain(const Params &p);
 
     typedef SrcClockDomain::PerfLevel PerfLevel;
 
index 7c1b66d39c9290683e8bf67e06e5812a6dd6c77f..60b1cff7518452e2fc44c8c0d175d4eda99f9b6d 100644 (file)
@@ -55,7 +55,7 @@ class Workload : public SimObject
     } stats;
 
   public:
-    Workload(const WorkloadParams *_params) : SimObject(_params), stats(this)
+    Workload(const WorkloadParams &_params) : SimObject(_params), stats(this)
     {}
 
     void recordQuiesce() { stats.quiesce++; }
index 15cb3da1707883284e837d688c5f0589de2c9e52..75e5bc94a588bcab1474f049b6e2a4e47088f8d6 100644 (file)
@@ -54,7 +54,7 @@ bool Kernel::endOfSimulationComplete() { return endComplete; }
 sc_core::sc_status Kernel::status() { return _status; }
 void Kernel::status(sc_core::sc_status s) { _status = s; }
 
-Kernel::Kernel(Params *params) :
+Kernel::Kernel(const Params &params) :
     SimObject(params), t0Event(this, false, EventBase::Default_Pri - 1)
 {
     // Install ourselves as the scheduler's event manager.
@@ -183,10 +183,10 @@ Kernel *kernel;
 } // namespace sc_gem5
 
 sc_gem5::Kernel *
-SystemC_KernelParams::create()
+SystemC_KernelParams::create() const
 {
     panic_if(sc_gem5::kernel,
             "Only one systemc kernel object may be defined.\n");
-    sc_gem5::kernel = new sc_gem5::Kernel(this);
+    sc_gem5::kernel = new sc_gem5::Kernel(*this);
     return sc_gem5::kernel;
 }
index 44c1b87dc7859cc1ad7b9a352552cd87720c412d..c58e0f1297710305bee7e81480b8245ce0a2bf02 100644 (file)
@@ -46,7 +46,7 @@ class Kernel : public SimObject
 {
   public:
     typedef SystemC_KernelParams Params;
-    Kernel(Params *params);
+    Kernel(const Params &params);
 
     void init() override;
     void regStats() override;
index ffcd53127f46b8985d6ae90eb29aed8327044e6e..ba8f121a2e8fa20fef18b730481e2fecaccda30c 100644 (file)
@@ -441,14 +441,14 @@ Gem5ToTlmBridge<BITWIDTH>::invalidate_direct_mem_ptr(
 
 template <unsigned int BITWIDTH>
 Gem5ToTlmBridge<BITWIDTH>::Gem5ToTlmBridge(
-        Params *params, const sc_core::sc_module_name &mn) :
+        const Params &params, const sc_core::sc_module_name &mn) :
     Gem5ToTlmBridgeBase(mn),
     bridgeResponsePort(std::string(name()) + ".gem5", *this),
     socket("tlm_socket"),
     wrapper(socket, std::string(name()) + ".tlm", InvalidPortID),
-    system(params->system), blockingRequest(nullptr),
+    system(params.system), blockingRequest(nullptr),
     needToSendRequestRetry(false), blockingResponse(nullptr),
-    addrRanges(params->addr_ranges.begin(), params->addr_ranges.end())
+    addrRanges(params.addr_ranges.begin(), params.addr_ranges.end())
 {
 }
 
@@ -479,15 +479,15 @@ Gem5ToTlmBridge<BITWIDTH>::before_end_of_elaboration()
 } // namespace sc_gem5
 
 sc_gem5::Gem5ToTlmBridge<32> *
-Gem5ToTlmBridge32Params::create()
+Gem5ToTlmBridge32Params::create() const
 {
     return new sc_gem5::Gem5ToTlmBridge<32>(
-            this, sc_core::sc_module_name(name.c_str()));
+            *this, sc_core::sc_module_name(name.c_str()));
 }
 
 sc_gem5::Gem5ToTlmBridge<64> *
-Gem5ToTlmBridge64Params::create()
+Gem5ToTlmBridge64Params::create() const
 {
     return new sc_gem5::Gem5ToTlmBridge<64>(
-            this, sc_core::sc_module_name(name.c_str()));
+            *this, sc_core::sc_module_name(name.c_str()));
 }
index 1fe08402863ed9e131b25923f384efa596a010da..25720278e48f549d4982eb9b8da7649ebf38539f 100644 (file)
@@ -189,7 +189,7 @@ class Gem5ToTlmBridge : public Gem5ToTlmBridgeBase
     ::Port &gem5_getPort(const std::string &if_name, int idx=-1) override;
 
     typedef Gem5ToTlmBridgeBaseParams Params;
-    Gem5ToTlmBridge(Params *p, const sc_core::sc_module_name &mn);
+    Gem5ToTlmBridge(const Params &p, const sc_core::sc_module_name &mn);
 
     tlm_utils::simple_initiator_socket<Gem5ToTlmBridge<BITWIDTH>, BITWIDTH> &
     getSocket()
index 3891f58afa9a0882010b37d13dacd9d1ae155c9e..0cc0d7ff4b66206a4bc05a1468ca2f8b0b8add74 100644 (file)
@@ -477,14 +477,14 @@ TlmToGem5Bridge<BITWIDTH>::gem5_getPort(const std::string &if_name, int idx)
 
 template <unsigned int BITWIDTH>
 TlmToGem5Bridge<BITWIDTH>::TlmToGem5Bridge(
-        Params *params, const sc_core::sc_module_name &mn) :
+        const Params &params, const sc_core::sc_module_name &mn) :
     TlmToGem5BridgeBase(mn), peq(this, &TlmToGem5Bridge<BITWIDTH>::peq_cb),
     waitForRetry(false), pendingRequest(nullptr), pendingPacket(nullptr),
     needToSendRetry(false), responseInProgress(false),
     bmp(std::string(name()) + "master", *this), socket("tlm_socket"),
     wrapper(socket, std::string(name()) + ".tlm", InvalidPortID),
-    system(params->system),
-    _id(params->system->getGlobalRequestorId(
+    system(params.system),
+    _id(params.system->getGlobalRequestorId(
                 std::string("[systemc].") + name()))
 {
 }
@@ -524,15 +524,15 @@ TlmToGem5Bridge<BITWIDTH>::before_end_of_elaboration()
 } // namespace sc_gem5
 
 sc_gem5::TlmToGem5Bridge<32> *
-TlmToGem5Bridge32Params::create()
+TlmToGem5Bridge32Params::create() const
 {
     return new sc_gem5::TlmToGem5Bridge<32>(
-            this, sc_core::sc_module_name(name.c_str()));
+            *this, sc_core::sc_module_name(name.c_str()));
 }
 
 sc_gem5::TlmToGem5Bridge<64> *
-TlmToGem5Bridge64Params::create()
+TlmToGem5Bridge64Params::create() const
 {
     return new sc_gem5::TlmToGem5Bridge<64>(
-            this, sc_core::sc_module_name(name.c_str()));
+            *this, sc_core::sc_module_name(name.c_str()));
 }
index f1e3e081a50647fd8ffc863c369ed822854e1484..279f76d643dfafb22c5bdb7291e1d34562b234cc 100644 (file)
@@ -161,7 +161,7 @@ class TlmToGem5Bridge : public TlmToGem5BridgeBase
     ::Port &gem5_getPort(const std::string &if_name, int idx=-1) override;
 
     typedef TlmToGem5BridgeBaseParams Params;
-    TlmToGem5Bridge(Params *p, const sc_core::sc_module_name &mn);
+    TlmToGem5Bridge(const Params &p, const sc_core::sc_module_name &mn);
 
     tlm_utils::simple_target_socket<TlmToGem5Bridge<BITWIDTH>, BITWIDTH> &
     getSocket()