Implementing An 8-bit Processor-based Design In An FPGA

3y ago
27 Views
2 Downloads
881.16 KB
8 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Pierre Damon
Transcription

Legacy documentationrefer to the Altium Wiki for current informationImplementing an 8-bit Processor-basedDesign in an FPGASummaryTutorialTU0118 (v3.0) March 04, 2008This tutorial describes how to implement an 8-bit processor-based design in anFPGA. It describes the creation of FPGA and Embedded projects, creating a C file,setting up processor and compiler options and then configuring and programming thedesign to an FPGA device.This tutorial will create an FPGA project containing a single schematic sheet, and an embedded project containing a single Csource file. The design and associated software will be downloaded to the Altera Cyclone EP1C12Q240C6 device on thedaughter board supplied with the NanoBoard-NB1. The resulting bit counter will be displayed on the NanoBoard’s LEDs.Connect the NanoBoard-NB1 to the parallel port of the PC and power up the board by flicking the ON switch. Make sure youhave installed the Quartus tools (web edition) from Altera. These tools can be downloaded from the Altera website(www.altera.com).Note: Although this tutorial targets the Altera Cyclone EP1C12Q240C6 device on a 2-connector daughter board attached to aNanoBoard-NB1, this daughter board can be plugged in to the Desktop NanoBoard NB2DSK01 as well. In fact, the design canbe targeted to any daughter board FPGA device, attached to either of these NanoBoards, provided the relevant constraint file(s)are defined to target that device and the relevant vendor tools are installed on your PC.For a tutorial that looks at implementation of a 32-bit processor-based design, and targeted to a daughter board FPGAdevice attached to the Desktop NanoBoard NB2DSK01, refer to the document TU0128 Implementing a 32-bit Processorbased Design in an FPGA.Creating the FPGA ProjectFirst we will create an FPGA project.1. Create a new FPGA project by selecting File » New » Project » FPGA Project (or click onWorkspace button and select Add New Project » FPGA project).2. Save this project as FPGA Project1.PrjFpg by selecting File » Save Project (or right-clickon the new project name in the Projects panel and select Save Project) in a new directorycalled 8-bit FPGA Processor.Warning: Do not usespaces or dashes (-) in filenames or project names.Use underscores ( ) ifnecessary.3. Add a new schematic document to the FPGA project by selecting File » New » Schematic (or click on the Project buttonand select Add New to Project » Schematic). Save the schematic as Sheet1.SchDoc, in the same directory as the parentproject.4. Place the following components (listed below in Table 1) on the schematic sheet as shown in Figure 1. Placement can bemade direct from the Libraries panel. Simply select a component and either click the Place button at the top-right of thepanel, or click and drag the component directly onto the sheet. Each of these components are available from the defaultgeneric FPGA integrated libraries, so there is no need to add any libraries for this tutorial.Table 1. Components used in the bit counter schematicComponent name.Available from FPGA integrated library.TSK51A D (the processor)FPGA Processors.IntLibRAMS 8x1KFPGA Memories.IntLibCLOCK BOARD, TEST BUTTON, LED, NEXUS JTAG CONNECTORFPGA NB1 Port-Plugin.IntLibNEXUS JTAG PORT, OR2N1SFPGA Generic.IntLibFPGA STARTUP8FPGA Peripherals.IntLibTU0118 (v3.0) March 04, 20081

Legacy documentationrefer to the Altium Wiki for current informationImplementing an 8-bit Processor-based Design in an FPGAFigure 1. Initial placement of components on the schematic sheet, Sheet1.SchDoc.5. Wire the design initially, as shown in Figure 2, by using the Place » Wire and Place » Bus commands.Figure 2. Initial wiring – placement of wires and buses.6. Connect the RAMS 8x1K’s ADDR[9.0] pin to theROMADDR[15.0] pin on the TSK51A D symbol using a busjoiner. Place the component JB from the FPGAGeneric.IntLib to join the buses. Modify the parametertext to read [9.0] on both sides of the joiner by using inlinetext editing mode.7. Place a GND power port (from the Wiring toolbar) on the EA pin of the TSK51A D processor.Change the Style to Arrow using the associated Power Port dialog.8. Connect pins INT0, INT1, T0, T1 and RXD to a GND power port as well.Use the Spacebar torotate a power portwhile placing it.9. Place a VCC power port (from the Wiring toolbar) on the TRST pin of the NEXUS JTAG PORTcomponent, using the Bar style.10. Place a VCC Bus power port (from the Wiring toolbar) on the DELAY[7.0] pin of the FPGA STATRTUP8 component (itsNet property should read VCCBUS[.] in the associated Power Port dialog).11. Add No ERC markers to each of the output pins in the design that are not being used.12. Annotate the design using the Tools » Annotate Schematics Quietly command. The Confirm Designator Changes dialogdisplays the following message: “There are 4 designators requiring update. Proceed with changes?”. Click Yes. Thedesignators will be automatically changed from U? to U1, for example, and numerically augment. Your FPGA designschematic should now appear as shown in Figure 3.2TU0118 (v3.0) March 04, 2008

