MAX 10 NEEK
87
www.terasic.com
February 4, 2016
After the Qsys hardware project has been built, develop the Qsys software project, whose basic
architecture is shown in
Figure 6-23
. The top block contains the Nios II processor and the
necessary hardware to be implemented into the MAX 10 NEEK board. The software device drivers
contain the necessary device drivers needed for the Ethernet and other hardware components to
work. The HAL API block provides the interface for the software device drivers, while the Micro
C/OS-II provides communication services to the NicheStack™ and the Socket Server. The
NicheStack™ TCP/IP Stack software block provides networking services to the application block
where it contains the tasks for Socket Server and also LED management.
Figure 6-23 Nios II Software Routine Architecture
Finally, the detailed descriptions for Software flow chart of the Socket Server program are listed
below:
Firstly, the Socket Server program initiates the MAC and net device then calls the get_mac_addr()
function to set the MAC addresses for the PHY. Secondly, it initiates the auto-negotiation process to
check the link between the PHY and gateway device. If the link exists, the PHY and gateway
devices will broadcast their transmission parameters, speed, and duplex mode. After the
auto-negotiation process has been finished, the link will be established. Next, the Socket Server
program will prepare the transmitting and receiving path for the link. If the path is created
successfully, it will call the get_ip_addr() function to set up the IP address for the network interface.
After the IP address is successfully distributed, the NicheStack™ TCP/IP Stack will start to run for
Socket Server application.