From: Dek on
Hi all,

as the title says I have to read some information stored in UDP packet
with an FPGA. Now I'm evaluating 3 options:

1) Use an external processor and send data to FPGA through dedicated
lines
2) Use a microcontroller embedded into the FPGA (i.e. microblaze,
since I'm working on a Xilinx)
3) Write an hardware implementation of the IP stack, or at least of he
part of the stack I need to read those packets

What are the pros and cons of each solution? Can you suggest me others
way to do that?

Thanks all

Dek
From: glen herrmannsfeldt on
Dek <daniele.dequal(a)gmail.com> wrote:

> as the title says I have to read some information stored in UDP packet
> with an FPGA. Now I'm evaluating 3 options:

> 1) Use an external processor and send data to FPGA through dedicated
> lines
> 2) Use a microcontroller embedded into the FPGA (i.e. microblaze,
> since I'm working on a Xilinx)
> 3) Write an hardware implementation of the IP stack, or at least of he
> part of the stack I need to read those packets

UDP is much easier than TCP, so a good choice. Other than accepting
the actual data, the complications are doing ARP. That can easily
be done in another processor. Any machine on the same subnet
can do it with the appropriate permanent entry in the ARP table.
If your system already has a processor on the same ethernet
but with a different network connection, this would be the easiest.

picoblaze is probably enough to send/receive ARP and otherwise
coordinate reception of the UDP data.

It could even be done with a more ordinary state machine.
(That would count as option 3.)

> What are the pros and cons of each solution? Can you suggest
> me others way to do that?

-- glen
From: John McCaskill on
On Feb 10, 8:04 am, Dek <daniele.deq...(a)gmail.com> wrote:
> Hi all,
>
> as the title says I have to read some information stored in UDP packet
> with an FPGA. Now I'm evaluating 3 options:
>
> 1) Use an external processor and send data to FPGA through dedicated
> lines
> 2) Use a microcontroller embedded into the FPGA (i.e. microblaze,
> since I'm working on a Xilinx)
> 3) Write an hardware implementation of the IP stack, or at least of he
> part of the stack I need to read those packets
>
> What are the pros and cons of each solution? Can you suggest me others
> way to do that?
>
> Thanks all
>
> Dek



UDP is very simple. I have some designs that use a PicoBlaze to deal
with multiple streams of UDP packets that are multicast on a Gigabit
Ethernet VLAN. Those designs are just processing the headers and
diverting the packets of interest to the FPGA fabric for more
processing. Everything else is sent up the Linux network stack for
the PowerPC to deal with. If you only care about the UDP data, you
don't need to do that.

I also have designs that use the FPGA fabric to directly deal with the
data from the EMAC with out using a processor at all. Those are only
dealing with UDP and ICMP, and were simple and straight forward.

I would go for either option 2 or 3. I don't know enough about your
other constraints to pick between those two.

What FPGA are you using?

Regards,

John McCaskill
www.FasterTechnology.com
From: glen herrmannsfeldt on
John McCaskill <jhmccaskill(a)gmail.com> wrote:
(snip)

> I also have designs that use the FPGA fabric to directly deal with the
> data from the EMAC with out using a processor at all. Those are only
> dealing with UDP and ICMP, and were simple and straight forward.

What do you do about ARP?

You won't get the packets unless ARP tells where to send them.

-- glen
From: Peter Van Epp on
Dek <daniele.dequal(a)gmail.com> writes:

>Hi all,

>as the title says I have to read some information stored in UDP packet
>with an FPGA. Now I'm evaluating 3 options:

>1) Use an external processor and send data to FPGA through dedicated
>lines
>2) Use a microcontroller embedded into the FPGA (i.e. microblaze,
>since I'm working on a Xilinx)
>3) Write an hardware implementation of the IP stack, or at least of he
>part of the stack I need to read those packets

>What are the pros and cons of each solution? Can you suggest me others
>way to do that?

>Thanks all

>Dek

How fast is the UDP stream (gig or will 10/100 and low throughput do)?
Does your board already have an ethernet PHY or do you need to add one just
for this? If the volume and speed are both low (i.e. 100 or less) there was
a spi interfaced PIC 10/100 board referenced here a while back. That may be
your cheapest solution (the one referenced here is about $20 and Wiznet makes
a bunch more that are a little more expensive). I don't think it will do
anywhere near wire speed, but if your traffic is small enough that may be
the easiest solution (someone else does the IP heavy lifting such as it is and
worries about things like arp :-)).

Peter Van Epp