[Seq] Lower FirMemOp to HWModuleGeneratedOp #5024
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add the
LowerFirMem
pass which lowersseq.firmem
ops to a correspondinghw.module.generated
op. The pass intends to reflect whatLowerToHW
does inlowerMemoryDecls
: it collects a list of memory ops in the design, distills them down into memory parameters, deduplicates those parameters, creates onehw.module.generated
op for each unique memory config, and replaces the memory ops with instances of this generated module.The
LowerFirMem
pass is intended as an intermediate solution to allowseq.firmem
to be lowered throughHWMemSimImpl
without changing the latter's implementation. Existing tools that have passes operating onhw.module.generated
-style memories can simply run theLowerFirMem
pass and have the newseq.firmem
work with their existing pipeline.A few commits down the road we'll want to make
HWMemSimImpl
work directly withseq.firmem
ops, at which pointLowerFirMem
can go away again. At that point tools are expected to have updated their memory passes to work withseq.firmem
directly, completing the transition.This also adds the
LowerFirMem
pass to the firtool pipeline, but it doesn't do anything yet since nothing in the pipeline currently createsseq.firmem
ops. This will be changed in a follow-up commit.Follow-up work: This pass is just temporary. It will work with
seq.mem
directly onceseq.firmem
andseq.hlmem
are merged. As soon as HWMemSimImpl and other passes are updated to work withseq.mem
directly themselves, this pass will go away again.