Class: Udb::PartialConfig
Overview
This class represents a configuration that is “partially-configured” (e.g., portfolio or configurable IP). # It only lists mandatory & prohibited extensions and fully-constrained parameters (single value).
Constant Summary
AbstractConfig::ParamValueType
Instance Attribute Summary
#info, #type
Instance Method Summary
collapse
#arch_overlay, #arch_overlay_abs, #compatible, #configured?, create, create_from_data, #description, #name, #overlay?
Constructor Details
Returns a new instance of PartialConfig.
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
|
# File 'lib/udb/config.rb', line 238
def initialize(data, info)
super(data, info)
@param_values = @data.key?("params") ? @data["params"] : [].freeze
@mxlen = @data.dig("params", "MXLEN")
if @mxlen.nil?
MODE_XLEN_PARAMS.each do |param|
val = @data.dig("params", param)
if val == 64 || (val.is_a?(Array) && val.include?(64))
@mxlen = 64
break
end
end
if @mxlen.nil?
param_req = @data.dig("requirements", "param")
@mxlen = 64 if !param_req.nil? && param_req_implies_64?(param_req)
end
end
@mxlen.freeze unless @mxlen.nil?
end
|
Instance Method Details
#additional_extensions_allowed? ⇒ Boolean
334
|
# File 'lib/udb/config.rb', line 334
def additional_extensions_allowed? = @data.key?("additional_extensions") ? @data["additional_extensions"] : true
|
276
|
# File 'lib/udb/config.rb', line 276
def fully_configured? = false
|
#mandatory_extensions ⇒ Object
285
286
287
288
289
290
291
292
293
294
295
|
# File 'lib/udb/config.rb', line 285
def mandatory_extensions
@mandatory_extensions ||=
if @data["mandatory_extensions"].nil?
[]
else
@data["mandatory_extensions"].map do |e|
{ "name" => e["name"], "version" => e["version"].is_a?(String) ? [e["version"]] : e["version"] }
end
end
end
|
#mxlen ⇒ Object
273
|
# File 'lib/udb/config.rb', line 273
def mxlen = @mxlen
|
#non_mandatory_extensions ⇒ Object
298
299
300
301
302
303
304
305
306
307
308
|
# File 'lib/udb/config.rb', line 298
def non_mandatory_extensions
@non_mandatory_extensions ||=
if @data["non_mandatory_extensions"].nil?
[]
else
@data["non_mandatory_extensions"].map do |e|
{ "name" => e["name"], "version" => e["version"].is_a?(String) ? [e["version"]] : e["version"] }
end
end
end
|
#param_values ⇒ Object
270
|
# File 'lib/udb/config.rb', line 270
def param_values = @param_values
|
279
|
# File 'lib/udb/config.rb', line 279
def partially_configured? = true
|
#prohibited_extensions ⇒ Object
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
# File 'lib/udb/config.rb', line 311
def prohibited_extensions
@prohibited_extensions ||=
if @data["prohibited_extensions"].nil?
[]
else
@data["prohibited_extensions"].map do |e|
{
"name" => e["name"],
"version" =>
if e.key?("version")
e["version"].is_a?(String) ? [e["version"]] : e["version"]
else
">=0"
end
}
end
end
end
|
#requirements ⇒ Object
337
|
# File 'lib/udb/config.rb', line 337
def requirements = @data["requirements"]
|
282
|
# File 'lib/udb/config.rb', line 282
def unconfigured? = false
|