07-01-2019 09:09 PM
I am trying to access various data in a packet sent through the ethernet. I wrote a code using variables as shown:
wait until rising_edge(INTERNAL_RXCLK);
if(RXDV = '1') then
if(g_data = '1' and g_data_done = '0') then
if(PACKET_LENGTH = 13) then
d_packet <= RXD;
elsif(PACKET_LENGTH = 14 + c_a*5 and d_packet = x"0d") then
addr_reg(c) := RXD;
GPIO_LEDS(3 downto 0) <= RXD(3 downto 0);
c_a <= c_a + 1;
c <= c + 1;
Both c_a and c are integer variables
But everytime it is showing wrong values. Instead of using variables if I am hard coding the exact numbers then it is working fine. But I can't write the condition for every index. Can somebody suggest something how to solve this error.
07-12-2019 04:49 AM - edited 07-12-2019 04:51 AM
I'm guessing your more used to writting C++ ? It's not a critisisum. But be carefull.
Is this just for a test bench or synthesis.
Don't use a wait on clock and no sensetivity list.
Put the clock in the sensetuvity list, and use if rising_edge ..
Also. Take step back and think what hardware this code would produce, and what hardware u want