Removed RTLIL::SigSpec::optimize()
authorClifford Wolf <clifford@clifford.at>
Wed, 23 Jul 2014 18:32:28 +0000 (20:32 +0200)
committerClifford Wolf <clifford@clifford.at>
Wed, 23 Jul 2014 18:32:28 +0000 (20:32 +0200)
24 files changed:
backends/blif/blif.cc
backends/edif/edif.cc
backends/intersynth/intersynth.cc
backends/verilog/verilog_backend.cc
frontends/ast/genrtlil.cc
kernel/bitpattern.h
kernel/rtlil.cc
kernel/rtlil.h
passes/abc/blifparse.cc
passes/cmds/setundef.cc
passes/cmds/show.cc
passes/cmds/splice.cc
passes/cmds/splitnets.cc
passes/fsm/fsm_map.cc
passes/memory/memory_collect.cc
passes/memory/memory_dff.cc
passes/memory/memory_share.cc
passes/opt/opt_clean.cc
passes/opt/opt_const.cc
passes/proc/proc_dff.cc
passes/proc/proc_init.cc
passes/sat/eval.cc
passes/sat/freduce.cc
passes/sat/sat.cc

index a240d2a26a6166d71582a1774287a7c62c7de305..d0c25079082b2762df517de9273395c2175725c3 100644 (file)
@@ -70,7 +70,6 @@ struct BlifDumper
 
        const char *cstr(RTLIL::SigSpec sig)
        {
-               sig.optimize();
                log_assert(sig.size() == 1);
 
                if (sig.chunks().at(0).wire == NULL)
index 3b9a43370183cf6a81c9a294884f5ba0be20c717..8f36f4090b6870a7a585533a6b3599d8e8347d3a 100644 (file)
@@ -315,7 +315,6 @@ struct EdifBackend : public Backend {
                        }
                        for (auto &it : net_join_db) {
                                RTLIL::SigSpec sig = it.first;
-                               sig.optimize();
                                log_assert(sig.size() == 1);
                                if (sig.chunks().at(0).wire == NULL) {
                                        if (sig.chunks().at(0).data.bits.at(0) != RTLIL::State::S0 && sig.chunks().at(0).data.bits.at(0) != RTLIL::State::S1)
index 832922def21c38559450938214aeda82750a9150..a4cad5adda0c76f85721536f491a4fbb047641ba 100644 (file)
@@ -28,8 +28,6 @@
 
 static std::string netname(std::set<std::string> &conntypes_code, std::set<std::string> &celltypes_code, std::set<std::string> &constcells_code, RTLIL::SigSpec sig)
 {
-       sig.optimize();
-
        if (sig.chunks().size() != 1)
 error:
                log_error("Can't export composite or non-word-wide signal %s.\n", log_signal(sig));
index 1608350871523b356412be4b7b20a36b0273ab9c..1dcc3003a10a8818321a831c5c8bed0bb9253c8d 100644 (file)
@@ -133,7 +133,6 @@ std::string id(std::string internal_id, bool may_rename = true)
 
 bool is_reg_wire(RTLIL::SigSpec sig, std::string &reg_name)
 {
-       sig.optimize();
        if (sig.chunks().size() != 1 || sig.chunks()[0].wire == NULL)
                return false;
        if (reg_wires.count(sig.chunks()[0].wire->name) == 0)
@@ -303,7 +302,6 @@ std::string cellname(RTLIL::Cell *cell)
                if (sig.size() != 1 || sig.is_fully_const())
                        goto no_special_reg_name;
 
-               sig.optimize();
                RTLIL::Wire *wire = sig.chunks()[0].wire;
 
                if (wire->name[0] != '\\')
@@ -909,7 +907,6 @@ void dump_module(FILE *f, std::string indent, RTLIL::Module *module)
                                continue;
 
                        RTLIL::SigSpec sig = cell->connections["\\Q"];
-                       sig.optimize();
 
                        if (sig.chunks().size() == 1 && sig.chunks()[0].wire)
                                for (int i = 0; i < sig.chunks()[0].width; i++)
index 18ae008cb7210c19bc122de23c79efacdf529a46..3d848e82376af1d4395d6c24580c01cf2698c7ad 100644 (file)
@@ -292,8 +292,6 @@ struct AST_INTERNAL::ProcessGenerator
                        proc->syncs.push_back(sync);
 
                        assert(init_lvalue.size() == init_rvalue.size());
-                       init_lvalue.optimize();
-                       init_rvalue.optimize();
 
                        int offset = 0;
                        for (size_t i = 0; i < init_lvalue.chunks().size(); i++) {
@@ -308,7 +306,6 @@ struct AST_INTERNAL::ProcessGenerator
        // create new temporary signals
        RTLIL::SigSpec new_temp_signal(RTLIL::SigSpec sig)
        {
-               sig.optimize();
                std::vector<RTLIL::SigChunk> chunks = sig.chunks();
 
                for (int i = 0; i < SIZE(chunks); i++)
@@ -399,8 +396,6 @@ struct AST_INTERNAL::ProcessGenerator
                        lvalue.remove2(initSyncSignals, &rvalue);
                }
                assert(lvalue.size() == rvalue.size());
-               lvalue.optimize();
-               rvalue.optimize();
 
                int offset = 0;
                for (size_t i = 0; i < lvalue.chunks().size(); i++) {
@@ -433,9 +428,7 @@ struct AST_INTERNAL::ProcessGenerator
                                if (ast->type == AST_ASSIGN_EQ) {
                                        subst_rvalue_from.remove2(unmapped_lvalue, &subst_rvalue_to);
                                        subst_rvalue_from.append(unmapped_lvalue);
-                                       subst_rvalue_from.optimize();
                                        subst_rvalue_to.append(rvalue);
-                                       subst_rvalue_to.optimize();
                                }
 
                                removeSignalFromCaseTree(lvalue, current_case);
@@ -486,9 +479,7 @@ struct AST_INTERNAL::ProcessGenerator
 
                                        subst_lvalue_from.remove2(this_case_eq_lvalue, &subst_lvalue_to);
                                        subst_lvalue_from.append(this_case_eq_lvalue);
-                                       subst_lvalue_from.optimize();
                                        subst_lvalue_to.append(this_case_eq_ltemp);
-                                       subst_lvalue_to.optimize();
 
                                        RTLIL::CaseRule *backup_case = current_case;
                                        current_case = new RTLIL::CaseRule;
@@ -527,9 +518,7 @@ struct AST_INTERNAL::ProcessGenerator
 
                                subst_rvalue_from.remove2(this_case_eq_lvalue, &subst_rvalue_to);
                                subst_rvalue_from.append(this_case_eq_lvalue);
-                               subst_rvalue_from.optimize();
                                subst_rvalue_to.append(this_case_eq_ltemp);
-                               subst_rvalue_to.optimize();
 
                                this_case_eq_lvalue.replace(subst_lvalue_from, subst_lvalue_to);
                                removeSignalFromCaseTree(this_case_eq_lvalue, current_case);
index 934796d24b49ce5ba535b10a21cf4fbf30604e52..4f4bc37a046c4c7b5857f6497d5b43960c82e304 100644 (file)
@@ -34,10 +34,8 @@ struct BitPatternPool
                width = sig.size();
                if (width > 0) {
                        std::vector<RTLIL::State> pattern(width);
-                       sig.optimize();
                        for (int i = 0; i < width; i++) {
                                RTLIL::SigSpec s = sig.extract(i, 1);
-                               s.optimize();
                                assert(s.chunks().size() == 1);
                                if (s.chunks()[0].wire == NULL && s.chunks()[0].data.bits[0] <= RTLIL::State::S1)
                                        pattern[i] = s.chunks()[0].data.bits[0];
@@ -61,7 +59,6 @@ struct BitPatternPool
 
        bits_t sig2bits(RTLIL::SigSpec sig)
        {
-               sig.optimize();
                assert(sig.is_fully_const());
                assert(sig.chunks().size() == 1);
                bits_t bits = sig.chunks()[0].data.bits;
index 32a6b277578f2da58046bb740cdd54171ad1bce1..7d031e174b1d4ba1ec74e07e3e58974a552201ba 100644 (file)
@@ -768,14 +768,6 @@ void RTLIL::Module::check()
 
 void RTLIL::Module::optimize()
 {
-       for (auto &it : cells)
-               it.second->optimize();
-       for (auto &it : processes)
-               it.second->optimize();
-       for (auto &it : connections) {
-               it.first.optimize();
-               it.second.optimize();
-       }
 }
 
 void RTLIL::Module::cloneInto(RTLIL::Module *new_mod) const
@@ -1297,12 +1289,6 @@ RTLIL::Memory::Memory()
        size = 0;
 }
 
-void RTLIL::Cell::optimize()
-{
-       for (auto &it : connections)
-               it.second.optimize();
-}
-
 void RTLIL::Cell::check()
 {
        InternalCellChecker checker(NULL, this);
@@ -1548,40 +1534,6 @@ bool RTLIL::SigSpec::packed() const
        return bits_.empty();
 }
 
-void RTLIL::SigSpec::optimize()
-{
-#if 0
-       pack();
-       std::vector<RTLIL::SigChunk> new_chunks;
-       for (auto &c : chunks_)
-               if (new_chunks.size() == 0) {
-                       new_chunks.push_back(c);
-               } else {
-                       RTLIL::SigChunk &cc = new_chunks.back();
-                       if (c.wire == NULL && cc.wire == NULL)
-                               cc.data.bits.insert(cc.data.bits.end(), c.data.bits.begin(), c.data.bits.end());
-                       if (c.wire == cc.wire && (c.wire == NULL || cc.offset + cc.width == c.offset))
-                               cc.width += c.width;
-                       else
-                               new_chunks.push_back(c);
-               }
-       chunks_.swap(new_chunks);
-       check();
-#endif
-}
-
-RTLIL::SigSpec RTLIL::SigSpec::optimized() const
-{
-#if 0
-       pack();
-       RTLIL::SigSpec ret = *this;
-       ret.optimize();
-       return ret;
-#else
-       return *this;
-#endif
-}
-
 void RTLIL::SigSpec::sort()
 {
        unpack();
@@ -1825,8 +1777,6 @@ void RTLIL::SigSpec::extend(int width, bool is_signed)
                while (width_ < width)
                        append(padding);
        }
-
-       optimize();
 }
 
 void RTLIL::SigSpec::extend_u0(int width, bool is_signed)
@@ -1844,7 +1794,6 @@ void RTLIL::SigSpec::extend_u0(int width, bool is_signed)
                        append(padding);
        }
 
-       optimize();
 }
 
 void RTLIL::SigSpec::check() const
@@ -1888,8 +1837,6 @@ bool RTLIL::SigSpec::operator <(const RTLIL::SigSpec &other) const
                return width_ < other.width_;
 
        RTLIL::SigSpec a = *this, b = other;
-       a.optimize();
-       b.optimize();
 
        if (a.chunks_.size() != b.chunks_.size())
                return a.chunks_.size() < b.chunks_.size();
@@ -1910,8 +1857,6 @@ bool RTLIL::SigSpec::operator ==(const RTLIL::SigSpec &other) const
                return false;
 
        RTLIL::SigSpec a = *this, b = other;
-       a.optimize();
-       b.optimize();
 
        if (a.chunks_.size() != b.chunks_.size())
                return false;
@@ -1973,22 +1918,18 @@ bool RTLIL::SigSpec::has_marked_bits() const
 bool RTLIL::SigSpec::as_bool() const
 {
        pack();
-       assert(is_fully_const());
-       SigSpec sig = *this;
-       sig.optimize();
-       if (sig.width_)
-               return sig.chunks_[0].data.as_bool();
+       assert(is_fully_const() && SIZE(chunks_) <= 1);
+       if (width_)
+               return chunks_[0].data.as_bool();
        return false;
 }
 
 int RTLIL::SigSpec::as_int() const
 {
        pack();
-       assert(is_fully_const());
-       SigSpec sig = *this;
-       sig.optimize();
-       if (sig.width_)
-               return sig.chunks_[0].data.as_int();
+       assert(is_fully_const() && SIZE(chunks_) <= 1);
+       if (width_)
+               return chunks_[0].data.as_int();
        return 0;
 }
 
@@ -2010,11 +1951,9 @@ std::string RTLIL::SigSpec::as_string() const
 RTLIL::Const RTLIL::SigSpec::as_const() const
 {
        pack();
-       assert(is_fully_const());
-       SigSpec sig = *this;
-       sig.optimize();
-       if (sig.width_)
-               return sig.chunks_[0].data;
+       assert(is_fully_const() && SIZE(chunks_) <= 1);
+       if (width_)
+               return chunks_[0].data;
        return RTLIL::Const();
 }
 
@@ -2200,18 +2139,6 @@ RTLIL::CaseRule::~CaseRule()
                delete *it;
 }
 
-void RTLIL::CaseRule::optimize()
-{
-       for (auto it : switches)
-               it->optimize();
-       for (auto &it : compare)
-               it.optimize();
-       for (auto &it : actions) {
-               it.first.optimize();
-               it.second.optimize();
-       }
-}
-
 RTLIL::CaseRule *RTLIL::CaseRule::clone() const
 {
        RTLIL::CaseRule *new_caserule = new RTLIL::CaseRule;
@@ -2228,13 +2155,6 @@ RTLIL::SwitchRule::~SwitchRule()
                delete *it;
 }
 
-void RTLIL::SwitchRule::optimize()
-{
-       signal.optimize();
-       for (auto it : cases)
-               it->optimize();
-}
-
 RTLIL::SwitchRule *RTLIL::SwitchRule::clone() const
 {
        RTLIL::SwitchRule *new_switchrule = new RTLIL::SwitchRule;
@@ -2246,15 +2166,6 @@ RTLIL::SwitchRule *RTLIL::SwitchRule::clone() const
        
 }
 
-void RTLIL::SyncRule::optimize()
-{
-       signal.optimize();
-       for (auto &it : actions) {
-               it.first.optimize();
-               it.second.optimize();
-       }
-}
-
 RTLIL::SyncRule *RTLIL::SyncRule::clone() const
 {
        RTLIL::SyncRule *new_syncrule = new RTLIL::SyncRule;
@@ -2270,13 +2181,6 @@ RTLIL::Process::~Process()
                delete *it;
 }
 
-void RTLIL::Process::optimize()
-{
-       root_case.optimize();
-       for (auto it : syncs)
-               it->optimize();
-}
-
 RTLIL::Process *RTLIL::Process::clone() const
 {
        RTLIL::Process *new_proc = new RTLIL::Process;
index 6c0a7b66fcdcd33fb874bde245422dab66b39539..a13164c37ae9fef938245b3b9784a10784d6c511 100644 (file)
@@ -450,7 +450,6 @@ struct RTLIL::Cell {
        std::map<RTLIL::IdString, RTLIL::SigSpec> connections;
        std::map<RTLIL::IdString, RTLIL::Const> parameters;
        RTLIL_ATTRIBUTE_MEMBERS
-       void optimize();
        void check();
 
        template<typename T> void rewrite_sigspecs(T functor);
@@ -544,9 +543,6 @@ public:
        inline RTLIL::SigSpecIterator begin() { RTLIL::SigSpecIterator it; it.sig_p = this; it.index = 0; return it; }
        inline RTLIL::SigSpecIterator end() { RTLIL::SigSpecIterator it; it.sig_p = this; it.index = width_; return it; }
 
-       void optimize();
-       RTLIL::SigSpec optimized() const;
-
        void sort();
        void sort_and_unify();
 
@@ -624,7 +620,6 @@ struct RTLIL::SwitchRule {
        RTLIL_ATTRIBUTE_MEMBERS
        std::vector<RTLIL::CaseRule*> cases;
        ~SwitchRule();
-       void optimize();
 
        template<typename T> void rewrite_sigspecs(T functor);
        RTLIL::SwitchRule *clone() const;
@@ -634,7 +629,6 @@ struct RTLIL::SyncRule {
        RTLIL::SyncType type;
        RTLIL::SigSpec signal;
        std::vector<RTLIL::SigSig> actions;
-       void optimize();
 
        template<typename T> void rewrite_sigspecs(T functor);
        RTLIL::SyncRule *clone() const;
@@ -646,7 +640,6 @@ struct RTLIL::Process {
        RTLIL::CaseRule root_case;
        std::vector<RTLIL::SyncRule*> syncs;
        ~Process();
-       void optimize();
 
        template<typename T> void rewrite_sigspecs(T functor);
        RTLIL::Process *clone() const;
index 47fa0f821b446d199ab437ba3a5713b1a358cf86..04977b369aecfef164d54953ff97cc22fd8e117d 100644 (file)
@@ -212,9 +212,6 @@ RTLIL::Design *abc_parse_blif(FILE *f, std::string dff_name)
                                        goto continue_without_read;
                                }
 
-                               input_sig.optimize();
-                               output_sig.optimize();
-
                                RTLIL::Cell *cell = new RTLIL::Cell;
                                cell->name = NEW_ID;
                                cell->type = "$lut";
index 63d5bb9af7637be5cd5ff73298272f27149f44a8..6c4bb16c0072079b082ee9db2e3a8f00f4d4a5f9 100644 (file)
@@ -144,7 +144,6 @@ struct SetundefPass : public Pass {
                                        RTLIL::SigSpec bits;
                                        for (int i = 0; i < c.width; i++)
                                                bits.append(worker.next_bit());
-                                       bits.optimize();
                                        module->connections.push_back(RTLIL::SigSig(c, bits));
                                }
                        }
index 37fe440471f6b4f340d86975f5d0525d8a7427c0..6b37b7bb1feb9b494bc5513f35d6b638c7361f17 100644 (file)
@@ -171,8 +171,6 @@ struct ShowWorker
 
        std::string gen_signode_simple(RTLIL::SigSpec sig, bool range_check = true)
        {
-               sig.optimize();
-
                if (sig.chunks().size() == 0) {
                        fprintf(f, "v%d [ label=\"\" ];\n", single_idx_count);
                        return stringf("v%d", single_idx_count++);
@@ -199,7 +197,6 @@ struct ShowWorker
                if (net.empty())
                {
                        std::string label_string;
-                       sig.optimize();
                        int pos = sig.size()-1;
                        int idx = single_idx_count++;
                        for (int i = int(sig.chunks().size())-1; i >= 0; i--) {
index aed9c076e0e70455bc036fa66230cc88d13df301..68e8951ff0bf27b9406072e1244b84b1706aa140 100644 (file)
@@ -82,7 +82,6 @@ struct SpliceWorker
                        module->add(cell);
                }
 
-               new_sig.optimize();
                sliced_signals_cache[sig] = new_sig;
 
                return new_sig;
@@ -143,7 +142,6 @@ struct SpliceWorker
                        module->add(cell);
                }
 
-               new_sig.optimize();
                spliced_signals_cache[sig] = new_sig;
 
                log("  Created spliced signal: %s -> %s\n", log_signal(sig), log_signal(new_sig));
index c40ff2c4a912d67b1ea233dc6a0d7b5028031790..c65b6a5f88bdde2210cf7227149eac5cb93caedd 100644 (file)
@@ -141,7 +141,7 @@ struct SplitnetsPass : public Pass {
                                        if (!ct.cell_output(c.second->type, p.first))
                                                continue;
 
-                                       RTLIL::SigSpec sig = p.second.optimized();
+                                       RTLIL::SigSpec sig = p.second;
                                        for (auto &chunk : sig.chunks()) {
                                                if (chunk.wire == NULL)
                                                        continue;
index 9dda2ba89511c4d5d536a6e1195cef4e2e271002..cee267629f4aa36684a1e5974b25fc566031b88b 100644 (file)
@@ -42,13 +42,10 @@ static void implement_pattern_cache(RTLIL::Module *module, std::map<RTLIL::Const
                                eq_sig_a.append(ctrl_in.extract(j, 1));
                                eq_sig_b.append(RTLIL::SigSpec(pattern.bits[j]));
                        }
-               eq_sig_a.optimize();
-               eq_sig_b.optimize();
 
                for (int in_state : it.second)
                        if (fullstate_cache.count(in_state) == 0)
                                or_sig.append(RTLIL::SigSpec(state_onehot, in_state));
-               or_sig.optimize();
 
                if (or_sig.size() == 0)
                        continue;
@@ -218,8 +215,6 @@ static void map_fsm(RTLIL::Cell *fsm_cell, RTLIL::Module *module)
                                sig_a.append(RTLIL::SigSpec(state_wire, j));
                                sig_b.append(RTLIL::SigSpec(state.bits[j]));
                        }
-               sig_a.optimize();
-               sig_b.optimize();
 
                if (sig_b == RTLIL::SigSpec(RTLIL::State::S1))
                {
index 5f06438f0d3734b1a35ee0a76ebef9aa4efda1c9..fec0b407d3b424142ad87aeb099813f9a7bfe388 100644 (file)
@@ -139,9 +139,6 @@ static void handle_memory(RTLIL::Module *module, RTLIL::Memory *memory)
        mem->parameters["\\SIZE"] = RTLIL::Const(memory->size);
        mem->parameters["\\ABITS"] = RTLIL::Const(addr_bits);
 
-       sig_wr_clk_enable.optimize();
-       sig_wr_clk_polarity.optimize();
-
        assert(sig_wr_clk.size() == wr_ports);
        assert(sig_wr_clk_enable.size() == wr_ports && sig_wr_clk_enable.is_fully_const());
        assert(sig_wr_clk_polarity.size() == wr_ports && sig_wr_clk_polarity.is_fully_const());
@@ -158,10 +155,6 @@ static void handle_memory(RTLIL::Module *module, RTLIL::Memory *memory)
        mem->connections["\\WR_DATA"] = sig_wr_data;
        mem->connections["\\WR_EN"] = sig_wr_en;
 
-       sig_rd_clk_enable.optimize();
-       sig_rd_clk_polarity.optimize();
-       sig_rd_transparent.optimize();
-
        assert(sig_rd_clk.size() == rd_ports);
        assert(sig_rd_clk_enable.size() == rd_ports && sig_rd_clk_enable.is_fully_const());
        assert(sig_rd_clk_polarity.size() == rd_ports && sig_rd_clk_polarity.is_fully_const());
index b1f1e22b59f44bbff32b03286a4bf0a2e5802fb4..56915776e7b6ae1d0cb6305123f9c9910228f6f6 100644 (file)
@@ -69,7 +69,6 @@ static bool find_sig_before_dff(RTLIL::Module *module, RTLIL::SigSpec &sig, RTLI
        replaced_this_bit:;
        }
 
-       sig.optimize();
        return true;
 }
 
index 38eff99613ac84917bfb2984c0466a354ddb0d36..dd2a32cad17ca531077be95fb8a9a78467c8ffc4 100644 (file)
@@ -439,8 +439,6 @@ struct MemoryShareWorker
                                                        merged_en.replace(k, cell_en.extract(k, 1));
                                                        merged_data.replace(k, cell_data.extract(k, 1));
                                                }
-                                       merged_en.optimize();
-                                       merged_data.optimize();
                                }
 
                                // Connect the new EN and DATA signals and remove the old write port.
index 0be36606d4efbbeac7910138a42ee2df731c8ff8..ba0aadc6b9d489995f31b4fe8a5b60987e22e13a 100644 (file)
@@ -241,8 +241,6 @@ static void rmunused_module_signals(RTLIL::Module *module, bool purge_mode, bool
                                                new_conn.second.append_bit(s2[i]);
                                        }
                                if (new_conn.first.size() > 0) {
-                                       new_conn.first.optimize();
-                                       new_conn.second.optimize();
                                        used_signals.add(new_conn.first);
                                        used_signals.add(new_conn.second);
                                        module->connections.push_back(new_conn);
index ff139854f1c680b2c797ceb3d9927a6d6ed87b8c..800fbf1091a4b85442469282d0bff74d37b103a2 100644 (file)
@@ -481,8 +481,6 @@ static void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bo
                        }
 
                        if (new_a.size() < a.size() || new_b.size() < b.size()) {
-                               new_a.optimize();
-                               new_b.optimize();
                                cell->connections["\\A"] = new_a;
                                cell->connections["\\B"] = new_b;
                                cell->parameters["\\A_WIDTH"] = new_a.size();
index 8e5fbe8f4d6e514f661dd40fb1b63de582a840c3..a8aba903aaad0b72f34ce1ccc41f8a6c2544910c 100644 (file)
@@ -352,10 +352,6 @@ static void proc_dff(RTLIL::Module *mod, RTLIL::Process *proc, ConstEval &ce)
                ce.assign_map.apply(rstval);
                ce.assign_map.apply(sig);
 
-               insig.optimize();
-               rstval.optimize();
-               sig.optimize();
-
                if (rstval == sig) {
                        rstval = RTLIL::SigSpec(RTLIL::State::Sz, sig.size());
                        sync_level = NULL;
index ba1fb5ab9e7352ebdc9a4b9f5e066f0fd31c9851..4c9b6bcd22446da0eaa444a197636c7a6afdab3b 100644 (file)
@@ -28,7 +28,6 @@ static void proc_get_const(RTLIL::SigSpec &sig, RTLIL::CaseRule &rule)
        assert(rule.compare.size() == 0);
 
        while (1) {
-               sig.optimize();
                RTLIL::SigSpec tmp = sig;
                for (auto &it : rule.actions)
                        tmp.replace(it.first, it.second);
@@ -53,7 +52,6 @@ static void proc_init(RTLIL::Module *mod, RTLIL::Process *proc)
                                RTLIL::SigSpec lhs = action.first;
                                RTLIL::SigSpec rhs = action.second;
 
-                               lhs.optimize();
                                proc_get_const(rhs, proc->root_case);
 
                                if (!rhs.is_fully_const())
index 9b8c353618db730d9584c9b967ddf5be88b8c087..6949b76db8ab4bd505feef3c3f8d57c12b7c6109 100644 (file)
@@ -53,8 +53,6 @@ struct BruteForceEquivChecker
                        return;
                }
 
-               inputs.optimize();
-
                ConstEval ce1(mod1), ce2(mod2);
                ce1.set(mod1_inputs, inputs.as_const());
                ce2.set(mod2_inputs, inputs.as_const());
@@ -482,7 +480,6 @@ struct EvalPass : public Pass {
                                RTLIL::SigSpec signal, value, undef;
                                if (!RTLIL::SigSpec::parse_sel(signal, design, module, it))
                                        log_cmd_error("Failed to parse show expression `%s'.\n", it.c_str());
-                               signal.optimize();
                                value = signal;
                                if (set_undef) {
                                        while (!ce.eval(value, undef)) {
index 1e47e7de23554f537b5fb14683668292ca982293..ba01bc3221b9a730f758809922c81ba80fc900cc 100644 (file)
@@ -349,7 +349,7 @@ struct PerformReduction
                        std::vector<RTLIL::SigBit> bucket_sigbits;
                        for (int idx : bucket)
                                bucket_sigbits.push_back(out_bits[idx]);
-                       log("%s  Trying to shatter bucket with %d signals: %s\n", indt, int(bucket.size()), log_signal(RTLIL::SigSpec(bucket_sigbits).optimized()));
+                       log("%s  Trying to shatter bucket with %d signals: %s\n", indt, int(bucket.size()), log_signal(bucket_sigbits));
                }
 
                std::vector<int> sat_set_list, sat_clr_list;
@@ -494,7 +494,7 @@ struct PerformReduction
                                std::vector<RTLIL::SigBit> r_sigbits;
                                for (int idx : r)
                                        r_sigbits.push_back(out_bits[idx]);
-                               log("  Found group of %d equivialent signals: %s\n", int(r.size()), log_signal(RTLIL::SigSpec(r_sigbits).optimized()));
+                               log("  Found group of %d equivialent signals: %s\n", int(r.size()), log_signal(r_sigbits));
                        }
 
                        std::vector<int> undef_slaves;
@@ -640,7 +640,7 @@ struct FreduceWorker
 
                found_selected_wire:
                        log("  Finding reduced input cone for signal batch %s%c\n",
-                                       log_signal(RTLIL::SigSpec(std::vector<RTLIL::SigBit>(batch.begin(), batch.end())).optimized()), verbose_level ? ':' : '.');
+                                       log_signal(batch), verbose_level ? ':' : '.');
 
                        FindReducedInputs infinder(sigmap, drivers);
                        for (auto &bit : batch) {
@@ -663,12 +663,12 @@ struct FreduceWorker
                                continue;
 
                        if (bucket.first.size() == 0) {
-                               log("  Finding const values for bucket %s%c\n", log_signal(RTLIL::SigSpec(bucket.second).optimized()), verbose_level ? ':' : '.');
+                               log("  Finding const values for bucket %s%c\n", log_signal(bucket.second), verbose_level ? ':' : '.');
                                PerformReduction worker(sigmap, drivers, inv_pairs, bucket.second, bucket.first.size());
                                for (size_t idx = 0; idx < bucket.second.size(); idx++)
                                        worker.analyze_const(equiv, idx);
                        } else {
-                               log("  Trying to shatter bucket %s%c\n", log_signal(RTLIL::SigSpec(bucket.second).optimized()), verbose_level ? ':' : '.');
+                               log("  Trying to shatter bucket %s%c\n", log_signal(bucket.second), verbose_level ? ':' : '.');
                                PerformReduction worker(sigmap, drivers, inv_pairs, bucket.second, bucket.first.size());
                                worker.analyze(equiv, 100 * bucket_count / (buckets.size() + 1));
                        }
index 34becaee8fcf3e8f318d0df03f0c9c97ed4a8302..4b6b1b719cb6d792ab6f10d5654d6b5875a65707 100644 (file)
@@ -114,10 +114,6 @@ struct SatHelper
                                }
                        }
 
-                       lhs.optimize();
-                       rhs.optimize();
-                       removed_bits.optimize();
-
                        if (removed_bits.size())
                                log("Warning: ignoring initial value on non-register: %s\n", log_signal(removed_bits));
 
@@ -152,7 +148,6 @@ struct SatHelper
 
                if (!satgen.initial_state.check_all(big_lhs)) {
                        RTLIL::SigSpec rem = satgen.initial_state.remove(big_lhs);
-                       rem.optimize();
                        log_cmd_error("Found -set-init bits that are not part of the initial_state: %s\n", log_signal(rem));
                }