Class: Udb::XlenTerm
- Inherits:
-
Object
- Object
- Udb::XlenTerm
- Extended by:
- T::Sig
- Includes:
- Comparable
- Defined in:
- lib/udb/logic.rb
Instance Attribute Summary collapse
-
#xlen ⇒ Object
readonly
Returns the value of attribute xlen.
Instance Method Summary collapse
- #<=>(other) ⇒ Integer?
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Integer
hash and eql? must be implemented to use ExtensionTerm as a Hash key.
- #initialize(xlen) constructor
- #to_asciidoc ⇒ String
- #to_condition(cfg_arch) ⇒ Condition
- #to_h ⇒ Hash{String => Integer}
- #to_idl(cfg_arch) ⇒ String
- #to_s ⇒ String
- #to_s_pretty ⇒ String
- #to_z3(solver) ⇒ Z3::BoolExpr
Constructor Details
#initialize(xlen)
46 47 48 |
# File 'lib/udb/logic.rb', line 46 def initialize(xlen) @xlen = xlen end |
Instance Attribute Details
#xlen ⇒ Object (readonly)
Returns the value of attribute xlen.
43 44 45 |
# File 'lib/udb/logic.rb', line 43 def xlen @xlen end |
Instance Method Details
#<=>(other) ⇒ Integer?
89 90 91 92 93 |
# File 'lib/udb/logic.rb', line 89 def <=>(other) return nil unless other.is_a?(XlenTerm) @xlen <=> other.xlen end |
#eql?(other) ⇒ Boolean
105 106 107 |
# File 'lib/udb/logic.rb', line 105 def eql?(other) (self <=> other) == 0 end |
#hash ⇒ Integer
hash and eql? must be implemented to use ExtensionTerm as a Hash key
97 |
# File 'lib/udb/logic.rb', line 97 def hash = to_s.hash |
#to_asciidoc ⇒ String
69 |
# File 'lib/udb/logic.rb', line 69 def to_asciidoc = "xlen+++()+++ == #{@xlen}" |
#to_condition(cfg_arch) ⇒ Condition
51 52 53 |
# File 'lib/udb/logic.rb', line 51 def to_condition(cfg_arch) Condition.new({ "xlen" => @xlen }, cfg_arch) end |
#to_h ⇒ Hash{String => Integer}
72 73 74 75 76 |
# File 'lib/udb/logic.rb', line 72 def to_h { "xlen" => @xlen } end |
#to_idl(cfg_arch) ⇒ String
79 80 81 |
# File 'lib/udb/logic.rb', line 79 def to_idl(cfg_arch) "(xlen() == #{@xlen})" end |
#to_s ⇒ String
56 57 58 |
# File 'lib/udb/logic.rb', line 56 def to_s "xlen=#{@xlen}" end |
#to_s_pretty ⇒ String
66 |
# File 'lib/udb/logic.rb', line 66 def to_s_pretty = to_s |
#to_z3(solver) ⇒ Z3::BoolExpr
61 62 63 |
# File 'lib/udb/logic.rb', line 61 def to_z3(solver) solver.xlen == @xlen end |