Download presentation
Presentation is loading. Please wait.
Published byKristina Hood Modified over 9 years ago
1
Active-HDL Interfaces Debugging C Code Course 10
2
All materials updated on: September 30, 2004 10. C Debug Tools in Active-HDL C applications connected to the simulator via the VHPI or PLI interface can be debugged inside Active-HDL environment. Active- HDL includes tools required for C debug: C/C++ debugger (gdb) Graphical front-end for gdb The gdb debugger is part of the MinGW (Minimalist GNU for Windows). MinGW tools are installed into MinGW\bin directory.
3
All materials updated on: September 30, 2004 10.1 Tutorial Overview the datapath VHDL project (one of the samples delivered with Active-HDL and modified in Course 9) the dump_hierarchy VHPI application (created in Course 9) This tutorial shows how to start a debugging session and use the C/C++ debugging tools included in Active-HDL. If you do not have a copy of the modified datapath design with the datapath.dll library, run the tutorial in Course 9 first. The tutorial is based on the following code samples:
4
All materials updated on: September 30, 2004 10.2 Opening the 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. The design includes a VHPI application created in Course 9. The name of the VHPI dll file that will be loaded during the initialization of simulation is specified in VHDL code in the dump_hierarchy_vhpi.vhd file.
5
All materials updated on: September 30, 2004 10.3 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.
6
All materials updated on: September 30, 2004 10.4 Setting C Debug Options 4.Choose C/Handel-C Code Debug Settings from the Design menu and review the options shown in the picture. Select Add Generated macro to design option and click OK to close the window. The run_cdebug.do macro will be generated and added to the design.
7
All materials updated on: September 30, 2004 10.5 Initialization of C Debugging 5.Choose Initialize C Code Debug from the Simulation menu. The simulator prompt will be displayed in an external window (rather than the graphical Console). Note the name of the datapath.dll library in the text output.
8
All materials updated on: September 30, 2004 10.6 The C Code Debug Window 6.The C Code Debug window is displayed automatically after the simulation is initialized. Source files of the VHPI application are listed on the Source files tab. 7.C/C++ files can be open in the editor with a double click. The dump_hierarchy_vhpi.cpp file is loaded automatically after the initialization of simulation.
9
All materials updated on: September 30, 2004 10.7 Using Breakpoints 8.The editor displays C source code. Breakpoints are marked with the hand marker on the margin. You can set your own breakpoints: choose Toggle Breakpoint command from the Simulation menu or press F9 key To review all breakpoints select Breakpoints option from the Simulation menu. This command displays the Breakpoints dialog.
10
All materials updated on: September 30, 2004 10.8 Executing gdb Commands 9.The C Code Debug window allows entering commands to the gdb debugger. Type continue in the the Gdb command window and press the Execute button. The VHPI application will execute until suspended by a breakpoint. You can also use the Trace Into, Trace Out and Trace Over buttons. Active-HDL will automatically translate them into appropriate gdb commands.
11
All materials updated on: September 30, 2004 10.9 Monitoring Variable Values 10.Values of C/C++ variables can be displayed on the Watch tab. To add an item double click on the empty cell in the Expression column and enter the name of the variable, for example numObjs. Its value will be displayed in the Value column. You can also click on a variable name in the editor and use the Add to C Code Debug Watch command from the pop-up menu.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.