@@ -407,7 +407,7 @@ def read_lines(file: str) -> "list[str]":
407407
408408# Update the instruction dictionary
409409def process_standard_instructions (
410- lines : "list[str]" , instr_dict : InstrDict , file_name : str
410+ lines : "list[str]" , instr_dict : InstrDict , file_name : str , warn_overlap : bool = False
411411):
412412 """Processes standard instructions from the given lines and updates the instruction dictionary."""
413413 for line in lines :
@@ -437,9 +437,11 @@ def process_standard_instructions(
437437 and not instruction_overlap_allowed (name , key )
438438 and same_base_isa (ext_name , item ["extension" ])
439439 ):
440- log_and_exit (
441- f'Instruction { name } in extension { ext_name } overlaps with { key } in { item ["extension" ]} '
442- )
440+ overlap_msg = f'Instruction { name } in extension { ext_name } overlaps with { key } in { item ["extension" ]} '
441+ if warn_overlap :
442+ logging .warning (overlap_msg )
443+ else :
444+ log_and_exit (overlap_msg )
443445
444446 instr_dict [name ] = single_dict
445447
@@ -543,6 +545,7 @@ def create_inst_dict(
543545 file_filter : "list[str]" ,
544546 include_pseudo : bool = False ,
545547 include_pseudo_ops : "Optional[list[str]]" = None ,
548+ warn_overlap : bool = False ,
546549) -> InstrDict :
547550 """
548551 Creates a dictionary of instructions based on the provided file filters.
@@ -607,7 +610,7 @@ def create_inst_dict(
607610 for file_name in file_names :
608611 logging .debug (f"Parsing File: { file_name } for standard instructions" )
609612 lines = read_lines (file_name )
610- process_standard_instructions (lines , instr_dict , file_name )
613+ process_standard_instructions (lines , instr_dict , file_name , warn_overlap )
611614
612615 logging .debug ("Collecting pseudo instructions" )
613616 for file_name in file_names :
0 commit comments