-
Beta Was this translation helpful? Give feedback.
Answered by
vic9112
May 29, 2024
Replies: 2 comments
-
I have solved this problem, following is the current waveform: InterfaceThe Reason for using
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
vic9112
-
Great findings. This is the case with multi-access pointers. The argument s2m_buf_sts is accessed/updated multiple times. The synthesis tool is optimized away unless it is declared volatile. Refer to the PowerPoint below. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have solved this problem, following is the current waveform:
Interface
The
volatile
keyword is used to inform the compiler that a variable's value may change at any time.Reason for using
volatile
Compilers often optimize code by caching the values of variables in registers, assuming they do not change unless explicitly modified by the program. When dealing with hardware signals or memory-mapped I/O, the value can change outside the program's control (e.g., due to hardware events). Using volatile prevents the compiler from making such optimizations, ensuring that the code reads the variable from memory every time it is accessed.
In HLS…