CDL Modules
Files
apb_processor

Files

file  apb_processor.cdl
 Pipelined APB request/response master, driven by a ROM.
 

Detailed Description

Modules

module apb_processor::apb_processor ( clock  clk,
input bit  reset_n,
input t_apb_processor_request  apb_processor_request,
output t_apb_processor_response  apb_processor_response,
output t_apb_request  apb_request,
input t_apb_response  apb_response,
output t_apb_rom_request  rom_request,
input bit  rom_data[40] 
)

The module is presented with a request to execute a program from the ROM starting at a certain address. It executes the program, and hence a set of APB requests, as required.

The purpose of the module is to permit programmed sequences of APB transactions without a full-fledge microcontroller being needed, even for PLL setup or DDR pin DLL scanning, and so on.

A request to run a program is an address with a valid bit; if a valid request is presented, it should be held until acknowledge. The module will acknowledge a request using a single cycle acknowledge in its apb_processor_response. Then the module will start reading the ROM at the given address, executing 'APB program instructions' from the data returned. The ROM is external to this module, and hence the rom_request and rom_data signals permit a simple synchronous memory to be attached with the program data.

A second request to run a program may be presented while the APB processor module is busy with the previous program request; this is perfectly acceptable, but there will not be an acknowledge until the APB processor is ready to start the new program; the new request should be held stable until that point.

The ROM contains the APB program, which is 40 bits of data per instruction - 8 bits of opcode, 32 bits of data, per word. The opcode is in [8;32], and the operand data is in [32;0].

The opcodes fall in to 6 different classes: ALU, branch, set parameter, APB request, wait, finish.

  • ALU

    Five ALU ops are supported - OR, BIC, AND, XOR, ADD

  • Branch

    Four branch types are supported - always, if acc is zero, if acc is nonzero, and if repeat count is nonzero (with the side effect of decrementing the repeat count)

  • Set parameter

    Set parameter can set the APB address, accumulator and repeat count

  • Wait

    Wait uses the accumulator, decrementing it once per cycle, to wait before moving on in the program.

  • APB request

    APB request can request read, write accumulator, or write using the ROM content as data; these can optionally also auto-increment the address

  • Finish

    Complete the program, and permit a new request to be started

The module presents a registered APB request interface out, and accepts an APB response back, including pready.

Parameters
[in]clkClock for the CSR interface; a superset of all targets clock
[in]reset_nActive low reset
[in]apb_processor_requestRequest from the client to execute from an address in the ROM
[out]apb_processor_responseResponse to the client acknowledging a request
[out]apb_requestPipelined csr request interface output
[in]apb_responsePipelined csr request interface response
[out]rom_requestRequest to the instruction ROM for reading, with address
[in]rom_dataRead data back from the ROM with the APB program instruction