Legacy documentationrefer to the Altium Wiki for current informationImplementing an 8-bit Processor-based Design in an FPGAFigure 3. Final schematic sheet, fully wired.13. Save Sheet1.SchDoc [shortcut Ctrl S].Creating the Embedded ProjectNow we can create an embedded project that will hold the sourcefile for the software we want to download to the FPGA device.1. Create a new Embedded project by selecting File » New »Project » Embedded Project (or click on the Workspacebutton and select Add New Project » Embedded Project).2. Save this project by selecting File » Save Project, or rightclick on the new project name in the Projects panel andselect Save Project. Use a name without any spaces (e.g.Embedded Project1.PrjEmb) and save it in the samedirectory as the FPGA project and schematic files.3. Create a new C file by right-clicking on the embedded projectname in the Projects panel and selecting Add New toProject » C File, or click on the Project button and selectAdd New to Project » C File.4. Type the C code (as shown) into the new C file.5. Save the code in the same directory as the other project files. Using the default name (Source1.C) is fine for this tutorial.Setting the Embedded Software Project OptionsNext we will set the processor startup code and set some C compiler options, such as the memory model and code generationoptions.1. Right-click on the embedded project name (Embedded Project1.PrjEmb) in the Projects panel and select ProjectOptions. The Options for Embedded Project dialog opens.2. Add the startup code to your project by clicking on Processor in the Build Options list and click on Startup Code. Make surethe option Generate and use startup code project cstart.c is enabled.TU0118 (v3.0) March 04, 20083

Legacy documentationrefer to the Altium Wiki for current informationImplementing an 8-bit Processor-based Design in an FPGA3. Set a memory model by clicking on C Compiler in the Build Options list, selecting Memory Model and choosing Small:variables in DATA from the drop-down list for the compiler memory model. Make sure Allow reentrant functions is notselected.4. While still in the C Compiler options, click on Code Generation and enable the Strings options to Put strings in ROM only.Make sure the Interrupts and Registers options are also enabled.5. Click OK to save all options and close the dialog.4TU0118 (v3.0) March 04, 2008

Legacy documentationrefer to the Altium Wiki for current informationImplementing an 8-bit Processor-based Design in an FPGASetting the Processor PropertiesNow we need to tell the processor on the schematic where to find its RAM and which sub-design (embedded project) to usewhen the software is to be downloaded to the FPGA device on the daughter board.1. Go back to Sheet1.SchDoc in the Schematic Editor by clicking on its document tab.2. Double-click on the TSK51A D processor (U1) to open its Component Properties dialog.3. In the Parameters section, enter the designator of the RAM (most likely U4 — refer to your schematic) in the Value field ofthe ChildCore1 parameter. Click OK.4. To link the Embedded project to the processor component, go to the Projects panel and click on Structure Editor button todisplay the project structure view. Make sure that your hardware project is compiled so that it appears in the structure tree(Project » Compile FPGA Project).You will see the Valid Sub Projects and Configurations list in the bottom section of theProjects panel.Select the software project which we just created from the Valid Sub Projects and Configurations list, e.g.Embedded Project1.PrjEmb, by clicking on its icon and drag-and-drop it onto the processor component (TSK51A D)icon in the top section of the Projects panel. Note that valid targets will be highlighted. The link will be established and thestructure will recompile to re-establish the integrity.5. Save all files (File » Save All).TU0118 (v3.0) March 04, 20085

