0
votes

I am writing a code that is using an external package, but it is not finding the Types that i have declared in the package.

I've tried adding the package as a file using the import wizard and tried adding it as a library. No error is happening on the package name but on the instruction where i use the type declared in the package.

USE X.ALL;

ENTITY Y IS
PORT (I : IN packagetype;
O : OUT packagetype);
END Y;

ARCHITECTURE ArchX OF Y IS
BEGIN
O <= function(I);
END ArchX;

the following error appears: object packagetype is used but not declared

2
x.all refers to the entire contents of a library X. X.your_pkg.all would refer to the entire contents of your package. - Tricky
Tricky's comment assumes X is a reference library containing an unamed package with a declaration of type packagetype. function is a reserved word and may not be used as a function subprogram designator nor identifier of an object of an array type declared in the package. The synthesis tool poorly describes the error, packagetype is a type mark in port declarations and is not an object holding a value of a type. Simulator analyzers (compilers) typical provide more meaningful error messages. Provide a minimal reproducible example with a minimal package declaration and body. - user1155120
Here you can take the error message to mean the indentifier packagetype is not made visible by a context item provided to the primary design unit Y(made visible neither by a library clause nor a use clause). - user1155120

2 Answers

0
votes

try to click-right on the project name, then import the package as existing source

0
votes

If you have compiled package X into library work, then you can make it visible to a client (entity/arch or even another package) by

USE work.X.all;