@@ -881,21 +881,23 @@ package axi_test;
881
881
end
882
882
beat.ax_len = bytes / AXI_STRB_WIDTH - 1 ;
883
883
end
884
- // Determine `ax_addr`.
885
- if (beat.ax_atop == axi_pkg :: ATOP_ATOMICCMP && AXI_BURST_FIXED ) begin
884
+ // Determine `ax_addr` and `ax_burst` .
885
+ if (beat.ax_atop == axi_pkg :: ATOP_ATOMICCMP ) begin
886
886
// The address must be aligned to half the outbound data size. [E2-337]
887
887
beat.ax_addr = beat.ax_addr & ~ ((1'b1 << beat.ax_size) - 1 );
888
- end else begin
889
- // The address must be aligned to the data size. [E2-337]
890
- beat.ax_addr = beat.ax_addr & ~ ((1'b1 << (beat.ax_size+ 1 )) - 1 );
891
- end
892
- // Determine `ax_burst`.
893
- if (beat.ax_atop == axi_pkg :: ATOP_ATOMICCMP ) begin
894
888
// If the address is aligned to the total size of outgoing data, the burst type must be
895
889
// INCR. Otherwise, it must be WRAP. [E2-338]
896
890
beat.ax_burst = (beat.ax_addr % ((beat.ax_len+ 1 ) * 2 ** beat.ax_size) == 0 ) ?
897
891
axi_pkg :: BURST_INCR : axi_pkg :: BURST_WRAP ;
892
+ // If we are not allowed to emit WRAP bursts, align the address to the total size of
893
+ // outgoing data and fall back to INCR.
894
+ if (beat.ax_burst == axi_pkg :: BURST_WRAP && ! AXI_BURST_WRAP ) begin
895
+ beat.ax_addr - = (beat.ax_addr % ((beat.ax_len+ 1 ) * 2 ** beat.ax_size));
896
+ beat.ax_burst = axi_pkg :: BURST_INCR ;
897
+ end
898
898
end else begin
899
+ // The address must be aligned to the data size. [E2-337]
900
+ beat.ax_addr = beat.ax_addr & ~ ((1'b1 << (beat.ax_size+ 1 )) - 1 );
899
901
// Only INCR allowed.
900
902
beat.ax_burst = axi_pkg :: BURST_INCR ;
901
903
end
0 commit comments