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

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • Study Route: One Week Before the Interview
  • Study Route: Two Weeks
  • Study Route: Four Weeks (Full Course)4
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • UVM Testbench Puzzles25
  • Clock, Reset & CDC Puzzles25
  • Bus and Interface Protocol Puzzles25
    • Valid/Ready Handshake Puzzles
    • APB Protocol Puzzles
    • AXI Protocol Puzzles
      • The 4 KB Rule Splits a Burst
      • OKAY, SLVERR or DECERR?
      • WRAP Burst Address Sequence
      • WLAST One Beat Early
      • How Many Read Orders Are Legal?
      • Whose Data Is This? W Has No ID
    • FIFO, Arbitration and Credit Puzzles
    • Bus and Interface Protocol Puzzles: Tricky Q&A
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←AXI Protocol Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Bus and Interface Protocol Puzzles
  4. AXI Protocol Puzzles
  5. OKAY, SLVERR or DECERR?
On this page

    VLSI DV Interview PuzzlesAll levels

    OKAY, SLVERR or DECERR?

    System address map: 0x00000-0x0FFFF RAM (read/write), 0x10000-0x100FF status registers (read-only, the slave returns an error on writes), everything else unmapped. For the five 4-beat accesses in the code, what response does each get, who generates it, and how many R beats come back for the unmapped read?

    Puzzle

    Difficulty: Medium · Puzzle 2 of 6 · Topic: AXI Protocol Puzzles

    System address map: 0x00000-0x0FFFF RAM (read/write), 0x10000-0x100FF status registers (read-only, the slave returns an error on writes), everything else unmapped. For the five 4-beat accesses in the code, what response does each get, who generates it, and how many R beats come back for the unmapped read?

    Code

    tb.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
    `timescale 1ns/1ns
    module tb;
      typedef enum bit [1:0] {OKAY = 2'b00, SLVERR = 2'b10, DECERR = 2'b11} resp_t;
    
      // Address map: 0x0000-0xFFFF RAM (read/write), 0x10000-0x100FF status regs (read-only), everything else unmapped
      function automatic resp_t respond(bit [31:0] addr, bit is_write);
        if (addr < 32'h1_0000)                     return OKAY;
        if (addr >= 32'h1_0000 && addr < 32'h1_0100) return is_write ? SLVERR : OKAY;
        return DECERR;                                           // no slave decoded: the interconnect answers
      endfunction
    
      task automatic access(bit [31:0] addr, bit is_write, int beats);
        resp_t r = respond(addr, is_write);
        if (is_write) $display("WR 0x%05h : B resp = %s (one response for the whole burst)", addr, r.name());
        else          $display("RD 0x%05h : %0d R beats, every RRESP = %s, RLAST on beat %0d", addr, beats, r.name(), beats);
      endtask
    
      initial begin
        access(32'h0_0100, 1, 4);
        access(32'h1_0010, 1, 4);
        access(32'h1_0010, 0, 4);
        access(32'h2_0000, 1, 4);
        access(32'h2_0000, 0, 4);
        #1 $finish;
      end
    endmodule

    Hint

    Think about which component can answer when no slave is selected, and whether an error ends a read burst early.

    Step-by-step solution

    Diagram
    1) WR 0x00100 hits RAM: OKAY.
    2) WR 0x10010 reaches the read-only status block, which answers SLVERR (a slave was reached but refused the access).
    3) RD 0x10010 is a legal read of that block: OKAY on every beat.
    4) WR 0x20000 and RD 0x20000 hit no slave: the interconnect's default responder returns DECERR.
    5) An error does not shorten a read burst: all 4 R beats return with RRESP=DECERR and RLAST on beat 4. A write gets a single B response for the whole burst.

    Answer

    Answer: OKAY, SLVERR, OKAY, DECERR, DECERR. DECERR is generated by the interconnect (decode error, no slave); SLVERR by a slave that was reached. The unmapped 4-beat read returns 4 R beats, all DECERR, RLAST on the fourth.

    How this was checked

    Checked by running the code in Verilator 5; the printed output supports the answer above. An address-map model gives OKAY for RAM, SLVERR for a write to the read-only block, DECERR for unmapped addresses; an error read still returns every beat.

    Why candidates get it wrong

    Reporting a single error beat for a failed read is wrong: the full number of R beats with RLAST must still return or the master hangs. Also 'DECERR from the slave' is wrong: DECERR normally comes from the interconnect for an address no slave decodes, not from a slave you reached.

    Interviewer follow-up

    For a 4-beat write to an unmapped address, must the interconnect still take the W beats? Model answer: Yes. It has to accept and discard all 4 W beats (through WLAST) and then return one B response with DECERR; refusing the W beats would stall the shared write-data channel and block unrelated masters.

    Related topics

    • Back to AXI Protocol Puzzles

    • Bus and Interface Protocol Puzzles section

    Previous

    274 / 293

    Next: WRAP Burst Address Sequence

    Up next

    Up nextWRAP Burst Address Sequence

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • WLAST One Beat Early
    • How Many Read Orders Are Legal?
    • Whose Data Is This? W Has No ID