Class: Udb::XlenCondition

Inherits:
Condition show all
Extended by:
T::Sig
Defined in:
lib/udb/condition.rb

Instance Method Summary collapse

Constructor Details

#initialize(xlen)

Parameters:

  • xlen (Integer)


2041
2042
2043
2044
# File 'lib/udb/condition.rb', line 2041

def initialize(xlen)
  @xlen = xlen
  @satisfied_by_cfg_arch_memo = T.let({}, T::Hash[ConfiguredArchitecture, SatisfiedResult])
end

Instance Method Details

#to_hHash{String => T.untyped}, Boolean

Returns:

  • (Hash{String => T.untyped}, Boolean)


2058
# File 'lib/udb/condition.rb', line 2058

def to_h = { "xlen" => @xlen }

#to_idl(cfg_arch) ⇒ String

Parameters:

Returns:

  • (String)


2061
# File 'lib/udb/condition.rb', line 2061

def to_idl(cfg_arch) = "xlen() == #{@xlen}"

#to_logic_tree_internalLogicNode

Returns:



2047
2048
2049
2050
2051
2052
2053
2054
2055
# File 'lib/udb/condition.rb', line 2047

def to_logic_tree_internal
  if @xlen == 32
    LogicNode::Xlen32
  elsif @xlen == 64
    LogicNode::Xlen64
  else
    raise "unexpected"
  end
end