Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

Problem using VHDL from a project lower in the heirarchy in an upper level

I created a very simple dual edge detector using D flip flops and a few logic gates. I created this using Megafunctions LPM_DFF, LPM_XOR, LPM_INV, and LPM_AND symbols. This project compiles and creates the VHDL and symbol without issue. When I try to use the symbol in a project, I am unable to compile the project and get the following error.

Error (10481): VHDL Use Clause error at lpm_dff_0.vhd(28): design library "work" does not contain primary unit "lpm_components"

Error (10800): VHDL error at lpm_dff_0.vhd(28): selected name in use clause is not an expanded name

Can help with why this rather straight forward application using only basic Quartus components would give this error? Are there some settings in generating the VHDL that are not correct? I have not changed anything and tried reinstalling. Any help would be greatly appreciated.

14 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I was hoping someone had seen a similar problem so I wouldn't have to get into too great a detail, but here goes. When I received the original error, I found the following lines in the VHDL generated by the Altera Megafunction for LPM_DFF--

    -- use the following when compiling in Quartus II

    --LIBRARY lpm;

    --USE lpm.lpm_components.all;

    -- use the following when compiling in third party tools --

    -- add lpm_pack.vhd from the Quartus II library

    LIBRARY work;

    USE work.lpm_components.all;

    I commented out the work one and uncommented the LPM one as follows--

    -- use the following when compiling in Quartus II

    LIBRARY lpm;

    USE lpm.lpm_components.all;

    -- use the following when compiling in third party tools --

    -- add lpm_pack.vhd from the Quartus II library

    --LIBRARY work;

    --USE work.lpm_components.all;

    This led me to this error---

    Error (10482): VHDL error at lpm_dff_0.vhd(44): object "lpm_dff" is used but not declared

    When I commented out the _0 lines and changed them to take off the _0 as in the following VHDL---

    -- PROGRAM "Quartus II 32-bit"

    -- VERSION "Version 12.1 Build 177 11/07/2012 SJ Web Edition"

    -- CREATED "Thu Jan 17 23:22:14 2013"

    LIBRARY ieee;

    USE ieee.std_logic_1164.all;

    -- use the following when compiling in Quartus II

    LIBRARY lpm;

    USE lpm.lpm_components.all;

    -- use the following when compiling in third party tools --

    -- add lpm_pack.vhd from the Quartus II library

    --LIBRARY work;

    --USE work.lpm_components.all;

    --ENTITY lpm_dff_0 IS

    ENTITY lpm_dff IS

    PORT

    (

    clock : IN STD_LOGIC;

    data : IN STD_LOGIC_VECTOR(0 TO 0);

    q : OUT STD_LOGIC_VECTOR(0 TO 0)

    );

    --END lpm_dff_0;

    END lpm_dff;

    --ARCHITECTURE bdf_type OF lpm_dff_0 IS

    ARCHITECTURE bdf_type OF lpm_dff IS

    BEGIN

    -- instantiate LPM macrofunction

    b2v_inst : lpm_dff

    GENERIC MAP(LPM_WIDTH => 1)

    PORT MAP(clock => clock,

    data => data,

    q => q);

    END bdf_type;

    I got the following error--

    Error (10349): VHDL Association List error at lpm_dff_0.vhd(48): formal "LPM_WIDTH" does not exist

    Since this indicates the key paramter LPM_WIDTH is not there in substantiated VHDL, I sent out this cry for help.

    What doesn't make sense to me is why Quartus would generate VHDL that is not usuable in Quartus!!

    Does anyone have any ideas keeping in mind that I am not generating the VHDL in question but it is being generated by Quartus.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Do you mean the standard Quartus setup requires the import of Altera files in order to work? Can you give me some more detail about how this is accomplished?

    --- Quote End ---

    Its not Quartus, its a requirement of the VHDL language ...

    
    -- Altera LPM components
    library lpm;
    use lpm.lpm_components.all;
    

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Do you mean the standard Quartus setup requires the import of Altera files in order to work? Can you give me some more detail about how this is accomplished?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You need to import the respective Altera libraries. Review the MegaWizard generated code about the correct naming.