- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The background: I need to define my own type that I would like to use in entity's port. It looks like there is no other way to make this type public other than define it in package.
The code is -- mvb_lib.vhd -- package mvb_lib istype bit_cell is ('0','1',nl,nh);
end mvb_lib If in my top object i declare library mvb_lib
use mvb_lib.all the compiler does not comply but when I use bit_cell it terminates with error object "bit_cell" used but not declared. I found out, that I can use use work.mvb_lib.all in my file and in the properties of the file fill in "mvb_lib" into the library entry. But this is a little bit strange for me. Is there other "clean" way of using packages in projects?
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The first notes you mentioned should work i.e -- mvb_lib.vhd -- package mvb_lib is type bit_cell is ('0','1',NL,NH); end mvb_lib If in my top object i declare library mvb_lib use mvb_lib.all Did you make sure that you compiled the Package first before referencing it?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you mean to have this file in the file list before other vhd files that use the library? Or do I need to make new project just to compile the library?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
you must have the files in the list before you can reference them. If you are still having problems, then send me the files of relevance and I will make a script for you and make the necessary changes. Thanks- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am sending you back a zip file called mvb_lib_project.zip.
Extract this file and run the script "compile.do" in the Tools-> TCL-> Run Macro option in Modelsim. you will see that there are two unbound components data_pe : entity work.edp port map ( a => data_in, q => data_r, clr => reset, clk => clk ); ------------------------------------------------------------------------------- -- Positive edge detector for data_in ------------------------------------------------------------------------------- data_ne : entity work.edn port map ( a => data_in, q => data_f, clr => reset, clk => clk ); but this is because you have not provided me the edn and edp files. If you add this to the compile.do script but BEFORE the top level file, your project will compile. Hope this helps- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanx!
In my Quartus II 7.2 I found only menu item Tools/TclScripts which opens window with a list of 2 tcl scripts that are in /quartus/common/tcl/apps/gui directory. There is no button nor input field where I can input the script you send me. Do I require also the other files beside the compile.do, which are in the directories or are these files generated by the compiler?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Sorry for the delay in my reply. I was under the impression you were just using modelsim and not Quartus. Anyway I have rebuilt your files, re-naming them and giving the design more structure, so it is cleaner. the following zip file allows you to 1) Compile the design in Modelsim 2) Compile the design in Quartus II When you extract the zip file it will be evident on how to compile in either one of the tools Hope this helps
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page