12.07.2015 Views

Altera MAX+plusII Tutorial - ES 4 Design Projects

Altera MAX+plusII Tutorial - ES 4 Design Projects

Altera MAX+plusII Tutorial - ES 4 Design Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>ES</strong> 4 <strong>Design</strong> <strong>Projects</strong><strong>Altera</strong> VHDL <strong>Tutorial</strong><strong>Altera</strong> <strong>MAX+plusII</strong> <strong>Tutorial</strong>In this tutorial, a simple function will be implemented using VHDL.F = AB + CThe design process will include the following steps:1. Compose VHDL code2. Compile VHDL code3. Create a Waveform file and Simulate the Project1. Compose VHDL CodeOnce <strong>MAX+plusII</strong> has been started, click on File->New. Select Text Editor File andclick OK.An empty text file appears. Here you can enter your VHDL code. Before entering anycode, save the file and set the current project to that file by clicking on File->Project->Set Project to Current File. The "Save As" dialog box appears. Enter the name andlocation of your new file. Make sure to change the suffix to .vhd in the "AutomaticExtension" drop down box. Click OK.Now, you may type in your VHDL code. You may type in all the code or use built-intemplates. To insert a library template, right-click in the text editor window and select"VHDL Template…". In the VHDL Template window, select Library Clause and click49


<strong>ES</strong> 4 <strong>Design</strong> <strong>Projects</strong><strong>Altera</strong> VHDL <strong>Tutorial</strong>OK. A library statement is now inserted into the text editor. You may use the templatesto insert Entity and Architecture declarations as well.A screen shot is shown after the VHDL code has been entered. For help on VHDLcode, click on Help->VHDL.2. Compile VHDL CodeOnce the code has been entered, click on File->Project->Save and Compile. If all thecode was entered correctly, then it should compile and produce the following screen:50


<strong>ES</strong> 4 <strong>Design</strong> <strong>Projects</strong><strong>Altera</strong> VHDL <strong>Tutorial</strong>If your code did not compile correctly, go back, check and correct the errors thatappeared in the Messages window.3. Create a Waveform File and Simulate the ProjectThe next step in the design process is to simulate the design. To do this, you will needto create a waveform file with an extension of .scf. The do this, click on File->New.Select Waveform Editor File and make sure the extension listed is .scf.When the new window appears, right-click anywhere in the white space under the"Name:" column and select "Enter Nodes from SNF…". The "Enter Nodes from SNF"dialog box appears. Click on the List button. All the nodes from your design should belisted in the "Available Nodes and Groups:" box.51


<strong>ES</strong> 4 <strong>Design</strong> <strong>Projects</strong><strong>Altera</strong> VHDL <strong>Tutorial</strong>Click on the "=>" arrow to move them into the "Selected Nodes & Groups" window andclick OK. All the nodes should now appear in the waveform window:Now, we want to change the input values of A, B and C. First, click on View->Fit inWindow. Then highlight areas in which you want to simulate as '1' inputs. Click on the52


<strong>ES</strong> 4 <strong>Design</strong> <strong>Projects</strong><strong>Altera</strong> VHDL <strong>Tutorial</strong>'1' button on the left hand tool bar to make that region a '1'. Do this for all the inputs inorder to cover the range of inputs A, B and C could have:Once you have your waveform set up, click on File->Project->Save,Compile andSimulate. It should ask you to save the waveform file. Click OK. The project shouldthen compile and simulate. A window will appear stating the number of errors andwarnings in the simulation. Click OK. The "Simulator" window should now be in focus.Click on the "Open SCF" button. Verify that the output F is correct.53

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!