Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/std/isa/inst/Zimop/mop.r.n.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ data_independent_timing: false
hints:
- { $ref: inst/Zicfilp/sspopchk.x1.yaml# }
- { $ref: inst/Zicfilp/sspopchk.x5.yaml# }
- { $ref: inst/Zicfilp/ssrdp.yaml# }
- { $ref: inst/Zicfiss/ssrdp.yaml# }
pseudoinstructions:
- when: n == 0
to: mop.r.0
Expand Down
17 changes: 17 additions & 0 deletions tools/ruby-gems/udb/lib/udb/obj/instruction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,23 @@ def validate(resolver)
Instruction.deprecated_validate_encoding(@data["encoding"]["RV64"], name)
end
end

# Validate hint references
if @data.key?("hints")
@data["hints"].each_with_index do |hint, index|
if hint.key?("$ref")
begin
# Try to dereference the hint to validate it exists
hint_inst = @cfg_arch.ref(hint["$ref"])
if hint_inst.nil?
raise "Invalid hint reference in instruction '#{name}' at hints[#{index}]: '#{hint["$ref"]}' - reference not found"
end
rescue => e
raise "Invalid hint reference in instruction '#{name}' at hints[#{index}]: '#{hint["$ref"]}' - #{e.message}"
end
end
end
end
end

def ==(other)
Expand Down
Loading