Legacy documentationrefer to the Altium Wiki for current informationImplementing an 8-bit Processor-based Design in an FPGAConfiguring the Design to an FPGA DeviceNow we need to specify which FPGA device we want to use in our design, e.g. the Altera Cyclone EP1C12Q240C6 device onthe 2-connector daughter board attached to the NanoBoard-NB1. We will add a configuration and constraint file to do this. Theconstraint file will specify the device and determine the pin numbering.1. To create a new Configuration, right-click on the FPGA project name in the Projects panel (changing back to File View if stillin Structure Editor mode) and select Configuration Manager, or select Project » Configuration Manager from the menus.The Configuration Manager for FPGA Project1.PrjFpg dialog appears.2. Click on the Add button in the Configurations section of the dialog and type a configuration name in the New Configurationdialog that appears, e.g. demo. Click OK.3. Add a constraint file to your configuration by clicking on the Add button in the Constraints section of the dialog. In theChoose Constraint files to add to Project dialog that appears, drill down to the \Library\Fpga\NB1 ConstraintFiles\Altera FPGA folder and select the NB1 6 EP1C12Q240.Constraint file. Click Open.4. Back in the Configuration Manager dialog, assign the constraint to the configuration and click OK.5. The constraint file appears in the Projects panel under the Settings\Constraints Files sub-folder.6. Save all files (File » Save All).Using the Devices View to Program the FPGAThe Devices view (View » Devices View) allows you to follow through the workflow (from left to right) required to send yourprogram to the FPGA. In this view, you can: Compile the project (and check for errors) Synthesize (create an EDIF netlist) Build (translate the EDIF files, map the design to the FPGA, Place and Route the FPGA, run a Timing Analysis and thenMake the Bit File) Program FPGA (download the bit file to the daughter board’s FPGA device, e.g. the Altera Cyclone).When this workflow is completed, you will be able to run the program by flicking on the DIP switches on the NanoBoard. Todownload your design to the FPGA:1. Open the Devices view by selecting View » Devices View.2. Make sure your NanoBoard-NB1 is properly connected and switched on. In the Devices view, click on the Live button andcheck that the Connected indicator is green.3. In the Devices view, click on Compile. The red indicator will turn green when a successful compilation takes place. If anyerror messages display in the Messages panel, go back to your schematic and embedded source code, correct any errors,save the files and recompile.4. Click on Synthesize. If the synthesis is completed successfully, a folder called Generated[config name] is created which holds the generated EDIF, VHDL and synthesis log file. If thesynthesis does not complete, check the Messages panel for errors. The configuration which is usedin this example, which we named demo, will display in the Devices view underneath the AlteraCyclone icon.5. Click on Build. This will step through several processes to ultimately make the Bit file that can bedownloaded to the FPGA. The Build stage actually invokes the Vendor tools. It is therefore essentialthat these tools be installed on your PC (in the case of this tutorial, Altera Quartus tools). You willsee the buttons next to the various processes turn green as they are successfully completed. TheBuild button will turn green when all necessary processes are completed and the Results Summarydialog appears. Click on Close to continue.6You can run all stages ofthe workflow up to andincluding the currentstage by clicking on thelocatedarrow iconon the left side of thestage button, e.g.clicking on this icon onthe Program FPGAbutton will run allprevious stages first.TU0118 (v3.0) March 04, 2008

Legacy documentationrefer to the Altium Wiki for current informationImplementing an 8-bit Processor-based Design in an FPGA6. Click on Program FPGA to download the bit file to the daughter board’s Cyclone FPGA device. Watch the process flow andfinally the programming of the FPGA through the JTAG bus.7. When the Program FPGA process is completed, the LEDs on the NanoBoard-NB1 will be flashing as a bit counter.Setting Clock FrequenciesThe speed (clock frequency) can be tuned on the NanoBoard-NB1 to slow down or quicken thecounter. Let’s slow down the counter display.1. Double-click on the NanoBoard-NB1 icon in the top chain of the Devices view.The Instrument Rack – NanoBoard Controllers panel appears. The default clock frequencyis 50MHz.2. Select another clock frequency, e.g. the slowest (6 MHz), by clicking on the 6(Min) button.3. The shifting of the LED display will be slowed down accordingly.TU0118 (v3.0) March 04, 20087

