aboutsummaryrefslogtreecommitdiffstats
path: root/fpga/usrp3
diff options
context:
space:
mode:
authorWade Fife <wade.fife@ettus.com>2020-04-15 21:05:15 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-08-04 15:40:08 -0500
commit24f8bb39fd2769ff93d11b21152a834500152de4 (patch)
tree65fbf5d1a0aa6e3ac828c69a6e650c3ad0f72105 /fpga/usrp3
parentb862eda69cf41c7044a1805324f2fcfef5b0ba3d (diff)
downloaduhd-24f8bb39fd2769ff93d11b21152a834500152de4.tar.gz
uhd-24f8bb39fd2769ff93d11b21152a834500152de4.tar.bz2
uhd-24f8bb39fd2769ff93d11b21152a834500152de4.zip
fpga: rfnoc: Add 4 KiB boundary check to sim_axi_ram
Adding a check for bursts that cross the 4 KiB boundary to the AXI4 memory model. Crossing a 4 KiB boundary is not allowed by AXI4.
Diffstat (limited to 'fpga/usrp3')
-rw-r--r--fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_axi_ram_fifo/sim_axi_ram.sv12
1 files changed, 12 insertions, 0 deletions
diff --git a/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_axi_ram_fifo/sim_axi_ram.sv b/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_axi_ram_fifo/sim_axi_ram.sv
index ee7ff5df8..efe3c2f30 100644
--- a/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_axi_ram_fifo/sim_axi_ram.sv
+++ b/fpga/usrp3/lib/rfnoc/blocks/rfnoc_block_axi_ram_fifo/sim_axi_ram.sv
@@ -75,6 +75,10 @@ module sim_axi_ram #(
localparam DEBUG = 0;
+ // Define a mask that can be used to tell which 4K window is being addressed
+ localparam [AWIDTH-1:0] MASK_4K = {AWIDTH{1'b1}} << 12;
+
+
//---------------------------------------------------------------------------
// Data Types
//---------------------------------------------------------------------------
@@ -309,6 +313,10 @@ module sim_axi_ram #(
assert ($cast(burst, s_axi_awburst)) else begin
$fatal(1, "Invalid AWBURST value");
end
+ assert ((s_axi_awaddr & MASK_4K) ==
+ ((s_axi_awaddr + (s_axi_awlen+1)*(2**s_axi_awsize) - 1) & MASK_4K)) else begin
+ $fatal(1, "Memory write burst crosses 4 KiB boundary");
+ end
if (DEBUG) begin
$display("WRITE REQ: id=%X, addr=%X, len=%X, size=%X, burst=%s, %t, %m",
@@ -362,6 +370,10 @@ module sim_axi_ram #(
assert ($cast(burst, s_axi_awburst)) else begin
$fatal(1, "Invalid ARBURST value");
end
+ assert ((s_axi_araddr & MASK_4K) ==
+ ((s_axi_araddr + (s_axi_arlen+1)*(2**s_axi_arsize) - 1) & MASK_4K)) else begin
+ $fatal(1, "Memory read burst crosses 4 KiB boundary");
+ end
if (DEBUG) begin
$display("READ REQ: id=%X, addr=%X, len=%X, size=%X, burst=%s, %t, %m",