class Origen::Fuses::FuseField
Currently just a simple data container most suited for import from Excel/CSV/XML by stuffing all attributes into the options hash
Attributes
name[RW]
owner[RW]
size[RW]
start_addr[RW]
Public Class Methods
new(name, start_addr, size, owner, options = {})
click to toggle source
# File lib/origen/fuses/fuse_field.rb, line 8 def initialize(name, start_addr, size, owner, options = {}) options = { default_value: 0 }.merge(options) @name, @start_addr, @size, @owner = name, start_addr, size, owner # Check if the start address is in Verilog format or includes the number base in it if @start_addr.is_a? String if @start_addr.is_verilog_number? || @start_addr.match(/^0[x,o,d,b]\S+/) @start_addr = @start_addr.to_dec end end unless @size.is_a?(Numeric) && @start_addr.size.is_a?(Numeric) Origen.log.error("Fuse fields must have numeric attributes for 'size' and 'start_addr'!") fail end # If the fuse field is owned by Top Level DUT then keep the start address as-is # If not, then add the fuse field start address to the base address of the IP unless owner.is_top_level? @start_addr += owner.base_address if owner.respond_to?(:base_address) end options.each do |o, val| instance_eval("def #{o};@#{o};end") # getter instance_eval("def #{o}=(val);@#{o}=val;end") # setter ivar_name = "@#{o}".to_sym instance_variable_set(ivar_name, options[o]) end def reprogrammeable? respond_to?(:reprogrammeable) ? reprogrammeable : true end def customer_visible? respond_to?(:customer_visible) ? customer_visible : false end end
Public Instance Methods
customer_visible?()
click to toggle source
# File lib/origen/fuses/fuse_field.rb, line 39 def customer_visible? respond_to?(:customer_visible) ? customer_visible : false end
reprogrammeable?()
click to toggle source
# File lib/origen/fuses/fuse_field.rb, line 35 def reprogrammeable? respond_to?(:reprogrammeable) ? reprogrammeable : true end