You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# @param design [Design] The design
# @return [Boolean] whether or not the instruction is implemented given the supplied design
#
# TODO: Does this function actually work for a partially configured design?
# It is calling DatabaseObject.defined_by? with ExtensionRequirement objects
# returned from Design.prohibited_ext_reqs() and Design.mandatory_ext_reqs()
# but only accepts an ExtensionVersion object.
def exists_in_design?(design)
if design.fully_configured?
(@data["base"].nil? || (design.possible_xlens.include?(@data["base"]))) &&
design.implemented_ext_vers.any? { |ext_ver| defined_by?(ext_ver) } &&
design.implemented_ext_vers.none? { |ext_ver| excluded_by?(ext_ver) }
else
raise "unexpected design type" unless design.partially_configured?
(@data["base"].nil? || (design.possible_xlens.include?(@data["base"]))) &&
design.prohibited_ext_reqs.none? { |ext_req| defined_by?(ext_req) } &&
design.mandatory_ext_reqs.none? { |ext_req| excluded_by?(ext_req) }
end
end
Should probably look more like this code from CSR field:
@param possible_xlens [Array] List of xlens that be used in any implemented mode
@param extensions [Array] List of extensions implemented
@return [Boolean] whether or not the instruction is implemented given the supplies config options
See the comments I added to this code:
@param possible_xlens [Array] List of xlens that be used in any implemented mode
@param extensions [Array] List of extensions implemented
@return [Boolean] whether or not the instruction is implemented given the supplies config options
def exists_in_design?(design)
if design.fully_configured?
parent.exists_in_design?(design) &&
(@DaTa["base"].nil? || design.possible_xlens.include?(@DaTa["base"])) &&
(@DaTa["definedBy"].nil? || design.transitive_implemented_ext_vers.any? { |ext_ver| defined_by?(ext_ver) })
else
raise "unexpected type" unless design.partially_configured?
end
The text was updated successfully, but these errors were encountered: