Using the NicheStack TCP/IP Stack - Nios II Edition Tutorial

ID 683574
Date 10/04/2021
Document Table of Contents

1.6.2. Software Architecture

The onion diagram shows the architectural layers of a Nios II MicroC/OS-II software application.

Figure 9. Layered Software Model

Each layer encapsulates the specific implementation details of that layer, abstracting the data for the next outer layer. The following list describes each layer:

  • Nios II processor system hardware—The core of the onion diagram represents the Nios II soft core processor and hardware peripherals implemented in the FPGA.
  • Software device drivers—The software device drivers layer contains the software functions that manipulate the Ethernet and hardware peripherals. These drivers know the physical details of the peripheral devices, abstracting those details from the outer layers.
  • HAL API—The Hardware Abstraction Layer (HAL) application programming interface (API) provides a standardized interface to the software device drivers, presenting a POSIX-like API to the outer layers.
  • MicroC/OS-II—The MicroC/OS-II RTOS layer provides multitasking and intertask communication services to the NicheStack TCP/IP Networking Stack and the Nios II Simple Socket Server.
  • NicheStack TCP/IP Stack software component—The NicheStack TCP/IP Stack software component layer provides networking services to the application layer and application-specific system initialization layer through the sockets API.
  • Application-specific system initialization—The application-specific system initialization layer includes the MicroC/OS-II and NicheStack TCP/IP Stack software component initialization functions invoked from main(), as well as creates all application tasks, and all the semaphores, queue, and event flag RTOS inter-task communication resources.
  • Application—The outermost application layer contains the Nios II Simple Socket Server task and LED management tasks.

The "Nios II Simple Socket Server Data Flow Diagram" shows the structure of the design example described in the “Introduction” section. The sections following the figure describe the tasks in the figure.

Figure 10. Nios II Simple Socket Server Data Flow Diagram

The figure shows the state of the system after initialization. When the NicheStack TCP/IP Stack software component receives an Ethernet packet that contains an LED command sent from a telnet client program, the NicheStack TCP/IP Stack processes the incoming Ethernet packet with the TCP/IP protocol and presents the data packet to the socket server task using the sockets API. The LED management tasks then extract and post the LED command contained in the data packet to the LED command queue for processing.