Legacy documentationrefer to the Altium Wiki for current informationImplementing an 8-bit Processor-based Design in an FPGARevision HistoryDateVersion No.Revision29-Jan-20041.0New product release19-Jan-20051.1Sheet1.SchDoc components updated and SP2 dialog and menu changes.07-Jul-20051.2Updated for Altium Designer SP4.12-Dec-20051.3Path references updated for Altium Designer 602-Nov-20072.0Document renamed and updated for Altium Designer 6.8.04-Mar-20083.0Updated for Altium Designer Summer 08Software, hardware, documentation and related materials:Copyright 2008 Altium Limited.All rights reserved. You are permitted to print this document provided that (1) the use of such is for personal use only and will not be copied orposted on any network computer or broadcast in any media, and (2) no modifications of the document is made. Unauthorized duplication, inwhole or part, of this document by any means, mechanical or electronic, including translation into another language, except for brief excerpts inpublished reviews, is prohibited without the express written permission of Altium Limited. Unauthorized duplication of this work may also beprohibited by local statute. Violators may be subject to both criminal and civil penalties, including fines and/or imprisonment. Altium, AltiumDesigner, Board Insight, Design Explorer, DXP, LiveDesign, NanoBoard, NanoTalk, P-CAD, SimCode, Situs, TASKING, and TopologicalAutorouting and their respective logos are trademarks or registered trademarks of Altium Limited or its subsidiaries. All other registered orunregistered trademarks referenced herein are the property of their respective owners and no trademark rights to the same are claimed.8TU0118 (v3.0) March 04, 2008

Implementing an 8-bit Processor-based Design in an FPGA . Configuring the Design to an FPGA Device . Now we need to specify which FPGA device we want to use in our design, e.g. the Altera Cyclone EP1C12Q240C6 device on the 2-connector daughter board attached to the NanoBoard-NB1. We will add a configuration and constraint file to do this.

Related Documents:

Windows XP Professional 32-Bit/64-Bit, Windows Vista Business 32-Bit/64-Bit, Red Hat Enterprise Linux WS v4.0 32-bit/64-bit, Red Hat Enterprise Desktop v5.0 32-bit/64-bit (with Workstation Option), SUSE Linux Enterprise (SLE) desktop and server v10.1 32-bit/64-bit Resources Configuration LUTs

Alfa Romeo 145 old Processor new Processor 2004 146 old Processor By new Processor DIGA-Soft.de 147 Eeprom 147 NEC-Processor 156 before 2002 Cluster-Plug since 2002 Cluster-Plug 159 Eeprom 166 Processor Model 2002 Eeprom Spider Processor GT Eeprom GTV Processor All JTD (Diesel)

8127FS–AVR–02/2013 4. Register Summary Note: 1. For compatibility with future devices, reserved bits should be written to zero if accessed. Reserved I/O memory addresses Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Page 0x3F SREG I T H S V N Z C Page 12 0x3E SPH Stack Poin

Third generation of processor: 16-bit Microprocessor The 8-bit processors were followed by 16 bit processors. They are Intel 8086 and 80286. Fourth generation of processor: 32-bit Microprocessor The 32 bit microprocessors were introduced by several companies but the most popular one is Intel 80386. Fifth generation of processor: Pentium Series

SelectIO Resources DMA 8 Channel CoreSight Components Programmable Logic DAP DevC SWDT DMA Sync Notes: 1) Arrow direction shows control (master to slave) 2) Data flows in both directions: AXI 32-Bit/64-Bit, AXI 64-Bit, AXI 32-Bit, AHB 32-Bit, APB 32-Bit, Custom 3) Dashed line box indicates 2nd processor in dual-core devices ACP 256K SRAM ation .

Microsoft Windows 7, 32-bit and 64-bit Microsoft Windows 8 & 8.1, 32-bit and 64-bit Microsoft Windows 10, 32-bit and 64-bit Microsoft Windows Server 2008 R2 Microsoft Windows Server 2012, 64-bit only RAM: Minimum 2 GB for the 32-bit versions of Microsoft Windows 7, Windows 8, Windows 8.1, and Windows 10.

Implementation o Load bit o Read logic o Write logic Multi-bit register Bit out load in if load(t-1) then out(t) in(t-1) else out(t) out(t-1) 1-bit register o Register’s width: a trivial parameter o Read logic o Write logic Bit. . . w-bit register out load in w w Bit Bit Aside: Hardware Simulation Relevant topics from the HW simulator tutorial:

Windows Desktop Windows 7 (32-bit and 64-bit) KB4054518 must be installed on Windows 7 (32-bit and 64-bit) systems. For more information, read the KB article here.* Windows 7 Embedded (32-bit and 64-bit) KB4054518 must be installed on Windows 7 Embedded (32-bit and 64-bit) systems. For more information, read the KB article here.*