Since model elements follow Rational Statemate semantics, their assignments should be synchronized to the beginning of the next step (cycle). A direct assignment such as:
might result in racing condition especially when the data/condition element is shared between two concurrent activities. The synchronized assignments are implemented via a set of service calls supported by the intrinsics library. The following is the synchronized assignment call for the above assignments
There are cases where using direct or deferred assignments do not make a difference, however, it is always recommended that you avoid using direct assignments.
The intrinsics library offers a set of procedures that apply deferred assignments to the different types of Rational Statemate data-items. The assignment interface calls for each Rational Statemate type are listed below:
1.Example: set?(&FAULT,true);
2.Example: seti(&LOW_BOUND,50);
Example: sets(&FAULT,true);
The following APIs can be used to set arrays or slices of arrays. They all take source and destination arrays, and length. For example, in case of a slice assignment such as a1(3..5):=a2(1..3), the following call does:
void gen_array (ev_p, len)
event *ev_p;
int len;void set_array_condition(trg, src, l)
condition *trg;
condition *src;
int l;void set_array_int(trg, src, l)
int *trg;
int *src;
int l;void set_array_real(trg, src, l)
real *trg;
real *scr;
int l;void set_array_string(trg, src, l,l_trg_str,l_scr_str)
char *trg;
char *src;
int l; /* length */
int l_trg_str;
/* string length of target */
int l_src_str;
/* string length of source */void set_array_ba(trg, len, trg_ba_l, src, len_src,
src_ba_l)
bit_array *trg;
int len;
/* length of target */
int trg_ba_l;
/* bitarray length of target */
bit_array *src;
int len_src;
/* length of source */
int src_ba_l;
/* bitarray length of source */