Class: Udb::FullConfig

Inherits:
AbstractConfig show all
Defined in:
lib/udb/config.rb

Overview

This class represents a configuration that is “fully-configured” (e.g., SoC tapeout or fully-configured IP). # It has a complete list of extensions and parameters (all are a single value at this point). #

Instance Method Summary collapse

Constructor Details

#initialize(data, info)

NON-ABSTRACT METHODS #

Parameters:



292
293
294
295
296
297
298
299
300
301
302
# File 'lib/udb/config.rb', line 292

def initialize(data, info)
  super(data, info)

  @param_values = @data["params"]

  @mxlen = @data.dig("params", "MXLEN").freeze
  if @mxlen.nil?
    Udb.logger.error "Must set MXLEN for a configured config"
    raise InvalidConfigError
  end
end

Instance Method Details

#fully_configured?Boolean

Returns:

  • (Boolean)


315
# File 'lib/udb/config.rb', line 315

def fully_configured? = true

#implemented_extensionsArray<Hash{String => String}>

Returns:

  • (Array<Hash{String => String}>)


324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/udb/config.rb', line 324

def implemented_extensions
  @implemented_extensions ||=
    if @data["implemented_extensions"].nil?
      []
    else
      @data["implemented_extensions"].map do |e|
        if e.is_a?(Array)
          { "name" => e[0], "version" => e[1] }
        elsif e.is_a?(Hash)
          { "name" => e.fetch("name"), "version" => RequirementSpec.new(e.fetch("version")).version_spec.to_s }
        end
      end
    end
end

#mxlenInteger

Returns:

  • (Integer)


312
# File 'lib/udb/config.rb', line 312

def mxlen = @mxlen

#param_valuesHash{String => ParamValueType}

ABSTRACT METHODS OVERRIDDEN #

Returns:



309
# File 'lib/udb/config.rb', line 309

def param_values = @param_values

#partially_configured?Boolean

Returns:

  • (Boolean)


318
# File 'lib/udb/config.rb', line 318

def partially_configured? = false

#unconfigured?Boolean

Returns:

  • (Boolean)


321
# File 'lib/udb/config.rb', line 321

def unconfigured? = false