title: How to simulate an Altera megafunction using Modelsim SE
body: <p>___Hi, everyone. I have instantiated a <code>PLL</code> using the Megawizard in Quartus II. Then I wanted to simulate it using <code>ModelSim SE</code> because Quartus II 10.1 doesn't have a built-in simulator. I copied <em>builtInPLL.vhd</em> (output of the Megawizard) and <em>PLL_tb.vhd</em> (testbench) to the directory of the ModelSim project. But when I compiled <em>builtInPLL.vhd</em>, it gave out the following error messages:</p>
  
  <blockquote>
    <p>Error: builtInPLL.vhd(39): Library altera_mf not found.<br>
    Error: builtInPLL.vhd(40): (vcom-1136) Unknown identifier "altera_mf".</p>
  </blockquote>
  
  <p>relevant lines in <em>builtInPLL.vhd</em>:  </p>
  
  <blockquote>
    <p>LIBRARY altera_mf;<br>
    USE altera_mf.all;</p>
  </blockquote>
  
  <p>I googled these messages but found nothing really helpful. I copied <em>altera_mf.vhd</em> from <code>..\eda\sim_lib</code> and compiled it with <em>builtInPLL.vhd</em>. Modelsim still gave me the messages above. And many files with suffix <code>.dat</code> and <code>.dbs</code> were created in the work directory. What are they?</p>
  
  <p>Where is the library <code>altera_mf</code> located? And how can I simulate a megafunction using ModelSim SE.<br>
  Any help will be appreciated.Thanks.</p>