Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12600 Discussions

What if startofpacket is deasserted before endofpacket?

Altera_Forum
Honored Contributor II
1,102 Views

The concept of data packet usually involves a stream of serial data with fields. A data packet thus becomes a self contained unit and may not have a total fixed length as some fields may be of variable length which is described by other fields. 

 

 

 

In avalon streaming interface there exist startofpacket and endofpacket signals. I would expect that a system is able to "know" if a packet transfer has been completed by reading the fields inside it and see if all bytes are received, parity or CRC values match payload e.t.c. Why then do we need a endofpacket signal and also a startofpacket signal? 

 

 

Also, what does it mean if startofpacket is asserted, deasserted and asserted again without the endofpacket being asserted? Does it mean that a packet was only partially transferred and shall be ignored?
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
367 Views

Lots of things could arrise: 

1. Data loss, you've lost some data - how do we resync with the start of a packet? 

2. Data corruption - CRC fails, something is wrong in the packet 

3. You didnt receive an EOP and you've got data loss - what now? 

 

You can use SOP/EOP to resynchronise your state machine should the above things occur. 

 

Now - what if we are just sending some data thats not got any headers that tell us the packet length? 

 

Avalon (and AXI) are format agnostic. They dont care what you send over them. So SOP/EOP are just optional signals that dont need to be used, but all the Altera IPs require them to be there, for the above reasons. 

 

If you get 2 SOPs with no EOP, there was probably a problem upstream. You need to decide how to fix that - fix the upstream block, or design the system so that is impossible.
0 Kudos
Reply