rohd icon indicating copy to clipboard operation
rohd copied to clipboard

Add support to "name" `Pipeline` stages and reference them by name

Open mkorbel1 opened this issue 2 years ago • 2 comments

Motivation

Different stages of a pipeline may have meaningful names associated with them, and logic from within or outside the pipeline may want to access a certain stage's signal by name rather than absolute index. This helps make refactoring pipelines even easier, since adding a stage will not modify stage names.

Desired solution

Add to or extend functionality of Pipelines to support naming stages.

Additional details

Some thought has to be put into where the name goes and what the type of the name should be. Should it always be a String or should it be parameterized so that an enum could be used? The current implementation is a List<List<Conditional> Function(PipelineStageInfo p)>, so modifying the input to Pipelines to accept some new List or a Map would be a significant API change, but maybe it is appropriate so that more functionality can be more easily added in the future.

mkorbel1 avatar Apr 15 '22 16:04 mkorbel1

When creating this, we can also add new capabilities like adding the stall signals as part of the stage themselves instead of as a separate input into the Pipeline abstraction.

Can we extend Function to maintain backwards compatibility or is that not reasonable/possible?

mkorbel1 avatar Feb 01 '23 16:02 mkorbel1

Can we extend Function to maintain backwards compatibility or is that not reasonable/possible?

Apparently, no: https://github.com/dart-lang/sdk/issues/33748

mkorbel1 avatar Feb 01 '23 17:02 mkorbel1