Home
Using PMC-DX Engineering Design Kit with the DX503
Contents
1. between the architecture and begin keywords egal not LA 23 and not LA 22 and not LA 21 and LA 20 Counter Adr lt not LA 7 and not LA 6 and LA 5 and not LA 4 and not LA 3 and not LA 2 and Base Address 0x8020 576 Board Address lt Base Address or Mem Base_ Address or Not _Used_Space Sma Enada yerocess The Counter Feqister s Write trobes process CLE egin i CLE event and CLE 1 then Counter Ath Counter Adr and not ADS on and not LBEO n and LW Ron end if end process Board Interrupt Logic Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit S71 process CLK RESET 572 begin 873 if RESET 1 then 974 DirCtrl downto 0 lt o0000000 575 elsif CLK event and CLK 1 then S76 if Direction StbhO 1 then Sa DirCtrl downto 0 lt LD downto 0 879 If there is a Counter StD pre config the direction 879 to channel 4 as an input and channels 3 0 as outputs sso elsif Counter Sth 1 then 881 DirCtrl 7 downto 0 lt 00001111 S92 else esg3 DirCtrl downto O lt DirCtrli downto Oj 684 end if 885 end if 886 end process 887 930 The Counter EN Register Greta bit 5 magli turna on the functionality of the Counter azz process CLE RESET 353 heqin a34 i RESET 1 Chen 9355 Counter EN lt QO
2. 9356 Plsit CLE event and CLE I then a37 if Counter Sth 1 then 936 Counter EN lt LD 5 a else 940 Counter EN lt Counter EN a41 end LE 942 ene Ir 943 end DEocess 944 945 Counter Inc determines when to load the counter 946 BEGTSber Deen Hit 4 947 process CLE RESET 945 begin 949 if RESET 1 then 950 Counter Inc lt O 951 elsif CLE event and CLE 1 then ggz if Counter EN 1 then 955 Counter Inc lt LD 4 954 else 955 Counter Inc lt Counter Ine O56 end i a57 end if 955 end process 959 4 At line 871 there is the process statement to control the Differential Direction Control Register Add the red code to cause channels 0 3 to become outputs when there is a write to the counter address and make sure that channel 4 is an input to handle the increment line 5 The enable for the counter will be handled in the process statement at line 930 Notice that Counter _EN receives its information from the local data bus LD bit 5 Add the code shown on the left 6 The external increment line for the counter will be handled in the process statement at line 945 Notice that the Counter_Inc receives its information from channel 4 The counter is stopped and started using this input line Add the code to the left directly following the code added in step 5 Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com
3. Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com 1 6 Using the PMC CX Engineering Design Kit 7 Choose choice 4 to access the FPGA PCICK Main Menu configuration menu Example design demo instructions Locate Choose board Attach interrupt callback FPGA configuration PLE9656 configuration and control Flash commands Raw memory access Uiew status information Exit Enter selection 8 Next select option 2 Perform direct PCI bus to Xilinx configuration It is PCICK FPGA Configuration Menu recommended that you test this modified SEG ds clikeancig conf ierad example design using the reconfiguration i Perform flash configuration direct method It is not recommended that 2 Perform direct PCI bus to ilinx configuration the flash be overwritten until you have AR ech cl aac tested your code The reconfigure direct method will allow program of the FPGA directly from the PCI bus If for some reason the PMC CX does not perform as expected you can power the PMC CX down Upon power up the example design provided by Acromag will again be loaded into the FPGA 9 Select Y if the file path given is correct Use file G Program Files Acromag PCISW_API_WINS config_files CK1882R mcs a J C1 or A oe y or enter the path to the mcs file we _ Configuring created in the last section Answer Y if This may take up to a minute gt the computer asks if the FPGA is Is the FPGA configured with
4. amp CCXDlg OnBnClickedoOk END_MESSAGE_MAP CCXDlg message handlers BOO CCXD LG On ni CDialog CDiglog OninicDielog Add About menu item to system menu IDM_ABOUTBOX must be in the system command range ASSERT IDM_ABOUTBOX amp OXFFFO IDM_ABOUTBOX ASSERT IDM_ABOUTBOX lt OxFO0OQQ CMenu psysMenu GetSystemMenu FALSE if pSysMenu NULL CString StrAboutMenu strAboutMenu LoadString IDS_ABOUTBOX if strAboutMenu IskEmpty psysMenu gt AppendMenu MF_SEPARATOR psysMenu gt AppendMenu MF_STRING IDM_ABOUTBOX strAboutMenu L Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com 2 8 Using the PMC CX Engineering Design Kit Set the icon for this dialog The framework does this automatically when the application s main window is not a dialog SetIcon m_hIcon TRUE Bet Dig icon SetIcon m_hIcon FALSE Ji Set smail icon 7 TODO Adda extra initialization here m_Handle 1 no card handle is in use m_CardNum 0 assume there is only 1 card m_ReadOrWrite 0 set read as te first operation m_AdrMode 1 Jisec the Tire Gata size to word m_AdrOffset 0000 set the original offset to 0x0000 UpdateData FALSE return TRUE return TRUE unless you set the focus to a control void CCXDlg OnSysCommand UINT nID LPARAM lParam if nID amp OxXFFFO IDM_ABOUTBOX CAbout
5. 259 260 261 abe 400 401 402 403 404 405 406 Insert Components Declarations etween the architecture and begin keyuwarda DEM is an another VHDL file to allow different generic statements component BUFG end component begin DPSRAN DP SRAM port map i To revise or add to the provided VHDL code begin by double clicking on the XC2V1002 XC2V1002_ arch XC2V1002 vhd file located in the Sources window This will open the VHDL file for editing Under the commented code line 261 additional components and signals may be added After the begin keyword line 403 additional instantiations for components may be added In this guide we will only be adding signals No components will be added at this time For simplicity we suggest adding to or revising the provided VHDL code that is associated with the I O To use the rear I O begin by double clicking on the XC2V1002 XC2V1002_arch XC2V1002 vhd file located in the Sources window if it is not already opened This will open the VHDL file associated with the rear I O for editing Note It is good programming practice to group like segments together to avoid confusion later when editing code Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com G Using the PMC CX Engineering Design Kit Example Use of the VHDL Code Below is a simple example of some VHDL that could be us
6. gt ShowWindow FALSE GetDlgItem IDC_RORWBUTTON gt SetWindowText Read else drop down is write GetDlgItem IDC_TOWRITE gt ShowWindow TRUE GetDlgItem IDC_WRITESTATIC gt ShowWindow TRUE GetDlgItem IDC_RORWBUTTON gt SetWindowText Write Void CCXD1lg OnBnClickedRorwbutton TODO Add your control notification handler code here DWORD data what to read from the card short nStatus status of the dll operation CSuring six temp string DWORD adr address short len length of the DWORD that is read char delim dummy pointer for conversions UpdateData TRUE update variables convert m_AdrOffset froma string hex number to DWORD adr DWORD strtol m_AdrOffset amp delim 16 if m_ReadOrwWrite 0 read Switch m_AdrMode case 0 read a byte nStatus PCICX_ReadByte m_Handle CX_PCIBAR2 adr PBYTE amp data len 2 break case l read a word nStatus PCICX ReadWord m_Handle CX_PCIBAR2 adr PWORD amp data len 4 break case 2 read a Dword nStatus PCICX ReadDword m_Handle CX _PCIBARZ2 adr amp data len 8 break default nStatus ERR_BAD PARAM break if nStatus OK if read correctly Str ormat 2x cdara change data to hex str str Right len a substring which length depends on _AdrMode ceplace the leading zero that right took off while len 8 amp str GetLength lt 8 39 Acromag Inc Tel 248 295 03
7. 1 0 Using the PMC CX Engineering Design Kit 7 The counter will be handled in this Process statement When the counter ae Counter Reg determine when to increment the counter is enabled it will check the A oe ee Counter_Inc line to see if ithas a 963 if RESET 1 then be ep z cq 964 Counter Reg lt 0000 positive logic equivalence of 1 every 965 elsif a and CLK 1 then positive clock edge If it does then the abe a ty teed a 1 enee counter will be incremented Add this 968 else 5 J code beginning at line 960 aes ce ee a ere et 971 end if 972 end process 973 8 Add the following lines of red code to the READ_DATA MUX lines beginning 1017 A 1018 RD Data O lt Counter_Reg 0 and Counter_Adr or about line 1018 This will allow the 1019 BREQo and Reset Reg Adr or 1020 DMA RequestO and DMA Control Adr or read and write commands to access 1021 IntStata O and Int StatClear adr or the counter address at 8020H 1022 Io0_ON and DigReg3itoO Adr or 1023 DirCtr1 O and Direction Adr or 1024 IntEna O and Int Enable Adr or 1025 IntTypA O and Int _Type Adr or Bits 3 0 will hold the four bits of the ee Sa ae ee 1027 DMA_TS QO and DMA_TS_Adr or counter bit 4 will hold the increment ee atari ey eae sea J 1029 SRAM RdData 0 and SRAM Strobe line and bit 5 will hold the enable fae 5 z 1031 RD Data 1 lt Counter_Reg 1 and Counter_Adr or 1032 LINTo_n and Reset Reg Adr or 1033 DMA Request
8. Explorer Window on the 5 A cx l or Header Files bottom tabs of the screen n Cx A or View gt Solution n CxDIg h h Resource h Explorer from the main ih stdafx h menu h targetwer h Resource Files Bi Cx ica Expand the Source Files a a Cxrce tab and double click Source Files cet C Cpp CXDIg cpp to open and C ME edit the file stdaFx cpp ReadMe txt eo SF ar 11 Add the following three lines of code directly beneath the existing ope include statements to produce T A ot E a the resulting code on the right include satdafx h include lt windows h gt include CX wh include PCICX h include CXDlg h include PCICE H include PCIErrorCodes h g ifdef DEBUG L define new DEBUG NEW endi 12 All the dll functions should now be enabled To check click on the Debug Program button atthe top of the screen Choose Yes if a prompt appears asking if the user would like to build files Note Be sure to copy PCICX h PClErrorCodes h and PCICX lib into your project folder in order to execute the program You can find these files at C ProgramFiles Acromag PCISW_API_WIN c_includ e and C ProgramFiles Acromag PCISW_API_WIN c_lib respectively Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit TODO Place dialog controls here Choose What board type to o
9. Kit case ERR_FILE OPEN return Error File already opened case ERR_FILE_FORMAT return ErrortFile not the right tormac case ERR_FILE_ READ return Error File cannot be read case ERR CONFIG DONE return Error Configuration is not complete case EBRR_EX DESIGN return Error FPGA is not configured w Acromag supplied design case ERR_HARDWARE return Error Hardware malfunction case ERR_FLASH BUSY recurn Error Flash chip is busy case ERR UNSUPPORTED return Error Device does not support the requested action default return An error has occurred return An error has occurred void CCXDlg OnCbnSelchangeBrdtype TODO Add your control notification handler code here Shore nStatus 0 J Carrent status short nHandle 1 a temp handle WORD wDevID board ID BOOL FPGAConfigured is the fpga configured int tempBoardType m_BoardType past selected board type CString boardName UpdateData TRUE update the member function from the GUI determine which board type was selected if m_BoardType 0 wDevID CX1002R_DEV boardName CX1002R else if m_BoardType 1 wDevID CX2002R_DEV boardName CX2002R else if m_BoardType 2 wDevID CX1003R_DEV boardName CX1003R else if m_BoardType 3 wDevID CX2003R_DEV boardName CX2003R elsef MessageBox Not a Valid Board Name ERROR chec
10. Tel 248 295 0310 Fax 248 624 9234 11 1 Select XC2V1002 XC2V1002_arch XC2V1002 vhd in the Sources Window 2 Select Generate PROM ACE or JTAG File in the Processes Window 3 Right click on Generate PROM ACE JTAG File and click on Rerun all Note If there are any errors correct them and repeat steps 2 and 3 4 A black prompt screen may appear for a few seconds after step 3 Ignore this screen and DO NOT type inside it 5 Select Prepare a PROM File and click Next Email solutions acromag com http www acromag com 12 6 Enter the following information Select PROM File Format Memory Fill Value PROM File Name Location Click on Next Generic Parallel PROM MCS FF CX1002 Path to the CX1002 file 7 Enter the following information for the LX40 Auto Select PROM Unchecked Parallel PROM Density 4M Number of Data Streams 1 Loading Direction UP Click Add and the click Next Using the PMC CX Engineering Design Kit iMPACT Prepare PROM Files want to target a ilins PROM Generic Parallel PROM 3rd Party SPI PROM PROM Supporting Multiple Design Versions Spartan3E MultiBoot PROM File Format MCS OTEK UFP C format O EXO BIN ISC HEX Swap Bits Checksum Fill Value 2 Hex Digits FF PROM File Name xc2v1000 Location coop My Documents Lloyd SEMESTER TWO XC2V1000 XC2V 1000 iMPACT Specify Parallel PROM Device Au
11. access to program the FPGA Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit GetDlgItem IDC_PATHSTATIC gt ShowWindow TRUE GetDlgItem IDC_FILENAME gt ShowWindow TRUE GetDlgItem IDC_PROG gt EnableWindow TRUE path of the default mcs file m_FileName C Programfiles Acromag PCISW_API_WIN config_files boar dName mcs check to see if board is already configured if configured thens how the configured static text Jand operation controls nstatus PCICX_IsFPGAConfigured m_Handle amp FPGAConfigured dll function reference pg 70 if FPGAConfigured show the r w controls GetDlgItem IDC_ISFPGACONFIG gt ShowWindow TRUE GetDlgItem IDC_OPSTATIC gt ShowWindow TRUE GetDlgItem IDC_RORW gt ShowWindow TRUE GetDlgItem IDC_ADROFF gt ShowWindow TRUE GetDlgItem IDC_ADRSTATIC gt ShowWindow TRUE GetDlgItem IDC_ADRMODE gt ShowWindow TRUE GetDlgItem IDC_ADRMODESTATIC gt ShowWindow TRUE GetDlgItem IDC_RORWBUTTON gt ShowWindow TRUE else jinide the r w controls GetDlgItem IDC_ISFPGACONFIG gt ShowWindow FALSE GetDlgItem IDC_OPSTATIC gt ShowWindow FALSE GetDlgItem IDC_RORW gt ShowWindow FALSE GetDlgItem IDC_ADROFF gt ShowWindow FALSE GetDlgItem IDC_ADRSTATIC gt ShowWindow FALSE GetDlgItem IDC_ADRMODE gt ShowWindow FALSE GetDlgI
12. an Acromag example design lt or H gt y Is a mezzanine module attached lt Y or W gt y configured with an Acromag example design or if this is a mezzanine model PCICH FPGA Configuration Menu FPGA is currently configured The PCICX FPGA Configuration Menu 1 Perform flash configuration i 2 Perform direct PCI bus to ilinx configuration will appear after a few moments and 99 Return to previous menu Enter selection should say FPGA is currently configured if the CX board was loaded with the new file Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit 1 Using the Example C to Run The FPGA PCICK Main Menu 1 From the PCIAX FPGA Configuration f i Menu type 99 and press Enter to return to Example design demo instructions the PCILX Main Menu Locate Choose board Attach interrupt callback FPGA configuration PLA9656 configuration and control 2 Open the Raw memory access menu by Flash commands typing 7 and pressing Enter This menu Raw memory access will allow us to use the built in functions to Uiew status information Exit Enter selection read and write to the board 3 Select 2 and press Enter to access the Select memory space to access i PCLEOQR PLE gt PCIBAR2 memory space where the 2 PCIBAR2 CPLD Flash FPGA AXM_D registers are located Enter selection _ 4 To write to the board Type 3 a
13. and Visual C All trademarks are the property of their respective owners Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit 3 Getting Started When using the any CX board besides the CX1002 simply substitute its model number for the CX1002 through out this document Turn off your computer and unplug the power cord Before touching either board make sure to discharge all static electricity Then attach the CX1002 to the APC PMC board Insert the APC PMC into an empty PCI Bus in your computer When restarting your computer you will be prompted to insert a CD with the drivers on it At this point insert the CD PCI Win32 Driver Software into your CD ROM drive When the plug and play installation has completed follow the steps to install the PCISW API WIN software on your computer When finished insert the CD titled PMC CX Engineering Design Kit and copy the CX1002 folder to your computer Before you start read through the Readme_CX1002 txt file found in the CX1002 Folder of the PMC CX Engineering Design Kit Also familiarize yourself with the PMC CX1002 User s Manual and the PCICX Function Reference included on the PCI Win32 Driver Software CD The user s manual gives the memory addresses of all the registers and their purposes The function reference gives information on how to use the DLL file in C C Visual Basic and LabView we will
14. dialog box should look like the figure to the left Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com 2 2 Using the PMC CX Engineering Design Kit Control ID under Misc Caption under tab Appearance tab Static Text IDC_STATIC Choose what board type to open Static Text IDC _MULTBRDSTATIC Select Card Number E Static Text IDC_ISFPGACONFIG The FPGA is already configured nTo reconfigure enter in the information E eS ee ee ee below Static Text IDC_PATHSTATIC Static Text IDC_OPSTATIC Static Text Static Text Static Text number text file text o s s s C Next to select card Edit Control IDC ADROFF Next to Address offset text Next to Data to Write text Edit Control Button IDC_OPENCARD Open Card S Je S Button _ IDC_PROG Program e S Button e Combo Box Next to Choose what board type to open text Combo Box Underneath Choose an operation type text Combo Box Next to Change transfer size text Note Remember when creating the combo boxes make sure to click and drag the area for the control as if the drop down menu is open This is done by selecting the down arrow on the combo box 16 For each combo box right click we need to enter the data shown in the CX1002R Se ES POr E OR one po OXOR menu Enter the intormationshown p foxo A ite 17 Also in the Behavior tab set the ll a po W
15. m_ReadOrwWrite IDC_TOWRITE DWORD Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit Event Handler Wizard CX Welcome to the Event Handler Wizard Message type Class list CBN_SELCHANGE CBN_EDITCHANGE CBN_CLOSEUP Function handler name OnCbnSelchangeRorw CAboutDig ICCxAy a IDD_ Cx _ DIGLaG om _AadrMode om _AdrorFset P m_Board Type r mi ardhurm P m_FieMame p m_Handle 2 m_hIiconm m_ Readorwrite a z T T J D 0 Mi Cosg a DoDatab change g BelMessagerap Gebstatus g GetThisMessage OnBroclickedok wW OnBoclickedope OnBoClickedPrag w OnBnClickedRkorw OnCbnselchange Oncbnselchange Oncbnselchange g OntInitDialog gW OnPaint oW OnQueryDragiIcon g OnSysCommand Nested Types Cancel 20 24 Right click on the following controls and select Add Event Handler to assign the following messages A default Function handler name is generated and does NOT need to be changed Click the Add and Edit button to save changes and exit the Event Handler Wizard Object IDs iDC_BRDTYPE CBN_SELCHANGE iIDC_OPENCARD BN_CLICKED 25 The Class View tab should now look like something this Double click any function declaration to edit that function 26 Use the code provided on pages 26 to 37 for
16. 1 and DMA Control Adr or 1034 IntStata l and Int _StatClear_Adr or 1035 102 _1N and DigReg3itoO0 Adr or 1036 DirCtrl 1 and Direction Adr or 1037 IntEna 1i and Int _Enable Adr or 1038 IntTypA 1 and Int _Type_Adr or 1039 IntPolA 1 and Int Polarity Adr or 1040 DMA_TS 1 and DMA_TS5_Adr or 1041 DMA1l TS 1 and DMA1_TS_Adr or 1042 SRAM RdData 1 and SRAM Strobe 1043 1044 RD Data 2 lt Counter_reg 2 and Counter_Adr or 1045 LSERR_n and Reset Reg Adr or 1046 USERO and DMA Control Adr or 1047 104 2N and DigReg31ito0_ Adr or 1048 IntStata 2 and Int StatClear_ Adr or 1049 DirCtrl 2 and Direction _Adr or 1050 IntEna 2 and Int _Enable Adr or OS IntTypA 2 and Int _Type_Adr or 1052 IntPolA 2 and Int Polarity Adr or 1053 DMA_T5 2 and DMA_TS_Adr or 1054 DMAl TS 2 and DMA1_TS_Adr or SS SRAM RdData 2 and SRAM Strobe 1056 1057 RD_Data 3 lt Counter_Reg 3 and Counter_Adr or 1058 I06_3N and DigReg3itoO0 Adr or 1059 IntStata 3 and Int StatClear Adr or 1060 DirCtr1l 3 and Direction dr or 1061 IntEna 3 and Int Enable Adr or 1062 IntTypA 3 and Int _Type_Adr or 1063 IntPolA 3 and Int Polarity Adr or 1064 DMA_TS 3 and DMA_TS_Adr or 1065 DMA1 TS 3 and DMA1 TS_Adr or 1066 SRAM RdData 3 and SRAM Strobe 1067 1068 RD Data 4 lt Counter_Inc and Counter_Adr or 1069 108 4N and DigReg3itoO Adr or 1070 IntStata 4 and Int StatClear_Adr or LOL DirCtrl 4 and Direct
17. 10 Fax 248 624 9234 Email solutions acromag com http www acromag com 3 6 Using the PMC CX Engineering Design Kit Str U0 Feotre MessageBox Value read str display the read else MessageBox GetStatus nStatus ERROR i else Jnrite switch m_AdrMode case 0 write a byte nStatus PCICX_WriteByte m_Handle CX_PCIBAR2 adr BYTE amp data len 2 break case l write a word nStatus PCICX WriteWord m_Handle CX _PCIBAR2 adr WORD amp data len 4 break case 2 write a dword nStatus PCICX WriteDword m_Handle CX_PCIBAR2 adr m_WData len 8 break default nStatus ERR_BAD PARAM break display if status of write if nStatus OK MessageBox GetStatus nStatus else MessageBox GetStatus nStatus ERROR called when the OK button is pressed I7 operations closes the open board and the program void CCXDlg OnBnClickedoOk TODO Add your control notification handler code here f 7elose the board that is an wee PCICX_ Close m_Handle from dll function reference pg 10 OnOK Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com
18. Acromag kj Series PMC CX Virtex 2 Based FPGA PMC Module Using the PMC CX Engineering Design Kit ACROMAG INCORPORATED Tel 248 295 0310 30765 South Wixom Road Fax 248 624 9234 P O BOX 437 Wixom MI 48393 7037 U S A Copyright 2007 Acromag Inc Printed in the USA Data and specifications are subject to change without notice 8500 807 C10G009 2 Using the PMC CX Engineering Design Kit TABLE OF Getting Started ccccceeeseeeeeeeceeeeeeeeeeeeeeeeeseeeneeeeess 3 CONTENTS 5 ieee arin Configuring XilinkX cccceeeee eee eeeeeeneeneeeeeeeeeneenenaes 3 Adding to the Provided VHDL Code ccscse0ee 7 Example Use of the VHDL Code csssscceeeeeeeeeeee eens 8 Create a Program Hex File ccccseeeeeeeeeeeeneeneeees 12 Loading the mcs File Into the CX Board 15 Using the Example C to Run The FPGA 05 17 Creating a MFC Program to use with the CX Board 18 Example MFC C06 iiiivensvitecsusceessccsievencentorucsdenivesusueaes 26 OBJECTIVE The purpose of this document is to provide basic instructions on using the PMC CX Engineering Design Kit with the PMC CX Boards It will focus on programming the FPGA of the PMC CX1002 using VHDL but can be easily modified to use with any model of the CX line This document also shows how to use the supplied dll files with a MFC application It is assumed that the user has a working knowledge of Xilinx VHDL
19. BoardType tempBoardType j update the GUI s variables UpdateData FALSE void CCXDlg OnBnClickedOpencard TODO Add your control notification handler code here short nStatus 0 status of the dll operation short nHandle 1 temp handle WORD wDevID Jj id of our board BOOL FPGAConfigured is the FPGA configured int tempBoardType m_BoardType past board type CString temp boardName temp string current board int tempCardNum m_CardNum past card number UpdateData TRUE data from the screen close the board opened previously PCICX_Close m_Handle from the dll function reference pg 10 Determine which board type was selected if m_BoardType 0 wDevID CX1002R_DEV boardName CX1002R else if m_BoardType 1 wDevID CX1003R_DEV boardName CX1003R else if m_BoardType 2 wDevID CX2002R_DEV boardName CX2002R else if m_BoardType 3 wDevID CX2003R_DEV boardName CX2003R else MessageBox Not a Valid Board Name ERROR return check the status of opening board 1 in the card number m_cardnum nStatus PCICX_Open short m_CardNum amp nHandle wDevID dil function reference pg 9 if nStatus OK nStatus ERR_CALIB notify that the board was openend correctly temp Format sd m_CardNum MessageBox boardName card temp opened m_Handle nHandle assign temp handle to global handle allow GUI
20. Dlg dlgAbout dlgAbout DoModal elec CDialog OnsysCommand niD lParam If you add a minimize button to your dialog you will need the code below to draw the icon For MFC applications using the document view model this is automatically done for you by the framework v id CCXDIg 0NnPaint if Ilslconic CPaintDC de this device context for painting SendMessage WM_ICONERASEBKGND reinterpret_cast lt WPARAM gt dc GetSafeHdc 0 Center icon in client rectangle int cxIcon GetSystemMetrics SM_CXICON int cy loon GetSystemMetrics SM_CYICON CRect rect GetClientRect amp rect int x rect Width cxIcon 1 2 ime y Peck Veignt cylcon 1 7 2 Draw the icon dc DrawlLcon x y mATCon else CULalLog OnPaint 4 Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit 2 Q The system calls this Function to obtain the cursor to display while the user drags the minimized window HCURSOR CCXADIG OnQueryDragicon return static_cast lt HCURSOR gt m_hIcon CString CCXDLO GetStatus Short Status Switch nStatus case OK return Operation Successful case ERR_INVALID_HNDL return Error No board is associated with the specified handle case ERR_CARD _IN_USE return Error This card is already open case ERR_NEWDEV re
21. ODESTATIC gt ShowWindow TRUE GetDlgItem IDC_RORWBUTTON gt ShowWindow TRUE ee ee ee AM mM else MessageBox Configuration did not complete n Check your path name and try again BERROR else error with usig this handle MessageBox GetStatus nStatus ERROR force user to open a new card from the beginning GetDlgItem IDC_PATHSTATIC gt EnablewWindow FALSE GetDlgItem IDC_FILENAME gt EnableWindow FALSE GetDlgItem IDC_PROG gt EnableWindow FALSE GetDlgItem IDC_ISFPGACONFIG gt ShowWindow FALSE GetDlgItem IDC_OPSTATIC gt ShowWindow FALSE GetDlgItem IDC_RORW gt ShowWindow FALSE GetDlgItem IDC_ADROFF gt ShowWindow FALSE GetDlgItem IDC_ADRSTATIC gt ShowWindow FALSE GetDlgItem IDC_ADRMODE gt ShowWindow FALSE GetDlgItem IDC_ADRMODESTATIC gt ShowWindow FALSE GetDlgItem IDC_RORWBUTTON gt ShowWindow FALSE ee ee ee ee a close the board if there is a handle if m_ Handle 1 PCICX_Close m_Handle from the dll reference pg 10 m_Handle 1 void CCXDlg OnCbnSelchangeRorw TODO Add your control notification handler code here Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit UpGateDatat TRUE if m_ReadOrWrite 0 drop down is read GetDlgItem IDC_TOWRITE gt ShowWindow FALSE GetDlgItem IDC_WRITESTATIC
22. ag 1 Open Microsoft Visual Studio 2008 from eps Etec the start menu Some screens may nent ee z a i h visual Basic isual Studio installed templates vary if using a different version of Windows O z Smart Device Pr Activex Control ath MFC Application Visual Studios acne ecu oak E visual C E visual J My Templates 2 Open a new MFC project by clicking on e _jJSearch Online Templates File gt New and selecting Project mart Device 3 Expand the C tab and click MFC Win32 Under Visual Studio installed templates oe click MFC Ap pl ication Enter the A project for creating an application that uses the Microsoft Foundation Class Library project name CX and leave the create on cx directo ry for solution box checked Location C Documents and Settings coop My Dacumentstvisual Studio 2005 Projects vi Solution Create new Solution v H Create directory For solution Click OK Solution Name cx 4 The MFC Application Wizard 3 4 Ci r gt ey appears MFC Application Wizard CX Application Type Click Next On the Application Type screen choose the Dialog Based option Deselect the Use Unicode Libraries option Click Next until the Overview Application type Project style Windows Explorer MFC standard Single document Specify Document View architecture support language and interface style options for your application Appli Generated Classes w
23. be focusing only on using the C C demo program Configuring Xilinx 1 Make a new directory and call it xc2v1000 File Edit View Favorites Tools Help i C Documents and Settings coop My Documents loyd SEMESTER TWO xc2v1000 Sele a a Q sack v 4 5 pO search ij Folders f x HS B X a Address O C Documents and Settings coop My Documents Lloyd SEMESTER TWO xc2v1000 j Go 2 From the CX1002 VHD Files Name Size Type Date Modified File and Folder Tasks RI alxcavi002 vhd 50KB VHDL File 11 17 2006 10 49 AM folder copy the all the vhdl files in Make fold E Cx1002Constraints_ucf 7KB File 12 19 2006 10 52 AM i C9 Make a new folder H DIG_I0_8 vhd 11KB VHDL File 1 21 2004 12 46 PM into the xc2v1000 folder Then 5 io this Folder to the DP_SRAM vhd 36KB VYHOL File 12 12 2006 4 07 PM from the CX1002 folder copy the CONSTRAINTS uctf file to the xc2v1000 folder E3 Share this folder Other Places 3 Start Xilinx s Project Navigator ES New Project Wizard Create New Project from your start menu Enter a Name and Location for the Project Project Name Project Location 4 Open a new project by selecting File gt New Project xe2v1000 give pat to xc2v100 directory Select the Type E for the Project 5 In the Project Name field type deat xc2v1000 In the Project Location field type the path name where to find the xc2v1000 folder Make sure the Top Level Module Type field is HDL and clic
24. ed to control five of the CX1002 s LVTTL channels It is included to show how the code supplied with the Engineering Design Kit can be modified for personal use 1 Open XC2V1002 vhd and scroll down to line 256 We will be adding the signals registers that the counter will be using Counter_EN will enable the counter Counter_Inc will determine if the counter is incrementing or not and Counter_Reg is the binary counter Add the lines in the box on the right This code will create a new address strobe for the counter It will be located in register 0x8020 2 We will now replace a previously unused memory address Add the two lines of code as shown to the right at line 573 This will be the location in memory to access the counter 3 At line 730 we will insert the counter s write strobe This will pulse Counter_Stb when there is a write command to the Counter_Adr Add the lines of code as shown eae 256 signal Word sel sTP_ LoGIc Here we add the decode signal for the NEW counter address Signal Counter Adr STD LOGIC Oxeo20 The LGUNGEr Ss Signals Brnable the counter for use Signal Counter EN STD LOGIC Inerement the Counter by one Signal Counter Inc sTD LoGIec The Counter s Register signal Counter Req STD LOGIC Vector 3 downto j The Write Strobe signal for the Counter signal Counter Sth STD LOGIC ar Tnsert Components Declarations ard
25. enerated The mcs file is now ready to be loaded into the CX1002 ry a03 Full xcv S00 xc 1002 bit PROM File Generation Succeeded Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit 1 D Loading the mcs File Into the CX Board gt Oe o gt D gt l l 1 Load PCICXDemo exe found in L Disk fC Oe an penton PCISW_API_WIN c_example PCILX msdev6 Release created by the PCI gt Win32 Driver Software CD ROM Woe O gt PCTS APT_ Cc examples PCIC WIN Note The PCISW_API_WIN folder pon will be installed by default at cd gt cd gt C Program Files Acromag msdey Release PCTC Demo exe PCICH Demonstration Program 2 Begin by entering 1 and reading the PCICX Main Menu operating instructions 1 Example design demo instructions 2 Locate Choose board Po Exit Enter selection 3 Press 2 to select which type of LX board to use CalHA2ZR CacAbh2R CaLlHASR CaA ZAHR select board to open 4 Type in the menu number that corresponds with your board model and press Enter 5 Answer Y to the first example if the FPGA is configured with the Acromag example design or the FPGA is configured with a design whose basic structure is the Acromag example design Otherwise type N and press Enter 6 Type Y if there is a mezzanine module attached like the AXM EDK that we are using
26. guration All Configurations Platform Active Win32 Configuration Manager C ProgramFiles Acromag PCISW_API_WIN c_incluc Yes nologo v Level 3 W3 axi Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Configuration All Configurations a Platform Active win32 Configuration Properties A Output File lal General Debugging Version CIC Enable Incremental Linking General Suppress Startup Banner Optimization Ignore Import Library Preprocessor Register Output Code Generation ies Per user Redirection Language Additional Library Directories Precompiled Headers hras Output Files Link Library Dependencies Browse Information Use Library Dependency Inputs Advanced Use UNICODE Response Files Command Line Linker General Input Manifest File Debugging System Optimization Embedded IDL Advanced Output File Command Line rom Override the default output file name OUT file Show Progress EEES ba Configuration Manager k OutDir ProjectName exe Not Set Yes INOLOGO No No No C ProgramFiles Acromag PCISW_API_WIN c_lib Yes No Yes sean is Conhigur gion Properties General Debugger J E Ophea shen Prepress ate Cente Gaie ain Larue Pr comgd d Hitt p Files Bean Ind raTa Achai Domai Line Link r General Maent Fike Debary Seether piira Embedded a mache ae el camma es Lives Gonfiguesson All Gorfigurst
27. indow appears se Use of MFC C Use HTML dialog Use MFC in a shared DLL for Gen erated Classes se lect User Interface Features Multiple top level documents Use MFC in a static library C CX D lg T h enc ick Fi n is h z Advanced Features Document View architecture support Generated Classes RESO angers English United States vi 5 Open PCI Win32 Driver Software Juse Utcode lbraries User s Manual to page 16 Here it gives instructions on using the dll in Microsoft Visual C 6 Follow along as we visually go through this process Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit cx Property Pages Common Properties Configuration Properties General Debugging C C General Optimization Preprocessor Code Generation Language Additional Include Directories Resolve using References Debug Information Format Suppress Startup Banner Warning Level Detect 64 bit Portability Issues Treat Warnings As Errors Use UNICODE Response Files Precompiled Headers Output Files Browse Informatio Advanced Command Line Linker Manifest Tool Resources n XML Document Generator Browse Information Build Events Custom Build Step Suppress Startup Banner Suppress the display of the startup banner and information messages nologo TX Property Pages 1 d Confi
28. ineering Design Kit ES Process Pro perties 13 Click on Process from the menu bar i Category and click on Properties E fe Configuration Options g fan Opti 14 Click on the Startup Options tab Serer ore 2 Encryption Options Property Hame Value 15 Verify that the following options are FPGA Start Up Clock selected Enable Internal Done Pipe Done Output Events FPGA Start Up Clock CCLK rae a 2 i elease Write Enable Output Events Enable Internal Done Pipe Not Checked aera eae eee Done Match Cycle Enable Outputs Default 5 Drive Done Pin High Release Write Enable 5 Release DLL Default Be Pte le al Match Cycle Auto Drive Done Pin High Check ES Process Pro perties 16 Click on the Configuration Options tab eo General Options 17 Change only the following option ori Readback Options Configuration Pin Mo Pull Down Encryption Options Property Name Value A Configuration Aate Configuration Clk Configuration Pins All other settings should stay the same Configuration Pin MO EE Configuration Pir M1 J Configuration Pin Mz Click on OK Configuration Fin Poon Configuration Pin Done Pull Up Configuration Pin Irit Pull Up k Xilinx should now be completely configured Property display level Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit Adding To The Provided VHDL Code 256 eae a50
29. ion_ dr or 1072 IntEna 4 and Int Enable Adr or 1073 IntTypa 4 and Int _Type_Adr or 1074 IntPolA 4 and Int Polarity Adr or 1075 DMA TS 4 and DMA TS Adr or 1076 DMA1_ TS 4 and DMA1 TS_Adr or 1077 SRAM RdData 4 and SRAM Strobe 1078 1079 RD_Data 5 lt Counter_EN and Counter_Adr or 1080 IQ10_5N and DigReg3itoO Adr or 1081 IntStata 5 and Int_5tatClear_ dr or 1082 DirCtr1l 5 and Direction Adr or 1083 IntEna 5 and Int Enable Adr or 1084 IntTypA 5 and Int_Type_ dr or 1065 IntPolA 5 and Int Polarity Adr or 1056 DMA _TS 5 and DMA _TS_Adr or 1087 DMA1 TS 5 and DMA1_TS_Adr or 1088 SRAM RdData 5 and SRAM Strobe 1089 Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit Create A Program Hex File Processes Add Existing Source Create Hew Source View Design Summary Design Utilities User Constraints Synithesize 5 7 Implement Design Generate Programming File Programing File Generation Repor ie Configure Device IMPACT at Processes iMPACT Welcome to iMPACT Please select an action from the list below Configure devices using Boundary Scan JTAG Automatic ally connect to a cable and identify B oundary S can chain Prepare a PROM File Prepare a System ACE File Prepare a Boundary Scan File Configure devices using Slave Serial mode Acromag Inc
30. ions w Pluto Artean Holdinoral Depreni yrs Al Default Lite aries borane Specie Library Module Del into File Aii locke bin Apiarmnibty Fried Managed Resare File Force Sami Pelepas Dita Lige DILL r Asabiy Lite Ratduni e 7 TE ES l Ta w ciiur aan Maragan e PHC is ha Species akBinnal Bete bo odd bo lia bed ie eo here We corde alien opel 19 6 Select Project form the menu bar and click CX Properties 7 Under Configuration Properties expand the C C tab and highlight the General sub menu Select All Configurations for Configuration In the Additional include directories edit box type in the path to the c header files If the PCI Win32 Driver Software was installed in the default location then they will be found at C Program Files Acromag PCISW_API_WIN c_include 8 Next expand the Linker tab and highlight the General sub menu In the Additional library Dependencies edit box type in the location of the above library If the PCI Win32 Driver Software was installed in the default location then they will be found at C Program Files Acromag PCISW_APIWIN c_lib 9 Highlight the Input sub menu Under Additional Dependencies type PCICX lib Click Apply Click OK Email solutions acromag com http www acromag com 2 0 Using the PMC CX Engineering Design Kit Solution Explorer Solutio M xx TEM es E ME a 10 Locate the Solution a Solution Cx 1 project
31. k Next HDL Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com A Using the PMC CX Engineering Design Kit 6 Enter the following information if ES New Project Wizard Device Properties using the CX1002 Select the Device and Design Flow for the Project Device Family Virtex2 Property Hame woe o oom i Pro uct Category l Device xc2v1000 cs Package fg456 Device lt C2v1000 Speed Grade 4 Package FG456 Top Level Module HDL Ba 4 Synthesis Tool XST 3 i Top Level Source Type HDL Simulator Modelsim XE VHDL synthesis Too XST VHDL erilog Simulator Modelsim XE VHDL Then click Next Enable Enhanced Design Summary Enable Message Filtering F 7 In the Create New Source dialogue Displeg Increrertal Messages E box click Next to go on the following screen we will not be creating a new source at this time 8 We will next add the files we copied from the CD Follow these steps A Press the Add Source Button z B Press Ctrl A to select all of the ES New Project Wizard Add Existing Sources fi les f Add Existing Sources C Press on the Open Button j T E A D Every ucf and vhd files should be 2 DIG_IO_8 vhd included 3 DP_SRAM vhd 4 XC2V1002 vhd 5 Make sure that every Copy to Project check boxes are deselected and then click on Next 9 Review the specifications to make sure they are c
32. k to see if there is more than one card or wDevID type jfoy Crying to open a card in slot 1 notetuse will tell we if this is a lgega operation hence there is or isn t a second card nStatus PCICX_Open 1 amp nHandle wDevID from dll function reference pg9 if nStatus 0K there area two or more cards Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit 3 1 else disable the controls in the GUI for choosing a card GetDlgItem IDC_MULTBRDSTATIC gt EnableWindow FALSE GetDlgItem IDC_CRDNUM gt EnableWindow FALSE GetDlgItem IDC_OPENCARD gt EnableWindow FALSE enable the controls in the GUI for choosing a card GetDlgItem IDC_MULTBRDSTATIC gt EnableWindow TRUE GetDlgItem IDC_CRDNUM gt EnableWindow TRUE GetDlgItem IDC_OPENCARD gt EnableWindow TRUE there is only one card try to open a card in slot one nStatus PCICX_Open short 0 amp nHandle wDevID from dll function reference g 9 if nStatus OK nStatus ERR_CALIB I 32 successfu l or Just call error notify that the board was opened correctly MessageBox boardName card 0 opened assign the temp handle to the global handle m_Handle nHandle allow user to progrma the FPGA GetDlgItem IDC_PATHSTATIC gt EnableWindow TRUE GetDlgItem IDC_FILENAME gt EnableWindow TRUE GetDlgItem IDC_PROG gt EnableWi
33. log CAboutDlg IDD void CAboutDlg DoDataExchange CDataExchange pDX CDialog DoDataExchange pDX BEGIN_MESSAGE_MAP CAboutDlg CDialog END_MESSAGE_MAP ji CCXDlg dialog CCXD1g CCXDlg CWnd pParent NULL CDialog CCXDlg IDD pParent m Handle 0 Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit m_BoardType 0 m AdrMode 0 m AdrOffset _T m_CardNum 0 m FileName _T m ReadOrWrite 0 m WData 0 m_hIcon AfxGetApp gt LoadIcon IDR_MAINFRAME void CCXDlg DoDataExchange CDataExchange pDX CDialog DoDataExchange pDX DDX_CBindex pDX IDC_BRDTYPE m_BoardType DDX_CBIndex pDX IDC_ADRMODE m_AdrMode DDX_Text pDX IDC_ADROFF m_AdrOffset DDX_Text pDX IDC_CRDNUM m_CardNum DDX_Text pDX IDC_FILENAME m FileName DDX_CBIndex pDX IDC_RORW m_ReadOrwWrite DDX_Text PDX IDC_TOWRITE m_WData BEGIN_MESSAGE_MAP CCXDlg CDialog ON_WM_SYSCOMMAND ON_WM_PATINT ON_WM_QUERYDRAGICON AFX_MSG_MAP ON_CBN_SELCHANGE IDC_BRDTYPE amp CCXDl1g OnCbnSelchangeBrdtype ON_BN_CLICKED IDC_OPENCARD amp CCXDlg OnBnClickedOpencard ON_BN_CLICKED IDC_PROG amp CCXDlg OnBnClickedProg ON_CBN_SELCHANGE IDC_RORW amp CCXDlg OnCbnSelchangeRorw ON_BN_CLICKED IDC_RORWBUTTON amp CCXDlg OnBnClickedRorwbutton ON_BN_CLICKED IDOK
34. nd press PCICH memory access menu Enter i Change transfer size WORD 16 bit ae Read From board 3 Write to board 5 Type 8020 the hexadecimal memory 99 Return to main menu Enter Selection l address of Counter_Adr and press Enter Then enter the data to enable Enter offset to write to 828 the counter in hex remembering that bit Enter data to write WORD 16 hit gt 5 enables the counter bit 4 is the increment line and bits 3 0 are the counter 6 This concludes the setup and the counter should function as previously described Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com 1 8 Using the PMC CX Engineering Design Kit Creating a MFC program to use with the CX Board For this section a general understanding of C C and the Visual Studios software is required Even though a step by step process is given much of the syntax may be confusing if one is not familiar to programming in Visual C Primarily the following sections shows how to enable use of the dll functions while creating a simple MFC program References to PCICX Function Reference and PCI Win32 Driver User s Manual are made throughout this section A copy of each should be close for reference as we create the MFC executable These files are found in PCISW_API_WIN doc created by the PCI Win32 Driver Software CD ROM Note The PCISW_API_WIN folder will be installed by default at C Program Files Acrom
35. ndow TRUE filename of the mcs file supplied by Acromag m_FileName C Program files Acromag PCISW_API config_files boardName mcs check to see if configured if configured then show already configured text and operation controls PCICX_IsFPGAConfigured m_Handle amp FPGAConfigured from 11 function reference pg70 if FPGAConfigured GetDlgItem IDC_ISFPGACONFIG gt ShowWindow TRUE GetDlgItem IDC_OPSTATIC gt ShowWindow TRUE GetDlgItem IDC_RORW gt ShowWindow TRUE GetDlgItem IDC_ADROFF gt ShowWindow TRUE GetDlgItem IDC_ADRSTATIC gt ShowWindow TRUE GetDlgItem IDC_ADRMODE gt ShowWindow TRUE GetDlgItem IDC_ADRMODESTATIC gt ShowWindow TRUE GetDlgItem IDC_RORWBUTTON gt ShowWindow TRUE else hnide the controls GetDlgItem IDC_ISFPGACONFIG gt ShowWindow FALSE GetDlgItem IDC_OPSTATIC gt ShowWindow FALSE GetDlgItem IDC_RORW gt ShowWindow FALSE GetDlgItem IDC_ADROFF gt ShowWindow FALSE GetDlgItem IDC_ADRSTATIC gt ShowWindow FALSE GetDlgItem IDC_ADRMODE gt ShowWindow FALSE GetDlgItem IDC_ADRMODESTATIC gt ShowWindow FALSE GetDlgItem IDC_RORWBUTTON gt ShowWindow FALSE else MessageBox GetStatus nStatus n boardNamet card 0 failed to open ERROR Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com 3 2 Using the PMC CX Engineering Design Kit m_
36. or S Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit 2 3 18 Set the following properties Select a control and expand the Behavior tab of the properties menu to edit these options All other controls not in this table should have their visibility set to rasg IDC_PROG DC_STATIC 19 Click on the Debug Program b button _ at the top of the screen The dialog screen should now look like this 20 Click OK to close the program 21 In the Workspace window click the Class ay r View tab and expand CX classes Right click on CCXDlg and Search gt p ace click Add gt Add Variable Enter the Ge Maps following information amp Global Functions and Variables Macros and Constants aa cain Value Variable Type Short a ccApp Variable Name protected CCXDigiCwnd pParent 0 Click Finish g DoDataExchangelCDataExchange p hd GetMessageMaptyoid const hd GetThisMessageMap void hd OntnitDialog yoid hd OnPaint void hd OnQueryDragicon void g0 OnSysCommand UINT nID LPARAM a rm _Handle a m_hicon lt gt esol Eca Res Pro Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com 24 Using the PMC CX Engineering Design Kit 22 Right click on the CCXDlg and click Add gt Add Func
37. orrect and then click Finish 10 Make sure that all of the files ES Adding Source Files were added successfully and The following allows you to see the status of the source files being added to the click on OK project and allows you to specify the Design View association for sources which are successtully added to the project Design Unit Association H ynthesis imp Simulation wt DIG_IO_8 DIGIO_4ARCH Synthesis Simulati E DP_SRAM vhd DP_SAAM DP_SAAM_ARCH Sunthesis Imp Simulation E C2v1002 vhd hgt Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit D S Ounces 11 In the Sources Window click on XC2V1002 XC2V1002_arch cx1002orig XC2V1002 vhd to highlight it E g4 xc2v500 4fg456 E Mle h EA O02 s CA1 00 arch fC M OP SRAM DP_SRAM DP_SRA al DIGA DIG_IO_8 DIGIO_ARCH C 1002Constraints uct 410020 12 In the Processes Window click Add Existing Source on Generate Programming File Froate New E so it is also highlighted Wiew Design Summary Design Utilities User Constraints Synthesize 457 Implement Design Generate Frogramming File Programming File Generation Report ers Generate PROM ACE or JTAG File ers Configure Device IMPACT ay Processes Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com 6 Using the PMC CX Eng
38. pen Select card number Edit Open Card T he FPGA is already configured To reconfigure enter in the information below Path of the mces fie Edt Program Choose an operation type Change transter size Read Address offset Edt Data bo write Edt OT 13 The example dialog program should load as shown to the left If not then the dll has not been configured correctly Repeat steps 7 12 and make sure all the paths and file names are correct Exit the dialog box by clicking OK NOTE If you have not made any changes to the generated code other than step 11 but receive an error stating error spawning cmd exe do the following Go to Tools gt Options Expand the Project and Solutions tab Click on VC Directories Add the following lines SystemRoot System32 System Root SystemRoot System32 wbem 14 In the Workspace window click on the ResourceView tab expand the CX rc and Dialog folders and then double click on IDD_CX_DIALOG for editing The dialogue editor side panel should also appear If not locate it from View gt Toolbars gt Dialog Editor 15 Delete both the cancel button and the TODO static text in the example dialog program above Then add the components listed on the following page and move the OK button Make sure the Properties side panel is open while editing right click on any object and click Properties to open When finished the
39. tem IDC_ADRMODESTATIC gt ShowWindow FALSE GetDlgItem IDC_RORWBUTTON gt ShowWindow FALSE n mn _ mn ee AM AMM else if the card can not be opened temp Format Sd m CardNum MessageBox GetStatus nStatus n boardName card temp faile d to open TERROR switch back to previous board settings m_BoardType tempCardNum UpdateData FALSE void CCXDlg OnBnClickedProg TODO Add your control notification handler code here short nStatus status of dll operation BOOL FPGAConfigured 7 18 EpGa configured 33 Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com 34 Using the PMC CX Engineering Design Kit UpdateData TRUE Jidate from the GUI this gt BeginWaitCursor start the hourglass cursor nStatus PCICX_IsFPGAConfigured m_Handle amp FPGAConfigured from dll reference pg70 if nStatus ERR INVALID HNDL it is possible to program this handle jj do a flash configuration nStatus PCICX_FlashConfigure m_Handle m_FileName trom dll reference po 74 if nStatus OK MessageBox GetStatus nStatus enable the r w operations GetDlgItem IDC_OPSTATIC gt ShowWindow TRUE GetDlgItem IDC_RORW gt ShowWindow TRUE GetDlgItem IDC_ADROFF gt ShowWindow TRUE GetDlgItem IDC_ADRSTATIC gt ShowWindow TRUE GetDlgItem IDC_ADRMODE gt ShowWindow TRUE GetDlgItem IDC_ADRM
40. the member functions All colored code is new code which you must add to the code generated by the MFC Wizards Make sure your code matches the code provided 27 From the menu bar at the top of the screen click on Build gt Clean CX Then click on Build CX If there are no errors click on the Debug Program button P atthe top of the screen again The program should now allow the user to open a board execute a flash configuration and read and write to a specified memory location Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com 2 6 Using the PMC CX Engineering Design Kit Example MFC Code Note that the following code is color coded Black indicates what was added by the ClassWizard and the colored code is specific to our example The code segments colored green are comments to help explain the purpose of each section CXDlg cpp implementation file 2i include stdafxz h Tine lice Oxen finclude CxDlg h include lt windows h gt Fanecluce PCIC h tinclude PCInrrorlodes h ifdef _DEBUG define new DEBUG_NEW endif CAboutDlg dialog used for App About class CAbouEDIG 4 public CDialog Public CAboutD1lg Dialog Data enum IDD IDD_ABOUTBOX protected virtual void DoDataExchange CDataExchange pDX 7 DDX DDV support Implementation protected DECLARE_MESSAGE_MAP E CAboutDig CAboutDig lt lt CDia
41. tion to open the Add Member ags Member Luncton Wize is Function Wizard Enter the following Welcome to the Add Member Function Wizard y information and also select the Static option y Note In the Return Type and Parameter as __ Fancionneme Type fields you are able to type in the desired a a aaa value if it is not contained in the drop down Eg j E i menu iaia Static L virtual C pure Return Type CString ining Function Name GetStatus ee eee Parameter type short Parameter name nStatus then click Add Access protected Static box is checked Finish _ _ Cancel _ Click Finish Add Member Variable Wizard CX 2 Welcome to the Add Member Variable Wizard 23 In the Workspace window click on the Access ResourceView tab expand the CX re and Z Control variable Dialog folders and then double click on Variable type Control I Category IDD_CX_DIALOG Member variables now 3 Do a vue need to be attached to the controls Right net click on the control to be edited and click Add inva Max value Variable to open the Add Member Variable _ E Wizard Comment notation not required First click on the Category dropdown and choose Value The following options in the i table then become available Enter the values and then press Finish IDC_ADRMODE m_AdrMode IDC_ADROFF m_AdrOffset CString IDC_BRDTYPE IDC_CRDNUM IDC_FILENAME CString IDC _RORW
42. to Select PROM Select a Parallel PROM Density Bytes 4M 4194304 v Position Density an Delete All C Create BPl Mode PROM BPI Master Device Family Number of Data Streams 1 Loading Direction UP Spartan 3E Data Stream 0 Start Address D Maximum 8 hex digits L Spartan 34 Virtex 5 Downstream Daisy Chain Type Parallel Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com Using the PMC CX Engineering Design Kit 1 3 8 Click Finish on the following page 9 Click on OK to add a device Add Device i Start adding device File to Data Stream 0 10 Select xc2v1002 bit and click Open a Add Device Look in B xc2y1002edit2 ex Fe 5 Ongo O _xmsgs My Recent O xst Documents le xc2v1002 bit Bie lt aa y amp Fe a j a My Network File name jxc2v1 002 bit X Places Files of type FPGA Bit Files bit M Cancel Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com 1 A Using the PMC CX Engineering Design Kit 11 Select No Add Device Would wou like to add another design file to Data Stream O 12 Select OK Add Device You have completed the device File entry Click Ok to continue 14 From the menu go Operations gt Generate File A message will appear on the screen to indicate the PROM file was successfully g
43. turn Error There was a software error while creating this instance case ERR_CONNECT return Error There was an error connecting to this board case ERR_MAPMEM return Error There was a memory mapping error case ERR_THREAD return error occurred while creating an interupt case ERR_ISR_ENABLE return Error occurred while enableing interrupt Sp oorc 3 case ERR_OUTOFHANDLES return Error Too many cards open case ERR_BAD PARAM return Error Invalid Parameter case ERR_INSUF_MEM return Error Insufficient memory case ERR _OCX_IN_USE return Error Control already configured for use by another device s PCI case ERR _DLL LOAD return Error ActiveX methods can t load the DLL case ERR_CONFIG_READ return Error occurred while reading from the device s PCI Conriguracion case ERR_TIMEOUT return Error Operation timed out before completing case ERR _ CONFIG _ SET return Error Configuration Failed case ERR _CALIB teLurn Error trom Calibration case ERR CONFIG _WRITE return Error occurred when writing to the configuration space case ERR_DMA MAP return Error DMA is not mapped into the process case BRR_EEPROM_ ACK return Error EEPROM Acknowledge was never recieved case ERR_EKEPROM READBACK return Error writing to the EEPROM Acromag Inc Tel 248 295 0310 Fax 248 624 9234 Email solutions acromag com http www acromag com 3 0 Using the PMC CX Engineering Design
Download Pdf Manuals
Related Search
Related Contents
WPC 2500 BW-AM WPC 5000 BW-AM WPC 10000 BW-AM About the User's Manual Open the Instruction Manual SECRETARA DE COMUNICACIONES Y TRANSPORTES 使用上の注意はカタログー取扱説明書をお読みください。 Manual de instrucciones Programming and Operating Instructions Manuel d`utilisation DU KX [U4.65.03] Opérateur NUME_DDL_GENE Copyright © All rights reserved.
Failed to retrieve file