device_type: "fvp"

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

{% block context %}{% endblock %}

{%- set deploy_timeout = 5 %}

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

actions:
- deploy:
    to: fvp
    timeout:
      minutes: {{ deploy_timeout }}
    images:
      ap_romfw:
        url: "{{ ap_romfw }}"
      scp_romfw:
        url: "{{ scp_romfw }}"
      scp_fw:
        url: "{{ scp_fw }}"
      mcp_romfw:
        url: "{{ mcp_romfw }}"
      mcp_fw:
        url: "{{ mcp_fw }}"
      fip:
        url: "{{ fip }}"
      rootfs:
        url: "{{ rootfs }}"
        compression: xz
- boot:
    method: fvp
    docker:
      name: "fvp:morello-0.11.27"
      local: true
      container_name: "{{ tmpdir.name }}"
    image: "/opt/model/FVP_Morello/models/Linux64_GCC-6.4/FVP_Morello"
    version_string: "Fast Models [^\\n]+"
    timeout:
      minutes: {{ boot_timeout }}
    console_string: "terminal_uart_ap: Listening for serial connection on port (?P<PORT>\\d+)"
    feedbacks:
    - "terminal_(?P<NAME>uart0): Listening for serial connection on port (?P<PORT>\\d+)"
    - "terminal_(?P<NAME>uart1): Listening for serial connection on port (?P<PORT>\\d+)"
    - "terminal_(?P<NAME>uart_aon): Listening for serial connection on port (?P<PORT>\\d+)"
    - "terminal_(?P<NAME>uart1_ap): Listening for serial connection on port (?P<PORT>\\d+)"
    - "terminal_(?P<NAME>sec_uart_ap): Listening for serial connection on port (?P<PORT>\\d+)"
    - "terminal_(?P<NAME>uart0_board): Listening for serial connection on port (?P<PORT>\\d+)"
    - "terminal_(?P<NAME>uart1_board): Listening for serial connection on port (?P<PORT>\\d+)"
    arguments:
    - "--data Morello_Top.css.scp.armcortexm7ct={SCP_ROMFW}@0x0"
    - "--data Morello_Top.css.mcp.armcortexm7ct={MCP_ROMFW}@0x0"
    - "-C Morello_Top.soc.scp_qspi_loader.fname={SCP_FW}"
    - "-C Morello_Top.soc.mcp_qspi_loader.fname={MCP_FW}"
    - "-C css.scp.armcortexm7ct.INITVTOR=0x0"
    - "-C css.mcp.armcortexm7ct.INITVTOR=0x0"
    - "-C board.virtioblockdevice.image_path={ROOTFS}"
    - "-C css.pl011_uart_ap.out_file=uart0.log"
    - "-C css.scp.pl011_uart_scp.out_file=scp.log"
    - "-C css.mcp.pl011_uart0_mcp.out_file=mcp.log"
    - "-C css.pl011_uart_ap.unbuffered_output=1"
    - "-C displayController=0"
    - "-C board.virtio_rng.enabled=1"
    - "-C board.virtio_rng.seed=0"
    - "-C board.rtc_clk_frequency=32768"
    - "-C num_clusters=2"
    - "-C num_cores=2"
    - "-C board.virtio_net.enabled=1"
    - "-C board.virtio_net.transport=legacy"
    - "-C board.virtio_net.hostbridge.userNetworking=1"
    - "-C board.virtio_net.hostbridge.userNetPorts=\"5555=5555\""
    - "-C disable_visualisation=true"
    - "-C css.trustedBootROMloader.fname={AP_ROMFW}"
    - "-C board.ap_qspi_loader.fname={FIP}"
    prompts:
{% for prompt in prompts %}
    - "{{ prompt }}"
{% endfor %}
{% if auto_login %}
    auto_login:
      login_prompt: "{{ auto_login.login_prompt}}"
      username: "{{ auto_login.username }}"
      password_prompt: "{{ auto_login.password_prompt }}"
      password: "{{ auto_login.password }}"
{% endif %}
