Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/rhdl/block_dsl.rb

Instance Method Summary collapse

Instance Method Details

#fanout(check_context, statement) ⇒ Object



9
10
11
# File 'lib/rhdl/block_dsl.rb', line 9

def fanout(check_context, statement)
  # literals can fanout anytime
end

#generateObject



5
6
7
# File 'lib/rhdl/block_dsl.rb', line 5

def generate
  "1'b#{to_s}"
end

#get_output_type(check_context) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/rhdl/block_dsl.rb', line 13

def get_output_type(check_context)
  if self == 0 || self == 1
    return DataType.new("uint", 1, nil)
  end

  raise 'integer literal other than 0 or 1 not supported'
end