Active-HDL Interfaces Building VHPI Applications C Compilation Course 9.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Copyright  Oracle Corporation, All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE.
XP New Perspectives on Creating Web Pages With Excel Tutorial 1 1 Creating Web Pages With Excel Tutorial 1.
Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
Creating a Form on a Web Page
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
How to use the VHDL and schematic design entry tools.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Using Visual C++ and Pelles C
® IBM Software Group © 2006 IBM Corporation The Eclipse Data Perspective and Database Explorer This section describes how to use the Eclipse Data Perspective,
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
Design Verification Design Profiler Course 8. All materials updated on: September 30, Design Profiler Design Profiler is a tool integrated within.
Beginning Programming with the Visual Studio.NET Environment.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Renesas Technology America Inc. 1 M16C/Tiny SKP Tutorial 2 Creating A New Project Using HEW4.
StateCAD FPGA Design Workshop. For Academic Use Only Presentation Name 2 Objectives After completing this module, you will be able to:  Describe how.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Simulink ® Interface Course 13 Active-HDL Interfaces.
Computer Programming and Basic Software Engineering 9 Building Graphical User Interface Working with Unmanaged Code.
Computing IV Visual C Introduction with OpenCV Example Xinwen Fu.
XP New Perspectives on Microsoft PowerPoint 2002 Tutorial 1 1 Microsoft PowerPoint 2002 Tutorial 1 – Creating a PowerPoint Presentation.
CCS APPS CODE COVERAGE. CCS APPS Code Coverage Definition: –The amount of code within a program that is exercised Uses: –Important for discovering code.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
IE 411/511: Visual Programming for Industrial Applications
Creating a Web Site to Gather Data and Conduct Research.
Mentor Tools tutorial Bold Browser Design Manager Design Architect Library Components Quicksim Creating and Compiling the VHDL Model.
Website Development with Dreamweaver
Simulink ® Interface Course 13 Active-HDL Interfaces.
A1 Visual C++.NET Intro Programming in C++ Computer Science Dept Va Tech August, 2002 © Barnette ND & McQuain WD 1 Quick Introduction The following.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Creating a Project with C++ Builder
Teacher’s Assessment Assistant Worksheet Builder Starting the Program
HTML Concepts and Techniques Fourth Edition Project 7 Creating a Form on a Web Page.
HDL Bencher FPGA Design Workshop. For Academic Use Only Presentation Name 2 Objectives After completing this module, you will be able to:  Describe the.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
1 Building the CarryDrop Simulation in JBuilderX By Deddy Koesrindartoto 08/16/2004.
® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications.
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
Active-HDL Interfaces Debugging C Code Course 10.
Interfaces to External EDA Tools Debussy Denali SWIFT™ Course 12.
Version How to Use Packet Tracer MarinaMD.
Unit 1: Java and Eclipse The Eclipse Development Environment.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
Programmable Logic Training Course HDL Editor
Information and Communication Technology Sayed Mahbub Hasan Amiri Dhaka Residential Model College Higher Secondary.
Design Verification Code and Toggle Coverage Course 7.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
Creating and Editing a Web Page Using Inline Styles
1 VHDL & Verilog Simulator. Modelsim. 2 Change the directory to where your files exist (All of the files must be in a same folder). Modelsim.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
XP New Perspectives on Creating Web Pages With Word Tutorial 1 1 Creating Web Pages With Word Tutorial 1.
Copyright © 2007 by Pearson Education 1 UNIT 6A COMBINATIONAL CIRCUIT DESIGN WITH VHDL by Gregory L. Moss Click hyperlink below to select: Tutorial for.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the use of the High-performance.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
Introduction to Vivado
Chapter 2: The Visual Studio .NET Development Environment
1. Open Visual Studio 2008.
Lab 1 Introduction to C++.
Founded in Silicon Valley in 1984
These slides are for reference only. They are not "lecture notes"
Software Setup & Validation
Presentation transcript:

Active-HDL Interfaces Building VHPI Applications C Compilation Course 9

All materials updated on: September 30, Building VHPI Applications The VHPI interface provides a standard-compliant mechanism for connecting C applications to VHDL models simulated in Active- HDL. It allows development of applications such as: Code coverage tools Design traversals Behavioral C models Custom debugging environments C/C++ based testbenches

All materials updated on: September 30, VHPI Tools in Active-HDL All tools required to develop and debug VHPI applications are included in Active-HDL. Active-HDL includes: VHPI/PLI Wizard C/C++ Editor C/C++ Compiler (gcc) C/C++ debugger (gdb) Graphical front-end for gdb VHPI applications can be compiled with any C/C++ compiler. However, gdb-compatible debug information is required for debugging VHPI applications in Active-HDL environment. (Debugging of C applications is described in course 10.)

All materials updated on: September 30, 2005 This tutorial shows how to create a simple VHPI application. This application will be used in the datapath sample project delivered with Active-HDL. The application traverses the design hierarchy and counts the number of signals. The tutorial covers: 9.2 Sample VHPI Application Using VHPI/PLI Wizard Entering C/C++ code in the editor Configuring C/C++ build environment Connecting VHPI application to the VHDL model (the datapath sample)

All materials updated on: September 30, Loading VHDL Design 1.Choose Open Workspace/Design Explorer from the File menu. Then, double-click the datapath workspace icon located in the \Samples\VHDL_Designs folder.

All materials updated on: September 30, Compiling the Design 2.Compile the design using the Compile All command from the Design menu. 3.Use the list box in the Design Browser to set top_testbench (tb_architecture) as the top- level unit.

All materials updated on: September 30, Running the Wizard 4.Start the wizard with the VHPI/PLI Wizard command from the Tools menu. 5.Type dump_hierarchy in the VHDL Procedure/Function/ Architecture Name field. Uncheck the Generate VHPI Interface Template option and set the remaining options as shown in the figure on the right. 6.Press Add Item to List, then Generate, and close the window by clicking OK.

All materials updated on: September 30, Reviewing Created Files 7.Review the list of files created by the wizard. The list is printed into the Console window. # Design: Created file C:\My_Designs\Samples\Datapath\src\VHPI\vhpiuser_aldec.cpp # Design: Created file C:\My_Designs\Samples\Datapath\src\VHPI\dump_hierarchy_vhpi.h # Design: Created file C:\My_Designs\Samples\Datapath\src\VHPI\dump_hierarchy_vhpi.cpp # Design: Created file C:\My_Designs\Samples\Datapath\src\VHPI\dump_hierarchy_vhpi.vhd The files are also visible in the VHPI folder in the Design Browser. Also a DLM C/C++ configuration file is automatically added for building the application.

All materials updated on: September 30, Editing C Code 8.The dump_hierarchy_vhpi.cpp file contains an empty body of the dump_hierarchy_exec function. The following slides show complete code for the modified dump_hierarchy_vhpi function and for an auxiliary traverse_hierarchy routine. Before editing the functions add the following #include directive to the beginning of the dump_hierarchy_vhpi.cpp file: #include

All materials updated on: September 30, dump_hierarchy_vhpi function vhpiHandleT rootInstHdl = NULL; // handler to rootInst component vhpiHandleT iteratorSigHdl = NULL; // iterator for SigDecls vhpiHandleT Hdl = NULL; // handler vhpiHandleT archBodyHdl = NULL; // handler to archBody vhpiHandleT entityDeclHdl = NULL; // handler to entityDecl int numObjs = 0; // initialize objects counter vhpi_printf("\nUsing VHPI application as Foreign Architecture to count declared signals..."); //1. if ( rootInstHdl = vhpi_handle(vhpiRootInst, NULL) ){ //2 // signal declarations if ( iteratorSigHdl= vhpi_iterator(vhpiSigDecls, rootInstHdl) ) //3. while ( Hdl = vhpi_scan(iteratorSigHdl) ){ // handler points to object of type vhpiSignalDeclK (signal) vhpi_printf("found signal: %s ", // signal name vhpi_get_str(vhpiNameP, Hdl)); numObjs++; } // CONTINUED ON NEXT SLIDE Replace the // put your code here comment in procedure dump_hierarchy_exec in the dump_hierarchy_vhpi.cpp file with following code:

All materials updated on: September 30, dump_hierarchy_vhpi (continued) traverse_hierarchy(rootInstHdl, &numObjs); // fetching some information about analyzed design: // name of architecture of top level design if ( archBodyHdl = vhpi_handle(vhpiDesignUnit, rootInstHdl) ){ // name of entity of top level design if ( entityDeclHdl = vhpi_handle(vhpiPrimaryUnit, archBodyHdl) ){ vhpi_printf("==============================================="); vhpi_printf("SUMMARY:"); vhpi_printf("Analyzed entire design '%s' contains %d signal(s)", vhpi_get_str(vhpiNameP, entityDeclHdl), numObjs); } vhpi_printf("\nEnd of Your VHPI application "); (function defined in the dump_hierarchy_vhpi.cpp file continued)

All materials updated on: September 30, traverse_hierarchy function PLI_VOID traverse_hierarchy(vhpiHandleT ScopeHdl, int *numObjs){ vhpiHandleT iteratorSigHdl = NULL; // iterator for SigDecls vhpiHandleT iteratorRegHdl = NULL; // iterator for InternalRegions vhpiHandleT Hdl = NULL; // handler vhpiHandleT SigHdl = NULL; // handler if (ScopeHdl==NULL) return; if ( iteratorRegHdl = vhpi_iterator(vhpiInternalRegions, ScopeHdl) ) //1. while ( Hdl = vhpi_scan(iteratorRegHdl) ){ //2. vhpi_printf("%s [%d]: %s ",vhpi_get_str(vhpiKindStrP, Hdl), vhpi_get(vhpiKindP, Hdl), vhpi_get_str(vhpiNameP, Hdl) ); // signal declarations if (iteratorSigHdl= vhpi_iterator(vhpiSigDecls, Hdl)) //3. while ( SigHdl = vhpi_scan(iteratorSigHdl) ){ // handler points to object of type vhpiSignalDeclK (signal) vhpi_printf("found signal: %s ", //signal name vhpi_get_str(vhpiNameP, SigHdl)); (*numObjs)++; } traverse_hierarchy(Hdl, numObjs); } Above the dump_hierarchy_exec function type the following code:

All materials updated on: September 30, a CPP file contents

All materials updated on: September 30, Creating the Foreign Architecture 9.VHPI applications can be registered by using foreign subprograms or foreign architectures. This tutorial shows how to register the VHPI application by using the foreign architecture. Edit the dump_hierarchy_vhpi.vhd to include the code shown below: After editing, check if the new code compiles correctly. entity dump_hierarchy is end entity dump_hierarchy; architecture dump_hierarchy of dump_hierarchy is attribute foreign of dump_hierarchy : architecture is "VHPI $dsn\src\VHPI\datapath.dll;dump_hierarchy_model"; begin end architecture dump_hierarchy;

All materials updated on: September 30, Instantiating the Foreign Architecture 10.The dump_hierarchy architecture created on the previous slide has to be instantiated in the top-level unit. The neighboring pictures show component declaration and instantiation in the testbench.vhd file.

All materials updated on: September 30, C/C++ Configuration 11.Double click on the C/C++ Configuration file $DSN/VHPI/datapath.dlm. The C/C++ configuration dialog allows to specify all options required to build the VHPI application. Verify that the settings are the same as shown in the picture below.

All materials updated on: September 30, C/C++ Compilation 12. Click datapath.dlm with the right mouse button and choose Build from the context menu. The VHPI library (datapath.dll) will be built.

All materials updated on: September 30, Running the Simulation 13. Recompile HDL files. (Two files were edited during previous tutorial steps.) 14. Choose Initialize Simulation from the Simulation menu. The VHPI application will be registered through the VHDL foreign architecture. This is reported to the Console window. # KERNEL: PLI/VHPI kernel's engine initialization done. # VHPI: Loading library 'C:\My_Designs\Samples\Datapath\src\VHPI\datapath.dll' # : Using VHPI application as Foreign Architecture to count declared signals... # VHPI: found signal: CLK # VHPI: found signal: RESET # VHPI: found signal: START # VHPI: found signal: CODE # VHPI: found signal: DATA_IN... When the scan is complete, the design is ready for simulation. The VHPI application starts analyzing the design and prints collected information to the Console window.