@@ -43,8 +43,9 @@ def initialize(parent_csr, field_name, field_data)
4343 def __source = @parent . __source
4444
4545 # CSR field data starts at fields: NAME: with the YAML
46- def source_line ( *path )
47- T . unsafe ( self ) . super ( "fields" , name , *path )
46+ sig { params ( path : T ::Array [ String ] ) . returns ( Integer ) }
47+ def source_line ( path )
48+ super ( [ "fields" , name ] . concat ( path ) )
4849 end
4950
5051 # For a full config, whether or not the field is implemented
@@ -104,7 +105,7 @@ def type_ast
104105 idl_code ,
105106 name : "CSR[#{ csr . name } ].#{ name } .type()" ,
106107 input_file : csr . __source ,
107- input_line : csr . source_line ( "fields" , name , "type()" ) ,
108+ input_line : csr . source_line ( [ "fields" , name , "type()" ] ) ,
108109 symtab : @cfg_arch . symtab ,
109110 type_check : false
110111 )
@@ -346,7 +347,7 @@ def reset_value_ast
346347 return_type : Idl ::Type . new ( :bits , width : max_width ) ,
347348 name : "CSR[#{ parent . name } ].#{ name } .reset_value()" ,
348349 input_file : csr . __source ,
349- input_line : csr . source_line ( "fields" , name , "reset_value()" ) ,
350+ input_line : csr . source_line ( [ "fields" , name , "reset_value()" ] ) ,
350351 symtab : cfg_arch . symtab ,
351352 type_check : false
352353 )
@@ -497,7 +498,7 @@ def sw_write_ast(symtab)
497498 return_type : Idl ::Type . new ( :bits , width : 128 ) , # big int to hold special return values
498499 name : "CSR[#{ csr . name } ].#{ name } .sw_write(csr_value)" ,
499500 input_file : csr . __source ,
500- input_line : csr . source_line ( "fields" , name , "sw_write(csr_value)" ) ,
501+ input_line : csr . source_line ( [ "fields" , name , "sw_write(csr_value)" ] ) ,
501502 symtab :,
502503 type_check : false
503504 )
@@ -822,6 +823,6 @@ def location_pretty(effective_xlen = nil)
822823 # @return [String] Long description of the field type
823824 sig { params ( effective_xlen : T . nilable ( Integer ) ) . returns ( String ) }
824825 def type_desc ( effective_xlen = nil )
825- TYPE_DESC_MAP [ type ( effective_xlen ) ]
826+ TYPE_DESC_MAP . fetch ( type ( effective_xlen ) , "" )
826827 end
827828end
0 commit comments