OpenCores
URL https://opencores.org/ocsvn/ha1588/ha1588/trunk

Subversion Repositories ha1588

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /ha1588
    from Rev 34 to Rev 35
    Reverse comparison

Rev 34 → Rev 35

/trunk/rtl/tsu/ptp_parser.v
47,7 → 47,7
 
// packet parser: counter
reg [ 9:0] int_cnt, bypass_ipv4_cnt, bypass_ipv6_cnt, bypass_udp_cnt, ptp_cnt;
reg bypass_vlan, ptp_l2, bypass_ipv4, bypass_ipv6, found_udp, bypass_udp, ptp_l4, ptp_event;
reg bypass_vlan, ptp_l2, bypass_mpls, bypass_ipv4, bypass_ipv6, found_udp, bypass_udp, ptp_l4, ptp_event;
reg [ 3:0] ptp_msgid;
reg [15:0] ptp_seqid;
always @(posedge rst or posedge clk) begin
61,7 → 61,7
if (int_valid && int_sop)
int_cnt <= 10'd0;
else if (int_valid)
int_cnt <= int_cnt + 10'd1 - bypass_vlan - (bypass_ipv4 || bypass_ipv6 || bypass_udp);
int_cnt <= int_cnt + 10'd1 - bypass_vlan - bypass_mpls - (bypass_ipv4 || bypass_ipv6 || bypass_udp);
 
if (int_valid && int_sop)
bypass_ipv4_cnt <= 10'd0;
89,6 → 89,7
always @(posedge rst or posedge clk) begin
if (rst) begin
bypass_vlan <= 1'b0;
bypass_mpls <= 1'b0;
bypass_ipv4 <= 1'b0;
bypass_ipv6 <= 1'b0;
found_udp <= 1'b0;
99,6 → 100,7
end
else if (int_valid && int_sop) begin
bypass_vlan <= 1'b0;
bypass_mpls <= 1'b0;
bypass_ipv4 <= 1'b0;
bypass_ipv6 <= 1'b0;
found_udp <= 1'b0;
118,16 → 120,26
else if (int_valid && bypass_vlan)
bypass_vlan <= 1'b0;
 
// bypass mpls
if (int_valid && (int_cnt==10'd3 || bypass_vlan && int_cnt==10'd4) &&
(int_data[31:16]==16'h8847 || int_data[31:16]==16'h8848)) // ether_type == mpls
bypass_mpls <= 1'b1;
else if (int_valid && int_cnt==10'd4 && bypass_mpls &&
int_data[24]==1'b0) // bottom of label stack == 0
bypass_mpls <= 1'b1;
else if (int_valid && bypass_mpls)
bypass_mpls <= 1'b0;
 
// bypass ipv4
if (int_valid && (int_cnt==10'd3 || bypass_vlan && int_cnt==10'd4) && bypass_ipv4_cnt==10'd0 &&
int_data[31:16]==16'h0800 && int_data[15:12]==4'h4) // ether_type == ipv4, ip_version == 4
if (int_valid && (int_cnt==10'd3 || (bypass_vlan || bypass_mpls) && int_cnt==10'd4) && bypass_ipv4_cnt==10'd0 &&
(int_data[31:16]==16'h0800 || bypass_mpls) && int_data[15:12]==4'h4) // ether_type == ipv4, ip_version == 4
bypass_ipv4 <= 1'b1;
else if (int_valid && bypass_ipv4_cnt==10'd4)
bypass_ipv4 <= 1'b0;
 
// bypass ipv6
if (int_valid && (int_cnt==10'd3 || bypass_vlan && int_cnt==10'd4) && bypass_ipv6_cnt==10'd0 &&
int_data[31:16]==16'h86dd && int_data[15:12]==4'h6) // ether_type == ipv6, ip_version == 6
if (int_valid && (int_cnt==10'd3 || (bypass_vlan || bypass_mpls) && int_cnt==10'd4) && bypass_ipv6_cnt==10'd0 &&
(int_data[31:16]==16'h86dd || bypass_mpls) && int_data[15:12]==4'h6) // ether_type == ipv6, ip_version == 6
bypass_ipv6 <= 1'b1;
else if (int_valid && bypass_ipv6_cnt==10'd9)
bypass_ipv6 <= 1'b0;
155,10 → 167,10
ptp_l4 <= 1'b1;
 
// check if it is PTP Event message
if (int_valid && (int_cnt==10'd3 || bypass_vlan && int_cnt==10'd4) && int_data[31:16]==16'h88F7 &&
if (int_valid && (int_cnt==10'd3 || bypass_vlan && int_cnt==10'd4) && int_data[31:16]==16'h88F7 &&
(int_data[11: 8]== 4'h0 || int_data[11:8]==4'h2)) // ptp_message_id == sync || delay_req
ptp_event <= 1'b1;
else if (int_valid && (int_cnt==10'd4 || bypass_vlan && int_cnt==10'd5) && bypass_udp_cnt==10'd1 && ptp_l4 &&
else if (int_valid && int_cnt==10'd4 && bypass_udp_cnt==10'd1 && ptp_l4 &&
(int_data[11: 8]== 4'h0 || int_data[11:8]==4'h2)) // ptp_message_id == sync || delay_req
ptp_event <= 1'b1;
end
/trunk/sim/tsu/wave.do
32,6 → 32,7
add wave -noupdate -format Literal /tsu_queue_tb/DUT_RX/int_data_d1
add wave -noupdate -divider {New Divider}
add wave -noupdate -format Logic /tsu_queue_tb/DUT_RX/parser/bypass_vlan
add wave -noupdate -format Logic /tsu_queue_tb/DUT_RX/parser/bypass_mpls
add wave -noupdate -format Logic /tsu_queue_tb/DUT_RX/parser/bypass_ipv4
add wave -noupdate -format Logic /tsu_queue_tb/DUT_RX/parser/bypass_ipv6
add wave -noupdate -format Logic /tsu_queue_tb/DUT_RX/parser/bypass_udp
53,9 → 54,10
add wave -noupdate -format Literal /tsu_queue_tb/DUT_RX/q_wrusedw
add wave -noupdate -divider {New Divider}
add wave -noupdate -format Literal -radix unsigned /tsu_queue_tb/BFM_RX/num_rx
add wave -noupdate -format Literal -radix unsigned /tsu_queue_tb/rx_ptp_event_cnt
add wave -noupdate -divider {New Divider}
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {76206000 ps} 0}
WaveRestoreCursors {{Cursor 1} {535600 ps} 0}
configure wave -namecolwidth 188
configure wave -valuecolwidth 165
configure wave -justifyvalue left
70,4 → 72,4
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {0 ps} {317931600 ps}
WaveRestoreZoom {0 ps} {389986800 ps}
/trunk/sim/tsu/tsu_queue_tb.v
119,6 → 119,23
.gmii_txdata(gmii_txdata)
);
 
integer rx_ptp_event_cnt;
initial begin
rx_ptp_event_cnt = 0;
forever @(posedge DUT_RX.q_wr_en) begin
rx_ptp_event_cnt = rx_ptp_event_cnt + 1;
$display("%d", BFM_RX.num_rx);
end
end
 
integer tx_ptp_event_cnt;
initial begin
tx_ptp_event_cnt = 0;
forever @(posedge DUT_TX.q_wr_en) begin
tx_ptp_event_cnt = tx_ptp_event_cnt + 1;
//$display("%d", BFM_TX.num_tx);
end
end
 
endmodule
 
/trunk/sim/tsu/ptpdv2_rx.pcap Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.