Intel® Simics® Simulator for Intel® FPGAs: User Guide

ID 784383
Date 11/16/2024
Public
Document Table of Contents

7.2.2.2.1. TFTP Using Forwarding Port

Set up an outgoing port forwarding to forward the tftp request from the service node to the host PC.

The following capture shows how to set up the forwarding port. In this case, the port in the service node that forwards the request is the 69 (standard for TFTP service). You must define the target port and target IP (the host for outgoing forwarding port) to which the request is forwarded, which is also the 69 and 10.122.105.138 (host IP address). You also define the UDP protocol, which is the one that supports the TFTP service.

HostPC | Target system
 Outgoing   69 <- 69
#Intel Simics simulator CLI 

simics> connect-real-network-port-out ethernet-link = ethernet_switch0
service-node-port = 69 target-port = 69 target-ip = 10.122.105.138 -udp
10.10.0.1 UDP port 69 on link ethernet_switch0.link -> host 10.122.105.138:69
ff02::1:2 UDP port 69 on link ethernet_switch0.link -> host 10.122.105.138:69
Warning: This can expose the target system on the host local network.
simics>
simics> run

In the host PC terminal, install a TFTP server, define its directory, in which you must locate the file to be transferred to the target system. The following capture shows an example of how to use the tftp command in the Linux host terminal. For this example, it is important to do the following setup in the Host PC:

  1. Locate the file to be transferred to the target system in the tftp directory.
  2. The tftp directory must be different than the current directory in which the current simulation is running.
  3. The file to be transferred must not be in the same directory in which the simulation is running.

For this example, the last two conditions are important because, as you see in the next section, the file to be transferred can be done using a TFTP server that is provided as part of the service node and may hide the functionality supplied by the forwarding port created.

In the following capture from the target system console, the tftp command executes the file transfer. In this case, the file is called host2target.txt and the service node IP along with the port 69 is used:

# Target Serial Console

root@psgdevice:~# tftp -gr host2target.txt 10.10.0.1 69
root@psgdevice:~# ls
host2target.txt