When I instanse and use this class, time in simulator does’nt increases.
Why?
E1_NUM = 16
I want only 16 cells of time_slot_nodes have unique data in [0:15].
And only 16 cells of enable_nodes are 1.
class choose_time_slot;
// rand bit[4:0] node_number[32*NUM_NODES];
rand int time_slot_node[32*E1_NUM];
rand bit enable_node[32*E1_NUM];
constraint enable{
foreach(enable_node[j])
if(j % 32 == 0 || j % 32 == 31 )
enable_node[j] == 0;
enable_node.sum() == 16;
}
constraint time_slot{
foreach(time_slot_node[j])
if(enable_node[j] == 1)
time_slot_node[j] inside {[0:15]};
foreach(time_slot_node[i])
foreach(time_slot_node[j])
if( i != j)
if(enable_node[i] == 1 && enable_node[j] == 1)
time_slot_node [i] != time_slot_node[j];
}
constraint prirority{
solve enable_node before time_slot_node;
}