【发布时间】:2014-05-06 20:02:05
【问题描述】:
我正在尝试使用 ModelSim Microsemi 10.2c 编译以下示例:
architecture example of assignment_to_an_aggregate is
type vowel_type is (a, e, i, o, u);
type consonant_type is (b, c, d, f, g);
signal my_vowel: vowel_type;
signal my_consonant: consonant_type;
begin
(my_vowel, my_consonant) <= (a, b);
end;
它给出了以下错误:
** Error: assignment_to_aggregates.vhdl(40): (vcom-1349) Ambiguous types in signal assignment statement.
Possible target types are:
std.STANDARD.TIME_VECTOR
std.STANDARD.REAL_VECTOR
std.STANDARD.INTEGER_VECTOR
std.STANDARD.BIT_VECTOR
std.STANDARD.BOOLEAN_VECTOR
std.STANDARD.STRING
** Error: assignment_to_aggregates.vhdl(57): VHDL Compiler exiting
任何人都可以解释这不起作用吗?为什么编译器会认为 TIME_VECTOR、STRING 等是这个赋值目标的合理类型?注意:即使目标聚合只有相同类型的信号,我也会遇到相同的错误。
谢谢!
【问题讨论】:
标签: variable-assignment vhdl aggregate