@@ -14,15 +14,15 @@ def initialize(data, arch_def)
1414
1515 def family = arch_def . profile_family ( @data [ "family" ] )
1616
17- # @return [Profile] Profile that this profile inherits from (the "hier")
17+ # @return [Profile] Profile that this profile inherits from
1818 # @return [nil] if this profile has no parent
1919 def inherits_from = arch_def . profile ( @data [ "inherits" ] )
2020
2121 # @return ["M", "S", "U", "VS", "VU"] Privilege mode for the profile
2222 def mode
2323 if @data [ "mode" ] . nil?
24- raise "No mode specified and no inheritance for profile '#{ name } '" if inherits_from . empty ?
25- inherits_from . last . mode
24+ raise "No mode specified and no inheritance for profile '#{ name } '" if inherits_from . nil ?
25+ inherits_from . mode
2626 else
2727 @data [ "mode" ]
2828 end
@@ -31,9 +31,9 @@ def mode
3131 # @return [32, 64] The base XLEN for the profile
3232 def base
3333 if @data [ "base" ] . nil?
34- raise "No base specified and no inheritance for profile '#{ name } '" if inherits_from . empty ?
34+ raise "No base specified and no inheritance for profile '#{ name } '" if inherits_from . nil ?
3535
36- inherits_from . last . base
36+ inherits_from . base
3737 else
3838 @data [ "base" ]
3939 end
@@ -98,9 +98,9 @@ def mandatory_extension_requirements
9898 @data [ "extensions" ] &.any? { |opt | opt [ "name" ] == ext_req . name }
9999 }
100100
101- @data [ "extensions" ] &.each do |ext_ver |
102- if ext_ver [ "presence" ] == "mandatory"
103- @mandatory_ext_reqs << ExtensionRequirement . new ( ext_ver [ "name" ] , ext_ver [ "version" ] , presence : "mandatory" )
101+ @data [ "extensions" ] &.each do |ext_req |
102+ if ext_req [ "presence" ] == "mandatory"
103+ @mandatory_ext_reqs << ExtensionRequirement . new ( ext_req [ "name" ] , ext_req [ "version" ] , presence : "mandatory" )
104104 end
105105 end
106106 end
0 commit comments