Skip to content

Commit b5648a5

Browse files
committed
fix: mark memory module as effectful
This commit fixes a corner-case, where a memory module itself is not effectful, but it is connected to an effectful *ext* memory module. If we simply mark all memory modules as pure, this would optimize out the ext memory module, causing inconsistencies in the sifive -repl-seq-mem flow. The previous firrtl transforms and hierarchies would be generated correct, yet the final _ext sram would be omitted completely. Signed-off-by: Tianrui Wei <[email protected]>
1 parent bbe2444 commit b5648a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Dialect/FIRRTL/Transforms/LayerSink.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ class EffectInfo {
138138
// Regular modules may be pure.
139139
if (auto m = dyn_cast<FModuleOp>(op))
140140
return update(m);
141-
// Memory modules are pure.
142-
if (auto m = dyn_cast<FMemModuleOp>(op))
143-
return;
141+
// // Memory modules are pure.
142+
// if (auto m = dyn_cast<FMemModuleOp>(op))
143+
// return;
144144
// All other kinds of modules are effectful.
145145
// intmodules, extmodules, classes.
146146
return markEffectful(moduleOp);

0 commit comments

Comments
 (0)