Hi,
I'm trying to get the best performance from constrained a list of list of mvl (data_l) to a list of list of bit (data) ; pseudocode: data[i][j] = ((data_l[i][j] == MVL_1 ) ? 1:0)
Simulator used Xcelium.
Currently the code looks like this
struct if4_bit_list_s { l: list of bit; };
struct if4_bus_type_s {
l: list of mvl; keep for each (d) in l { soft d in [MVL_0, MVL_1]; };
};
.............
data_l: list of if4_bus_type_s;
keep for each (d) in data_l {
for each in d.l {soft it in [MVL_0, MVL_1];};
};
data: list of if4_bit_list_s;
............
keep gen (data_l) before (data); --0
keep data_l.size() == data.size(); --1
keep for each (d) using index (idx) in data_l {
data_l[idx].l.size() == data[idx].l.size();
};
keep for each (d) using index (idx) in data_l {
for each in d.l { --2
it == MVL_1 => data[idx].l[index] == 1; --3
it != MVL_1 => data[idx].l[index] == 0; --4
}; --5
};
Replacing the second "for each" block (2:5) with
data[idx].l == read_only(mvl_to_bits(d.l , {MVL_1}).copy()) ; results in constrain failure to lists size (1 is failing) .
As far I can see on debugger the data_l is not fully generated (value inside data_l are not constrain to MVL_0 or MVL_1 yet) when size constraint between data and data_l (1) come into play although data_l should be generated first (0).
Replacing the (3) and (4) with
data[idx].l[index] == (it == MVL_1).as_a(bit);
results in less cpu time consumption (self / self+) : from (3.5 / 14.01) to (3.13 / 9.38) ;
Is there a way to write the generation of data from data_l better/optimal (maybe get rid of second "for each" somehow )?