Module: Origen::Fuses

Defined in:
lib/origen/fuses.rb,
lib/origen/fuses/fuse_field.rb

Defined Under Namespace

Classes: FuseField

Instance Method Summary collapse

Instance Method Details

#fuse_field(name, start_addr, size, options = {}) ⇒ Object


22
23
24
25
26
27
28
29
# File 'lib/origen/fuses.rb', line 22

def fuse_field(name, start_addr, size, options = {})
  @_fuses ||= {}
  if fuses.respond_to? :name
    Origen.log.error("Cannot create fuse field '#{name}', it already exists!")
    fail
  end
  @_fuses[name] = FuseField.new(name, start_addr, size, self, options)
end

#fuses(expr = nil) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/origen/fuses.rb', line 4

def fuses(expr = nil)
  if expr.nil?
    if @_fuses.nil?
      @_fuses = {}
    elsif @_fuses.is_a? Hash
      if @_fuses.empty?
        @_fuses
      else
        @_fuses.ids
      end
    else
      @_fuses = {}
    end
  else
    @_fuses.recursive_find_by_key(expr)
  end
end