-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIRRTLToHW] Lower memories to seq.firmem #5025
Conversation
a1c211c
to
f9d9a39
Compare
0cfe049
to
48ba4fd
Compare
f9d9a39
to
ba81672
Compare
48ba4fd
to
594ac4c
Compare
594ac4c
to
3fc40f0
Compare
ba81672
to
f26c703
Compare
3fc40f0
to
62cc0b7
Compare
62cc0b7
to
fb9a3d3
Compare
f26c703
to
6172685
Compare
6172685
to
c1120f5
Compare
513dc4e
to
563f1f0
Compare
c1120f5
to
5c04613
Compare
5c04613
to
96ceeb3
Compare
563f1f0
to
eecc11e
Compare
eecc11e
to
1354a99
Compare
1354a99
to
30c580e
Compare
input clock: Clock | ||
input data: UInt<8> | ||
output out0: UInt<8> | ||
output out1: UInt<8> | ||
|
||
; CHECK: testmem_combMem testmem_ext ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropping the suffix combMem
is reasonable, but maybe internally there is a hacky logic that detects combinatorial memories by checking the suffix. I think it's totally OK to drop the suffix at will but it would be nice to check beforhand. It seems the suffix is introduced by 2167a06, @prithayan do you remember if that was requirement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to drop the combMem
, I don't think any tool is relying on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropping suffix may cause some problems but otherwise LGTM!
30c580e
to
eba7c86
Compare
Thanks! I'll run another sanity check on some internal design. |
Make `LowerToHW` emit `seq.firmem` operations for memories instead of emitting generator ops. These memory ops are then lowered to generator ops later in the firtool pipeline through the Seq `LowerFirMem` pass, which is already in place. The main change is replacing the generator op creation in `LowerToHW` with code that constructs the FirMem and associated ports, which is conceptually simpler. This commit also outlines memory lowering tests into a separate `lower-to-hw-memories.mlir` file and combines it with a few more test cases. The only change to firtool Verilog output should be a loss of the `_combMem` suffix on memories.
eba7c86
to
f21371a
Compare
Checked a few of our internal designs and they still work with the change. Merging this in. In case of unexpected breakages we'll back this out again. |
Make `LowerToHW` emit `seq.firmem` operations for memories instead of emitting generator ops. These memory ops are then lowered to generator ops later in the firtool pipeline through the Seq `LowerFirMem` pass, which is already in place. The main change is replacing the generator op creation in `LowerToHW` with code that constructs the FirMem and associated ports, which is conceptually simpler. This commit also outlines memory lowering tests into a separate `lower-to-hw-memories.mlir` file and combines it with a few more test cases. The only change to firtool Verilog output should be a loss of the `_combMem` suffix on memories, alongside name changes.
Make
LowerToHW
emitseq.firmem
operations for memories instead of emitting generator ops. These memory ops are then lowered to generator ops later in the firtool pipeline through the SeqLowerFirMem
pass, which is already in place.The main change is replacing the generator op creation in
LowerToHW
with code that constructs the FirMem and associated ports, which is conceptually simpler.This commit also outlines memory lowering tests into a separate
lower-to-hw-memories.mlir
file and combines it with a few more test cases.The only change to firtool Verilog output should be a loss of the
_combMem
suffix on memories.Follow-up work: Once this lands,
seq.firmem
andseq.hlmem
can be collapsed into a unifiedseq.mem
. Passes like HWMemSimImpl (and at least one SiFive-internal pass I can think of) can then be updated to work withseq.mem
directly. Afterwards theseq.mem
-to-hw.module.generated
lowering pass can be removed again.