You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get an error about different types not matching with this:
packagetest_pkgisgeneric (
typet ;
) ;
typedata_arrayisarray(0to1, 0to1) of t ;
endpackage ;
entitytest_entityisgeneric (
type a isarray(naturalrange<>) oftypeis private ;
--type a is array(0 to 1) of type is private ; -- errors?function"<"(l, r : in a'element) returnbooleanis<> ;
package pkg isnew work.test_pkg genericmap (t => a'element) -- t needs to be the same type as a'element
) ;
port (
ins : in a ;
outs : out a
) ;
endentity ;
architecturearchoftest_entityisuse pkg.all ;
signal data : data_array ;
-- works--type data_array is array(0 to 1, 0 to 1) of a'element ; -- same declaration as in the test_pkg--signal data : data_array ;beginstage0 : for element in0to1generateprocess(ins)
beginif ins(0) < ins(1) then
data(0, 0) <= ins(1) ;
data(0, 1) <= ins(0) ;
else
data(0, 0) <= ins(1) ;
data(0, 1) <= ins(0) ;
endif ;
endprocess ;
endgenerate ;
endarchitecture ;
** Error: type of value (an anonymous type) does not match type of target T
> test.vhdl:38
|
38 | data(0, 0) <= ins(1) ;
| ^^^^^^^^^^^^^^^^^^^^^^
There is also an error when I try to constrain the array type a bit more in the declaration. Riviera PRO is fine with it, but nvc says the 0 token is unexpected.
Am I abusing something here, or should this work?
The text was updated successfully, but these errors were encountered:
There is also an error when I try to constrain the array type a bit more in the declaration. Riviera PRO is fine with it, but nvc says the 0 token is unexpected.
Although I think the intent of the LRM is clear, but I haven't implemented that yet.
Am I abusing something here, or should this work?
Gosh, I don't really know. I can see why you would expect that to work, but currently the generic map on the generic package is only used to check compatibility when instantiating the entity, not when analysing the architecture.
I get an error about different types not matching with this:
There is also an error when I try to constrain the array type a bit more in the declaration. Riviera PRO is fine with it, but nvc says the
0
token is unexpected.Am I abusing something here, or should this work?
The text was updated successfully, but these errors were encountered: