Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to simulate and test the verilog-ethernet design? #197

Open
lizajoseph opened this issue Mar 4, 2024 · 6 comments
Open

How to simulate and test the verilog-ethernet design? #197

lizajoseph opened this issue Mar 4, 2024 · 6 comments

Comments

@lizajoseph
Copy link

lizajoseph commented Mar 4, 2024

I would like to run and simulate the verilog-ethernet design. I have installed cocotb, cocotb-test, however I am not clear on how to run the tests for this design and view the simulation results in waveforms. And is there any documentation available to understand the flow of the data in this design?

@alexforencich
Copy link
Owner

Run the tests by running "make" in the appropriate directory (each test case is in a folder with a makefile and a python script). If you want to look at waveforms, run "make WAVES=1". This should produce an fst file that can be opened in gtkwave.

@lizajoseph
Copy link
Author

Thanks Alex, I ran the tests in cocotbext-eth->eth_mac, gmii, gmii_phy, mii, mii_phy, ptp_clock, ptp_clock_sim_time, rgmii, rgmii_phy, xgmii.

How is the DUT connected to these tests? I see that each of these modules have a ".v" file with only IO ports. I was expecting the "fpga_au50.v" to be my DUT in the tests.

Also, in what sequence should I run these tests to understand the flow of TX and RX data?

@lizajoseph
Copy link
Author

lizajoseph commented Mar 6, 2024

I invoked the behavioral simulation after loading the fpga.xpr, However the simulation in the waveform does not generate any clock, the mmcm_locked remains "0" and the qsfp_tx_n[3:0], qsfp_tx_p[3:0], qsfp_rx_n[3:0], qsfp_rx_p[3:0] is in "z" state.

Note: I am not able to add any screenshot of waveform

@alexforencich
Copy link
Owner

@lizajoseph
Copy link
Author

The Alveo example design testbench is here: https://github.com/alexforencich/verilog-ethernet/tree/master/example/Alveo/fpga_25g/tb/fpga_core

Hi Alex,

When I try to run simulation using "make WAVES=1", I get the following error. Am I missing anything in the setup?

ERROR: results.xml was not written by the simulation!
make[1]: *** [/home/[email protected]/anaconda3/lib/python3.9/site-packages/cocotb/share/makefiles/simulators/Makefile.icarus:96: results.xml] Error 1
make[1]: Leaving directory '/home/[email protected]/verilog-ethernet/example/Alveo/fpga_25g/tb/fpga_core'
make: *** [/home/[email protected]/anaconda3/lib/python3.9/site-packages/cocotb/share/makefiles/Makefile.inc:40: sim] Error 2

@lizajoseph
Copy link
Author

The issue was with "scapy" that needs to be installed as most testcases uses scapy libraries. After installing scapy I was able to run the testcases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants