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)
45 46 47 |
# File 'lib/udb/logic.rb', line 45 def initialize(xlen) @xlen = xlen end |
Instance Attribute Details
#xlen ⇒ Object (readonly)
Returns the value of attribute xlen.
42 43 44 |
# File 'lib/udb/logic.rb', line 42 def xlen @xlen end |
Instance Method Details
#<=>(other) ⇒ Integer?
88 89 90 91 92 |
# File 'lib/udb/logic.rb', line 88 def <=>(other) return nil unless other.is_a?(XlenTerm) @xlen <=> other.xlen end |
#eql?(other) ⇒ Boolean
104 105 106 |
# File 'lib/udb/logic.rb', line 104 def eql?(other) (self <=> other) == 0 end |
#hash ⇒ Integer
hash and eql? must be implemented to use ExtensionTerm as a Hash key
96 |
# File 'lib/udb/logic.rb', line 96 def hash = to_s.hash |
#to_asciidoc ⇒ String
68 |
# File 'lib/udb/logic.rb', line 68 def to_asciidoc = "xlen+++()+++ == #{@xlen}" |
#to_condition(cfg_arch) ⇒ Condition
50 51 52 |
# File 'lib/udb/logic.rb', line 50 def to_condition(cfg_arch) Condition.new({ "xlen" => @xlen }, cfg_arch) end |
#to_h ⇒ Hash{String => Integer}
71 72 73 74 75 |
# File 'lib/udb/logic.rb', line 71 def to_h { "xlen" => @xlen } end |
#to_idl(cfg_arch) ⇒ String
78 79 80 |
# File 'lib/udb/logic.rb', line 78 def to_idl(cfg_arch) "(xlen() == #{@xlen})" end |
#to_s ⇒ String
55 56 57 |
# File 'lib/udb/logic.rb', line 55 def to_s "xlen=#{@xlen}" end |
#to_s_pretty ⇒ String
65 |
# File 'lib/udb/logic.rb', line 65 def to_s_pretty = to_s |
#to_z3(solver) ⇒ Z3::BoolExpr
60 61 62 |
# File 'lib/udb/logic.rb', line 60 def to_z3(solver) solver.xlen == @xlen end |