You are on page 1of 51

10

Analyzing and Debugging Designs with the System


Console
2013.11.04
QII53028 Subscribe Send Feedback
About the System Console
The System Console facilitates visibility into your system to enable faster debugging, and faster time to
market for your FPGA. You can access the hardware modules instantiated in your FPGA. System Console
and Qsys provide the framework and baseline functionality that you need to compose your own sophisticated
instrumentation and verification solution.
You can use the System Console for the following tasks:
To start, stop, or step a Nios II or SoC processor.
To read or write Avalon Memory-Mapped slaves using special masters.
To sample the Qsys system clock and system reset signals.
To run JTAG loopback tests to analyze board noise problems.
To shift arbitrary instruction register and data register values to instantiated system level debug (SLD)
nodes.
To write or source Tcl macros to deploy your verification solutions efficiently.
To create test platforms for streaming peripherals.
To perform low level tasks such as board bring-up and device driver debugging.
Related Information
System Console Online Training
System Level Debugging Architecture
The System Console is an API that works with instantiated debug IP, such as the JTAG Master component,
to send commands and receive data. Applications, such as the Transceiver Toolkit, runonthe SystemConsole
framework.
ISO
9001:2008
Registered

2013 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIXwords
and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other
words and logos identified as trademarks or service marks are the property of their respective holders as described at
www.altera.com/common/legal.html. Altera warrants performance of its semiconductor products to current specifications in accordance with
Altera's standard warranty, but reserves the right to make changes to any products and services at any time without notice. Altera assumes
no responsibility or liability arising out of the application or use of any information, product, or service described herein except as expressly
agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published
information and before placing orders for products or services.
www.altera.com
101 Innovation Drive, San Jose, CA 95134
Figure 10-1: System Level Debugging Architecture
System Console Flow
A high-level flow for the System Console comprises the following:
Figure 10-2: System Console Flow
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
System Console Flow 10-2
2013.11.04
Related Information
Qsys Components on page 10-6
Starting System Console on page 10-8
Locating Available Services on page 10-9
Opening and Closing Services on page 10-10
Use-Cases for the System Console
You can leverage the SystemConsole for multiple debugging use-cases. There are tutorials, application notes,
and design examples to aid in this evaluation.
Board bring-up
Remote debug over TCP/IP
Test the signal integrity of serial links with the Transceiver Toolkit
Debug memory interfaces with the External Memory Interface Toolkit
Related Information
Debugging Transceiver Links Documentation
External Memory Interface Documentation
Application Note 693: Remote Debugging over TCP/IP for Altera SoC
Application Note 624: Debugging with System Console over TCP/IP
Board Bring-Up with the System Console Tutorial on page 10-11
System Console GUI
The System Console GUI consists of a main window with four separate panes:
The System Explorer pane allows you to view a hierarchy of the System Console virtual file system in
your design, including connections, devices, designs, design instances, and scripts.
The Tools pane allows you to launch tools such as the GDBServer Control Panel and Transceiver Toolkit.
The Tcl Console allows you to source scripts, set variables, and write procedures.
The Messages pane displays status, warning, and error messages.
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-3 Use-Cases for the System Console
QII53028
2013.11.04
Figure 10-3: System Console GUI
Related Information
System Console Online Help
Introduction to Tcl Online Training
System Explorer Pane
The System Explorer pane contains the following information about the system being debugged:
The connections folder displays information about the debug cables which are visible to the System
Console.
The designs folder displays information about Quartus II project designs which have been loaded into
the System Console.
The devices folder contains information about each device connected to the System Console.
The design_instances folder contains design instances.
The scripts folder stores scripts for easy execution.
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
System Explorer Pane 10-4
2013.11.04
You will be doing most of your work within the devices folder. Within the devices folder is a folder for each
device currently connected to the SystemConsole. Each device folder contains a (link) folder and sometimes
contains a (files) folder.
The (link) folder shows debug agents (and other hardware) which the System Console is able to access,
arranged by connection type. The (files) folder contains information about the design files loaded from the
Quartus II project for the device. Folders under the design_instances folder are linked to the appropriate
(files) node.
Figure 10-4: System Explorer Pane
The Figure shows that the EP4SGX230 folder contains a (link) folder. The link folder contains a JTAG
folder. The JTAG folder contains folders that describe the debug pipes and agents that are connected to
the EP4SGX230 device via a JTAG connection.
The (files) folder contains information about the design files loaded from the Quartus II project for the
device. Instances within the design_instances folder are linked to the corresponding files in the (files)
folder.
Folders that have a context menu available show a small context menu icon. Right-click these folders to
view the context menu.
Folders that have informational messages available display a small informational message icon. Hover
over these folders to see the informational message.
Folders corresponding to debug agents have a clock status icon. There is a green clock signal icon if the
clock is running or a red clock signal icon if the clock is not running.
Setting Up the System Console
Set up the System Console according to the hardware available in your system. You can access available
debug IP on your system with the System Console. The debug IP allows you to access the running state of
your system.
The System Console Examples provide you with detailed examples of using the System Console with debug
IP.
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-5 Setting Up the System Console
QII53028
2013.11.04
Related Information
On-chip Debugging Design Examples Website
This page contains example design files that you can download.
System Console Examples on page 10-11
Qsys Components
You can use the System Console to help you debug Qsys systems. The System Console communicates with
debug IP in your system design. You can instantiate debug IP cores using Qsys or the MegaWizard Plug-In
Manager.
The following table describes some of the IPcores you can use with the SystemConsole to debug your system.
When connected to the SystemConsole, these components enable you to send commands and receive data.
(1)
Table 10-1: Qsys Components for Communication with the System Console
Component Interface Types for Debugging Component Name
Components that include an Avalon

Memory-
Mapped (Avalon-MM) slave interface. The JTAG
debug module can also control the Nios II processor
for debug functionality, including starting, stopping,
and stepping the processor.
Nios

II processor with JTAG debug enabled


