@@ -63,8 +63,10 @@ def configured? = @data["type"] != "unconfigured"
6363 def type = @data [ "type" ]
6464end
6565
66- # this class represents a configuration file (e.g., cfgs/*/cfg.yaml) that is "unconfigured"
67- # (i.e., we don't know any implemented/mandatory extensions or parameter values)
66+ #################################################################
67+ # This class represents a configuration that is "unconfigured". #
68+ # It doesn't know anything about extensions or parameters. #
69+ #################################################################
6870class Unconfig < Config
6971 attr_reader :param_values
7072
@@ -76,15 +78,15 @@ def initialize(cfg_file_path, data)
7678
7779 def mxlen = nil
7880
79- def implemented_extensions = raise "implemented_extensions is only availabe for a FullConfig"
80- def mandatory_extensions = raise "mandatory_extensions is only availabe for a PartialConfig"
81- def prohibited_extensions = raise "prohibited_extensions is only availabe for a PartialConfig"
81+ def implemented_extensions = raise "implemented_extensions is only available for a FullConfig"
82+ def mandatory_extensions = raise "mandatory_extensions is only available for a PartialConfig"
83+ def prohibited_extensions = raise "prohibited_extensions is only available for a PartialConfig"
8284end
8385
84- # this class represents a configuration file (e.g., cfgs/*/cfg.yaml) that is "partially configured"
85- # (i.e., we have a list of mandatory/prohibited extensions and a paritial list of parameter values)
86- #
87- # This would, for example, represent a Profile or configurable IP
86+ ##############################################################################################################
87+ # This class represents a configuration that is "partially-configured" (e.g., portfolio or configurable IP). #
88+ # It only lists mandatory & prohibited extensions and fully-constrained parameters (single value).
89+ ##############################################################################################################
8890class PartialConfig < Config
8991 attr_reader :param_values , :mxlen
9092
@@ -99,15 +101,16 @@ def initialize(cfg_file_path, data)
99101 @mxlen . freeze
100102 end
101103
102- def implemented_extensions = raise "implemented_extensions is only availabe for a FullConfig"
104+ def implemented_extensions = raise "implemented_extensions is only available for a FullConfig"
103105
104106 # @return [Array<Hash{String => String,Array<String}>]
105107 # List of all extensions that must be implemented, as specified in the config file
106108 # The first entry in the nested array is an Extension name.
107109 # The second entry in the nested array is an Extension version requirement
108110 #
109111 # @example
110- # partial_config.mandatory_extensions #=> [{ "name" => "A", "version" => ["~> 2.0"] }, { "name" => "B", "version" => ["~> 1.0"] }, ...]
112+ # partial_config.mandatory_extensions =>
113+ # [{ "name" => "A", "version" => ["~> 2.0"] }, { "name" => "B", "version" => ["~> 1.0"] }, ...]
111114 def mandatory_extensions
112115 @mandatory_extensions ||=
113116 if @data [ "mandatory_extensions" ] . nil?
@@ -126,7 +129,8 @@ def mandatory_extensions
126129 # The second entry in the nested array is an Extension version requirement.
127130 #
128131 # @example
129- # partial_config.prohibited_extensions #=> [{ "name" => "F", "version" => [">= 2.0"] }, { "name" => "Zfa", "version" => ["> = 1.0"] }, ...]
132+ # partial_config.prohibited_extensions =>
133+ # [{ "name" => "F", "version" => [">= 2.0"] }, { "name" => "Zfa", "version" => ["> = 1.0"] }, ...]
130134 def prohibited_extensions
131135 @prohibited_extensions ||=
132136 if @data [ "prohibited_extensions" ] . nil?
@@ -144,10 +148,10 @@ def prohibited_extensions
144148 # def ext?(ext_name, cfg_arch) = mandatory_extensions(cfg_arch).any? { |e| e.name == ext_name.to_s }
145149end
146150
147- # this class represents a configuration file (e.g., cfgs/*/cfg.yaml) that is "fully configured"
148- # (i.e., we have a complete list of implemented extensions and a complete list of parameter values)
149- #
150- # This would, for example, represent a specific silicon tapeout/SKU
151+ ################################################################################################################
152+ # This class represents a configuration that is "fully-configured" (e.g., SoC tapeout or fully-configured IP). #
153+ # It has a complete list of extensions and parameters (all are a single value at this point). #
154+ ################################################################################################################
151155class FullConfig < Config
152156 attr_reader :param_values , :mxlen
153157
@@ -176,8 +180,8 @@ def implemented_extensions
176180 end
177181 end
178182
179- def mandatory_extensions = raise "mandatory_extensions is only availabe for a PartialConfig"
180- def prohibited_extensions = raise "prohibited_extensions is only availabe for a PartialConfig"
183+ def mandatory_extensions = raise "mandatory_extensions is only available for a PartialConfig"
184+ def prohibited_extensions = raise "prohibited_extensions is only available for a PartialConfig"
181185
182186 # def prohibited_ext?(ext_name, cfg_arch) = !ext?(ext_name, cfg_arch)
183187 # def ext?(ext_name, cfg_arch) = implemented_extensions(cfg_arch).any? { |e| e.name == ext_name.to_s }
0 commit comments