device_type: "fvp"

job_name: "tuxrun@{{ device.name }}"
priority: medium
visibility: public

{% block context %}{% endblock %}

{%- set deploy_timeout = timeouts.deploy|default(5) %}
{%- set boot_timeout = timeouts.boot|default(10) %}

timeouts:
  job:
    minutes: {{ deploy_timeout + boot_timeout + tests_timeout }}
  action:
    minutes: 10
  connection:
    minutes: 10

actions:
- deploy:
    to: fvp
    timeout:
      minutes: {{ deploy_timeout }}
    uniquify: False
    images:
      startup:
        url: "file://{{ tmpdir }}/startup.nsh"
      uefi:
        url: "{{ uefi }}"
      bl1:
        url: "{{ bl1 }}"
      dtb:
        url: "{{ dtb }}"
      kernel:
        url: "{{ kernel }}"
{% if compression(kernel)[1] %}
        compression: {{ compression(kernel)[1] }}
{% endif %}
      rootfs:
        url: "{{ rootfs }}"
        compression: {{ compression(rootfs)[1] }}
        format: ext4
{% if overlays %}
        overlays:
{% if tests %}
          lava: true
{% endif %}
{% for name, overlay, dst in overlays %}
          {{ name }}:
            url: "{{ overlay }}"
            path: "{{ dst }}"
            format: tar
            compression: {{ compression(overlay)[1] }}
{% endfor %}
{% elif tests %}
        overlays:
          lava: true
{% endif %}
      fip:
        url: "{{ fip }}"
- boot:
    method: fvp
    docker:
      name: "fvp:aemva-11.21.15"
      local: true
      container_name: "{{ tmpdir.name }}"
    image: "/opt/model/FVP_AEMvA/models/Linux64_GCC-9.3/FVP_Base_RevC-2xAEMvA"
    version_string: "Fast Models [^\\n]+"
    timeout:
      minutes: {{ boot_timeout }}
    console_string: "terminal_0: Listening for serial connection on port (?P<PORT>\\d+)"
    feedbacks:
    - "(?P<NAME>terminal_1): Listening for serial connection on port (?P<PORT>\\d+)"
    - "(?P<NAME>terminal_2): Listening for serial connection on port (?P<PORT>\\d+)"
    - "(?P<NAME>terminal_3): Listening for serial connection on port (?P<PORT>\\d+)"
    arguments:
    - "--plugin /opt/model/FVP_AEMvA/plugins/Linux64_GCC-9.3/ScalableVectorExtension.so"
    - "--stat"
    - "-C SVE.ScalableVectorExtension.has_sme2=1"
    - "-C SVE.ScalableVectorExtension.has_sme=1"
    - "-C SVE.ScalableVectorExtension.has_sve2=1"
    - "-C bp.dram_metadata.is_enabled=1"
    - "-C bp.dram_size=4"
    - "-C bp.flashloader0.fname='{FIP}'"
    - "-C bp.flashloader1.fname='{UEFI}'"
    - "-C bp.hostbridge.userNetPorts=8022=22"
    - "-C bp.hostbridge.userNetworking=1"
    - "-C bp.refcounter.non_arch_start_at_default=1"
    - "-C bp.refcounter.use_real_time=0"
    - "-C bp.secure_memory=1"
    - "-C bp.secureflashloader.fname='{BL1}'"
    - "-C bp.smsc_91c111.enabled=1"
    - "-C bp.terminal_0.mode=telnet"
    - "-C bp.terminal_0.start_telnet=0"
    - "-C bp.terminal_1.mode=raw"
    - "-C bp.terminal_1.start_telnet=0"
    - "-C bp.terminal_2.mode=raw"
    - "-C bp.terminal_2.start_telnet=0"
    - "-C bp.terminal_3.mode=raw"
    - "-C bp.terminal_3.start_telnet=0"
    - "-C bp.ve_sysregs.exit_on_shutdown=1"
    - "-C bp.virtioblockdevice.image_path='{ROOTFS}'"
    - "-C bp.vis.disable_visualisation=1"
    - "-C cache_state_modelled=0"
    - "-C cluster0.NUM_CORES=4"
    - "-C cluster0.PA_SIZE=48"
    - "-C cluster0.check_memory_attributes=0"
    - "-C cluster0.clear_reg_top_eret=2"
    - "-C cluster0.cpu0.semihosting-cwd={ARTIFACT_DIR}"
    - "-C cluster0.ecv_support_level=2"
    - "-C cluster0.enhanced_pac2_level=3"
    - "-C cluster0.gicv3.cpuintf-mmap-access-level=2"
    - "-C cluster0.gicv3.without-DS-support=1"
    - "-C cluster0.gicv4.mask-virtual-interrupt=1"
    - "-C cluster0.has_16k_granule=1"
    - "-C cluster0.has_amu=1"
    - "-C cluster0.has_arm_v8-1=1"
    - "-C cluster0.has_arm_v8-2=1"
    - "-C cluster0.has_arm_v8-3=1"
    - "-C cluster0.has_arm_v8-4=1"
    - "-C cluster0.has_arm_v8-5=1"
    - "-C cluster0.has_arm_v8-6=1"
    - "-C cluster0.has_arm_v8-7=1"
    - "-C cluster0.has_arm_v8-8=1"
    - "-C cluster0.has_arm_v9-0=1"
    - "-C cluster0.has_arm_v9-1=1"
    - "-C cluster0.has_arm_v9-2=1"
    - "-C cluster0.has_arm_v9-3=1"
    - "-C cluster0.has_branch_target_exception=1"
    - "-C cluster0.has_brbe=1"
    - "-C cluster0.has_brbe_v1p1=1"
    - "-C cluster0.has_const_pac=1"
    - "-C cluster0.has_hpmn0=1"
    - "-C cluster0.has_large_system_ext=1"
    - "-C cluster0.has_large_va=1"
    - "-C cluster0.has_rndr=1"
    - "-C cluster0.has_permission_indirection_s1=1"
    - "-C cluster0.has_permission_indirection_s2=1"
    - "-C cluster0.has_permission_overlay_s1=1"
    - "-C cluster0.has_permission_overlay_s2=1"
    - "-C cluster0.has_tcr2=1"
    - "-C cluster0.has_gcs=1"
    - "-C cluster0.max_32bit_el=0"
    - "-C cluster0.memory_tagging_support_level=3"
    - "-C cluster0.pmb_idr_external_abort=1"
    - "-C cluster0.stage12_tlb_size=1024"
    - "-C cluster1.NUM_CORES=4"
    - "-C cluster1.PA_SIZE=48"
    - "-C cluster1.check_memory_attributes=0"
    - "-C cluster1.clear_reg_top_eret=2"
    - "-C cluster1.ecv_support_level=2"
    - "-C cluster1.enhanced_pac2_level=3"
    - "-C cluster1.gicv3.cpuintf-mmap-access-level=2"
    - "-C cluster1.gicv3.without-DS-support=1"
    - "-C cluster1.gicv4.mask-virtual-interrupt=1"
    - "-C cluster1.has_16k_granule=1"
    - "-C cluster1.has_amu=1"
    - "-C cluster1.has_arm_v8-1=1"
    - "-C cluster1.has_arm_v8-2=1"
    - "-C cluster1.has_arm_v8-3=1"
    - "-C cluster1.has_arm_v8-4=1"
    - "-C cluster1.has_arm_v8-5=1"
    - "-C cluster1.has_arm_v8-6=1"
    - "-C cluster1.has_arm_v8-7=1"
    - "-C cluster1.has_arm_v8-8=1"
    - "-C cluster1.has_arm_v9-0=1"
    - "-C cluster1.has_arm_v9-1=1"
    - "-C cluster1.has_arm_v9-2=1"
    - "-C cluster1.has_arm_v9-3=1"
    - "-C cluster1.has_branch_target_exception=1"
    - "-C cluster1.has_brbe=1"
    - "-C cluster1.has_brbe_v1p1=1"
    - "-C cluster1.has_const_pac=1"
    - "-C cluster1.has_hpmn0=1"
    - "-C cluster1.has_large_system_ext=1"
    - "-C cluster1.has_large_va=1"
    - "-C cluster1.has_rndr=1"
    - "-C cluster1.has_permission_indirection_s1=1"
    - "-C cluster1.has_permission_indirection_s2=1"
    - "-C cluster1.has_permission_overlay_s1=1"
    - "-C cluster1.has_permission_overlay_s2=1"
    - "-C cluster1.has_tcr2=1"
    - "-C cluster1.has_gcs=1"
    - "-C cluster1.max_32bit_el=0"
    - "-C cluster1.memory_tagging_support_level=3"
    - "-C cluster1.pmb_idr_external_abort=1"
    - "-C cluster1.stage12_tlb_size=1024"
    - "-C pci.pci_smmuv3.mmu.SMMU_AIDR=2"
    - "-C pci.pci_smmuv3.mmu.SMMU_IDR0=4592187"
    - "-C pci.pci_smmuv3.mmu.SMMU_IDR1=6291458"
    - "-C pci.pci_smmuv3.mmu.SMMU_IDR3=5908"
    - "-C pci.pci_smmuv3.mmu.SMMU_IDR5=4294902901"
    - "-C pci.pci_smmuv3.mmu.SMMU_ROOT_IDR0=3"
    - "-C pci.pci_smmuv3.mmu.SMMU_ROOT_IIDR=1083"
    - "-C pci.pci_smmuv3.mmu.SMMU_S_IDR1=2684354562"
    - "-C pci.pci_smmuv3.mmu.SMMU_S_IDR2=0"
    - "-C pci.pci_smmuv3.mmu.SMMU_S_IDR3=0"
    - "-C pci.pci_smmuv3.mmu.root_register_page_offset=131072"
    - "-C pctl.startup=0.0.0.0"
    auto_login:
      login_prompt: 'login:'
      username: root
    prompts:
    - 'root@(.*):[/~]#'
{% for prompt in tux_prompt %}
    - "{{ prompt }}"{% endfor %}
