Skip to content

Add example when using directionally split records for the bus #118

@timkoers

Description

@timkoers

I've gotten directionally splitted bus records to work with the components in this package.

Since our feedback signals live inside another record (with a different signal direction), I needed to use some Python trickery (shallow copy) to get that to work.

Below is an example of record mapping of an AXI4-Stream where the feedback signal lives in another signal.

import copy

stream_bus = AxiStreamBus.from_prefix(dut.axi_mosi, "")
stream_bus.tready = copy.copy(dut.axi_miso.tready)

You can then just initialize a source/sink/whatever as normal and use this.

This also works for AXI4 records, but require more shallow copies as, for each channel, you'd have to create a single structure that contains both incoming and outgoing signals for that channel.
This is also verified to work by using it with an AxiRam.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions