Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add adapter module for bus #566

Merged
merged 12 commits into from
Jan 29, 2024
Merged

Conversation

makz00
Copy link
Contributor

@makz00 makz00 commented Jan 15, 2024

Resolves: #531

@makz00 makz00 marked this pull request as ready for review January 15, 2024 00:03
@makz00 makz00 marked this pull request as draft January 15, 2024 00:04
coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
coreblocks/lsu/dummyLsu.py Outdated Show resolved Hide resolved
@makz00 makz00 marked this pull request as ready for review January 20, 2024 00:20
coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
coreblocks/lsu/dummyLsu.py Outdated Show resolved Hide resolved
Copy link
Member

@tilk tilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proper AXI tests left for later.

Copy link
Contributor

@lekcyjna123 lekcyjna123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only few small comments

coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
coreblocks/peripherals/wishbone.py Outdated Show resolved Hide resolved
Copy link
Member

@tilk tilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please fix the docstrings? I've pointed out some issues, but there is more. Also, is using a Protocol for the bus configurations justified?

Comment on lines 16 to 32
class BusParametersInterface(Protocol):
"""
Bus Parameters Interface for common buses

Parameters
----------
data_width : int
An integer that describe the width of data for parametrized bus.
addr_width : int
An integer that describe the width of address for parametrized bus.
granularity : int
An integer that describe the granularity of accesses for parametrized bus.
"""

data_width: int
addr_width: int
granularity: int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the use of a Protocol necessary here? Shouldn't this just become a dataclass?

Copy link
Contributor Author

@makz00 makz00 Jan 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it would be dataclass then all specific buses implementations will have to use it for holding parameters. Presumably some bus can have different parameters than other buses and then that dataclass will have to be extended and in some cases would have redundant fields. Please correct me if I am missing something.

With Protocol we specify parameters that are important from Common Bus Master side point of view.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it the way it is for now.

coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
coreblocks/peripherals/bus_adapter.py Outdated Show resolved Hide resolved
@makz00 makz00 requested a review from tilk January 27, 2024 20:50
@tilk
Copy link
Member

tilk commented Jan 29, 2024

There are conflicts to be resolved.

@tilk tilk merged commit 1888131 into kuznia-rdzeni:master Jan 29, 2024
8 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generalize bus interfaces
4 participants