Class: RubyRTL::RIntLit
Instance Attribute Summary
Attributes inherited from Literal
Attributes inherited from Ast
Instance Method Summary collapse
-
#initialize(val) ⇒ RIntLit
constructor
A new instance of RIntLit.
Methods inherited from Ast
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 |