You cannot initialize an array signal with an arbitrary aggregate or function call in its declaration in strict VHDL-87/93, but you can do it in several correct ways depending on what "array" and "initialize" mean in your code: use a constant with an initial value, use a signal declaration with a static initial value (legal for signals in VHDL-93 and later when the expression is locally static or otherwise allowed in that context), or assign the value in a concurrent statement or process. The failure you are seeing is almost always one of three things: the left-hand side is not a signal or variable declaration but a type or subtype declaration, the initial value is not a locally static expression, or you are trying to write an assignment statement in a declarative region where only declarations are allowed. VHDL-2008 relaxes some of these restrictions, but the underlying distinction between declarations and statements remains.
What "initialize an array in an architecture" actually means
The phrase covers four different constructs, and they have different rules. Confusing them is the usual source of the error message.
1: Initializing a signal declared in the architecture declarative part, for example signal coeff : coeff_array := (0, 1, 2, 3); 2: Initializing a constant declared in the architecture declarative part, for example constant coeff : coeff_array := (0, 1, 2, 3); 3: Initializing a variable inside a process, for example variable coeff : coeff_array := (0, 1, 2, 3); 4: Assigning array values to a signal after elaboration, in a concurrent signal assignment or inside a process.
Only the first and third involve a signal or variable initial value; the second is a constant, and the fourth is ordinary assignment, not initialization. A message like "can't initialize an array value inside architecture VHDL" usually comes from a tool that has parsed something in the declarative region as an initialization and then rejected it, often because the code placed a signal assignment or a non-static expression where a declaration belongs.
The direct fix: put the array value on a signal or constant declaration, not in a statement
A signal declaration with an initial value is legal in VHDL-93 and later, provided the value is an expression the language permits in that context. The safe and portable form is an aggregate of literals:
If your array element type is a record or an enumeration, the aggregate uses the same positional or named association rules as any other aggregate:
For a constant, the same syntax works and is often preferable when the value never changes:
The key point is that these are declarations. The := here is an initial value, not an assignment statement. You cannot write coeff <= (0, 1, 2, 3); in the declarative part before begin; that is a statement, and statements are only allowed in the architecture statement part, in a process, or in a subprogram body. If you put a signal assignment in the declarative region, the parser will complain, and the message may be phrased loosely as an initialization problem.
Why some initial values are rejected even on a signal declaration
VHDL-93 restricts the initial value of a signal to an expression whose value can be determined at elaboration. In practice, many tools accept expressions that are locally static, meaning built from literals, constants, and certain attributes, without depending on signals or function calls in ways the standard disallows. If you write:
where make_coeffs is a user-defined function, portability suffers. Some simulators and synthesis tools accept it under VHDL-2008, and some accept it as an extension even in earlier modes, but strict VHDL-93 does not permit a function call in a signal initial value in the general case. The same applies to an aggregate that contains a signal name or a non-static expression. The conservative rule is to keep signal initial values to literals, constants, and locally static expressions.
A common variant of this problem is trying to size an unconstrained array signal from a function call or a generic in a way the tool cannot resolve at elaboration:
This is fine if n is a generic or constant known at elaboration and the aggregate is compatible, but it fails if the range depends on a signal or on a value only known at run time. Unconstrained array signals need their constraints supplied at elaboration, and the initial value must match those constraints.
Constants are usually the better answer
If the array represents a fixed table, such as FIR coefficients, a sine lookup table, or a state-transition table, a constant is the cleaner design choice:
A constant is initialized once and cannot be reassigned, which matches the intent of a lookup table and avoids the question of whether the initial value is legal for a signal. It also makes the synthesis intent clear. If you need the values to be visible to other units, declare the constant in a package instead of the architecture.
Assigning array values after elaboration
If the array must change during simulation or must be driven by logic, initialize it with a concurrent assignment or a process rather than an initial value:
A concurrent signal assignment is a statement in the architecture statement part. It drives the signal from time zero in simulation and is the normal way to describe combinational or registered behavior. Inside a process, use a variable declaration with an initial value for procedural code:
Variable initial values in a process are evaluated when the process is elaborated, which is typically once per simulation run. Do not rely on process-variable initialization to model hardware state; use a signal and a clocked assignment for that.
The declarative-region mistake in context
A frequent concrete error is to write something like this:
The parser sees a statement before begin and reports an error, sometimes described as an initialization problem. The fix is to move the assignment after begin, or to fold the value into the declaration:
Another frequent case is declaring a type and then trying to give the type an initial value:
A type declaration has no initial value. Initial values belong to objects: signals, variables, and constants. This distinction is worth keeping straight because the error message rarely names it.
VHDL-2008 changes and what still does not work
VHDL-2008 made several things easier. Conditional and selected signal assignments are expressions, aggregates are more flexible, and some tools accept more elaborate expressions in initial values. However, VHDL-2008 did not turn declarations into statements, and it did not remove the requirement that an object's initial value be determinable at elaboration. You still cannot put a signal assignment in the architecture declarative part, and you still cannot initialize a type. If a tool accepts a function call in a signal initial value, that is often a vendor extension rather than a portable standard feature; check the tool's documentation and the language mode you are compiling in before relying on it.
A practical checklist
When initialization fails, check these in order:
Is the := attached to a signal, variable, or constant declaration, not to a type or subtype declaration?
Is the <= (or other assignment) placed after begin, inside a process, or inside a subprogram body, rather than in the declarative part? Is the initial value locally static, or does it depend on a signal, a function call, or a run-time value in a mode that does not allow it? Does the aggregate match the array's index range and element type, and are unconstrained array constraints supplied? If the value must change during simulation, is a concurrent assignment or a clocked process a better fit than an initial value?
Bottom line
The direct answer is that array initialization in an architecture is legal when it appears as the initial value of a signal, variable, or constant declaration, with an expression the language mode permits, and illegal when it is written as a statement in the declarative region or attached to a type declaration. Use a constant for fixed tables, a signal initial value for elaboration-time defaults, and a concurrent or process assignment for behavior that must evolve. If your tool rejects a signal initial value that looks legal, suspect a non-static expression, an unconstrained range, or a vendor-specific extension, and move the value into a constant or an assignment after begin.