Class: RubyRTL::RIntLit

Inherits:
Literal show all
Defined in:
lib/ruby_rtl/ast.rb

Instance Attribute Summary

Attributes inherited from Literal

#type, #val

Attributes inherited from Ast

#comments

Instance Method Summary collapse

Methods inherited from Ast

#accept

Constructor Details

#initialize(val) ⇒ RIntLit



248
249
250
251
252
# File 'lib/ruby_rtl/ast.rb', line 248

def initialize val
  val=val==0 ? 1 : val
  bitwidth=Math.log2(val).floor + 1
  super(val,RIntType.new(bitwidth))
end