- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello people!
I am kind of new to VHDL and I was wondering when one can use the X'last_value for a signal and when does that have a meaningful value. I mean except for the use with the clock signal, i do not know how the FPGA keeps track of the previous values of every signal. For example I have a clocked process that has only the clock and reset at its sensitivity list. Inside the rising_edge block of the process i need to check the previous value of a signal that changes in a much slower pace than my clock. My main question is: Is the "system" saving the previous value of every signal that is registered with this clock in every clock cycle?Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- Hello people! I am kind of new to VHDL and I was wondering when one can use the X'last_value for a signal and when does that have a meaningful value. I mean except for the use with the clock signal, i do not know how the FPGA keeps track of the previous values of every signal. For example I have a clocked process that has only the clock and reset at its sensitivity list. Inside the rising_edge block of the process i need to check the previous value of a signal that changes in a much slower pace than my clock. My main question is: Is the "system" saving the previous value of every signal that is registered with this clock in every clock cycle? --- Quote End --- No there is no such thing as automatic memory of signal values. The expression you mentioned is just the way the compiler used to understand clock signal for registers. I normally use if rising_edge(clk) ... i.e. function format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It may be useful for simulation, but I don't think it will be too helpful for synthesis. Instead I think you will have to make use of a basic register to store the previous value.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page