2- Changes in the router to support 1588
From NetFPGAWiki
- 2- Changes in the router to support 1588
- In order to support 1588 standard, some changes was made in nf2_core.v and nf2_mac_grp.v modules. Also a new module called stamp_counter.v was added and instantiated in nf2_core.v. The following flowchart shows how different modules are connected in nf2_core.v. stamp_counter.v is a 96-bit counter. The lowest 32bits are the fraction part of the counter.
Counter is controlled by the softwer with two different values. inc_value_int and inc_value_frac. inc_value_int is a 64 bit register which will be added to the 64 highest bits of the counter when enable_inc_int is high. inc_value_frac controlls the counter correction value and is added to the lowest 64bits of the counter.
- 2-1 Filtering the input ptp packets
- PTP packets are ethernet packets with valid PTP header. mac_grp_time_stamp.v monitors the incoming and out goign packets and generates the time stamp if case of a valid ptp packet. The following image shows the format of a valid PTP packet header. As shown in the image, the byte following the eth_type should be less than 4 to generate the time stamp.
- 2-2 Generate a time stamp for valid PTP packets
- In case of having a valid PTP packet, the value of the stamp counter is copied to registers. Software can access these registers and read them. Three registers are associated to each mac, two registers show the 64 highest bit of the counter and third register is 1 if the value of the time stamp registers is valid.