Components that include an Avalon-MM slave
interface.
JTAG to Avalon master bridge
Provides the same functionality as JTAG to Avalon
master bridge, but is faster.
USB Debug Master
Components that include an Avalon-ST interface. Avalon Streaming (Avalon-ST) JTAG Interface
The JTAG UART is an Avalon-MM slave device that
can be used in conjunction with the System Console
to send and receive bytestreams.
JTAG UART
For more information, refer to AN624: Debugging
with SystemConsole over TCP/IP and AN693: Remote
Debugging over TCP/IP for Altera SoC.
TCP/IP
Provides Tcl support for ISSP. In-System Sources and Probes (ISSP)
The following figure shows examples of interfaces of the components that the System Console can use.
(1)
The System Console can also send and receive bytestreams from any system-level debugging (SLD) node in
Qsys components provided by Altera, a custom component, or part of your Quartus II project; however, this
approach requires detailed knowledge of the JTAG commands.
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Qsys Components 10-6
2013.11.04
Figure 10-5: Example Interfaces (Paths) the System Console Uses to Send Commands
Connections You Make
in Qsys
Transparent Connections
JTAG Logic
(Quartus II)
JTAG TAP
Controller
(Hard IP)
Virtual
JTAG Hub
(Soft IP)
JTAG Avalon Master Bridge
Virtual JTAG
Interface
Avalon-MM
Master
Nios II Processor
Virtual JTAG
Interface
Avalon-MM
Master
Avalon-ST JTAG Interface
Virtual JTAG
Interface
Avalon-ST
Source and
Sink
JTAG UART
Legacy
JTAG
Interface
Avalon-MM
Slave
User Component
Avalon-MM
Slave
User Component
Avalon-ST
Source
and Sink
or
To
Host PC
Running
System Console
The SystemConsole provides many different types of services. Different modules can provide the same type
of service. For example, both the Nios II processor and the JTAGto AvalonBridge master provide the master
service; consequently, you can use the master commands to access both of these modules.
If your system includes a Nios II/f core with a data cache, it may complicate the debugging process. If you
suspect the Nios II/f core writes to memory from the data cache at nondeterministic intervals; thereby,
overwriting data written by the System Console, you can disable the cache of the Nios II/f core while
debugging.
Related Information
System Design with Qsys Documentation
App Note 624: Debugging with System Console over TCP/IP
App Note 693: Remote Debugging over TCP/IP for Altera SoC
Nios II Processor website
Embedded Peripherals IP Documentation
Avalon Verification IP Suite Documentation
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-7 Qsys Components
QII53028
2013.11.04
Embedded Peripherals IP Documentation
Virtual JTAG (sld_virtual_jtag) Megafunction Documentation
System Console Flow on page 10-2
Starting System Console
There are three different ways to launch the System Console.
Related Information
System Console Flow on page 10-2
Starting System Console from Quartus II
To start System Console from Quartus II, do the following:
On the Tools menu, point to System Console, and then click System Console.
Starting System Console from Qsys
To start System Console from Qsys, do the following:
On the Tools menu, click System Console.
Starting System Console from Nios II Command Shell
To start the System Console from a Nios II command shell, follow these steps:
1. On the Windows Start menu, point to All Programs, then Altera, then Nios II EDS <version>, and then
click Nios II <version> Command Shell.
2. To start the System Console, type the following command:
system-console
You can customize your System Console environment by adding commands to the configuration file called
system_console_rc.tcl. You can locate this file in either of the following locations:
<quartus_install_dir> /sopc_builder/system_console_macros/system_console_rc.tcl, known as the
global configuration file, which affects all users of the system
<$HOME> /system_console/system_console_rc.tcl, known as the user configuration file, which only
affects the owner of that home directory
On startup, the System Console automatically runs any Tcl commands in these files. The commands in the
global configuration file run first, followed by the commands in the user configuration file.
Services for System Console
The System Console provides extensive portfolios of services for various applications, such as real-time
on-chip control and debugging, and system measurement. The System Console functions by running Tcl
commands. When you interact with the Tcl console in the System Console, you have general commands
related to finding and accessing instances of those services. Each service type has functions that are unique
to that service.
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Starting System Console 10-8
2013.11.04
Table 10-2: System Console Example Applications
Services Used Application
device, jtag_debug, sld Board Bring-Up
processor, elf, bytestream, master Processor Debug
bytestream, master, issp Active retrieval of dynamic information
marker, design Query static design information
monitor, master, dashboard System Monitoring
transceiver_reconfig_analog, alt_xcvr_reconfig_dfe,
alt_xcvr_reconfig_eye_viewer
Transceiver Toolkit Direct PHY Control
transceiver_channel_rx, transceiver_channel_tx,
transceiver_debug_link
Transceiver Toolkit System Level Control
Locating Available Services
The System Console uses a virtual file system to organize the available services, which is similar to the /
dev location on Linux systems. Instances of services are referred to by their unique service path in
the file system. You can retrieve service paths for a particular service with the command
get_service_paths <service-type>.
Table 10-3: Example of Locating a Service Path
Locating the Master Service
set m_path [lindex [get_service_paths master] 0]
set allows you to set the value of a variable.
m_path is a variable name.
lindex allows you to retrieve an element from a list.
get_service_paths returns a list of service instances by type.
master is a service type that accesses memory-mapped slaves.
0 is the 0
th
element of the list of the service instance returned.
System Console commands require service paths to identify the service instance you want to access. The
paths for different components can change between runs of the tool and between versions. Use
get_service_paths and similar commands to obtain service paths rather then hard coding them into
your Tcl scripts.
Most System Console service instances are automatically discovered when you start the System Console.
The System Console automatically scans for all JTAG and USB-based service instances and retrieves their
service paths. Some other services, such as those connected by TCP/IP, are not automatically discovered.
You can use the add_service Tcl command to inform the System Console about those services.
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-9 Locating Available Services
QII53028
2013.11.04
Related Information
System Console Flow on page 10-2
Opening and Closing Services
After you have a service path to a particular service instance, you can access the service for use.
The open_service command tells the System Console to start using a particular service instance. The
open_service command works on every service type. The open_service command claims a service
instance for exclusive use.
Table 10-4: Example of Opening a Service
Opening the Master Service
open_service master $m_path
open_service master opens the master service instance.
$m_path is the name of a variable.
The open_service command does not tell the System Console which part of a service you are interested
in. As such, service instances that you open are not safe for shared use among multiple users.
The claim_servicecommand tells the SystemConsole to start accessing a particular portionof a service
instance. For example, if you use the master service to access memory, then use claim_service to tell
the System Console that you only want to access the address space between 0x0 and 0x1000. The System
Console then allows other users to access other memory ranges and denies them access to your claimed
memory range. The claim_service command returns a newly created service path that you can use to
access your claimed resources.
Not all services support the claim_service command. Note:
You can access a service after you open or claim it. When you finish accessing a service instance, use the
close_service command to direct the System Console to make resources available.
Table 10-5: Example of Closing a Service
Closing the Master Service
close_service master $m_path
close_service master closes the master service.
$m_path is the name of a variable.
Related Information
System Console Flow on page 10-2
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Opening and Closing Services 10-10
2013.11.04
Using the System Console
The Quartus II software expands the framework of the System Console by allowing you to start services for
performing different types of tasks.
To use the System Console commands, you must connect to a system with a programming cable and with
the proper debugging IP.
Interactive Help
Typing help help into the Tcl Console lists all available commands. Typing help <command name>
provides the syntax of individual commands. The System Console provides command completion if you
type the beginning letters of a command and then press the Tab key.
The SystemConsole interactive help commands only provide help for enabled services; consequently, typing
help help does not display help for commands supplied by disabled plug-ins.
System Console Examples
There are examples for performing board bring-up, creating a simple dashboard, loading and linking a
design, and programming a Nios II processor. The Debugging_using_SystemConsole.zip file contains
design files for the board bring-up example. The Nios II Ethernet Standard zip files contain the design files
for the Nios II processor example.
The instructions for these examples assume that you are familiar with the Quartus II software, Tcl
commands, and Qsys.
Note:
Related Information
On-Chip Debugging Design Examples Website
Contains the design files for the example designs that you can download.
Setting Up the System Console on page 10-5
Board Bring-Up with the System Console Tutorial
You can perform low-level hardware debugging of Qsys systems with the System Console. Debug systems
that include IP cores instantiated in your Qsys system or perform initial bring-up of your PCB. This board
bring-up example uses a NEEK board (Cyclone III) and USB-Blaster cable. You can use different hardware
for this tutorial, but additional setup time is required to change device and pin assignments.
Related Information
Faster Board Bring-Up with System Console Demo Video
Use-Cases for the System Console on page 10-3
Board Bring-Up Commands on page 10-35
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-11 Using the System Console
QII53028
2013.11.04
Board Bring-Up Flow
The following figure shows the board bring-up flow for this tutorial.
Figure 10-6: Board Bring-Up Flow
Related Information
Setting Up the Board Bring-Up Design Example on page 10-13
Verifying JTAG Connectivity on page 10-14
Verifying Clock and Reset Signals on page 10-15
Verifying Memory and Other Peripheral Interfaces on page 10-16
Qsys Modules
Figure 10-7: Qsys Modules for Board Bring-up Example
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Board Bring-Up Flow 10-12
2013.11.04
The Qsys design for this example includes the following modules:
JTAG Avalon-MMProvides a connection between your development board and the Qsys system via
JTAG interface.
On-chip memorySimplest type of memory for use in an FPGA-based embedded system. The memory
is implemented on the FPGA; consequently, external connections on the circuit board are not necessary.
Parallel I/O (PIO) moduleProvides a memory-mapped interface between an Avalon-MM slave port
and general purpose I/O ports.
ChecksumAcceleratorCalculates the checksumof a data buffer in memory. The ChecksumAccelerator
consists of the following:
Checksum Calculator (checksum_transform.v)
Read Master (slave.v)
Checksum Controller (latency_aware_read_master.v)
How the Qsys Modules Work
The base address of the memory buffer anddata lengthpasses to the ChecksumController via the Avalon-MM
master. The Read Master continuously reads data from memory and passes the data to the Checksum
Calculator. When the checksum calculations are complete, the Checksum Calculator issues a valid signal
along with the checksum result to the Checksum Controller. The Checksum Controller sets the DONE bit
in the status register and also asserts the interrupt signal. You should only read the result fromthe Checksum
Controller when the DONE bit and interrupt signal are asserted.
Setting Up the Board Bring-Up Design Example
To load the design example into the Quartus II software and program your device, follow these steps:
1. Extract the Debugging_using_SystemConsole.zip file to your local hard drive.
2. Open Systemconsole_design_example.qpf from step 1.
3. Verify the device name in the Project Navigator, Cyclone III: EP3C25, matches your device. If it does
not match, change the pin assignments (LED, clock, and reset pins) in the Systemcon-
sole_design_example.qsf file.
4. Compile the design.
a. Right-click Compile Design under Task and click Start.
5. Program your device.
a. On the Tools menu, click Programmer.
b. Click Hardware Setup.
c. Click the Hardware Settings tab.
d. Under Currently selected hardware, click USB-Blaster, and click Close.
If you do not see the USB-Blaster option, then your device was not detected. Verify that the
USB-Blaster driver is installed, the NEEKboard is powered off, and the USB-Blaster connecting
wire is intact.
Note:
This design example has been validated using a USB-Blaster cable. If you do not have a USB-Blaster
cable and you are using a different cable type, then select your cable from the Currently selected
hardware options.
e. Click Auto Detect, select EP3C25 device.
f. Double-click your device under File, browse to your project folder from step 1 and open
Systemconsole_design_example.sof.
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-13 How the Qsys Modules Work
QII53028
2013.11.04
g. Turn on the Program/Configure option.
h. Click Start.
i. Close the Programmer.
6. Open Qsys.
a. On the Tools menu, click Qsys.
7. Open the Systemconsole_design_example.qsys file in your project folder from step 1.
The design takes about two minutes to load. Note:
Related Information
Board Bring-Up Flow on page 10-12
Verifying JTAG Connectivity
To debug any design with the System Console, begin by verifying JTAG connectivity.
1. Open System Console. From Qsys, under the Tools menu, click System Console.
2. In the Tcl Console, type the following:
pwd
System Console returns the current working directory. Note:
3. Type the following:
get_service_types
System Console returns the available service types. Note:
4. Find the available paths to the jtag_debug service. Type the following:
get_service_paths jtag_debug
5. Select a service path. Type the following:
set jtag_debug_path [ lindex [get_service_paths jtag_debug] 0]
6. Open the service. Type the following:
open_service jtag_debug $jtag_debug_path
7. Verify the JTAG chain. Type the following:
jtag_debug_loop $jtag_debug_path [list 1 2 3 4 5 6 7 8 9 10]
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Verifying JTAG Connectivity 10-14
2013.11.04
Sends a specified list of bytes through the loopback debug node and returns a list of bytes in the
order received.
Note:
8. Issue a reset request to the systemthrough the master_reset output of the JTAGto Avalon Master Bridge.
Type the following:
jtag_debug_reset_system $jtag_debug_path
Figure 10-8: Master Reset of the JTAG to Avalon Master Bridge
Figure 10-9: Verifying JTAG Connectivity
Related Information
Board Bring-Up Flow on page 10-12
Verifying Clock and Reset Signals
To verify clock and reset signals, follow these steps:
1. Verify that the clock is toggling.
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-15 Verifying Clock and Reset Signals
QII53028
2013.11.04
Type the following:
jtag_debug_sample_clock $jtag_debug_path
Repeat several times. System Console returns a zero and then a one when the clock toggles.
Or type the following:
jtag_debug_sense_clock
System Console returns a one if the clock has ever toggled.
2. Test the reset signal. Type the following:
jtag_debug_sample_reset $jtag_debug_path
3. Close jtag_debug service. Type the following:
close_service jtag_debug $jtag_debug_path
Figure 10-10: Verifying Clock and Reset
Related Information
Board Bring-Up Flow on page 10-12
Verifying Memory and Other Peripheral Interfaces
The Avalon-MM service accesses memory-mapped slaves via a suitable Avalon-MM master, which can be
controlled by the host. You can use Tcl commands to read and write to memory with a master service.
Master services are provided by System Console master components such as the JTAG Avalon master.
Related Information
Board Bring-Up Flow on page 10-12
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Verifying Memory and Other Peripheral Interfaces 10-16
2013.11.04
Locating and Opening the Master Service
1. Select the master service type and check for available service paths. Type the following:
get_service_paths master
2. Set the master service path. Type the following:
set master_service_path [ lindex [get_service_paths master] 0]
3. Open the master service. Type the following:
open_service master $master_service_path
Avalon-MM Slaves
The address range for every Qsys component is specified under the Address Map tab. These addresses are
used by the Avalon-MM master to communicate with slaves.
Register mapping for all Altera components is specified in their respective Data Sheets.
Figure 10-11: Address Map
Related Information
Data Sheets Website
Testing the PIO component
The PIO connects to the LEDs of the Cyclone III board. Test if this component is operating properly by
forcing values to it with the Avalon-MM master.
Figure 10-12: Register Map for the PIO Core
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-17 Locating and Opening the Master Service
QII53028
2013.11.04
1. Write to memory locations of the PIO component.
a. Type the following:
master_write_8 $master_service_path 0x0 0x7
To read back the register value, type the following:
master_read_8 $master_service_path 0x0 0x1
Note:
b. Type the following:
master_write_8 $master_service_path 0x0 0x2
c. Type the following:
master_write_8 $master_service_path 0x0 0xe
d. Type the following:
master_write_8 $master_service_path 0x0 0x7
Observe the LEDs turn on and off as you execute these Tcl commands. The LED is on if the register value
is zero and off if the register value is one. LED 0, LED 1, and LED 2 connect to the PIO. LED 3 connects to
the interrupt signal of the Checksum Accelerator.
Figure 10-13: Verifying Clock and Reset Signals
Testing On-chip Memory
Test the memory by using a recursive function that writes to incrementing memory addresses.
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Testing On-chip Memory 10-18
2013.11.04
1. Run the design example Tcl script. Type the following:
source set_memory_values.tcl
Figure 10-14: Testing On-chip Memory
Testing the Checksum Accelerator
The Checksum Accelerator calculates the checksum of a data buffer in memory. It calculates the value for
a specified memory buffer, sets the DONE bit in the status register, and asserts the interrupt signal. You
should only read the result fromthe controller when both the DONE bit and the interrupt signal are asserted.
The host should assert the interrupt enable control bit in order to check the interrupt signal.
Figure 10-15: Register Map for Checksum Component
1. Pass base address of the memory buffer and data length to the Checksum Accelerator.
a. Type the following:
master_write_32 $master_service_path 0x24 0x80
b. Type the following:
master_write_32 $master_service_path 0x2C 0x20
2. Write clear to status and control registers.
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-19 Testing the Checksum Accelerator
QII53028
2013.11.04
Type the following:
master_write_32 $master_service_path 0x20 0x0
a.
b. Type the following:
master_write_32 $master_service_path 0x38 0x1
3. Write Go to the control register. Type the following:
master_write_32 $master_service_path 0x38 0x8
4. Cross check if the checksum DONE bit is set. Type the following:
master_read_32 $master_service_path 0x20 0x1
5. Is the DONE bit set?
If yes, check the result. Type the following:
master_read_16 $master_service_path 0x3C 0x1
You are finished with the Board Bring-Up Design Example.
If the result is zero and the JTAG chain works properly, the clock and reset signals work properly,
and the memory works properly, then the problem is the Checksum Accelerator component.
6. Confirm if the DONE bit in the status register (bit 0) and interrupt signal are asserted.
a. Type the following:
master_read_32 $master_service_path 0x20 0x1
Check DONE bit should return a one.
b. Type the following:
master_write_32 $master_service_path 0x38 0x18
c. Check the Control Enable to see the interrupt signal. LED 3 (MSB) should be off. This indicates the
interrupt signal is asserted.
You have narrowed down the problem to the data path. View the RTL to check the data path.
7. Open the Checksum_transform.v file from your project folder.
<unzip dir>/Debugging_using_SystemConsole/ip/checksum_accelerator/checksum_accelerator.v
8. Notice that the data_out signal is grounded, uncommented line 87 and comment line 88. Fix the problem.
9. Save the file and regenerate the Qsys system.
10. Re-compile the design and reprogram your device.
11. Redo the above steps, starting with Verifying Memory and Other Peripheral Interfaces or run the Tcl
script included with this design example.
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Testing the Checksum Accelerator 10-20
2013.11.04
Type the following:
source set_memory_and_run_checksum.tcl
Figure 10-16: Checksum File
Creating a Simple Dashboard Example
The following shows how to create a simple dashboard:
1. Create a Tcl file inside $HOME/system_console/scripts and name it dashboard_example.tcl.
2. Open the System Console from the command line by typing system-console. You should now see
the System Console GUI, including the System Explorer.
3. Add the following lines to your Tcl file:
namespace eval dashboard_example {
set dash [add_service dashboard dashboard_example
"Dashboard Example" "Tools/Example"]
dashboard_set_property $dash self developmentMode true
dashboard_add $dash mylabel label self
dashboard_set_property $dash mylabel text "Hello World!"
dashboard_add $dash mybutton button self
dashboard_set_property $dash mybutton text "Start Count"
dashboard_set_property $dash mybutton onClick
{::dashboard_example::start_count 0}
dashboard_set_property $dash self itemsPerRow 1
dashboard_set_property $dash self visible true}
4. Return to the System Console GUI. Under the System Explorer tree, locate the scripts, and right-click
the node dashboard_example.tcl.
5. On the popup menu, click Execute. This command executes the Tcl script that you added to
$HOME/system_console/scripts.
6. You should now see an internal window titled Dashboard Example, Hello World! in
the middle of the dashboard window and a button named Start Count.
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-21 Creating a Simple Dashboard Example
QII53028
2013.11.04
7. To add some behavior to the example dashboard, you can create a seconds counter. First create a proc
inside the namespace_eval as follows:
proc start_count { c } {
incr c
variable dash
dashboard_set_property $dash mylabel text $c
after 1000 ::dashboard_example::start_count $c
}
8. Then add a line in the main script as shown by the following:
dashboard_set_property $dash mybutton onclick
{::dashboard_example::start_count 0}
9. The lines above define a proc inside the namespace. When you click Start Count, the script calls the
proc start_count with an argument of 0. The body of the proc is fairly simple. The proc
increments the argument, sets the value of the label to the argument, and then directs Tcl to call this
proc again in another 1000 milliseconds, using the recently incremented value as an argument.
Table 10-6: Example of Creating a Simple Dashboard
Creating a Simple Dashboard
namespace eval dashboard example {
proc start count { c } {
incr c
variable dash
dashboard_set_property $dash mylabel text $c
after 1000 ::dashboard_example::start_count $c
}
set dash [add_service dashboard dashboard_example "Dashboard Example"
Tools/Example"]
dashboard_set_property $dash self developmentmode true
dashboard_add $dash mylabel label self
dashboard_set_property $dash mylabel text "Hello World!"
dashboard_add $dash mybutton button self
dashboard_set_property $dash mybutton text "Start Count"
dashboard_set_property $dash mybutton onclick {
::dashbard_example::start_count 0}
dashboard_set_property $dash self itemsperrow 1
dashboard_set_property $dash self visible true
Related Information
Building a Custom Verification GUI with System Console Demo Video
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Creating a Simple Dashboard Example 10-22
2013.11.04
Dashboard Commands on page 10-43
Nios II Processor Example
In this example, you programthe Nios II processor on your board to run the count binary software example
that is included in the Nios II installation. This is a simple program that uses an 8-bit variable to repeatedly
count from 0x00 to 0xFF. The output of this variable is displayed on the LEDs on your board. After
programming the Nios II processor, you use the System Console processor commands to start and stop the
processor.
To run this example, perform the following steps:
1. Download the Nios II Ethernet Standard Design Example for your board from the Altera website.
2. Create a folder to extract the design. For this example, use C:\Count_binary.
3. Unzip the Nios II Ethernet Standard Design Example into C:\Count_binary.
4. In a Nios II command shell, change to the directory of your new project.
5. Program your board. In a Nios II command shell, type the following:
nios2-configure-sof niosii_ethernet_standard_<board_version>.sof
6. Using Nios II Software Build Tools for Eclipse, create a new Nios II Application and BSP from Template
using the Count Binary template and targeting the Nios II Ethernet Standard Design Example.
7. To build the executable and linkable format (ELF) file (.elf) for this application, right-click the Count
Binary project and select Build Project.
8. Download the .elf file to your board by right-clicking Count Binary project and selecting Run As, Nios
II Hardware.
The LEDs on your board provide a new light show.
9. Start the System Console. Type the following:
system-console
10. Set the processor service path to the Nios II processor. Type the following:
set niosii_proc [lindex [get_service_paths processor] 0]
11. Open both services. Type the following:
open_service processor $niosii_proc
12. Stop the processor. Type the following:
processor_stop $niosii_proc
The LEDs on your board freeze.
13. Start the processor. Type the following:
processor_run $niosii_proc
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-23 Nios II Processor Example
QII53028
2013.11.04
The LEDs on your board resume their previous activity.
14. Stop the processor. Type the following:
processor_stop $niosii_proc
15. Close the services. Type the following:
close_service processor $niosii_proc
The processor_step, processor_set_register, and processor_get_register
commands provide additional control over the Nios II processor.
Related Information
Nios II Ethernet Standard Design Example
Nios II Software Build Tools User Guide
Processor Commands on page 10-39
On-Board USB Blaster II Support
The System Console supports an On-Board USB-Blaster
TM
II circuit via the USB Debug master command.
Not all Stratix V boards support the On-Board USB-Blaster II. For example, the transceiver signal integrity
board does not support the On-Board USB-Blaster II.
Related Information
All Development Kits website
Console Commands
The console commands enable testing. You can use console commands to identify a module by its path, and
to open and close a connection to it. The path that identifies a module is the first argument to most of the
System Console commands.
Table 10-7: Console Commands
Function Arguments Command
Returns a list of service types that the System Console
manages. Examples of service types include master,
bytestream, processor, sld, jtag_debug, device, and
plugin.
get_service_types
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
On-Board USB Blaster II Support 10-24
2013.11.04
Function Arguments Command
Returns a list of paths to nodes that implement the
requested service type.
Whenthis command returns aniteminthe
list that has only one element and the
element has no spaces in it, you should not
pass the element to other commands.
Note:
Run this command:
set masters [get_service_paths master]
set master [lindex $masters 0]
master_read_memory $master 0x0200 16
As an example, do not run this command:
set master [get_service_paths master]
master_read_memory $master 0x0200 16
<service_type> get_service_paths
Opens the specified service type at the specified path.
An open_service command is equivalent to a
claim_servicecommandwithout claims specified.
<service_type>
<service_path>
open_service
Provides finer control of the portion of a service you
want to use.
Runhelp claim_serviceto get a <service-type>
list .
Then run help claim_service <service-type>
to get specific help on that service.
<service-type>
<service-path>
<claim-group>
<claims>
claim_service
Closes the specified service type at the specified path. <service_type>
<service_path>
close_service
Returns 1 if the service type provided by the path is
open, 0 if the service type is closed.
<service_type>
<service_path>
is_service_open
Returns a list of all services that are instantiable with
the add_service command.
get_services_to_
add
Adds a service of the specified service type with the
giveninstance name. Runget_services_to_add
to retrieve a list of instantiable services. This command
returns the path where the service was added.
Run help add_service <service-type> to get
specific help about that service type, including any
parameters that might be required for that service.
<service-type>
<instance-name>
<optional-parameters>
add_service
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-25 Console Commands
QII53028
2013.11.04
Function Arguments Command
Creates a new GUI dashboard in System Console
desktop.
<name> <title>
<menu>
add_service
dashboard
Instantiates a gdbserver. <Processor Service>
<port number>
add_service
gdbserver
Instantiates a Nios II DPX debug driver. <path to debug
channel>
<isDualHeaded>
<Base Av St Channel
number>
add_service
nios2dpx
Instantiates a tcp service. <instance_name>
<ip_addr>
<port number>
add_service tcp
Instantiates a Transceiver Toolkit receiver channel. <data_pattern_checker
path>
<transceiver path>
<transceiver channel
address>
<reconfig path>
<reconfig channel
address>
add_service
transceiver_
channel_rx
Instantiates a Transceiver Toolkit transceiver channel. <data_pattern_
generator path>
<transceiver path>
<transceiver channel
address>
<reconfig path>
<reconfig channel
address>
add_service
transceiver_
channel_tx
Instantiates a Transceiver Toolkit debug link. <transceiver_channel_
tx path>
<transceiver_channel_
rx path>
add_service
transceiver_debug_
link
Returns the current System Console version and build
number.
get_version
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Console Commands 10-26
2013.11.04
Function Arguments Command
Adds help text for a given command. Use this when
you write a Tcl script procedure (proc) and then want
to provide help for others to use the script.
<command>
<help-text>
add_help
For the given claim group, returns a list of services
claimed. The returned list consists of pairs of paths and
service types. Each pair is one claimed service.
<claim-group> get_claimed_
services
Scans for available hardware and updates the available
service paths if there have been any changes.
refresh_
connections
Sends a message of the given level to the message
window. Available levels are info, warning, error, and
debug.
<level>
<message>
send_message
Plugins
Plugins allow you to customize how you use the System Console services and are enabled by default.
Table 10-8: Plugin Commands
Function Arguments Command
Enables the pluginspecified by the
path. After a pluginis enabled, you
can retrieve the <service-path>
and <service_type_name> for
additional services using the get_
service_paths command.
<plugin-path> plugin_enable
Disables the plugin specified by
the path.
<plugin-path> plugin_disable
Returns a non-zero value when
the plugin at the specified path is
enabled.
<plugin-path> is_plugin_enabled
Design Service Commands
Design Service commands allow you to use the System Console services to load and work with your design
at a system level.
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-27 Plugins
QII53028
2013.11.04
Table 10-9: Example of Loading and Linking a Design
Loading and Linking a Design
#Load design and specify the directory of the .qpf
design_load /my project
#Locate the design and device paths. Set paths as variables.
set design_path [lindex [get_service_paths design] 0]
set device_path [lindex [get_service_paths device] 0]
#Link the design and device paths
design_link $design_path $device_path
Table 10-10: Design Service Commands
Function Arguments Command
Loads a model of a Quartus II
design into the System Console.
Returns the design path.
For example, if your Quartus II
Project File (.qpf) file is in c:/
projects/loopback, type the
following command: design_
load {c:\projects\
loopback\}
<quartus-project-path>,
<sof-file-path>,
or <qpf-file-path>
design_load
(2)
Instantiates a Quartus II design,
which creates an instance. The
instance name is optional. Returns
the instance path.
<design-path>
<instance-name>
design_instantiate
(2)
Turn on the Auto Usercode option to have the SystemConsole automatically instantiate and link designs after
they have been loaded. You can turn on this option from the General Page (Device and Pin Options Dialog
Box) in the Quartus II Online Help.
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Design Service Commands 10-28
2013.11.04
Function Arguments Command
Creates a design instance if
necessary and then links a
Quartus II logical design with a
physical device.
For example, you can link a
Quartus II design called 2c35_
quartus_design to a 2c35 device.
After you create this link, the
System Console creates the
appropriate correspondences
between the logical and physical
submodules of the Quartus II
project.
System Console does
not verify that the link
is valid; if you create an
incorrect link, the
System Console does
not report an error.
Note:
<design-instance-path>
<device-service-path>
design_link
Extracts debug files froma SRAM
Object File (.sof) to a zip file
which can be emailed to Altera
Support for analysis.
<design-path>
<zip-file-name>
design_extract_debug_
files
Converts the project into a dotty
file which shows what the System
Console has extracted from the
project. Use the Graphviz tools to
display the file.
<design-path>
<dot-file-name>
design_extract_dotty
Gets the list of warnings for this
design. If the design loads
corrrectly, then an empty list
returns.
<design-path> design_get_warnings
Adds or updates files within the
debug files section of the .sof.
<design-path>
<list-of-files-to-update>
design_update_debug_
files
Related Information
Altera Support Website
General Page (Device and Pin Options Dialog Box) Online Help
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-29 Design Service Commands
QII53028
2013.11.04
Programmable Logic Device (PLD) Commands
The PLD commands provide access to programmable logic devices on your board. Before you use these
commands, identify the path to the programmable logic device on your board using the
get_service_paths.
Table 10-11: PLD Commands
Function Arguments Command
Loads the specified .sof file to the
device specified by the path.
<service_path>
<sof-file-path>
device_download_sof
Returns all connections which go
to the device at the specified path.
<service_path> device_get_connections
Returns the design this device is
currently linked to.
<device_path> device_get_design
Monitor Commands
You can use the Monitor commands to read many Avalon-MMslave memory locations at a regular interval.
For example, if you want to perform 100 reads per second, every second, you get much better performance
using the monitor service than if you call 100 separate master_read_memory commands every second.
This is the primary difference between the monitor service and the master service.
To use Monitor commands, you must create a new monitor, set its callback and interval, add ranges, and
then set it to enabled.
From within the callback you must use appropriate read_data commands to extract the data. Note that
under heavy load, one or more monitor callbacks might be skipped.
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Programmable Logic Device (PLD) Commands 10-30
2013.11.04
Table 10-12: Example Monitor Script
Monitor Script
#Locate monitor and master paths, and open monitor path
set monitor_path [get_service_paths monitor]
set master_path [lindex [get_service_paths master] 0]
open_service monitor $monitor_path
#Configure monitor withspecific address inthe master path, set the interval at 3000ms, and set callback procedure
with monitor path and master path as arguments
monitor_add_range $monitor_path $master_path 0x2000 4
monitor_set_interval $monitor_path 3000
monitor_set_callback $monitor_path [list callback_proc \ $monitor_path
$master_path]
#Callback procedure to retrieve read data, store the data in the variable data , and print out data using the puts
command
proc callback_proc {mon_path mstr_path} {set data [monitor_read_data
$mon_path $mstr_path 0x2000 4] puts "Data at Address 0x2000: $data"}
#Activate the monitor service
monitor_set_enabled $monitor_path 1
Table 10-13: Main Monitoring Commands
Function Arguments Command
Adds a contiguous memory
address into the monitored
memory list.
<service path> is the value
returned when you opened the
service.
<target-path> argument is the
name of a master service to read.
The address is within the address
space of this service. <target-path>
is returned from[lindex
[get_service_paths
master] n] where n is the
number of the master service.
<address> and <size> are relative
to the master service.
<service-path>
<target-path>
<address>
<size>
monitor_add_range
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-31 Monitor Commands
QII53028
2013.11.04
Function Arguments Command
Defines a Tcl expression in a
single string that will be evaluated
after all the memories monitored
by this service are read. Typically,
this expressionshould be specified
as a Tcl procedure call with
necessary argument passed in.
<service-path>
<Tcl-expression>
monitor_set_callback
Specifies the frequency of the
polling action by specifying the
interval between two memory
reads. The actual polling
frequency varies depending onthe
system activity. The monitor
service will try to keep it as close
to this specification as possible.
<service-path>
<interval>
monitor_set_interval
Returns the current interval set
which specifies the frequency of
the polling action.
<service-path> monitor_get_interval
Enables/disables monitoring.
Memory read starts after this is
enabled, and Tcl callback is
evaluated after data is read.
<service-path>
<enable(1)/disable(0)>
monitor_set_enabled
Table 10-14: Monitor Callback Commands
Function Arguments Command
Adds contiguous memory
addresses into the monitored
memory list.
The <target-path>argument is the
name of a master service to read.
The address is within the address
space of this service.
<service-path> <target-path>
<address> <size>
monitor_add_range
Defines a Tcl expression in a
single string that will be evaluated
after all the memories monitored
by this service are read. Typically,
this expressionshould be specified
as a Tcl procedure call with
necessary argument passed in.
<service-path>
<Tcl-expression>
monitor_set_callback
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Monitor Commands 10-32
2013.11.04
Function Arguments Command
Returns a list of 8-bit values read
from the most recent values read
from device. The memory range
specified must be the same as the
monitored memory range as
defined by monitor_add_range.
<service-path> <target-path>
<address> <size>
monitor_read_data
Returns a list of 8-bit values read
from all recent values read from
device since last Tcl callback. The
memory range specified must be
within the monitored memory
range as defined by monitor_add_
range.
<service-path> <target-path>
<address> <size>
monitor_read_all_data
Returns the number of millisec-
onds between last two data reads
returned by monitor_read_data.
<service-path> <target-path>
<address> <size>
monitor_get_read_
interval
Returns a list of intervals in
milliseconds between two reads
within the data returned by
monitor_read_all_data.
<service-path> <target-path>
<address> <size>
monitor_get_all_read_
intervals
Returns the number of callback
events missed during the
evaluation of last Tcl callback
expression.
<service-path> monitor_get_missing_
event_count
Under normal load, the monitor service reads the data after each interval and then calls the callback. If the
value you read is timing sensitive, the monitor_get_read_interval command can be used to read
the exact time between the intervals at which the data was read.
Under heavy load, or with a callback that takes a long time to execute, the monitor service skips some
callbacks. If the registers you read do not have side effects (for example, they read the total number of events
since reset), skipping callbacks has no effect on your code. The monitor_read_data command and
monitor_get_read_interval command are adequate for this scenario.
If the registers you read have side effects (for example, they return the number of events since the last read),
you must have access to the data that was read, but for which the callback was skipped. The
monitor_read_all_dataandmonitor_get_all_read_intervalscommands provide access
to this data.
Trace Commands
The System Console trace system allows you to identify events of interest in the hardware and send details
of those events to the host system.
To use the trace commands listed in this section and capture the data these commands produce, instantiate
an Altera Trace System and suitable monitors (for example, an Avalon-ST Video Monitor) in your system.
Openthe trace systemwith the claim_service trace<service-path><library-name>command. You
can determine the path to your instantiated trace system by running get_service_paths trace.
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-33 Trace Commands
QII53028
2013.11.04
The claim_service trace command returns a new service path that represents the instantiated and
opened trace system. Use the returned service path in the commands below to access your hardware and
retrieve events of interest.
Table 10-15: Trace System Commands
Function Arguments Command
Returns a Tcl list of monitor paths
to the monitors (for example, an
Avalon-ST Video Monitor) that
are currently connected to the
trace systemspecified by <service-
path>.
<service-path> trace_get_monitors
Returns all the information that is
known about the specified
monitor on this trace system. The
values returned are a serialized
array of key / value pairsthey
can be converted to an array with
the array set command.
<service-path>
<monitor-path>
trace_get_monitor_info
Reads a configuration register
from the monitor specified. The
register at index 0 typically
identifies the type of monitor,
registers at higher indexes (which
are word addresses), and provides
more information about the
monitor.
<service-path>
<monitor-path>
<index>
trace_read_monitor
Writes a configuration register in
the specified monitor. The register
at word address 4 typically holds
enable bits for the monitor, the
meanings of registers at higher
addresses are dependent on the
type of monitor being accessed.
<service-path>
<monitor-path>
<index>
<value>
trace_write_monitor
Sets the maximum database size
(in bytes) that the driver stores in
memory. When the database
becomes larger than the specified
size, the oldest events are dropped
to prevent the application from
running out of memory.
<service-path>
<size>
trace_set_max_db_size
Returns the current maximum
database size (in bytes) for the
trace system.
<service-path> trace_get_max_db_size
Returns the approximate current
size (in bytes) for the database.
<service-path> trace_get_db_size
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Trace Commands 10-34
2013.11.04
Function Arguments Command
Starts data collection using the
current monitor settings.
Currently only the FIFO capture
mode is supportedthis mode
uses little buffering in the
hardware and sends the captured
data to the host as quickly as
possible.
<service-path>
<capture-mode>
trace_start
Stops data collection. Any data
that has been collected before the
stop command is issued is sent to
the host.
<service-path> trace_stop
Returns the current status of the
trace system. The status returned
is either IDLE (if the trace system
is not running) or RUNNING (if it
is collecting data). Intermediate
states (where the trace system is
starting up or flushing data before
going idle) are not currently
represented.
<service-path> trace_get_status
Saves the current trace database
to the specified file. Trace database
files typically have the extension
.tdb.
<service-path>
<filename>
trace_save
Loads a previously saved trace
database intomemory. The system
loads the database into a newnode
in the filesystemthe service path
to that node is returned by this
trace_load command.
<filename> trace_load
Board Bring-Up Commands
The board bring-up commands allow you to debug your design while the design is running in an FPGA.
These commands are presented in the order that you would use them during board bring-up.
The System Console is intended for debugging the basic hardware functionality of your Nios II
processor, including its memories and pinout. If you are writing device drivers, you may want to use
the System Console and the Nios II software build tools together to debug your code.
Note:
Related Information
Nios II Software Build Tools Reference
Board Bring-Up with the System Console Tutorial on page 10-11
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-35 Board Bring-Up Commands
QII53028
2013.11.04
JTAG Debug Commands
You can use JTAG debug commands to verify the functionality and signal integrity of your JTAG chain.
Your JTAGchain must function correctly to debug the rest of your system. To verify signal integrity of your
JTAG chain, Altera recommends that you provide an extensive list of byte values.
Table 10-16: JTAG Commands
Function Arguments Command
Loops the specified list of bytes
through a loopback of tdi and
tdoof a system-level debug (SLD)
node. Returns the list of byte
values in the order that they were
received. Blocks until all bytes are
received. Byte values are given
with the 0x (hexadecimal) prefix
and delineated by spaces.
<service-path>
<list_of_byte_values>
jtag_debug_loop
Issues a reset request to the
specified service. Connectivity
within your device determines
which part of the system is reset.
<service-path> jtag_debug_reset_system
Clock and Reset Signal Commands
The next stage of board bring-up tests the clock and reset signals. Use these commands to verify that your
clock is toggling and that the reset signal has the expected value.
Table 10-17: Clock and Reset Commands
Function Argument Command
Returns the value of the clock
signal of the system clock that
drives the module's system
interface. The clock value is
sampled asynchronously;
consequently, you may need to
sample the clock several times to
guarantee that it is toggling.
<service-path> jtag_debug_sample_clock
Returns the value of the reset_
n signal of the Avalon-ST JTAG
Interface core. If reset_nis low
(asserted), the value is 0 and if
reset_nis high(deasserted), the
value is 1.
<service-path> jtag_debug_sample_reset
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
JTAG Debug Commands 10-36
2013.11.04
Function Argument Command
Returns the result of a sticky bit
that monitors for system clock
activity. If the clock has toggled
since the last execution of this
command, the bit is 1. Returns
true if the bit has ever toggled
and otherwise returns false.
The sticky bit is reset to 0 on read.
<service-path> jtag_debug_sense_clock
Avalon-MM Commands
The master service provides commands that allow you to access memory-mapped slaves via a suitable
Avalon-MM master, which can be controlled by the host. You can use the commands to read and write
memory with a master service. Master services are provided either by System Console master components
such as the JTAGAvalon Master or the USB Debug Master, by PLI or TCP masters, and by some processors
which typically must be paused before they can be used for general purpose memory access.
SLD Commands
You can use the SLDcommands to shift values into the instruction and data registers of SLDnodes and read
the previous value.
Claim Values for Claim Services
Each master claim consists of three parts: a base address, a size, and an access mode. The base address and
size can be specified in decimal or hexadecimal (with preceding 0x).
Valid access modes include the following:
RO or READONLY gives read access to the specified addresses.
RW or READWRITE gives read and write access to the specified addresses.
EXC or EXCLUSIVE gives read and write access to the specified addresses.
If multiple RO and/or RW addresses have overlapping address ranges they are allowed to open at the same
time. EXC and EXCLUSIVE claims do not allow other claims for the same memory range.
Table 10-18: Module Commands
Function Arguments Command
(3)
Avalon-MM Master Commands
Writes the list of byte values,
starting at the specified base
address.
<service-path>
<base-address>
<list_of_byte_values>
master_write_memory
(3)
Transfers performed in 16- and 32-bit sizes are packed in little-endian format.
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-37 Avalon-MM Commands
QII53028
2013.11.04
Function Arguments Command
(3)
Writes the list of byte values,
starting at the specified base
address, using 8-bit accesses.
<service-path>
<base-address>
<list_of_byte_values>
master_write_8
Writes the list of 16-bit values,
starting at the specified base
address, using 16-bit accesses.
<service-path>
<base-address>
<list_of_16_bit_words>
master_write_16
Writes the entire contents of the
file through the master, starting at
the specified address. The file is
treated as a binary file containing
a stream of bytes.
<service-path>
<file-name>
<address>
master_write_from_file
Writes the list of 32-bit values,
starting at the specified base
address, using 32-bit accesses.
<service-path>
<base-address>
<list_of_32_bit_words>
master_write_32
Returns a list of <size> bytes.
Read from memory starts at the
specified base address.
<service-path>
<base-address>
<size_in_bytes>
master_read_memory
Returns a list of <size>bytes. Read
from memory starts at the
specified base address, using 8-bit
accesses.
<service-path>
<base-address>
<size_in_bytes>
master_read_8
Returns a list of <size> 16-bit
values. Read from memory starts
at the specified base address, using
16-bit accesses.
<service-path>
<base-address>
<size_in_multiples_of_16_bits>
master_read_16
Returns a list of <size> 32-bit
values. Read from memory starts
at the specified base address, using
32-bit accesses.
<service-path>
<base-address>
<size_in_multiples_of_32_bits>
master_read_32
Reads the number of bytes
specified by <count> from the
memory address specified and
creates (or overwrites) a file
containing the values read. The
file is written as a binary file.
<service-path>
<file-name>
<address>
<count>
master_read_to_file
(3)
Transfers performed in 16- and 32-bit sizes are packed in little-endian format.
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Claim Values for Claim Services 10-38
2013.11.04
Function Arguments Command
(3)
When a register map is defined,
returns a list of register names in
the slave.
<service-path> master_get_register_
names
SLD Commands
Shifts the instruction value into
the instruction register of the
specified node. Returns the
previous value of the instruction.
If the <timeout>value is set to
0, the operation never times out.
A suggested starting value for
<delay> is 1000 s.
<service-path>
<ir-value>
<delay> (in s)
sld_access_ir
Shifts the byte values into the data
register of the SLD node up to the
size in bits specified. If the
<timeout> value is set to 0, the
operationnever times out. Returns
the previous contents of the data
register. Asuggested starting value
for <delay> is 1000 s.
<service-path>
<size_in_bits>
<delay-in-s>,
<list_of_byte_values>
sld_access_dr
Locks the SLD chain to guarantee
exclusive access. If the SLD chain
is already locked, tries for
<timeout> ms before returning -
1, indicating an error. Returns 0
if successful.
<service-path>
<timeout-in-milliseconds>
sld_lock
Unlocks the SLDchain. Returns 0
for success, -1 for any errors.
<service-path> sld_unlock
Processor Commands
These commands allow you to start, stop, and step through software running on a Nios II processor. The
commands also allow you to read and write the registers of the processor.
(3)
Transfers performed in 16- and 32-bit sizes are packed in little-endian format.
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-39 Processor Commands
QII53028
2013.11.04
Table 10-19: Processor Commands
Function Arguments Command
Downloads the given Executable
and Linking Format File (.elf) to
memory using the specifiedmaster
service. Sets the processor's
program counter to the .elf entry
point.
<processor-service-path>
<master-service-path>
<elf-file-path>
elf_download
Returns a non-zero value if the
processor is in debug mode.
<service-path> processor_in_debug_mode
Resets the processor and places it
in debug mode.
<service-path> processor_reset
Puts the processor into run mode. <service-path> processor_run
Puts the processor into stop mode. <service-path> processor_stop
Executes one assembly instruction. <service-path> processor_step
Returns a list with the names of all
of the processor's accessible
registers.
<service-path> processor_get_register_
names
Returns the value of the specified
register.
<service-path>
<register_name>
processor_get_register
Sets the value of the specified
register.
<service-path>
<value>
<register_name>
processor_set_register
Related Information
Nios II Processor Example on page 10-23
Bytestream Commands
These commands provide access to modules that produce or consume a stream of bytes. You can use the
bytestream service to communicate directly to IP that provides bytestream interfaces, such as the Altera
JTAG UART.
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Bytestream Commands 10-40
2013.11.04
Table 10-20: Example Bytestream Script
Bytestream Script
#Locate and open the path
set b_path [lindex [get_service_paths bytestream] 0]
open_service bytestream $b_path
#Send eight bytes, eight numbers starting with one
bytestream_send $b_path [list 1 2 3 4 5 6 7 8]
#Create a list variable return_bytes as a placeholder for the returned bytes
set return_bytes [list]
while { [length $return_bytes] ==0}{set return_bytes [bytestream_receive
$b_path 8]}
#Close the service
close_service bytestream $b_path
Table 10-21: Bytestream Commands
Function Arguments Command
Sends the list of bytes to the
specified bytestream service.
Values argument is the list of bytes
to send.
<service-path>
<values>
bytestream_send
Returns a list of bytes currently
available in the specified services
receive queue, up to the specified
limit. Length argument is the
maximum number of bytes to
receive.
<service-path>
<length>
bytestream_receive
Marker Commands
These commands provide debugging information.
Table 10-22: Marker Commands
Function Arguments Command
Returns all debug assignments in
a key value ordered list.
<service-path> marker_get_assignments
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-41 Marker Commands
QII53028
2013.11.04
Function Arguments Command
Returns all debug information in
a key value ordered list.
<service-path> marker_get_info
Returns the debug type of the
marker.
<service-path> marker_get_type
In-System Sources and Probes Commands
You can use the In-System Sources and Probes (ISSP) commands to read source and probe data. You use
these commands with the In-System Sources and Probes that you insert into your project from the Quartus
II software main menu.
Before you use the ISSP service, you must open it with commands similar to the following:
set issp [lindex [ get_service_paths issp ] 0]
set chan [claim_service issp $issp <library-name>
set v [issp_read_probe_data $chan]
The valid values for probe claims include read_only, normal, and exclusive.
Table 10-23: In-System Sources and Probes Tcl Commands
Function Arguments Command
Returns a list of the configurations
of the In-System Sources and
Probes instance, including:
instance_index
instance_name
source_width
probe_width
<service-path> issp_get_instance_info
Retrieves the current value of the
probes. A hex string is returned
representing the probe port value.
<service-path> issp_read_probe_data
Retrieves the current value of the
sources. A hex string is returned
representing the source port value.
<service-path> issp_read_source_data
Sets values for the sources. The
value can be either a hex string or
a decimal value supported by
System Console Tcl interpreter.
<service-path>
<source-value>
issp_write_source_data
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
In-System Sources and Probes Commands 10-42
2013.11.04
Dashboard Commands
The SystemConsole dashboard allows you to create graphical tools that seamlessly integrate into the System
Console. This section describes how to build your own dashboard with Tcl commands and the properties
that you can assign to the widgets on your dashboard. The dashboard allows you to create tools that interact
with live instances of an IP core on your device.
Table 10-24: Example of Creating a Dashboard
Creating a Dashboard
add_service dashboard my_new_dashboard "This is a New Dashboard" Tools/My
New Dashboard
Table 10-25: Dashboard Commands
Description Arguments Command
Allows you to add a specified
widget to your GUI dashboard.
<service-path>
<id>
<type>
<group id>
dashboard_add
Allows you to remove a specified
widget fromyour GUI dashboard.
<service-path>
<id>
dashboard_remove
Allows you to set the specified
properties of the specified widget
that has been added to your GUI
dashboard.
<service-path>
<property>
<id>
<value>
dashboard_set_property
Allows you to determine the
existing properties of a widget
added to your GUI dashboard.
<service-path>
<id>
<type>
dashboard_get_property
Returns a list of all possible
widgets that you can add to your
GUI dashboard.
dashboard_get_types
Returns a list of all possible
properties of the specified widgets
in your GUI dashboard.
<widget type> dashboard_get_
properties
Related Information
Creating a Simple Dashboard Example on page 10-21
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-43 Dashboard Commands
QII53028
2013.11.04
Specifying Widgets
You can specify the widgets that you add to your dashboard.
Note that dashboard_add performs a case-sensitive match against the widget type name. Note:
Table 10-26: Dashboard Widgets
Description Widget
Allows you to add a collection of widgets and control
the general layout of the widgets.
group
Allows you to add a button. button
Allows you to group tabs together. tabbedGroup
Allows you to define button actions. fileChooserButton
Allows you to add a text string. label
Allows you to display text. text
Allows you add a text field. textField
Allows you to add a list. list
Allows you to add a table. table
Allows you to add an LED with a label. led
Allows you to add the shape of an analog dial. dial
Allows you to add a chart of historic values, with the
X-axis of the chart representing time.
timeChart
Allows you to add a bar chart. barChart
Allows you to add a check box. checkBox
Allows you to add a combo box. comboBox
Allows you to add a line chart. lineChart
Allows you to add a pie chart. pieChart
The Example is a Tcl script to instantiate a widget. In this example, the Tcl command adds a label to the
dashboard. The first argument is the path to the dashboard. This path is returned by the add_service
command. The next argument is the IDyouassignto the widget. The IDmust be unique withinthe dashboard.
You use this ID later on to refer to the widget.
Following that argument is the type of widget you are adding, which in this example is a label. The last
argument to this command is the group where you want to put this widget. In this example, a special keyword
self is used. Self refers to the dashboard itself, the primary group. You can then add a group to self,
which allows you to add other widgets to this group by using the ID of the new group, rather than using the
ID of the self group.
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Specifying Widgets 10-44
2013.11.04
Table 10-27: Example of Instantiating a Widget
Instantiating a Widget
dashboard_add $dash mylabel label self
Customizing Widgets
You can change widget properties at any time. The dashboard_set_property command allows you
to interact with the widgets you instantiate. This functionality is most useful when you change part of the
execution of a callback.
In the following example, the first argument is the path to the dashboard. Next is the unique IDof the widget,
which then allows you to target an arbitrary widget. Following that is the name of the property. Each type
of widget has a defined set of properties, discussed later. You can change the properties. In this example,
mylabel is of the type label, and the example shows how to set its text property. The last argument
is the value that the property takes when the command is executed.
Table 10-28: Example of Customizing a Widget
Customizing a Widget
dashboard_set_property $dash mylabel text "Hello World!"
Assigning Dashboard Widget Properties
The following table lists the various properties that you can apply to the widgets on your dashboard.
Table 10-29: Example of Viewing Properties for a Widget
Viewing Properties for a Widget
# View all the properties for a widget
dashboard_get_properties <widget_type>
# View all the properties for the dial widget
dashboard_get_properties dial
Table 10-30: Properties Common to All Widgets
Description Property
Enables or disables the widget. enabled
Allows the widget to be expanded. expandable
Allows the widget to be resized horizontally if there's
space available in the cell where it resides.
expandableX
Allows the widget to be resized vertically if there's
space available in the cell where it resides.
expandableY
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-45 Customizing Widgets
QII53028
2013.11.04
Description Property
If the widget's expandableYis set, this is the maximum
height in pixels that the widget can take .
maxHeight
If the widget's expandableYis set, this is the minimum
height in pixels that the widget can take.
minHeight
If the widget's expandableXis set, this is the maximum
width in pixels that the widget can take.
maxWidth
If the widget's expandableXis set, this is the minimum
width in pixels that the widget can take.
minWidth
The height of the widget if expandableY is not set. preferredHeight
The width of the widget if expandableX is not set. preferredWidth
A tool tip string that appears once the mouse hovers
above the widget.
toolTip
The value of the checkbox, whether it is selected or
not.
selected
Allows the widget to be displayed. visible
Allows for registering a callback function to be called
when the value of the box changes.
onChange
Allows you to list available options. options
Table 10-31: button Properties
Description Property
A Tcl command to run, usually a proc, every time
the button is clicked.
onClick
The text on the button. text
Table 10-32: fileChooserButton Properties
Description Property
The text on the button. text
A Tcl command to run, usually a proc, every time
the button is clicked.
onChoose
The text of file chooser dialog box title. title
The text of file chooser dialog box approval button.
By default, it is "Open".
chooserButtonText
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Assigning Dashboard Widget Properties 10-46
2013.11.04
Description Property
The file filter based on extension. Only one extension
is supported. By default, all file names are allowed.
The filter is specified as [list filter_description file_
extension], for example [list "Text Document
(.txt)" "txt"].
filter
Specifies what kind of files or directories can be
selected. "files_only", by default. Possible options are
"files_only" and "directories_only".
mode
Controls whether multiple files can be selected. False,
by default.
multiSelectionEnabled
Returns a list of file paths selected in the file chooser
dialog box. This property is read-only. It is most useful
when used within the onclickscript or a procedure
when the result is freshly updated after the dialog box
closes.
paths
Table 10-33: dial Properties
Description Properties
The maximum value that the dial can show. max
The minimum value that the dial can show. min
The space between the different tick marks of the dial. tickSize
The title of the dial. title
The value that the dial's needle should mark. It must
be between min and max.
value
Table 10-34: group Properties
Description Properties
The number of widgets the group can position in one
row, fromleft to right, before moving to the next row.
itemsPerRow
The title of the group. Groups with a title can have a
border around them, and setting an empty title
removes the border.
title
Table 10-35: label Properties
Description Properties
The text to show in the label. text
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-47 Assigning Dashboard Widget Properties
QII53028
2013.11.04
Table 10-36: led Properties
Description Properties
The color of the LED. The options are: red_off, red,
yellow_off, yellow, green_off, green, blue_off, blue,
and black.
color
The text to show next to the LED. text
Table 10-37: text Properties
Description Properties
Controls whether the text box is editable. editable
Controls whether the text box can format HTML. htmlCapable
The text to show in the text box. text
Table 10-38: timeChart Properties
Description Properties
The label for the X axis. labelX
The label for the Y axis. labelY
The latest value in the series. latest
The number of sample points to display in the historic
record.
maximumItemCount
The title of the chart. title
Table 10-39: table Properties
Description Properties
Table-wide Properties
The number of columns (Mandatory) (0, by default)
.
columnCount
The number of rows (Mandatory) (0, by default). rowCount
Controls whether you can drag the columns (false, by
default).
headerReorderingAllowed
Controls whether you can resize all column widths.
(false, by default). Note, each column can be individ-
ually configured to be resized by using the
columnWidthResizable property.
headerResizingAllowed
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Assigning Dashboard Widget Properties 10-48
2013.11.04
Description Properties
Controls whether you can sort the cell values in a
column (false, by default).
rowSorterEnabled
Controls whether to drawboth horizontal and vertical
lines (true, by default).
showGrid
Controls whether to draw horizontal line (true, by
default).
showHorizontalLines
Controls whether to draw vertical line (true, by
default).
showVerticalLines
Current row index. Zero-based. This value affects
some properties below (0, by default).
rowIndex
Current column index. Zero-based. This value affects
all column specific properties below (0, by default).
columnIndex
Specifies the text to be filled in the cell specified the
current rowIndex and columnIndex (Empty, by
default).
cellText
Control or retrieve row selection. selectedRows
Column-specific Properties
The text to be filled in the column header. columnHeader
The cell text alignment in the specified column.
Supported types are "leading"(default), "left", "center",
"right", "trailing".
columnHorizontalAlignment
The type of sorting method used. This is applicable
only if rowSorterEnabled is true. Each column has its
own sorting type. Supported types are "string"
(default), "int", and "float".
columnRowSorterType
The number of pixels used for the column width. columnWidth
Controls whether the column width is resizable by
you (false, by default).
columnWidthResizable
Table 10-40: barChart Properties
Description Properties
Chart title. title
X axis label text. labelX
Y axis label text. labelY
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-49 Assigning Dashboard Widget Properties
QII53028
2013.11.04
Description Properties
Y axis value range. By default, it is auto range. Range
is specified in a Tcl list, for example [list lower_
numerical_value upper_numerical_value].
range
Itemvalue. Value is specified in a Tcl list, for example
[list bar_category_str numerical_value].
itemValue
Table 10-41: lineChart Properties
Description Properties
Chart title. title
Axis X label text. labelX
Axis Y label text. labelY
Axis Y value range. By default, it is auto range. Range
is specified in a Tcl list, for example [list lower_
numerical_value upper_numerical_value].
range
Itemvalue. Value is specified in a Tcl list, for example
[list bar_category_str numerical_value].
itemValue
Table 10-42: pieChart Properties
Description Properties
Chart title. title
Itemvalue. Value is specified in a Tcl list, for example
[list bar_category_str numerical_value].
itemValue
Document Revision History
Table 10-43: Document Revision History
Changes Version Date
Re-organization of sections.
Added high-level information
with block diagram, workflow,
SLD overview, use-cases, and
example Tcl scripts.
13.1.0 November 2013
Updated Tcl command tables.
Added board bring-up design
example. Removed SOPCBuilder
content.
13.0.0 June 2013
Analyzing and Debugging Designs with the System Console Altera Corporation
Send Feedback
QII53028
Document Revision History 10-50
2013.11.04
Changes Version Date
Re-organization of content. 12.1.0 November 2012
Moved Transceiver Toolkit
commands to Transceiver Toolkit
chapter.
12.0.1 August 2012
Maintenance release. This chapter
adds newSystemConsole features.
12.0.0 June 2012
Maintenance release. This chapter
adds newSystemConsole features.
11.1.0 November 2011
Maintenance release. This chapter
adds newSystemConsole features.
11.0.0 May 2011
Maintenance release. This chapter
adds new commands and
references for Qsys.
10.1.0 December 2010
Initial release. Previously released
as the SystemConsole User Guide,
whichis being obsoleted. This new
chapter adds new commands.
10.0.0 July 2010
For previous versions of the Quartus II Handbook, refer to the Quartus II Handbook Archive.
Related Information
Quartus II Handbook Archive
Altera Corporation Analyzing and Debugging Designs with the System Console
Send Feedback
10-51 Document Revision History
QII53028
2013.11.04

You might also like