There is a weird array initialization that happens in the interpreter, and which initializes uninitialized arrays for no reason. Here is an example. The following code:
struct TXParams = {
pdsch : arr[20] bit
};
fun configTX() {
var params : struct TXParams;
return params;
};
let comp main = read[bit] >>> write
gets compiled into the following (dump-fold-2):
struct TXParams = pdsch: arr[20] bit
in
fun configTX{_r1}() =
TXParams {pdsch = {'0, '0, '0, '0, '0, '0, '0, '0, '0, '0, '0, '0, '0, '0, '0, '0, '0, '0, '0, '0}}
in
(read[bit] >>>
write[bit])
This initialization is not required at this stage. Firstly, initialization of ordinary arrays happens in Codegen and not in Interpreter, so there is no need that these arrays get initialized here. Often these arrays are very large and tremendously slow down compilation. Secondly, we may have different ways to initialize these array and it is better to have the array initialization code unified in Codegen.
There is a weird array initialization that happens in the interpreter, and which initializes uninitialized arrays for no reason. Here is an example. The following code:
gets compiled into the following (dump-fold-2):
This initialization is not required at this stage. Firstly, initialization of ordinary arrays happens in Codegen and not in Interpreter, so there is no need that these arrays get initialized here. Often these arrays are very large and tremendously slow down compilation. Secondly, we may have different ways to initialize these array and it is better to have the array initialization code unified in Codegen.