3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-12 20:18:20 +00:00

mem: Fix index confusion in write port merging

Fix mistaking the read-port and write-port indices for each other when
we are adding the partial transparency emulation to be able to merge two
write ports.
This commit is contained in:
Martin Povišer 2023-09-12 14:54:03 +02:00
parent 88ce47e4f0
commit cbc4ec8178

View file

@ -1252,12 +1252,12 @@ void Mem::prepare_wr_merge(int idx1, int idx2, FfInitVals *initvals) {
// If transparent with only one, emulate it, and remove the collision-X // If transparent with only one, emulate it, and remove the collision-X
// flag that emulate_transparency will set (to align with the other port). // flag that emulate_transparency will set (to align with the other port).
if (rport.transparency_mask[idx1]) { if (rport.transparency_mask[idx1]) {
emulate_transparency(i, idx1, initvals); emulate_transparency(idx1, i, initvals);
rport.collision_x_mask[idx1] = false; rport.collision_x_mask[idx1] = false;
continue; continue;
} }
if (rport.transparency_mask[idx2]) { if (rport.transparency_mask[idx2]) {
emulate_transparency(i, idx2, initvals); emulate_transparency(idx2, i, initvals);
rport.collision_x_mask[idx2] = false; rport.collision_x_mask[idx2] = false;
continue; continue;
} }