Forum Discussion

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

Error in Quartus II

Hi,

i need help to solve a problem i'm having with Quartus. I'm trying to simulate a vhdl-file and i got an error msg during compilation. The error msg is:

Error (10482): VHDL error at control_fsm.vhd(76): object "t_state" is used but not declared.

the problem is the objext t_state is already declared in the library file. What can i do to eliminate this error?

A quick reply would be highly appreciated. Thanx.

7 Replies

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

    Make sure the library file appears in the project file list before the files that reference it. Check this at "Project --> Add/Remove Files in Project".

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

    yes, the library file appears in the project file before the files that reference it.

    It this the correct way to declare the library file?

    library mc8051_p;

    use mc8051_p.all;
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I presume t_state is declared in a package called mc8051_p, yes? Then you need to import from the package like so:

    use work.mc8051_p.all;
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    yes, t_state is already declared in package called mc8051_p.

    when I import the package file like what you suggested: "use work.mc8051_p.all"

    I still got error messages which are:

    Error (10481): VHDL Use Clause error at control_fsm.vhd(72): design library "work" does not contain primary unit "mc8051_p"

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

    What should I do next?

    fyi, I am using Altera Quartus II version 7.1 Web Edition.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The error message indicates that you didn't compile the package into the "work" library. Here, "work" doesn't necessarily mean the library named "work"; it's a synonym for the library containing the current design unit. Are you compiling control_fsm.vhd into the same library as your package? Are you sure you've added your package to the project files list? Does Quartus II issue info to tell you it was parsed? The order of the files in the project list doesn't matter. Quartus II parse the files, then links them in the correct order.

    If everything looks in order, the we have a perplexing situation that may require more details about your project and possibly some code snippets.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    what do you mean by compiling the package into the "work" library? how I can do that?

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

    Hello,

    you compile it to the library work by including it to the list of project files. Quartus Compilation Report:Analysis & Synthesis:Source Files Read should include the file containing the package definition. If you didn't specify an differing library name under file properties or through an Altera synthesis attribute, anything goes to the library work.

    If use work.mc8051_p.all gives the said error, either a package mc8051_p isn't defined in the source file or the file isn't in the project.

    Regards,

    Frank