intel / intel/rohd

Pipeline must provide access to inputs of a given stage.

Open
#424 6 comments 0 reactions 0 assignees View on GitHub
bug enhancement
Dominant language
Dart
Stars
489
Forks
88
Avg merge
3d 23h
Merged PRs (30d)
10

Description

### Describe the bug

The Pipeline abstraction only provides an API to get the combinational version of a pipeline signal in a given stage. Hence, if you want to do something like:
- Start with the input flop of a particular signal in a particular stage
- Use this input in some combinational logic in the given stage
- Use the output of this combinational logic to drive the output flop of that signal in the given stage

You end up with a combinational loop using the .get(signal, stageindex) API.

Looking at the current implementation, I do not see another way to accomplish the above. An enhancement would be to provide a new API with direct access to the inputs of the given stage (see below for sample implementation).

### To Reproduce

Pipeline dbgPipeline = Pipeline(_clk, reset: _reset,
], stages: [
(p) => [
p.get(mysignal) < 0,
],
(p) => [
p.get(mysignal) < mycombsignal,
],
]

mycombsignal <= dbgPipeline.get(mysignal, 1) | 0x1;

### Expected behavior

One should be able to use a signal in any stage of the pipeline to derive the signal's value in the next pipeline stage combinationally.

### Actual behavior

There is a ROHD exception at runtime because of a combinational loop.

### Additional: Dart SDK info

_No response_

### Additional: pubspec.yaml

_No response_

### Additional: Context

Sample implementation used as a workaround:

Logic getInput(Logic logic, [int? stageIndex]) {
stageIndex ??= _stages.length - 1;

final stageLogic = _stages[stageIndex].input[logic]!;
return stageLogic;
}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.