def current_mode
      if @current_mode
        return _modes[@current_mode] if _modes[@current_mode]
        fail "The mode #{@current_mode} of #{self.class} has not been defined!"
      else
        unless top_level?
          # Need to do this in case a class besides SubBlock includes Origen::Model
          obj_above_self = parent.nil? ? Origen.top_level : parent
          return nil if obj_above_self.nil?
          if obj_above_self.current_mode
            _modes[obj_above_self.current_mode.id] if _modes.include? obj_above_self.current_mode.id
          end
        end
      end
    end
def current_mode
      if @current_mode
        return _modes[@current_mode] if _modes[@current_mode]
        fail "The mode #{@current_mode} of #{self.class} has not been defined!"
      else
        unless top_level?
          # Need to do this in case a class besides SubBlock includes Origen::Model
          obj_above_self = parent.nil? ? Origen.top_level : parent
          return nil if obj_above_self.nil?
          if obj_above_self.current_mode
            _modes[obj_above_self.current_mode.id] if _modes.include? obj_above_self.current_mode.id
          end
        end
      end
    end
Returns the current mode/configuration of the top level SoC. If no mode has been specified
 yet this will return nil

   $dut = DUT.new
   $dut.mode             # => default
   $dut.mode.default?    # => true
   $dut.mode.ram_bist?   # => false
   $dut.mode = :ram_bist
   $dut.mode.default?    # => false
   $dut.mode.ram_bist?   # => true