aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtlil.cc49
-rw-r--r--kernel/rtlil.h4
-rw-r--r--kernel/yosys.cc2
3 files changed, 52 insertions, 3 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index 00c116115..d9003f28c 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -42,11 +42,58 @@ int RTLIL::IdString::last_created_idx_ptr_;
#endif
#define X(_id) IdString RTLIL::ID::_id;
-#include "constids.inc"
+#include "kernel/constids.inc"
#undef X
dict<std::string, std::string> RTLIL::constpad;
+const pool<IdString> &RTLIL::builtin_ff_cell_types() {
+ static const pool<IdString> res = {
+ ID($sr),
+ ID($ff),
+ ID($dff),
+ ID($dffe),
+ ID($dffsr),
+ ID($adff),
+ ID($dlatch),
+ ID($dlatchsr),
+ ID($_DFFE_NN_),
+ ID($_DFFE_NP_),
+ ID($_DFFE_PN_),
+ ID($_DFFE_PP_),
+ ID($_DFFSR_NNN_),
+ ID($_DFFSR_NNP_),
+ ID($_DFFSR_NPN_),
+ ID($_DFFSR_NPP_),
+ ID($_DFFSR_PNN_),
+ ID($_DFFSR_PNP_),
+ ID($_DFFSR_PPN_),
+ ID($_DFFSR_PPP_),
+ ID($_DFF_NN0_),
+ ID($_DFF_NN1_),
+ ID($_DFF_NP0_),
+ ID($_DFF_NP1_),
+ ID($_DFF_N_),
+ ID($_DFF_PN0_),
+ ID($_DFF_PN1_),
+ ID($_DFF_PP0_),
+ ID($_DFF_PP1_),
+ ID($_DFF_P_),
+ ID($_DLATCHSR_NNN_),
+ ID($_DLATCHSR_NNP_),
+ ID($_DLATCHSR_NPN_),
+ ID($_DLATCHSR_NPP_),
+ ID($_DLATCHSR_PNN_),
+ ID($_DLATCHSR_PNP_),
+ ID($_DLATCHSR_PPN_),
+ ID($_DLATCHSR_PPP_),
+ ID($_DLATCH_N_),
+ ID($_DLATCH_P_),
+ ID($_FF_),
+ };
+ return res;
+}
+
RTLIL::Const::Const()
{
flags = RTLIL::CONST_FLAG_NONE;
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 7279835ea..17f038e36 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -377,12 +377,14 @@ namespace RTLIL
namespace ID {
#define X(_id) extern IdString _id;
-#include "constids.inc"
+#include "kernel/constids.inc"
#undef X
};
extern dict<std::string, std::string> constpad;
+ const pool<IdString> &builtin_ff_cell_types();
+
static inline std::string escape_id(const std::string &str) {
if (str.size() > 0 && str[0] != '\\' && str[0] != '$')
return "\\" + str;
diff --git a/kernel/yosys.cc b/kernel/yosys.cc
index cbf041f79..b416c2b74 100644
--- a/kernel/yosys.cc
+++ b/kernel/yosys.cc
@@ -516,7 +516,7 @@ void yosys_setup()
already_setup = true;
#define X(_id) RTLIL::ID::_id = "\\" # _id;
-#include "constids.inc"
+#include "kernel/constids.inc"
#undef X
#ifdef WITH_PYTHON