Remove (* init *) entry when consumed into SRL
authorEddie Hung <eddie@fpgeh.com>
Fri, 23 Aug 2019 20:56:01 +0000 (13:56 -0700)
committerEddie Hung <eddie@fpgeh.com>
Fri, 23 Aug 2019 20:56:01 +0000 (13:56 -0700)
passes/pmgen/xilinx_srl.cc

index e21a826df319ab1878ce56acd0c829818c69d0b0..d446bf47ae928cbcf13c74f23a08589b1bf02ee7 100644 (file)
@@ -52,7 +52,9 @@ void run_fixed(xilinx_srl_pm &pm)
                        log_assert(Q.wire);
                        auto it = Q.wire->attributes.find(ID(init));
                        if (it != Q.wire->attributes.end()) {
-                               initval.append(it->second[Q.offset]);
+                               auto &i = it->second[Q.offset];
+                               initval.append(i);
+                               i = State::Sx;
                        }
                        else
                                initval.append(State::Sx);
@@ -118,7 +120,9 @@ void run_variable(xilinx_srl_pm &pm)
                        log_assert(Q.wire);
                        auto it = Q.wire->attributes.find(ID(init));
                        if (it != Q.wire->attributes.end()) {
-                               initval.append(it->second[Q.offset]);
+                               auto &i = it->second[Q.offset];
+                               initval.append(i);
+                               i = State::Sx;
                        }
                        else
                                initval.append(State::Sx);