-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
soc/interconnect/packet: Add **kwargs to Arbiter/Dispatcher to allow …
…specifying keep/omit parameters for connection.
- Loading branch information
1 parent
fea3a7e
commit 42c1046
Showing
1 changed file
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# | ||
# This file is part of LiteX. | ||
# | ||
# Copyright (c) 2015-2019 Florent Kermarrec <[email protected]> | ||
# Copyright (c) 2015-2024 Florent Kermarrec <[email protected]> | ||
# Copyright (c) 2019 Vamsi K Vytla <[email protected]> | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
|
||
|
@@ -37,12 +37,12 @@ def __init__(self, endpoint): | |
# Arbiter ------------------------------------------------------------------------------------------ | ||
|
||
class Arbiter(LiteXModule): | ||
def __init__(self, masters, slave): | ||
def __init__(self, masters, slave, **kwargs): | ||
if len(masters) == 0: | ||
pass | ||
elif len(masters) == 1: | ||
self.grant = Signal() | ||
self.comb += masters.pop().connect(slave) | ||
self.comb += masters.pop().connect(slave, **kwargs) | ||
else: | ||
self.rr = RoundRobin(len(masters)) | ||
self.grant = self.rr.grant | ||
|
@@ -57,11 +57,11 @@ def __init__(self, masters, slave): | |
# Dispatcher --------------------------------------------------------------------------------------- | ||
|
||
class Dispatcher(LiteXModule): | ||
def __init__(self, master, slaves, one_hot=False): | ||
def __init__(self, master, slaves, one_hot=False, **kwargs): | ||
if len(slaves) == 0: | ||
self.sel = Signal() | ||
elif len(slaves) == 1 and not one_hot: | ||
self.comb += master.connect(slaves.pop()) | ||
self.comb += master.connect(slaves.pop(), **kwargs) | ||
self.sel = Signal() | ||
else: | ||
if one_hot: | ||
|