Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)

Component Library?

Altera_Forum
Honored Contributor II
1,483 Views

Good evening all, 

I have been doing some searching around and haven’t been able to find an answer to my question either off of forums or available tutorials.  

 

 

 

I am new to this wonderful world of Digital Electronics. My buddy and I elected to run a pilot program at our university for Altera using the DE2-70 board along with the Quartus II software were the rest of the class is using Xilinx. Everything has been slow going but informative. We have been on our own and these forums have been our only life line to figuring out how to complete our weekly lab reports. No prior knowledge of VHDL or Quartus II, all we got was the word GO! 

 

 

Though we have completed many labs utilizing Quartus II we have yet to figure out how to create a Component Library were, for instance, we can create a VHDL program for a full adder, and then in a new project insert it utilizing the library to make a Four Bit Full Adder. 

I would like to know how to create such a library and implement any project within it in a bigger project. Then I would be able to create adders, multiplexers ETC. and not have to spend all that extra time on each project retyping it. 

 

 

My apologies if my lingo isn’t up to speed still getting a grip on it all. If anyone could fill me in on how to do this or point me to a place where I may find the steps I need to take to accomplish this I would be greatly appreciative.  

 

 

 

Respectfully, 

Ty
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
612 Views

Hi. Glad to hear you're getting somewhere 

 

VHDL allows the easy re-use of code. Libraries are set up however you want in your tool, and you can refer to them in your code. You dont actually need to create a library of components, as they already exist in any project.  

 

When instantiating an entity, the best way is via direct instantiation: 

 

my_inst : entity some_library.some_entity generic map ( --map generics here ) port map ( --map ports here );  

 

The advantage of this over componant declarations is two fold: 

1. You dont have to maintain what is essentially the same thing in two (or more, if you dont make a package of componant declarations) different places (entity declaration and componant declarations). You never need components again. 

2. The compiler checks your port maps directly to the entity declaration - so no more getting half way through synthesis before the error is discovered in component/entity mismatch (because of no. one). The error is found in seconds. 

 

The reason you'll see loads of component libraries and examples filled with components is that direct instatiation didnt exist in the first draft of the language, and those examples have lingered for 20 or so years. But its all hunkydory now and theres no problems with direct instantiation - so use it to tidy up your code. 

 

Another thing - within the same library, you can refer to "work", being the local library, so you can easily do: 

 

my_inst : entity work.some_entity 

port map ( 

..etc 

 

 

Is this what you were after? or anything more I can help with?
0 Kudos
Reply