M
Mark Christiaens
I was wondering what is going on in this test case:
---------------------------------------------
entity top is
end entity top;
architecture RTL of top is
type rtype is record
i1 : integer;
i2 : integer;
end record;
begin
process is
variable i : rtype;
begin
i := rtype'(0, 0); -- OK
assert i.i1 = 0; -- OK
assert rtype'(0, 0).i1 = 0; -- Not OK
wait;
end process;
end architecture RTL;
---------------------------------------------
As you can see, I've defined a record type "rtype". Using a record
aggregate to initialize a record variable is fine (according to
ModelSim ALTERA STARTER EDITION 6.5e), accessing the "i1" field of
that variable is fine but building a complete expression that uses the
record aggregate is not fine. ModelSim complains:
# -- Loading package standard
# -- Compiling entity top
# -- Compiling architecture rtl of top
# ** Error: top.vhd(18): Qualified expression type mark rtype is not
type std.standard.boolean.
# ** Error: top.vhd(18): near ".": expecting ';'
# ** Error: top.vhd(22): VHDL Compiler exiting
Why exactly is this not allowed?
---------------------------------------------
entity top is
end entity top;
architecture RTL of top is
type rtype is record
i1 : integer;
i2 : integer;
end record;
begin
process is
variable i : rtype;
begin
i := rtype'(0, 0); -- OK
assert i.i1 = 0; -- OK
assert rtype'(0, 0).i1 = 0; -- Not OK
wait;
end process;
end architecture RTL;
---------------------------------------------
As you can see, I've defined a record type "rtype". Using a record
aggregate to initialize a record variable is fine (according to
ModelSim ALTERA STARTER EDITION 6.5e), accessing the "i1" field of
that variable is fine but building a complete expression that uses the
record aggregate is not fine. ModelSim complains:
# -- Loading package standard
# -- Compiling entity top
# -- Compiling architecture rtl of top
# ** Error: top.vhd(18): Qualified expression type mark rtype is not
type std.standard.boolean.
# ** Error: top.vhd(18): near ".": expecting ';'
# ** Error: top.vhd(22): VHDL Compiler exiting
Why exactly is this not allowed?