From 93a70959f3f67ffcee8159b18a5f68904e32a074 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 4 Dec 2013 14:14:05 +0100 Subject: Replaced RTLIL::Const::str with generic decoder method --- kernel/rtlil.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'kernel/rtlil.h') diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 5873c3694..f00a51a26 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -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 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 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 { -- cgit v1.2.3