Sep '16
constraint dont_cross_1kb_c {
burst inside { VGM_AHB_INCR4, VGM_AHB_INCR8, VGM_AHB_INCR16 }
→ addr[10:0] <= 'h4_00 - vgm_ahb_get_num_transfers(burst) * 2**size;
}
This constraint is producing:
Warning: RC_1013 …/sv/vgm_ahb_seq_lib.svh(45): Randomization failed. Cyclic dependency between functions with random arguments detected.
Is
burst inside { VGM_AHB_INCR4, VGM_AHB_INCR8, VGM_AHB_INCR16 }
a constraint or a conditional?
1 reply
Sep '16
▶ brian_morris_ifb
TudorTimi
Verification Gentleman
It should be interpreted as a conditional in thit context. The idea is that the solver chooses a value for ‘burst’ and then based on the value it chose it constraints ‘addr[10:0]’.
The constraint is uni-directional (because given an ‘addr’ we can’t constrain the ‘burst’), but it doesn’t create any cyclical dependency, just an ordering. This is described in the IEEE 1800-2012 standard in section ‘18.5.12 Functions in constraints’.
It might be that your simulator doesn’t like ‘->’. Try using ‘if (burst …) addr == …’ instead.
1 reply
Jun '23
▶ TudorTimi
Shouldn’t it be " addr[9:0] " or " addr%1024 " instead of " addr[10:0] " to choose the offset within 1K boundary for the starting address ??
1 reply
May '24
▶ Geet3103
TudorTimi
Verification Gentleman
We basically want to say that (addr+burst_size-1)[31:10] == addr[31:10]
, where addr[31:10]
is the 1kb block we start in and addr+burst_size-1
is the last address in the burst. Using just [9:0]
isn’t enough, as those bits can toggle freely within a 1kb block.
Using just addr[9:0]
maybe would be possible, by saying something addr[9:0]+burst_size -1 < 'h40000
, but we’d also need the extra constraint that burst_size <= 'h40000
to handle wrap around.
Either of the two is probably more readable than the code in the post. 