Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/src/memory/csr/csr_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ class CsrBlock extends CsrContainer {
/// CSRs in this block.
final List<Csr> csrs;

/// What increment value to use when deriving logical addresses
/// for registers that are wider than the frontdoor data width.
final int logicalRegisterIncrement;

/// Direct access ports for reading and writing individual registers.
///
/// There is a public copy that is exported out of the module
Expand All @@ -51,7 +47,7 @@ class CsrBlock extends CsrContainer {
required super.frontWrite,
required super.frontRead,
super.allowLargerRegisters,
this.logicalRegisterIncrement = 1,
super.logicalRegisterIncrement,
super.reserveName,
super.reserveDefinitionName,
String? definitionName,
Expand Down
5 changes: 5 additions & 0 deletions lib/src/memory/csr/csr_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ abstract class CsrContainer extends Module {
/// to any register that exceeds the data width of the frontdoor.
final bool allowLargerRegisters;

/// What increment value to use when deriving logical addresses
/// for registers that are wider than the frontdoor data width.
final int logicalRegisterIncrement;

/// Constructs a base container.
CsrContainer(
{required Logic clk,
Expand All @@ -62,6 +66,7 @@ abstract class CsrContainer extends Module {
required DataPortInterface? frontRead,
required this.config,
this.allowLargerRegisters = false,
this.logicalRegisterIncrement = 1,
super.reserveName,
super.reserveDefinitionName,
String? definitionName})
Expand Down
9 changes: 3 additions & 6 deletions lib/src/memory/csr/csr_top.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ import 'package:rohd_hcl/src/memory/csr/csr_container.dart';
/// MSBs of the incoming address and registers within the given block
/// are addressable using the remaining LSBs of the incoming address.
class CsrTop extends CsrContainer {
/// What increment value to use when deriving logical addresses
/// for registers that are wider than the frontdoor data width.
final int logicalRegisterIncrement;

/// Configuration for the CSR Top module.
@override
CsrTopConfig get config => super.config as CsrTopConfig;
Expand Down Expand Up @@ -91,7 +87,7 @@ class CsrTop extends CsrContainer {
required super.frontWrite,
required super.frontRead,
super.allowLargerRegisters,
this.logicalRegisterIncrement = 1,
super.logicalRegisterIncrement,
super.reserveName,
super.reserveDefinitionName,
String? definitionName})
Expand Down Expand Up @@ -125,7 +121,8 @@ class CsrTop extends CsrContainer {
reset: reset,
frontWrite: blockFdWrite,
frontRead: blockFdRead,
allowLargerRegisters: allowLargerRegisters));
allowLargerRegisters: allowLargerRegisters,
logicalRegisterIncrement: logicalRegisterIncrement));
}

for (var i = 0; i < blocks.length; i++) {
Expand Down