Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • RTL Foundations36
  • Combinational Design25
  • Sequential Design27
  • FSM & Control27
  • Timing & Clocking39
  • Reset & CDC34
  • Memory & Buses57
    • SRAM and ROM
    • Register Files
    • Valid/Ready Handshake
    • AXI-Lite
      • Channel Overview
      • A Minimal AXI-Lite Slave
      • Responses, Strobes and Errors
      • Throughput and Backpressure
      • AXI-Lite End to End into a CSR
    • AXI-Stream
    • Bus Integration
    • Synchronous FIFO
    • Register-Map and CSR RTL
    • Memory Reliability
    • Peripheral RTL Integration
    • Full AXI4: RTL Roadmap
  • Advanced RTL28
  • Senior & Interview76
  • Glossary and Notation
Loading lesson

‹AXI-Lite
  1. Topics
  2. RTL Design
  3. Memory & Buses
  4. AXI-Lite
  5. Responses, Strobes and Errors

Part 7 · Memory & Buses · Intermediate

Responses, Strobes and Errors

OKAY, SLVERR, and DECERR; partial-write strobe cases with a worked example; default-slave behavior.

On this page

    Why this matters

    A write that ignores WSTRB clears the other bytes of a shared control register. A bus that answers OKAY with junk for an unmapped address leaves software trusting garbage, and with no default slave the master hangs.

    After this lesson you can: merge bytes using WSTRB, choose OKAY, SLVERR or DECERR correctly, and explain what the default slave is for.

    Response codes

    Every write ends with a two-bit B response and every read with a two-bit R response. AXI4-Lite permits OKAY, SLVERR and DECERR; EXOKAY is excluded. The minimal register bank implements only OKAY and SLVERR, while the default target below implements DECERR.

    Code

    Name

    Meaning

    Who sends it

    2'b00

    OKAY

    Normal success

    Lite slaves and the interconnect

    2'b01

    EXOKAY

    Exclusive-access success

    Full AXI only; never a Lite slave

    2'b10

    SLVERR

    Slave error: bad address or rejected access

    Lite slave for unmapped or protected words

    2'b11

    DECERR

    Decode error: no target owns the address

    Decode/default-target policy, including the Lite default slave below

    AXI4-Lite has no exclusive-request signals, so it cannot represent an exclusive request and must not return EXOKAY. DECERR is a legal Lite response; this fabric assigns it to the default target when no mapped target matches. SLVERR for an unimplemented word within the selected register bank is this bank's policy.

    Partial writes with WSTRB

    WSTRB has one bit per byte lane of WDATA: bit i enables byte i. A lane with its strobe high takes the new byte; a lane with its strobe low keeps the old byte.

    WSTRB

    Effect on a 32-bit word

    Typical use

    4'b1111

    Full-word replace

    Normal register write

    4'b0001, 0010, 0100, 1000

    One byte replaced

    Byte-wide control or status bits

    4'b0011, 4'b1100

    Low or high halfword replaced

    16-bit fields

    4'b0101, 4'b1010

    Alternating bytes replaced

    Packed byte arrays

    4'b0000

    Mapped writable word: nothing replaced, completes OKAY

    No-op write; address errors still apply

    Worked example: the register holds 0x12345678 and a write arrives with data 0xAABBCCDD and strobes 4'b1010. Lanes 3 and 1 take new bytes (AA and CC) while lanes 2 and 0 keep old bytes (34 and 78), so the register becomes 0xAA34CC78.

    Byte lane

    3

    2

    1

    0

    Old register

    12

    34

    56

    78

    WDATA

    AA

    BB

    CC

    DD

    WSTRB bit

    1

    0

    1

    0

    New register

    AA

    34

    CC

    78

    Read each column on its own: the strobe bit picks the WDATA byte (bold) when it is 1 and keeps the old byte when it is 0. The lanes never mix, so each byte is a separate 2-to-1 choice.

    Zero strobes suppress byte updates, not address validation: a mapped writable word in this bank returns OKAY unchanged, an unmapped bank word returns SLVERR, and a request routed to the default target returns DECERR. The bank bench checks both mapped and unmapped zero-strobe writes. The default target has no WSTRB input because every paired write returns DECERR regardless of its strobes.

    The default slave

    An interconnect routes each address to one slave, and every address it cannot route still needs an answer. A default slave accepts any paired write or any read and answers DECERR, so no master ever hangs on an unmapped access.

    The listing below pairs AW and W exactly like a real slave, then responds without touching any register. Reads return zero data with DECERR.

    axilite_default_slave.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    // Default slave for unmapped addresses: accepts every request, answers DECERR.
    module axilite_default_slave #(
      parameter int AW = 8,
      parameter int DW = 32
    ) (
      input  logic             clk,
      input  logic             rst_n,
      input  logic             s_awvalid,
      output logic             s_awready,
      input  logic             s_wvalid,
      output logic             s_wready,
      output logic             s_bvalid,
      input  logic             s_bready,
      output logic [1:0]       s_bresp,
      input  logic             s_arvalid,
      output logic             s_arready,
      output logic             s_rvalid,
      input  logic             s_rready,
      output logic [DW-1:0]    s_rdata,
      output logic [1:0]       s_rresp
    );
      localparam [1:0] DECERR = 2'b11;
    
      logic aw_seen, w_seen;
    
      assign s_awready = !aw_seen && !s_bvalid;
      assign s_wready  = !w_seen  && !s_bvalid;
      assign s_arready = !s_rvalid;
      assign s_bresp   = DECERR;
      assign s_rresp   = DECERR;
      assign s_rdata   = '0;
    
      always_ff @(posedge clk or negedge rst_n) begin
        if (!rst_n) begin
          aw_seen  <= 1'b0;
          w_seen   <= 1'b0;
          s_bvalid <= 1'b0;
          s_rvalid <= 1'b0;
        end else begin
          if (s_awvalid && s_awready) aw_seen <= 1'b1;
          if (s_wvalid && s_wready)   w_seen  <= 1'b1;
          if (aw_seen && w_seen && !s_bvalid) begin
            s_bvalid <= 1'b1;
            aw_seen  <= 1'b0;
            w_seen   <= 1'b0;
          end
          if (s_bvalid && s_bready) s_bvalid <= 1'b0;
          if (s_arvalid && s_arready) s_rvalid <= 1'b1;
          if (s_rvalid && s_rready)   s_rvalid <= 1'b0;
        end
      end
    endmodule

    Common mistakes

    Common pitfall

    Ignoring WSTRB and writing the full word is a read-modify-write hazard in disguise. A byte write to a shared control register then clears the other three bytes, including bits owned by other logic. Always merge through the strobes.

    Interview

    Likely question: “Unmapped address: SLVERR or DECERR, and from whom?” A mapped slave answers SLVERR for words inside its range that select nothing; the interconnect answers DECERR when no slave matches at all.

    Check yourself Can an AXI4-Lite interface encode an exclusive write, and which response is excluded?

    No: Lite lacks exclusive-request signals. EXOKAY is excluded; OKAY, SLVERR and DECERR are legal, with the implemented subset determined by the target's policy.

    Check yourself A write carries WSTRB = 4'b0000. What changes, and what response is returned?

    No bytes change. A mapped writable word in this bank returns OKAY, an unmapped bank word still returns SLVERR, and the default target returns DECERR. Zero strobes do not turn an invalid address into a successful access.

    Check yourself A master writes address 0x40 in a fabric with two slaves covering 0x00–0x07 and 0x10–0x17. Which block answers, and with what?

    The default slave, with DECERR on B. Neither real slave matches, so the fabric routes the request to the default path.

    Testbench

    The default slave plus a testbench: a W-before-AW write and a read both answer DECERR, with stalls proving the responses hold.

    axilite_default_slave.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    module axilite_default_slave #(
      parameter int AW = 8,
      parameter int DW = 32
    ) (
      input  logic             clk,
      input  logic             rst_n,
      input  logic             s_awvalid,
      output logic             s_awready,
      input  logic             s_wvalid,
      output logic             s_wready,
      output logic             s_bvalid,
      input  logic             s_bready,
      output logic [1:0]       s_bresp,
      input  logic             s_arvalid,
      output logic             s_arready,
      output logic             s_rvalid,
      input  logic             s_rready,
      output logic [DW-1:0]    s_rdata,
      output logic [1:0]       s_rresp
    );
      localparam [1:0] DECERR = 2'b11;
    
      logic aw_seen, w_seen;
    
      assign s_awready = !aw_seen && !s_bvalid;
      assign s_wready  = !w_seen  && !s_bvalid;
      assign s_arready = !s_rvalid;
      assign s_bresp   = DECERR;
      assign s_rresp   = DECERR;
      assign s_rdata   = '0;
    
      always_ff @(posedge clk or negedge rst_n) begin
        if (!rst_n) begin
          aw_seen  <= 1'b0;
          w_seen   <= 1'b0;
          s_bvalid <= 1'b0;
          s_rvalid <= 1'b0;
        end else begin
          if (s_awvalid && s_awready) aw_seen <= 1'b1;
          if (s_wvalid && s_wready)   w_seen  <= 1'b1;
          if (aw_seen && w_seen && !s_bvalid) begin
            s_bvalid <= 1'b1;
            aw_seen  <= 1'b0;
            w_seen   <= 1'b0;
          end
          if (s_bvalid && s_bready) s_bvalid <= 1'b0;
          if (s_arvalid && s_arready) s_rvalid <= 1'b1;
          if (s_rvalid && s_rready)   s_rvalid <= 1'b0;
        end
      end
    endmodule
    

    Remember

    • A strobe bit enables its byte lane. With 0x12345678, data 0xAABBCCDD and strobes 4'b1010, the register becomes 0xAA34CC78.

    • A mapped slave answers SLVERR for a word in its range that selects nothing. The interconnect answers DECERR when no slave matches.

    • AXI4-Lite has no exclusive access, so it never returns EXOKAY. Zero strobes change no byte but still return a response.

    Keep going

    • Practice: AXI4 write channel with WSTRB support

    • Practice: AXI4-Lite slave with invalid address protection

    • Interview: run a mock interview on this topic

    Related topics

    • Throughput and Backpressure

    Previous

    204 / 350

    Next: Throughput and Backpressure

    Up next

    Up nextThroughput and Backpressure

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Channel Overview
    • AXI-Lite End to End into a CSR