Bugfix in bram read-enable code
authorClifford Wolf <clifford@clifford.at>
Fri, 25 Sep 2015 12:22:33 +0000 (14:22 +0200)
committerClifford Wolf <clifford@clifford.at>
Fri, 25 Sep 2015 12:22:33 +0000 (14:22 +0200)
passes/memory/memory_bram.cc

index 3e83a6d9bde0c9bd745a2742dbcd8697532467c5..b371578d466cc4937db003d0f794e54f21534437 100644 (file)
@@ -859,8 +859,11 @@ grow_read_ports:;
                                if (pi.enable)
                                {
                                        SigSpec sig_en = pi.sig_en;
-                                       sig_en.extend_u0((grid_d+1) * pi.enable);
-                                       sig_en = sig_en.extract(grid_d * pi.enable, pi.enable);
+
+                                       if (pi.wrmode == 1) {
+                                               sig_en.extend_u0((grid_d+1) * pi.enable);
+                                               sig_en = sig_en.extract(grid_d * pi.enable, pi.enable);
+                                       }
 
                                        if (!addr_ok.empty())
                                                sig_en = module->Mux(NEW_ID, SigSpec(0, GetSize(sig_en)), sig_en, addr_ok);