2

I'm going to start the development of an application on a Zynq board. My task is basically to port an existing application running on a Microblaze on the dual core ARM.

What I'm wondering about is which O.S. to use on the new system, because I have no experience at all in this field. It seems to me that there are four main approaches:

1) Petalinux (use both cores)

2) Petalinux+FreeRTOS (use both cores)

3) FreeRTOS (use only a core)

4) Baremetal (use only a core)

What my application has to do is to move a big amount of data between Ethernet and multiple custom links, so it has to serve a lot of interrupts and command a lot of DMA operations.

How much is the overhead introduced by Petalinux in the interrupt service with respect to baremetal or FreeRTOS? Do you think that, for this kind of work, is faster a single core application running without any OS or, for example, a Petalinux application that has the overhead of the OS (and of the synchronization mechanisms like semaphores or mutex)?

I know the question is not precise and quite vague, but having no experience in the field I strongly need some initial hints.

Thank you.

arandomuser
  • 521
  • 1
  • 7
  • 22

2 Answers2

1

As you say, this is too vague to give a considered answer because it really depends on your application (when does it not). If you need all the 'stuff' that is available for Linux and boot time is not an issue then go with that. If you need actual real time behaviour, fast boot time, simplicity, and don't need anything Linux specific, then FreeRTOS might be your best choice. There is a Zynq FreeRTOS TCP project that uses the BSD style sockets interface (like Linux) here: http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCPIP_FAT_Examples_Xilinx_Zynq.html

Richard
  • 3,081
  • 11
  • 9
  • Thank you for your comment. My main doubt is the tradeoff in performance between a petalinux application that has more overhead but that uses both cores and a FreeRTOS solution that instead uses just a single core. What I'm looking for is mainly speed in interrupt services. – arandomuser Jun 26 '16 at 19:31
1

Usually the performance should not differ alot. If you compile your linux with a well optimizing compiler there is a good chance to be faster compared to bare metal.

But if you need hard real time linux is not suitable for you.

There is a good whitepaper from Altera but should fit for Xilinx too: whitepaper on real time jitter

akira hinoshiro
  • 393
  • 2
  • 15
  • Very useful answer. What about instead the memory copies between kernel and user space? I have to heavily rely on Ethernet (with TCP) so I'm wondering if using a petalinux solution the bus occupancy will be (much) higher – arandomuser Jun 27 '16 at 12:40
  • Hard to say what happens there is a big difference between the hardware implementation. There exists solutions with ethernet IP core without using the arm (and therefore Linux). In general real time ethernet is not possible (there exists some real time implementations) but in most cases it is not necessary. Another thing what is real time for you, packets per second, 1us, 1ms, 1s delay? – akira hinoshiro Jun 27 '16 at 13:59
  • I'm not interested in hard real time, but in throughput – arandomuser Jun 27 '16 at 16:38
  • Is there any reason why you are using a fpga at all? Your problem sounds like you are needing just an embedded ethernet adapter and there are cheaper and faster arms on the market. About the speed just use google and search something like "vxworks vs linux ethernet throughput" or so to find out more information on that. I personally would avoid implementing your own ethernet solution because normally you do not have time and maybe skill to do that. – akira hinoshiro Jun 28 '16 at 07:02
  • I must use fpga because what I have to do is to transfer data from ethernet to my custom links (implemented in the fpga). The link is a very high data rate link, so I need to push the ethernet performance the more that I can to not lose too much bandwidth – arandomuser Jun 28 '16 at 08:30