4

Considering this code:

architecture synth of my_entity is
    signal a : std_logic;
begin

    a <= c and d;
    b <= a and c;

end synth;

Is the second line going to respect that a changed in the other process or are all signals only at the end of architecture assigned?

Martin Thompson
  • 16,395
  • 1
  • 38
  • 56
Georg Schölly
  • 124,188
  • 49
  • 220
  • 267

2 Answers2

1

Careful with your terminology. When you say a changed in the other "process", that has a specific meaning in VHDL (process is a keyword in VHDL), and your code does not have any processes.

Synthesizers will treat your code as:

a <= c and d;
b <= (c and d) and c;

Simulators will typically assign a in a first pass, then assign b on a second pass one 'delta' later. A delta is an infinitesimal time delay that takes place at the same simulation time as the initial assignment.

Note this is a gross generalization of what really happens...if you want full details, read up on the documentation provided with your tool chain.

Charles Steinkuehler
  • 3,335
  • 18
  • 12
  • 1
    We learned that those lines above are called *implicit processes*, is there another name for them? – Georg Schölly Oct 11 '11 at 07:40
  • 2
    @GeorgSchölly You are correct. Concurrent statements get elaborated as processes. Hence, your signal assignments could be designated as processes. – Philippe Oct 11 '11 at 11:28
  • 2
    @Charles behavior is not tool dependent, but it is well defined by the VHDL standard. Here is a blog post that explains about delta cycles: http://www.sigasi.com/content/vhdls-crown-jewel – Philippe Oct 11 '11 at 11:30
1

Is the second line going to respect that a changed in the other process or are all signals only at the end of architecture assigned?

It sounds like you are thinking of signal behaviour within a single process when you say this. In that context, the signals are not updated until the end of the process, so the b update will use the "old" value of a

However, signal assignments not inside a process statement are executed continuously, there is nothing to "trigger" an architecture to "run". Or alternatively, they are all individual separate implied processes (as you have commented), with a sensitivity list implied by everything on the "right-hand-side".

In your particular case, the b assignment will use the new value of a, and the assignment will happen one delta-cycle after the a assignment.

For a readable description of how simulation time works in VHDL, see Jan Decaluwe's page here:

http://www.sigasi.com/content/vhdls-crown-jewel

And also this thread might be instructive:

https://groups.google.com/group/comp.lang.vhdl/browse_thread/thread/e47295730b0c3de4/d5bd4532349aadf0?hl=en&ie=UTF-8&q=vhdl+concurrent+assignment#d5bd4532349aadf0

Martin Thompson
  • 16,395
  • 1
  • 38
  • 56