alexforencich / verilog-ethernet

Verilog Ethernet components for FPGA implementation
MIT License
2.2k stars 677 forks source link

UDP complete waves #89

Open aignacio opened 3 years ago

aignacio commented 3 years ago

Hey Alex,

tks again for the IPs, bothering you again about usage! do you know how to get some waves of udp_complete module or if there's a diagram of how to drive the interfaces on this module? I tried to take a look at the testbench but isn't clear how it works with myhdl exactly...

alexforencich commented 3 years ago

My recommendation is to take a look at the example design for how to hook everything up.

The testbench has not been converted to cocotb yet (I am doing that piecemeal as I rewrite modules in a parametrized way) but you can run the myhdl testbench, and it will dump out an lxt waveform dump. You'll just have to install the myhdl python package, and compile and install myhdl.vpi so that icarus verilog can find it. Then you can run the testbench.

aignacio commented 3 years ago

Thanks for the hint, is that possible to use only s/mudp* I/F if I only want to send UDP pkts?

aignacio commented 3 years ago

image got the waves as you suggested, tks!, on this test I'm seeing you're setting 40 bytes as the length but only 32 bytes are transferred, 8 bytes are part of the UDP header?

alexforencich commented 3 years ago

The UDP length field includes the header, which is 8 bytes. However, if UDP checksum generation is enabled, then you can tie that off to zero and the length fields will be computed from the actual length of the AXI stream payload data.

aignacio commented 3 years ago

In the test_udp_complete.py I see that the parameter is set (UDP_CHECKSUM_GEN_ENABLE == 1) and you send the checksum and subtract it from the total (40). You mean if this parameter is set to ZERO I can tie off (s_udp_checksum = '0) and consider length == total number of data streamed in axis?

alexforencich commented 3 years ago

No, if checksum generation is enabled (should be enabled by default), then the length and checksum fields are automatically computed, so the values you pass in are ignored. If you disable checksum generation, then you must specify the length and checksum correctly for the packet to be valid.

unbtorsten commented 2 years ago

First of all, thank you for this amazing core! I, too, struggle with the documentation. Hence my question that relates to the OP:

My recommendation is to take a look at the example design for how to hook everything up.

I have been successful in working with the examples (cf. #93) and have modified the loopback implemented in fpga_core.v. Furthermore, I am able to send out custom data by diverting the rx_fifo stream and feeding the udp_complete instance from a second tx_fifo.

Is this how you designed integration of the module into a project? I feel like I do not understand the difference between fpga.v (top-level module) and fpga_core.v (core logic) located in /example/<BOARD>/fpga/rtl/. In fpga.v, the Ethernet core offers an (unused) UART. Should I connect to the core at this level, or instantiate other modules (such as data generator and processing) in fpga_core.v?

Juan8UTN commented 1 year ago

I have been successful in working with the examples (cf. #93) and have modified the loopback implemented in fpga_core.v. Furthermore, I am able to send out custom data by diverting the rx_fifo stream and feeding the udp_complete instance from a second tx_fifo.

Hi, sorry for bother you, but i'm asking myself if you can help me with that. I need to send custom data trough ethernet using UDP and, because i'm a newbie in the field, i'm little lost with that. Could you help me with some tips, code, whatever you consider?

unbtorsten commented 1 year ago

Hi, sorry for bother you, but i'm asking myself if you can help me with that. I need to send custom data trough ethernet using UDP and, because i'm a newbie in the field, i'm little lost with that. Could you help me with some tips, code, whatever you consider?

I think your question is rather broad at this time. This makes it difficult to help. Can you be more specific with regard to what you are aiming to achieve and what you have tried already? Also, this may better be posted in a separate issue?

Juan8UTN commented 1 year ago

Hi, sorry for bother you, but i'm asking myself if you can help me with that. I need to send custom data trough ethernet using UDP and, because i'm a newbie in the field, i'm little lost with that. Could you help me with some tips, code, whatever you consider?

I think your question is rather broad at this time. This makes it difficult to help. Can you be more specific with regard to what you are aiming to achieve and what you have tried already? Also, this may better be posted in a separate issue?

Hi, first of all, thanks for take the time to respond to me, i have already posted a separate issue (issue #133). Briefly, i need to modified the loopback example to respond with some custom data. I tried to modify the instances udp_complete and udp_payload_fifo but i hadn't any success. i am really newbie in this field, and i find myself a little lost with this, and really need it to continue with my final project to obtain my Bacherlor's degree.