-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
122 additions
and
10 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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
confapp |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// arbiter.dart | ||
// Implementation of arbiters. | ||
// Definition for an interface for a generic arbiter. | ||
// | ||
// 2023 March 13 | ||
// Author: Max Korbel <[email protected]> | ||
|
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
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
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,3 +1,12 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// priority_arbiter.dart | ||
// Implementation of a priority arbiter. | ||
// | ||
// 2023 March 13 | ||
// Author: Max Korbel <[email protected]> | ||
|
||
import 'package:rohd/rohd.dart'; | ||
import 'package:rohd_hcl/rohd_hcl.dart'; | ||
|
||
|
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,16 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// rotate_round_robin_arbiter.dart | ||
// Implementation of arbiters. | ||
// | ||
// 2023 | ||
// Author: Max Korbel <[email protected]> | ||
|
||
import 'package:rohd/rohd.dart'; | ||
import 'package:rohd_hcl/rohd_hcl.dart'; | ||
|
||
/// A round-robin arbiter. | ||
/// A [RoundRobinArbiter] implemented using rotations and a [PriorityArbiter]. | ||
class RotateRoundRobinArbiter extends StatefulArbiter | ||
implements RoundRobinArbiter { | ||
/// Creates an [Arbiter] that fairly takes turns between [requests]. | ||
|
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,18 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// round_robin_arbiter.dart | ||
// Interface for round-robin arbiters. | ||
// | ||
// 2023 December | ||
// Author: Max Korbel <[email protected]> | ||
|
||
import 'package:rohd/rohd.dart'; | ||
import 'package:rohd_hcl/rohd_hcl.dart'; | ||
|
||
/// A [StatefulArbiter] which fairly arbitrates between requests. | ||
abstract class RoundRobinArbiter extends StatefulArbiter { | ||
/// By default, creates an instance of a [MaskRoundRobinArbiter]. | ||
factory RoundRobinArbiter(List<Logic> requests, | ||
{required Logic clk, required Logic reset}) => | ||
MaskRoundRobinArbiter(requests, clk: clk, reset: reset); | ||
|
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,14 +1,31 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// stateful_arbiter.dart | ||
// Implementation of an arbiter that holds state. | ||
// | ||
// 2023 December | ||
// Author: Max Korbel <[email protected]> | ||
|
||
import 'package:meta/meta.dart'; | ||
import 'package:rohd/rohd.dart'; | ||
import 'package:rohd_hcl/rohd_hcl.dart'; | ||
|
||
/// An [Arbiter] which holds state in order to arbitrate. | ||
abstract class StatefulArbiter extends Arbiter { | ||
/// The clock used for sequential elements. | ||
/// | ||
/// Should only be used by implementations. | ||
@protected | ||
late final Logic clk = input('clk'); | ||
|
||
/// The reset used for sequential elements (active high). | ||
/// | ||
/// Should only be used by implementations. | ||
@protected | ||
late final Logic reset = input('reset'); | ||
|
||
/// Creates a new [StatefulArbiter] with associated [clk] and [reset]. | ||
StatefulArbiter(super.requests, {required Logic clk, required Logic reset}) { | ||
addInput('clk', clk); | ||
addInput('reset', reset); | ||
|
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 |
---|---|---|
|
@@ -8,12 +8,14 @@ | |
// Author: Max Korbel <[email protected]> | ||
|
||
import 'package:rohd_hcl/rohd_hcl.dart'; | ||
import 'package:rohd_hcl/src/component_config/components/config_round_robin_arbiter.dart'; | ||
|
||
/// A list of [Configurator]s for ROHD-HCL components. | ||
List<Configurator> get componentRegistry => [ | ||
RotateConfigurator(), | ||
FifoConfigurator(), | ||
PriorityArbiterConfigurator(), | ||
RoundRobinArbiterConfigurator(), | ||
RippleCarryAdderConfigurator(), | ||
CarrySaveMultiplierConfigurator(), | ||
BitonicSortConfigurator(), | ||
|
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
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
53 changes: 53 additions & 0 deletions
53
lib/src/component_config/components/config_round_robin_arbiter.dart
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// config_round_robin_arbiter.dart | ||
// Configurator for a PriorityArbiter. | ||
// | ||
// 2023 December 26 | ||
// Author: Max Korbel <[email protected]> | ||
|
||
import 'dart:collection'; | ||
|
||
import 'package:rohd/rohd.dart'; | ||
import 'package:rohd_hcl/rohd_hcl.dart'; | ||
|
||
/// The type of round-robin arbiter. | ||
enum RoundRobinImplmentation { | ||
/// A [MaskRoundRobinArbiter]. | ||
mask, | ||
|
||
/// A [RotateRoundRobinArbiter] | ||
rotate | ||
} | ||
|
||
/// A [Configurator] for [PriorityArbiter]. | ||
class RoundRobinArbiterConfigurator extends Configurator { | ||
/// A knob controlling the number of requests and grants. | ||
final IntConfigKnob numRequestKnob = IntConfigKnob(value: 8); | ||
|
||
/// A knob controlling the implementation. | ||
final ChoiceConfigKnob<RoundRobinImplmentation> implementationKnob = | ||
ChoiceConfigKnob(RoundRobinImplmentation.values, | ||
value: RoundRobinImplmentation.mask); | ||
|
||
@override | ||
final String name = 'Round Robin Arbiter'; | ||
|
||
@override | ||
late final Map<String, ConfigKnob<dynamic>> knobs = UnmodifiableMapView({ | ||
'Number of Requestors': numRequestKnob, | ||
'Implementation': implementationKnob, | ||
}); | ||
|
||
@override | ||
Module createModule() { | ||
final reqs = List.generate(numRequestKnob.value, (i) => Logic()); | ||
switch (implementationKnob.value) { | ||
case RoundRobinImplmentation.mask: | ||
return MaskRoundRobinArbiter(reqs, clk: Logic(), reset: Logic()); | ||
case RoundRobinImplmentation.rotate: | ||
return RotateRoundRobinArbiter(reqs, clk: Logic(), reset: Logic()); | ||
} | ||
} | ||
} |