mirror of
https://github.com/YosysHQ/yosys
synced 2026-06-09 18:41:06 +00:00
yosys: use newcelltypes for yosys_celltypes
This commit is contained in:
parent
7a5c303ccd
commit
5216d32d1b
3 changed files with 12 additions and 38 deletions
|
|
@ -548,9 +548,6 @@ struct CellTypes
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// initialized by yosys_setup()
|
|
||||||
extern CellTypes yosys_celltypes;
|
|
||||||
|
|
||||||
YOSYS_NAMESPACE_END
|
YOSYS_NAMESPACE_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -419,32 +419,7 @@ struct CellTableBuilder {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr CellTableBuilder builder{};
|
||||||
constexpr CellTableBuilder turbo_builder{};
|
|
||||||
|
|
||||||
// template<typename T>
|
|
||||||
// struct Worlds {
|
|
||||||
// struct World {
|
|
||||||
// std::array<T, MAX_CELLS> data{};
|
|
||||||
// constexpr T operator()(IdString type) const {
|
|
||||||
// return data[type.index_];
|
|
||||||
// }
|
|
||||||
// constexpr T& operator[](size_t idx) {
|
|
||||||
// return data[idx];
|
|
||||||
// }
|
|
||||||
// constexpr size_t size() const { return data.size(); }
|
|
||||||
// };
|
|
||||||
// World is_known {};
|
|
||||||
// World is_evaluable {};
|
|
||||||
// World is_combinatorial {};
|
|
||||||
// World is_synthesizable {};
|
|
||||||
// World is_stdcell {};
|
|
||||||
// World is_ff {};
|
|
||||||
// World is_mem_noff {};
|
|
||||||
// World is_anyinit {};
|
|
||||||
// World is_tristate {};
|
|
||||||
// virtual constexpr Categories();
|
|
||||||
// };
|
|
||||||
|
|
||||||
struct PortInfo {
|
struct PortInfo {
|
||||||
struct PortLists {
|
struct PortLists {
|
||||||
|
|
@ -460,8 +435,8 @@ struct PortInfo {
|
||||||
PortLists inputs {};
|
PortLists inputs {};
|
||||||
PortLists outputs {};
|
PortLists outputs {};
|
||||||
constexpr PortInfo() {
|
constexpr PortInfo() {
|
||||||
for (size_t i = 0; i < turbo_builder.count; ++i) {
|
for (size_t i = 0; i < builder.count; ++i) {
|
||||||
auto& cell = turbo_builder.cells[i];
|
auto& cell = builder.cells[i];
|
||||||
size_t idx = cell.type.index_;
|
size_t idx = cell.type.index_;
|
||||||
inputs[idx] = cell.inputs;
|
inputs[idx] = cell.inputs;
|
||||||
outputs[idx] = cell.outputs;
|
outputs[idx] = cell.outputs;
|
||||||
|
|
@ -503,8 +478,8 @@ struct Categories {
|
||||||
Category is_anyinit {};
|
Category is_anyinit {};
|
||||||
Category is_tristate {};
|
Category is_tristate {};
|
||||||
constexpr Categories() {
|
constexpr Categories() {
|
||||||
for (size_t i = 0; i < turbo_builder.count; ++i) {
|
for (size_t i = 0; i < builder.count; ++i) {
|
||||||
auto& cell = turbo_builder.cells[i];
|
auto& cell = builder.cells[i];
|
||||||
size_t idx = cell.type.index_;
|
size_t idx = cell.type.index_;
|
||||||
is_known.set(idx);
|
is_known.set(idx);
|
||||||
is_evaluable.set(idx, cell.features.is_evaluable);
|
is_evaluable.set(idx, cell.features.is_evaluable);
|
||||||
|
|
@ -558,6 +533,8 @@ namespace Compat {
|
||||||
// old setup_stdcells
|
// old setup_stdcells
|
||||||
static constexpr auto stdcells_nomem_noff = Categories::meet(categories.is_stdcell, nomem_noff);
|
static constexpr auto stdcells_nomem_noff = Categories::meet(categories.is_stdcell, nomem_noff);
|
||||||
static constexpr auto stdcells_mem = Categories::meet(categories.is_stdcell, categories.is_mem_noff);
|
static constexpr auto stdcells_mem = Categories::meet(categories.is_stdcell, categories.is_mem_noff);
|
||||||
|
// old setup_internals_eval
|
||||||
|
// static constexpr auto internals_eval = Categories::meet(internals_all, categories.is_evaluable);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
@ -665,6 +642,8 @@ struct NewCellTypes {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern NewCellTypes yosys_celltypes;
|
||||||
|
|
||||||
YOSYS_NAMESPACE_END
|
YOSYS_NAMESPACE_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "kernel/yosys.h"
|
#include "kernel/yosys.h"
|
||||||
#include "kernel/celltypes.h"
|
|
||||||
#include "kernel/log.h"
|
#include "kernel/log.h"
|
||||||
|
#include "kernel/newcelltypes.h"
|
||||||
|
|
||||||
#ifdef YOSYS_ENABLE_READLINE
|
#ifdef YOSYS_ENABLE_READLINE
|
||||||
# include <readline/readline.h>
|
# include <readline/readline.h>
|
||||||
|
|
@ -92,7 +92,7 @@ const char* yosys_maybe_version() {
|
||||||
}
|
}
|
||||||
|
|
||||||
RTLIL::Design *yosys_design = NULL;
|
RTLIL::Design *yosys_design = NULL;
|
||||||
CellTypes yosys_celltypes;
|
NewCellTypes yosys_celltypes;
|
||||||
|
|
||||||
#ifdef YOSYS_ENABLE_TCL
|
#ifdef YOSYS_ENABLE_TCL
|
||||||
Tcl_Interp *yosys_tcl_interp = NULL;
|
Tcl_Interp *yosys_tcl_interp = NULL;
|
||||||
|
|
@ -262,7 +262,7 @@ void yosys_setup()
|
||||||
|
|
||||||
Pass::init_register();
|
Pass::init_register();
|
||||||
yosys_design = new RTLIL::Design;
|
yosys_design = new RTLIL::Design;
|
||||||
yosys_celltypes.setup();
|
yosys_celltypes.static_cell_types = StaticCellTypes::categories.is_known;
|
||||||
log_push();
|
log_push();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -291,8 +291,6 @@ void yosys_shutdown()
|
||||||
log_errfile = NULL;
|
log_errfile = NULL;
|
||||||
log_files.clear();
|
log_files.clear();
|
||||||
|
|
||||||
yosys_celltypes.clear();
|
|
||||||
|
|
||||||
#ifdef YOSYS_ENABLE_TCL
|
#ifdef YOSYS_ENABLE_TCL
|
||||||
if (yosys_tcl_interp != NULL) {
|
if (yosys_tcl_interp != NULL) {
|
||||||
if (!Tcl_InterpDeleted(yosys_tcl_interp)) {
|
if (!Tcl_InterpDeleted(yosys_tcl_interp)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue