Method: HDLRuby::Tprocess#resolve

Defined in:
lib/HDLRuby/hruby_types.rb

#resolve(type) ⇒ Object

Type resolution: decide which class to use for representing a computating result with +type+.



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/HDLRuby/hruby_types.rb', line 38

def resolve(type)
    # puts "self=#{self} type=#{type}"
    if self.float? then
        return self
    elsif type.float? then
        return type
    elsif self.signed? then
        return self
    elsif type.signed? then
        return type
    elsif self.unsigned? then
        return self
    elsif type.unsigned? then
        return type
    elsif self.width >= type.width then
        return self
    else
        return type
    end
end