3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-28 15:07:58 +00:00

Moved some stuff to kernel/yosys.{h,cc}, using Yosys:: namespace

This commit is contained in:
Clifford Wolf 2014-07-31 13:19:47 +02:00
parent 1202f7aa4b
commit 1cb25c05b3
41 changed files with 790 additions and 665 deletions

View file

@ -22,6 +22,8 @@
#ifndef RTLIL_H
#define RTLIL_H
YOSYS_NAMESPACE_BEGIN
namespace RTLIL
{
enum State : unsigned char {
@ -50,8 +52,6 @@ namespace RTLIL
CONST_FLAG_REAL = 4 // unused -- to be used for parameters
};
extern int autoidx;
struct Const;
struct Selection;
struct Design;
@ -123,18 +123,6 @@ namespace RTLIL
return str.c_str();
}
static IdString new_id(std::string file, int line, std::string func) __attribute__((unused));
static IdString new_id(std::string file, int line, std::string func) {
std::string str = "$auto$";
size_t pos = file.find_last_of('/');
str += pos != std::string::npos ? file.substr(pos+1) : file;
str += stringf(":%d:%s$%d", line, func.c_str(), autoidx++);
return str;
}
#define NEW_ID \
RTLIL::new_id(__FILE__, __LINE__, __FUNCTION__)
template <typename T> struct sort_by_name {
bool operator()(T *a, T *b) const {
return a->name < b->name;
@ -969,4 +957,6 @@ void RTLIL::Process::rewrite_sigspecs(T functor)
it->rewrite_sigspecs(functor);
}
YOSYS_NAMESPACE_END
#endif