coreblocks.peripherals package
Submodules
coreblocks.peripherals.axi_lite module
- class coreblocks.peripherals.axi_lite.AXILiteInterface
Bases:
AbstractInterface[AbstractSignature],Protocol- read_address: AXILiteReadAddressInterface
- read_data: AXILiteReadDataInterface
- write_address: AXILiteWriteAddressInterface
- write_data: AXILiteWriteDataInterface
- write_response: AXILiteWriteResponseInterface
- class coreblocks.peripherals.axi_lite.AXILiteMaster
Bases:
ComponentAXI-Lite master interface.
- Parameters:
- axil_params: AXILiteParameters
Parameters for bus generation.
- Attributes:
- ra_request: Method
Transactional method for initiating request on read address channel. Ready when no request or only one is being executed. Takes ‘ra_request_layout’ as argument.
- rd_response: Method
Transactional method for reading response from read data channel. Ready when there is request response availabe. Returns data and response state as ‘rd_response_layout’.
- wa_request: Method
Transactional method for initiating request on write address channel. Ready when no request or only one is being executed. Takes ‘wa_request_layout’ as argument.
- wd_request: Method
Transactional method for initiating request on write data channel. Ready when no request or only one is being executed. Takes ‘wd_request_layout’ as argument.
- wr_response: Method
Transactional method for reading response from write response channel. Ready when there is request response availabe. Returns response state as ‘wr_response_layout’.
- __init__(axil_params: AXILiteParameters)
- axil_master: AXILiteInterface
- result_handler(m: TModule, forwarder: Forwarder, *, channel: AXILiteWriteResponseInterface | AXILiteReadDataInterface)
- start_request_transaction(m, arg, *, channel, is_address_channel)
- state_machine_request(m: TModule, method: Method, *, channel: AXILiteWriteAddressInterface | AXILiteWriteDataInterface | AXILiteReadAddressInterface, request_signal: Signal)
- class coreblocks.peripherals.axi_lite.AXILiteMasterInterface
Bases:
ProtocolTransactional interface of an AXI-Lite master.
- __init__(*args, **kwargs)
- ra_request: PROVIDED: 1>]
Initiates a request on the read address channel. Takes ra_request_layout as argument.
- rd_response: PROVIDED: 1>]
Reads a response from the read data channel. Returns rd_response_layout.
- wa_request: PROVIDED: 1>]
Initiates a request on the write address channel. Takes wa_request_layout as argument.
- wd_request: PROVIDED: 1>]
Initiates a request on the write data channel. Takes wd_request_layout as argument.
- wr_response: PROVIDED: 1>]
Reads a response from the write response channel. Returns wr_response_layout.
- class coreblocks.peripherals.axi_lite.AXILiteParameters
Bases:
objectParameters of the AXI-Lite bus.
- Parameters:
- data_width: int
Width of “data” signals for “write data” and “read data” channels. Must be either 32 or 64 bits. Defaults to 64
- addr_width: int
Width of “addr” signals for “write address” and “read address” channels. Defaults to 64 bits.
- class coreblocks.peripherals.axi_lite.AXILiteSignature
Bases:
SignatureAXI-Lite bus signature
- Parameters:
- axil_params: AXILiteParameters
Parameters used to generate AXI-Lite signature
- __init__(axil_params: AXILiteParameters)
- class coreblocks.peripherals.axi_lite.PureAXILiteMasterInterface
Bases:
AXILiteMasterInterfaceAXILiteMasterInterface with no behavior of its own.
- __init__(axil_params: AXILiteParameters)
coreblocks.peripherals.bus_adapter module
- class coreblocks.peripherals.bus_adapter.AXILiteMasterAdapter
Bases:
PureBusMasterInterface,ElaboratableAn adapter for AXI Lite master.
The adapter module is for use in places where BusMasterInterface is expected.
- Parameters:
- axil_params: AXILiteParameters
Parameters of the adapted AXI Lite master.
- Attributes:
- params: BusParametersInterface
Parameters of the bus.
- method_layouts: CommonBusMasterMethodLayout
Layouts of common bus master methods.
- __init__(axil_params: AXILiteParameters)
- bus: REQUIRED: 2>]
AXI Lite master which is adapted.
- read: PROVIDED: 1>]
Read requests. The request method is ready if the ra_request method of the underlying AXI Lite master is ready. The response method is ready if the rd_response method of the underlying AXI Lite master is ready.
- write: PROVIDED: 1>]
Write requests. The request method is ready if the wa_request and wd_request methods of the underlying AXI Lite master are ready. The response method is ready if the wr_response method of the underlying AXI Lite master is ready.
- class coreblocks.peripherals.bus_adapter.BusMasterInterface
Bases:
ProtocolAn interface of a common bus.
The bus interface is the preferred way to gain access to a specific bus. It simplifies interchangeability of buses on the core configuration level.
- __init__(*args, **kwargs)
- params: BusParametersInterface
Parameters of the bus.
- read: PROVIDED: 1>]
Read requests. The request method sends a read request to the bus, its input layout is CommonBusMasterMethodLayout.request_read_layout. The response method receives a response for a previously sent read request, its output layout is CommonBusMasterMethodLayout.read_response_layout.
- write: PROVIDED: 1>]
Write requests. The request method sends a write request to the bus, its input layout is CommonBusMasterMethodLayout.request_write_layout. The response method receives a response for a previously sent write request, its output layout is CommonBusMasterMethodLayout.write_response_layout.
- class coreblocks.peripherals.bus_adapter.BusParametersInterface
Bases:
ProtocolAn interface for parameters of a common bus.
- Parameters:
- data_widthint
An integer that describes the data width of a parametrized bus.
- addr_widthint
An integer that describes the address width of a parametrized bus.
- granularityint
An integer that describes the granularity of accesses of a parametrized bus.
- __init__(*args, **kwargs)
- class coreblocks.peripherals.bus_adapter.PureBusMasterInterface
Bases:
BusMasterInterfaceBusMasterInterface with no behavior of its own.
- __init__(params: BusParametersInterface)
- class coreblocks.peripherals.bus_adapter.WishboneMasterAdapter
Bases:
ElaboratableAn adapter for Wishbone master.
- Parameters:
- wb_params: WishboneParameters
Parameters of the adapted Wishbone master.
- port_count: int
Number of ports to be created for the bus adapter. Each port will have its own set of methods for read and write requests and responses. The default value is 1.
- Attributes:
- params: BusParametersInterface
Parameters of the bus.
- method_layouts: CommonBusMasterMethodLayout
Layouts of common bus master methods.
- __init__(wb_params: WishboneParameters, port_count: int = 1)
- bus: REQUIRED: 2>]
Wishbone master which is adapted.
- ports: PROVIDED: 1>]
List of bus master interfaces for each port. Each interface contains methods for read and write requests and responses. The number of interfaces is equal to port_count.
coreblocks.peripherals.wishbone module
- class coreblocks.peripherals.wishbone.PipelinedWishboneMaster
Bases:
ComponentPipelined Wishbone bus master interface.
- Parameters:
- wb_params: WishboneParameters
Parameters for bus generation.
- max_req: int
Size of the response buffer, limits the number of pending requests. Defaults to 8.
- Attributes:
- wb: WishboneInterface
Wishbone bus output.
- request: Method
Transactional method to start a new Wishbone request. Ready if new request can be immediately sent. Takes request_layout as argument.
- response: Method
Transactional method to read results from completed requests sequentially. Ready if buffered results are available. Returns state of request (error or success) and data (in case of read request) as response_out_layout.
- requests_finished: Signal, out
True, if there are no requests waiting for response
- __init__(wb_params: WishboneParameters, *, max_req: int = 8)
- generate_method_layouts(wb_params: WishboneParameters)
- class coreblocks.peripherals.wishbone.WishboneArbiter
Bases:
ComponentWishbone Arbiter.
Connects multiple masters to one slave. Bus is requested by asserting CYC signal and is granted to masters in a round robin manner.
- Parameters:
- wb_params: WishboneParameters
Parameters for bus generation.
- num_slaves: int
Number of master devices.
- Attributes:
- slave_wb: WishboneInterface
Slave inteface.
- masters: list of WishboneInterface
List of master interfaces.
- __init__(wb_params: WishboneParameters, num_masters: int)
- masters: list[WishboneInterface]
- slave_wb: WishboneInterface
- class coreblocks.peripherals.wishbone.WishboneInterface
Bases:
ComponentInterface- __init__(wb_params: WishboneParameters)
- class coreblocks.peripherals.wishbone.WishboneMaster
Bases:
ComponentWishbone bus master interface.
- Parameters:
- wb_params: WishboneParameters
Parameters for bus generation.
- name: str, optional
Name of this bus. Used for logging.
- Attributes:
- wb_master: WishboneInterface
Wishbone bus output.
- request: Method
Transactional method to start a new Wishbone request. Ready when no request is being executed and previous result is read. Takes request_layout as argument.
- response: Method
Transactional method to read previous request result. Becomes ready after Wishbone request is completed. Returns state of request (error or success) and data (in case of read request) as response_layout.
- __init__(wb_params: WishboneParameters, name: str = '')
- wb_master: WishboneInterface
- class coreblocks.peripherals.wishbone.WishboneMasterMethodLayout
Bases:
objectWishbone master layouts for methods
- Parameters:
- wb_params: WishboneParameters
Parameters used to generate Wishbone master layouts
- Attributes:
- request_layout: Layout
Layout for request method of WishboneMaster.
- response_layout: Layout
Layout for response method of WishboneMaster.
- __init__(wb_params: WishboneParameters)
- class coreblocks.peripherals.wishbone.WishboneMemorySlave
Bases:
ComponentWishbone slave with memory Wishbone slave interface with addressable memory underneath.
- Parameters:
- wb_params: WishboneParameters
Parameters for bus generation.
- **kwargs: dict
Keyword arguments for the underlying Amaranth’s Memory. If width and depth are not specified, then they’re inferred from wb_params: data_width becomes width and 2 ** addr_width becomes depth.
- Attributes:
- bus: WishboneInterface
Wishbone bus interface.
- __init__(wb_params: WishboneParameters, **kwargs)
- bus: WishboneInterface
- class coreblocks.peripherals.wishbone.WishboneMuxer
Bases:
ComponentWishbone Muxer.
Connects one master to multiple slaves.
- Parameters:
- wb_params: WishboneParameters
Parameters for bus generation.
- ssel_tga: Signal
Signal that selects the slave to connect. Signal width is the number of slaves and each bit coresponds to a slave. This signal is a Wishbone TGA (address tag), so it needs to be valid and held every time Wishbone STB is asserted. Number of create slabve interfaces is determied from ssel_tga bit width. Note that if Pipelined Wishbone implementation is used, then before starting any new request with different ssel_tga value, all pending request have to be finished (and stall cleared). Holding new requests should be implemented in block that controlls ssel_tga signal, before the Wishbone Master.
- Attributes:
- master_wb: WishboneInterface
Master inteface.
- slaves: list of WishboneInterface
List of connected slaves’ Wishbone interfaces.
- __init__(wb_params: WishboneParameters, ssel_tga: Signal)
- master_wb: WishboneInterface
- slaves: list[WishboneInterface]
- class coreblocks.peripherals.wishbone.WishboneParameters
Bases:
objectParameters of the Wishbone bus.
- Parameters:
- data_width: int
Width of dat_r and dat_w Wishbone signals. Defaults to 64 bits
- addr_width: int
Width of adr Wishbone singal. Defaults to 64 bits
- granularity: int
The smallest unit of data transfer that a port is capable of transferring. Defaults to 8 bits