aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-12-28 19:24:24 +0100
committerClifford Wolf <clifford@clifford.at>2014-12-28 19:24:24 +0100
commit137f35373f4ef0d1ddf212187e537e48d077b1f4 (patch)
treea77df3913cb442b444f530648b71d4777e0921d2 /kernel
parentf3a97b75c78bd6f3670445129405213c0a015481 (diff)
downloadyosys-137f35373f4ef0d1ddf212187e537e48d077b1f4.tar.gz
yosys-137f35373f4ef0d1ddf212187e537e48d077b1f4.tar.bz2
yosys-137f35373f4ef0d1ddf212187e537e48d077b1f4.zip
Changed more code to dict<> and pool<>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/celltypes.h12
-rw-r--r--kernel/utils.h10
2 files changed, 11 insertions, 11 deletions
diff --git a/kernel/celltypes.h b/kernel/celltypes.h
index 5ba4dd88b..32e144194 100644
--- a/kernel/celltypes.h
+++ b/kernel/celltypes.h
@@ -27,13 +27,13 @@ YOSYS_NAMESPACE_BEGIN
struct CellType
{
RTLIL::IdString type;
- std::set<RTLIL::IdString> inputs, outputs;
+ pool<RTLIL::IdString> inputs, outputs;
bool is_evaluable;
};
struct CellTypes
{
- std::map<RTLIL::IdString, CellType> cell_types;
+ dict<RTLIL::IdString, CellType> cell_types;
CellTypes()
{
@@ -55,7 +55,7 @@ struct CellTypes
setup_stdcells_mem();
}
- void setup_type(RTLIL::IdString type, const std::set<RTLIL::IdString> &inputs, const std::set<RTLIL::IdString> &outputs, bool is_evaluable = false)
+ void setup_type(RTLIL::IdString type, const pool<RTLIL::IdString> &inputs, const pool<RTLIL::IdString> &outputs, bool is_evaluable = false)
{
CellType ct = {type, inputs, outputs, is_evaluable};
cell_types[ct.type] = ct;
@@ -63,7 +63,7 @@ struct CellTypes
void setup_module(RTLIL::Module *module)
{
- std::set<RTLIL::IdString> inputs, outputs;
+ pool<RTLIL::IdString> inputs, outputs;
for (RTLIL::IdString wire_name : module->ports) {
RTLIL::Wire *wire = module->wire(wire_name);
if (wire->port_input)
@@ -109,7 +109,7 @@ struct CellTypes
setup_type("$alu", {"\\A", "\\B", "\\CI", "\\BI"}, {"\\X", "\\Y", "\\CO"}, true);
setup_type("$fa", {"\\A", "\\B", "\\C"}, {"\\X", "\\Y"}, true);
- setup_type("$assert", {"\\A", "\\EN"}, std::set<RTLIL::IdString>(), true);
+ setup_type("$assert", {"\\A", "\\EN"}, pool<RTLIL::IdString>(), true);
}
void setup_internals_mem()
@@ -123,7 +123,7 @@ struct CellTypes
setup_type("$dlatchsr", {"\\EN", "\\SET", "\\CLR", "\\D"}, {"\\Q"});
setup_type("$memrd", {"\\CLK", "\\ADDR"}, {"\\DATA"});
- setup_type("$memwr", {"\\CLK", "\\EN", "\\ADDR", "\\DATA"}, std::set<RTLIL::IdString>());
+ setup_type("$memwr", {"\\CLK", "\\EN", "\\ADDR", "\\DATA"}, pool<RTLIL::IdString>());
setup_type("$mem", {"\\RD_CLK", "\\RD_ADDR", "\\WR_CLK", "\\WR_EN", "\\WR_ADDR", "\\WR_DATA"}, {"\\RD_DATA"});
setup_type("$fsm", {"\\CLK", "\\ARST", "\\CTRL_IN"}, {"\\CTRL_OUT"});
diff --git a/kernel/utils.h b/kernel/utils.h
index 479effdc9..2ec6182ea 100644
--- a/kernel/utils.h
+++ b/kernel/utils.h
@@ -31,17 +31,17 @@ YOSYS_NAMESPACE_BEGIN
// A map-like container, but you can save and restore the state
// ------------------------------------------------
-template<typename Key, typename T, typename Compare = std::less<Key>>
+template<typename Key, typename T, typename OPS = hash_ops<Key>>
struct stackmap
{
private:
- std::vector<std::map<Key, T*, Compare>> backup_state;
- std::map<Key, T, Compare> current_state;
+ std::vector<dict<Key, T*, OPS>> backup_state;
+ dict<Key, T, OPS> current_state;
static T empty_tuple;
public:
stackmap() { }
- stackmap(const std::map<Key, T, Compare> &other) : current_state(other) { }
+ stackmap(const dict<Key, T, OPS> &other) : current_state(other) { }
template<typename Other>
void operator=(const Other &other)
@@ -94,7 +94,7 @@ public:
current_state.erase(k);
}
- const std::map<Key, T, Compare> &stdmap()
+ const dict<Key, T, OPS> &stdmap()
{
return current_state;
}