![]() |
|
|
|
#1 |
|
I was wondering what are the advantages and drawbacks on using
variables as compared to signals in vhdl. I know what they are used to model, but are there any specific reasons say as regards to simulation etc? zingafriend@yahoo.com |
|
|
|
|
#2 |
|
Posts: n/a
|
wrote:
> I was wondering what are the advantages and drawbacks on using > variables as compared to signals in vhdl. I know what they are used to > model, but are there any specific reasons say as regards to simulation > etc? For communication between processes, only signals can be used (not considering shared variables here). If a signal is only used within a process and not read by any other process, it can be replaced by a variable. The advantage is that the scope is limited (localized), which in general is a good thing. In contrast to signals, the order of reading/assigning variables is important. Remember: the value assigned to a signal can be read back only after at least a delta cycle. Another way of looking at it (in case of a flip-flop): a signal only allows acces to the Q output of a flipflop, a variable also makes it possible to read the D input of a flipflop. Variables allow for a more sequential style of "programming", which can be an advantage. Finally, when modeling memory (RAM), it is better to use a variable. Because variables do not have an event queue associated, their space requirement (memory footprint on your workstation/PC) is about ten times smaller than the equivalent signal. For large RAMs this could make the difference between being able to run, or just thrashing your disk caused by swapping. Paul. Paul Uiterlinden |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding variables to HREF | shareptmike | Software | 0 | 09-11-2009 10:23 AM |
| VB.net (using session variables) | susan_1516 | Software | 0 | 09-26-2008 08:01 AM |
| VHDL assign multiple concatenated signals | veevee1 | VHDL | 0 | 03-07-2007 11:26 AM |
| SCSI Long Cables, High Voltage Differential Signals and Data Skew? | Will Hay | A+ Certification | 1 | 03-04-2004 06:44 PM |
| SCSI Long Cables, High Voltage Differential Signals and Data Skew? | Will Hay | A+ Certification | 0 | 03-04-2004 06:29 PM |