Day 16

APB Master

Day 16

Design and verify an APB master interface which generates an APB transfer using a command input: | cmd_i | Comment | |-------|---------| | 2'b00 | No-operation | | 2'b01 | APB Read from address 0xDEAD_CAFE | | 2'b10 | Increment the previously read data and write to 0xDEAD_CAFE | | 2'b11 | Invalid/Not possible |

Interface Definition

  • The cmd_i input remains stable until the APB transfer is complete
  • The module should have the following interface:
module day16 (
  input       wire        clk,
  input       wire        reset,

  input       wire[1:0]   cmd_i,

  output      wire        psel_o,
  output      wire        penable_o,
  output      wire[31:0]  paddr_o,
  output      wire        pwrite_o,
  output      wire[31:0]  pwdata_o,
  input       wire        pready_i,
  input       wire[31:0]  prdata_i
);

Coding Exercise

You're expected to code both the RTL and testbench for the problem. Your testbench should include the stimulus and checkers.

NOTE

The testcase will show PASSED as long as the RTL and testbench compile, but it doesn't imply that the implemented logic is correct.

If you're interested in learning more about RTL Design and don't want to worry about implementing the checks or the testbench code then I'd recommend the Hands-on RTL Design course. The course contains 25 RTL Design problems to help improve your design skills and comes with a 2-part video solution for every problem.

Challenge

Try solving this problem which deals with designing an APB master but with slight variation.

Related concepts

Loading the interactive workspace...