lib/origen/registers/reg.rb
# Returns the description of this register if any, if none then an empty array
# will be returned
#
# **Note** Adding a description field will override any comment-driven documentation
# of a register (ie markdown style comments)
Returns the description of this register if any, if none then an empty array
will be returned

Note** Adding a description field will override any comment-driven documentation
of a register
Returns the description of this register if any if none then an empty array will be returned Note ** Adding a description field will override any comment - driven documentation of a register
def description(bitname = :_reg, options = {})
        bitname, options = :_reg, bitname if bitname.is_a?(Hash)
        options = {
          include_name:       true,
          include_bit_values: true
        }.merge(options)
        if @description_from_api[bitname]
          desc = @description_from_api[bitname]
        else
          parse_descriptions unless description_lookup[define_file]
          begin
            desc = description_lookup[define_file][name][bitname] || []
          rescue
            desc = []
          end
        end
        desc = desc.reject do |line|
          if bitname != :_reg
            unless options[:include_bit_values]
              !!(line =~ /^\s*(\d+)\s+\|\s+(.+)/)
            end
          else
            false
          end
        end
        if desc.first
          unless options[:include_name]
            desc[0] = desc.first.sub(/\s*\*\*\s*#{escape_special_char(full_name(bitname))}\s*\*\*\s*-?\s*/, '')
          end
        end
        desc.shift while desc.first && desc.first.strip.empty?
        desc.pop while desc.last && desc.last.strip.empty?
        desc
      end
def description ( bitname = :_reg , options = { } ) bitname , options = :_reg , bitname if bitname . is_a? ( Hash ) options = { include_name : true , include_bit_values : true } . merge ( options ) if @description_from_api [ bitname ] desc = @description_from_api [ bitname ] else parse_descriptions unless description_lookup [ define_file ] begin desc = description_lookup [ define_file ] [ name ] [ bitname ] || [ ] rescue desc = [ ] end end desc = desc . reject do | line | if bitname != :_reg unless options [ :include_bit_values ] ! ! ( line =~ / ^ \s *( \d +) \s + \| \s +(.+) / ) end else false end end if desc . first unless options [ :include_name ] desc [ 0 ] = desc . first . sub ( / \s * \* \* \s * #{ escape_special_char ( full_name ( bitname ) ) } \s * \* \* \s *-? \s * / , '' ) end end desc . shift while desc . first && desc . first . strip . empty? desc . pop while desc . last && desc . last . strip . empty? desc end
Returns the description of this register if any, if none then an empty array
will be returned
Returns the description of this register if any if none then an empty array will be returned
bitname
<not_specific>
options
<not_specific>