module RgGen::VHDL::Utility

Private Instance Methods

assign(lhs, rhs) click to toggle source
# File lib/rggen/vhdl/utility.rb, line 10
def assign(lhs, rhs)
  "#{lhs} <= #{rhs};"
end
bin(value, width = nil) click to toggle source
# File lib/rggen/vhdl/utility.rb, line 14
def bin(value, width = nil)
  width && format("\"%0*b\"", width, value) || "'#{value[0]}'"
end
hex(value, width) click to toggle source
# File lib/rggen/vhdl/utility.rb, line 18
def hex(value, width)
  print_width = (width + 3) / 4
  format("x\"%0*x\"", print_width, value)
end
local_scope(scope_name, attributes = {}, &block) click to toggle source
# File lib/rggen/vhdl/utility.rb, line 23
def local_scope(scope_name, attributes = {}, &block)
  LocalScope.new(attributes.merge(name: scope_name), &block).to_code
end