Fixed "fsm -export"
authorClifford Wolf <clifford@clifford.at>
Fri, 8 Aug 2014 12:49:06 +0000 (14:49 +0200)
committerClifford Wolf <clifford@clifford.at>
Fri, 8 Aug 2014 12:56:03 +0000 (14:56 +0200)
passes/fsm/fsm.cc
passes/fsm/fsm_export.cc

index 13e90910bc7a45a9b480ae9b9e176b1655690ffd..2fae760915ee78d83b25e9d674177e88eccb2f7a 100644 (file)
@@ -127,12 +127,12 @@ struct FsmPass : public Pass {
                        Pass::call(design, "fsm_recode" + fm_set_fsm_file_opt + encoding_opt);
                Pass::call(design, "fsm_info");
 
-               if (!flag_nomap)
-                       Pass::call(design, "fsm_map");
-
                if (flag_export)
                        Pass::call(design, "fsm_export");
 
+               if (!flag_nomap)
+                       Pass::call(design, "fsm_map");
+
                log_pop();
        }
 } FsmPass;
index cb762dc1af8b0c016939f424c610fc64f9d061a6..b4a6b3f7b25e1ca3d79aff272ce71f9443194cb7 100644 (file)
@@ -56,13 +56,12 @@ void write_kiss2(struct RTLIL::Module *module, struct RTLIL::Cell *cell, std::st
 
        attr_it = cell->attributes.find("\\fsm_export");
        if (!filename.empty()) {
-         kiss_name.assign(filename);
+               kiss_name.assign(filename);
        } else if (attr_it != cell->attributes.end() && attr_it->second.decode_string() != "") {
                kiss_name.assign(attr_it->second.decode_string());
        }
        else {
-               kiss_name.assign(module->name.str());
-               kiss_name.append('-' + cell->name.str() + ".kiss2");
+               kiss_name.assign(log_id(module) + std::string("-") + log_id(cell) + ".kiss2");
        }
 
        log("\n");