mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 06:03:23 +00:00
Replaced RTLIL::Const::str with generic decoder method
This commit is contained in:
parent
a2d053694b
commit
93a70959f3
21 changed files with 125 additions and 84 deletions
|
@ -38,6 +38,7 @@ namespace RTLIL
|
|||
Sa = 4, // don't care (used only in cases)
|
||||
Sm = 5 // marker (used internally by some passes)
|
||||
};
|
||||
|
||||
enum SyncType {
|
||||
ST0 = 0, // level sensitive: 0
|
||||
ST1 = 1, // level sensitive: 1
|
||||
|
@ -48,6 +49,13 @@ namespace RTLIL
|
|||
STi = 6 // init
|
||||
};
|
||||
|
||||
enum ConstFlags {
|
||||
CONST_FLAG_NONE = 0,
|
||||
CONST_FLAG_STRING = 1,
|
||||
CONST_FLAG_SIGNED = 2, // unused -- to be used for parameters
|
||||
CONST_FLAG_REAL = 4 // unused -- to be used for parameters
|
||||
};
|
||||
|
||||
extern int autoidx;
|
||||
|
||||
struct Const;
|
||||
|
@ -181,9 +189,10 @@ namespace RTLIL
|
|||
};
|
||||
|
||||
struct RTLIL::Const {
|
||||
std::string str;
|
||||
int flags;
|
||||
std::vector<RTLIL::State> bits;
|
||||
Const(std::string str = std::string());
|
||||
Const();
|
||||
Const(std::string str);
|
||||
Const(int val, int width = 32);
|
||||
Const(RTLIL::State bit, int width = 1);
|
||||
Const(std::vector<RTLIL::State> bits) : bits(bits) { };
|
||||
|
@ -193,6 +202,7 @@ struct RTLIL::Const {
|
|||
bool as_bool() const;
|
||||
int as_int() const;
|
||||
std::string as_string() const;
|
||||
std::string decode_string() const;
|
||||
};
|
||||
|
||||
struct RTLIL::Selection {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue