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
In the following code, the genvar index is not found when used in the initialization of a localparam.
This seems to be related to multi-dimensional arrays, packed structs, and parameters (tried to simplify, but removing any of these aspects does not trigger this bug anymore).
modulesubmodule#(
parameter logic [0:2][31:0] two_d_logic_array ='{default:0}
) ();
endmodulepackagepkg;
typedef structpacked{ logic [0:2][31:0][0:3] three_d_logic_array;
}a_packed_struct;
endpackagemoduletop#(
parameterpkg::a_packed_struct my_packed_struct ='{ three_d_logic_array:'{default:0}}
)();
for (genvar index =0; index < int'(4); index++) beginlocalparam logic [0:2][31:0] my_two_d_logic_array = my_packed_struct.three_d_logic_array[index]; // <-- ERROR: Identifier `\index' is implicitly declared and `default_nettype is set to none.submodule#(
.two_d_logic_array ( my_two_d_logic_array )
) sub1 ();
endendmodule
Debug output:
synlig> read_systemverilog -debug id_not_found.sv
1. Executing SystemVerilog frontend.
[INF:CM0023] Creating log file "/.../slpp_all/surelog.log".
[INF:CP0300] Compilation...
[INF:CP0301] /.../id_not_found.sv:7:1: Compile package "pkg".
[INF:CP0303] /.../id_not_found.sv:2:1: Compile module "work@submodule".
[INF:CP0303] /.../id_not_found.sv:13:1: Compile module "work@top".
[INF:CP0302] Compile class "work@mailbox".
[INF:CP0302] Compile class "work@process".
[INF:CP0302] Compile class "work@semaphore".
[INF:EL0526] Design Elaboration...
[INF:CP0335] /.../id_not_found.sv:16:50: Compile generate block "[email protected][0]".
[INF:CP0335] /.../id_not_found.sv:16:50: Compile generate block "[email protected][1]".
[INF:CP0335] /.../id_not_found.sv:16:50: Compile generate block "[email protected][2]".
[INF:CP0335] /.../id_not_found.sv:16:50: Compile generate block "[email protected][3]".
[NTE:EL0503] /.../id_not_found.sv:13:1: Top level module "work@top".
[NTE:EL0508] Nb Top level modules: 1.
[NTE:EL0509] Max instance depth: 3.
[NTE:EL0510] Nb instances: 5.
[NTE:EL0511] Nb leaf instances: 4.
[INF:UH0706] Creating UHDM Model...
[INF:UH0707] Elaborating UHDM...
[ FATAL] : 0
[ SYNTAX] : 0
[ ERROR] : 0
[WARNING] : 0
[ NOTE] : 5
Object 'work@top' of type 'design'
Object 'builtin' of type 'package'
Object 'pkg' of type 'package'
Object 'pkg::a_packed_struct' of type 'struct_typespec'
Object 'three_d_logic_array' of type 'typespec_member'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object 'work@top' of type 'module_inst'
Object 'my_packed_struct' of type 'parameter'
Object 'pkg::a_packed_struct' of type 'struct_typespec'
Object 'three_d_logic_array' of type 'typespec_member'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object '' of type 'param_assign'
Object 'my_packed_struct' of type 'parameter'
Object 'pkg::a_packed_struct' of type 'struct_typespec'
Object 'three_d_logic_array' of type 'typespec_member'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object '' of type 'operation'
Object '' of type 'operation'
Object '' of type 'tagged_pattern'
Object '' of type 'constant'
Object 'genblk1[0]' of type 'gen_scope_array'
Object '' of type 'gen_scope'
Object 'my_two_d_logic_array' of type 'parameter'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object 'index' of type 'parameter'
Object '' of type 'param_assign'
Object 'my_two_d_logic_array' of type 'parameter'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object 'my_packed_struct.three_d_logic_array[index]' of type 'hier_path'
Object 'my_packed_struct' of type 'ref_obj'
Object 'three_d_logic_array' of type 'bit_select'
Object 'index' of type 'ref_obj'
Object 'sub1' of type 'module_inst'
Object 'two_d_logic_array' of type 'parameter'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object '' of type 'param_assign'
Object 'two_d_logic_array' of type 'parameter'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object '' of type 'range'
Object '' of type 'constant'
Object '' of type 'constant'
Object 'my_packed_struct.three_d_logic_array[index]' of type 'hier_path'
Object 'my_packed_struct' of type 'ref_obj'
Object 'three_d_logic_array' of type 'bit_select'
Object 'index' of type 'ref_obj'
/.../id_not_found.sv:17: ERROR: Identifier `\index' is implicitly declared and `default_nettype is set to none.
The text was updated successfully, but these errors were encountered:
The essence of the problem laid in simplify_parameter function which it is executed while initial AST tree is being formed.
That function calls synlig_simplify function on some nodes and those calls demand properly set scope.
Because of the fact that in that moment AST tree is not properly formed yet, scope has to be artificially created.
The issue was that Synlig didn't consider adding nodes from currently created subtree to scope.
In the following code, the
genvar index
is not found when used in the initialization of a localparam.This seems to be related to multi-dimensional arrays, packed structs, and parameters (tried to simplify, but removing any of these aspects does not trigger this bug anymore).
Debug output:
The text was updated successfully, but these errors were encountered: