summaryrefslogtreecommitdiff
path: root/passes
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-07-31 13:19:47 +0200
committerClifford Wolf <clifford@clifford.at>2014-07-31 13:19:47 +0200
commit1cb25c05b37b0172dbc50e140fe20f25d973dd8a (patch)
tree4bccb9f45ccad05346697c79afca9a1b21dced9c /passes
parent1202f7aa4bb0f9afde157ebc4701d64e7e38abd8 (diff)
Moved some stuff to kernel/yosys.{h,cc}, using Yosys:: namespace
Diffstat (limited to 'passes')
-rw-r--r--passes/abc/abc.cc4
-rw-r--r--passes/cmds/design.cc4
-rw-r--r--passes/fsm/fsm_extract.cc4
-rw-r--r--passes/memory/memory_collect.cc2
-rw-r--r--passes/memory/memory_dff.cc2
-rw-r--r--passes/memory/memory_map.cc2
-rw-r--r--passes/memory/memory_unpack.cc2
-rw-r--r--passes/proc/proc_dff.cc6
-rw-r--r--passes/proc/proc_mux.cc4
-rw-r--r--passes/techmap/extract.cc2
-rw-r--r--passes/techmap/techmap.cc2
11 files changed, 19 insertions, 15 deletions
diff --git a/passes/abc/abc.cc b/passes/abc/abc.cc
index d2be7dcf..d204e93c 100644
--- a/passes/abc/abc.cc
+++ b/passes/abc/abc.cc
@@ -313,7 +313,7 @@ static void handle_loops()
}
std::stringstream sstr;
- sstr << "$abcloop$" << (RTLIL::autoidx++);
+ sstr << "$abcloop$" << (autoidx++);
RTLIL::Wire *wire = module->addWire(sstr.str());
bool first_line = true;
@@ -400,7 +400,7 @@ static void abc_module(RTLIL::Design *design, RTLIL::Module *current_module, std
std::string liberty_file, std::string constr_file, bool cleanup, int lut_mode, bool dff_mode, std::string clk_str, bool keepff)
{
module = current_module;
- map_autoidx = RTLIL::autoidx++;
+ map_autoidx = autoidx++;
signal_map.clear();
signal_list.clear();
diff --git a/passes/cmds/design.cc b/passes/cmds/design.cc
index bd1ee68f..79695c63 100644
--- a/passes/cmds/design.cc
+++ b/passes/cmds/design.cc
@@ -22,6 +22,8 @@
#include "kernel/rtlil.h"
#include "kernel/log.h"
+YOSYS_NAMESPACE_BEGIN
+
std::map<std::string, RTLIL::Design*> saved_designs;
std::vector<RTLIL::Design*> pushed_designs;
@@ -249,3 +251,5 @@ struct DesignPass : public Pass {
}
} DesignPass;
+YOSYS_NAMESPACE_END
+
diff --git a/passes/fsm/fsm_extract.cc b/passes/fsm/fsm_extract.cc
index 6da46832..718f779b 100644
--- a/passes/fsm/fsm_extract.cc
+++ b/passes/fsm/fsm_extract.cc
@@ -270,7 +270,7 @@ static void extract_fsm(RTLIL::Wire *wire)
// create fsm cell
- RTLIL::Cell *fsm_cell = module->addCell(stringf("$fsm$%s$%d", wire->name.c_str(), RTLIL::autoidx++), "$fsm");
+ RTLIL::Cell *fsm_cell = module->addCell(stringf("$fsm$%s$%d", wire->name.c_str(), autoidx++), "$fsm");
fsm_cell->set("\\CLK", clk);
fsm_cell->set("\\ARST", arst);
fsm_cell->parameters["\\CLK_POLARITY"] = RTLIL::Const(clk_polarity ? 1 : 0, 1);
@@ -296,7 +296,7 @@ static void extract_fsm(RTLIL::Wire *wire)
RTLIL::Cell *cell = module->cells_.at(cellport.first);
RTLIL::SigSpec port_sig = assign_map(cell->get(cellport.second));
RTLIL::SigSpec unconn_sig = port_sig.extract(ctrl_out);
- RTLIL::Wire *unconn_wire = module->addWire(stringf("$fsm_unconnect$%s$%d", log_signal(unconn_sig), RTLIL::autoidx++), unconn_sig.size());
+ RTLIL::Wire *unconn_wire = module->addWire(stringf("$fsm_unconnect$%s$%d", log_signal(unconn_sig), autoidx++), unconn_sig.size());
port_sig.replace(unconn_sig, RTLIL::SigSpec(unconn_wire), &cell->connections_[cellport.second]);
}
}
diff --git a/passes/memory/memory_collect.cc b/passes/memory/memory_collect.cc
index 40c68abc..aecb7bd6 100644
--- a/passes/memory/memory_collect.cc
+++ b/passes/memory/memory_collect.cc
@@ -126,7 +126,7 @@ static void handle_memory(RTLIL::Module *module, RTLIL::Memory *memory)
}
std::stringstream sstr;
- sstr << "$mem$" << memory->name << "$" << (RTLIL::autoidx++);
+ sstr << "$mem$" << memory->name << "$" << (autoidx++);
RTLIL::Cell *mem = module->addCell(sstr.str(), "$mem");
mem->parameters["\\MEMID"] = RTLIL::Const(memory->name);
diff --git a/passes/memory/memory_dff.cc b/passes/memory/memory_dff.cc
index 32505617..6cbce781 100644
--- a/passes/memory/memory_dff.cc
+++ b/passes/memory/memory_dff.cc
@@ -113,7 +113,7 @@ static void disconnect_dff(RTLIL::Module *module, RTLIL::SigSpec sig)
sig.sort_and_unify();
std::stringstream sstr;
- sstr << "$memory_dff_disconnected$" << (RTLIL::autoidx++);
+ sstr << "$memory_dff_disconnected$" << (autoidx++);
RTLIL::SigSpec new_sig = module->addWire(sstr.str(), sig.size());
diff --git a/passes/memory/memory_map.cc b/passes/memory/memory_map.cc
index 49291656..0000bd50 100644
--- a/passes/memory/memory_map.cc
+++ b/passes/memory/memory_map.cc
@@ -41,7 +41,7 @@ static std::string genid(std::string name, std::string token1 = "", int i = -1,
if (k >= 0)
sstr << "[" << k << "]";
- sstr << token4 << "$" << (RTLIL::autoidx++);
+ sstr << token4 << "$" << (autoidx++);
return sstr.str();
}
diff --git a/passes/memory/memory_unpack.cc b/passes/memory/memory_unpack.cc
index cdf7db04..3f675ede 100644
--- a/passes/memory/memory_unpack.cc
+++ b/passes/memory/memory_unpack.cc
@@ -31,7 +31,7 @@ static void handle_memory(RTLIL::Module *module, RTLIL::Cell *memory)
RTLIL::IdString mem_name = RTLIL::escape_id(memory->parameters.at("\\MEMID").decode_string());
while (module->memories.count(mem_name) != 0)
- mem_name += stringf("_%d", RTLIL::autoidx++);
+ mem_name += stringf("_%d", autoidx++);
RTLIL::Memory *mem = new RTLIL::Memory;
mem->name = mem_name;
diff --git a/passes/proc/proc_dff.cc b/passes/proc/proc_dff.cc
index 91cafe3b..d894b442 100644
--- a/passes/proc/proc_dff.cc
+++ b/passes/proc/proc_dff.cc
@@ -122,7 +122,7 @@ static void gen_dffsr_complex(RTLIL::Module *mod, RTLIL::SigSpec sig_d, RTLIL::S
}
std::stringstream sstr;
- sstr << "$procdff$" << (RTLIL::autoidx++);
+ sstr << "$procdff$" << (autoidx++);
RTLIL::Cell *cell = mod->addCell(sstr.str(), "$dffsr");
cell->attributes = proc->attributes;
@@ -144,7 +144,7 @@ static void gen_dffsr(RTLIL::Module *mod, RTLIL::SigSpec sig_in, RTLIL::SigSpec
bool clk_polarity, bool set_polarity, RTLIL::SigSpec clk, RTLIL::SigSpec set, RTLIL::Process *proc)
{
std::stringstream sstr;
- sstr << "$procdff$" << (RTLIL::autoidx++);
+ sstr << "$procdff$" << (autoidx++);
RTLIL::SigSpec sig_set_inv = mod->addWire(NEW_ID, sig_in.size());
RTLIL::SigSpec sig_sr_set = mod->addWire(NEW_ID, sig_in.size());
@@ -191,7 +191,7 @@ static void gen_dff(RTLIL::Module *mod, RTLIL::SigSpec sig_in, RTLIL::Const val_
bool clk_polarity, bool arst_polarity, RTLIL::SigSpec clk, RTLIL::SigSpec *arst, RTLIL::Process *proc)
{
std::stringstream sstr;
- sstr << "$procdff$" << (RTLIL::autoidx++);
+ sstr << "$procdff$" << (autoidx++);
RTLIL::Cell *cell = mod->addCell(sstr.str(), arst ? "$adff" : "$dff");
cell->attributes = proc->attributes;
diff --git a/passes/proc/proc_mux.cc b/passes/proc/proc_mux.cc
index e7661245..b18ce492 100644
--- a/passes/proc/proc_mux.cc
+++ b/passes/proc/proc_mux.cc
@@ -57,7 +57,7 @@ static void extract_core_signal(const RTLIL::CaseRule *cs, RTLIL::SigSpec &sig)
static RTLIL::SigSpec gen_cmp(RTLIL::Module *mod, const RTLIL::SigSpec &signal, const std::vector<RTLIL::SigSpec> &compare, RTLIL::SwitchRule *sw)
{
std::stringstream sstr;
- sstr << "$procmux$" << (RTLIL::autoidx++);
+ sstr << "$procmux$" << (autoidx++);
RTLIL::Wire *cmp_wire = mod->addWire(sstr.str() + "_CMP", 0);
@@ -127,7 +127,7 @@ static RTLIL::SigSpec gen_mux(RTLIL::Module *mod, const RTLIL::SigSpec &signal,
log_assert(when_signal.size() == else_signal.size());
std::stringstream sstr;
- sstr << "$procmux$" << (RTLIL::autoidx++);
+ sstr << "$procmux$" << (autoidx++);
// the trivial cases
if (compare.size() == 0 || when_signal == else_signal)
diff --git a/passes/techmap/extract.cc b/passes/techmap/extract.cc
index 19d32334..ed389f2f 100644
--- a/passes/techmap/extract.cc
+++ b/passes/techmap/extract.cc
@@ -296,7 +296,7 @@ namespace
SigSet<std::pair<std::string, int>> sig2port;
// create new cell
- RTLIL::Cell *cell = haystack->addCell(stringf("$extract$%s$%d", needle->name.c_str(), RTLIL::autoidx++), needle->name);
+ RTLIL::Cell *cell = haystack->addCell(stringf("$extract$%s$%d", needle->name.c_str(), autoidx++), needle->name);
// create cell ports
for (auto &it : needle->wires_) {
diff --git a/passes/techmap/techmap.cc b/passes/techmap/techmap.cc
index 2aa59e61..c2e5960f 100644
--- a/passes/techmap/techmap.cc
+++ b/passes/techmap/techmap.cc
@@ -161,7 +161,7 @@ struct TechmapWorker
for (auto &it : tpl->cells_)
if (it.first == "\\_TECHMAP_REPLACE_") {
orig_cell_name = cell->name;
- module->rename(cell, stringf("$techmap%d", RTLIL::autoidx++) + cell->name);
+ module->rename(cell, stringf("$techmap%d", autoidx++) + cell->name);
break;
}