pmat
Member level 5
- Joined
- Mar 26, 2007
- Messages
- 91
- Helped
- 15
- Reputation
- 28
- Reaction score
- 9
- Trophy points
- 1,288
- Location
- Grenoble, France, EU
- Activity points
- 1,790
I want to update the value of a signal which is struct. I create a struct variable v2
and i update its fields. Afterwards i call the write() function on the v1_sig with v2 as an
argument. Then i call wait() (the code is in a SC_THREAD being sensitive to a clock)
to let the signal being updated and finally print both values. However, v1_sig is still
not updated... What am i missing here???
sc_signal<myStruct> v1_sig;
myStruct v2;
v2.field1 = ...;
v2.field2 = ...;
etc.
v1_sig.write(v2);
wait();
cout<<v1_sig;
cout<<v2;
and i update its fields. Afterwards i call the write() function on the v1_sig with v2 as an
argument. Then i call wait() (the code is in a SC_THREAD being sensitive to a clock)
to let the signal being updated and finally print both values. However, v1_sig is still
not updated... What am i missing here???
sc_signal<myStruct> v1_sig;
myStruct v2;
v2.field1 = ...;
v2.field2 = ...;
etc.
v1_sig.write(v2);
wait();
cout<<v1_sig;
cout<<v2;