Tutorial- Using Nohau EMUL-51 Real Time In Circuit Emulator

Contact:  SweePoh, Quek (Kevin). Testech Electronics Pte Ltd. Block 1014, #02-194, Geylang East Ave 3, Singapore 389729.
Tel: (+65)-67492162  Fax: (+65)-67494246    Email: sales@testech-elect.com    URL: www.testech-elect.com 


Introduction

Nohau EMUL51/EA768-ETR64-50 is a high performance real time in circuit emulator capable of 50MHZ emulation speed. It has 64KFrame Hardware Buffer that allows real time execution trace history, Code Coverage, Performance Analysis, and automatic Bank switching support. The sophisticated conditional trigger and filters can be configured and viewed without intrusion into real time emulation.

In addition, the Seehau debugger supports in-line compiling and assembling, and provides both numerical and graphical display for the code coverage, performance analysis

A versatile macro systems with its own debugging environment allows you to create macro or record it from user click and playback, so that you can setup the same debugging situation everytimes. The seehau debugger supports TCP/IP, OLE capability, and Support over IP allows users at multiple sites to access an emulator.

Installing/Setting Up Nohau EMUL-51 Debugger

1)      Install the Nohau Seehau51 into your system. When the Seehau51 runs, it will bring up a Emulation Configuration Menu (or you can select Start-> Seehau 51 -> Config.
 a) Support the Emulator Emulation Memory, Pod Type, and the Trace type (in this tutorial, we had a Nohau Enhanced Trace ETR64, and note that a 256KFrame Hardware Trace is also available).



    Click Next and select the default HW Configuration for the EMUL51. (This screen can also be access from Seehau51 -> Config Emulator -> Hdw Config Tab).

BrkPt Replacement optionally uses software breakpoint, but since the Nohau emulator has hardware breakpoint, we did not want to select it. Mask interrupt on steps, prevent the code from stepping into a high frequency interrupt (example a short timer interrupt) during stepping). In addition, you can specify P3.6 and P3.7 to be used in normal mode (that is RD and WR signal) or normal Input or output IO pin.

Clock (MHz) Field: This field contains the time base reference for trace timestamps only. The timestamps calculation assumes standard 8051 timing using 12 clock per bus cycles. Enter the followings:-


 

Click Finish. Now you can runs the Seehau51 program.

2) Before you use the emulator, you must configure the emulator. In Seehau debugger, click on Config -> Emulator. It is now assume that you had already setup the "Hdw Config" tab as shown in step 1. 

3) Now select "Misc Setup" tab. 

4) Select the "Map Config" Tab.
By default, the code and xdata memory were all map to the emulator. If you have IO map peripheral on your target board, you must map those range to the external IO address, so that read/write will be send to the external peripheral instead of emulator internal xdata memory.

5) If your target uses bank switching, you  must configure this tab prior to emulation. Refer to the Pod Card for the settings on the Bank Switching.  In addition , you must do the followings :-

6) If you are debugging code running from target ROM/EPROM/Flash, you can perform source level debugging by loading symbols only. Do the following:

From the Seehau main menu bar, click the config menu

Loading and Running Code on Seehau51 Debugger

1)      Select File ->  Load Code -> /Nohau/Seehau51/Examples/timer.abs file.

2) Click on the source step button. It is execute the assembly startup code, and break on the C main code (that is the first C source code line).

3) In the Space Type region of the data window status bar, that has Int. Code... Click and select data or Shadow RAM (in this tutorial, the Nohau EMUL768 has shadow RAM that allows you to view variable in RAM that changes while the emulator is running full speed). 

In the Format Type region of the data windows status bar, change the display format to ASCII.

 4) Click on "View" -> "Symbol Browser". Seehau51 has symbol browser allowing you to browse through all public, functions and vairables. If you click on  any selected function name, the source window will jump to the selected function routine immediately. Likewise, if you right click on a variable and you may add it to the inspect/watch window.

 

5) Click on "View" -> "SF Regs". It allows you to select all the processor registers. Press the ">" button to place selected Special function registers onto the right pane. When finish, select all the registers, right click on the mouse, and select either "Add To Reg1" window or "Add to New" Window". Now you should be able to see the selected special function register in your peripheral registors window.

  

6) In the souce windows, select a function call inside the main routine and then right click. Set a hardware breakpoint.

7) Now in the main toolbar, click on "GO" icon. The emualtor will execute and then break on the function call where you had set a breakpoint. You can then use the toolbar or the "RUN" menu, to setp into, step over, reset, animate (that is auto stepping the code), Go to a cursor position.

 

Hardware Trace (Nohau Enhanced Trace options)

 1) Trace is a comprehensive tool use to assist your debugging problem, such as interrupt routine that needs to complete its course (SPI, I2C, serial interrupt etc), or diagnose interrmitten problem such as stack overuns, malicious pointer, inadvertent overwrite of global memory, re-entrant functions problem etc. The Nohau Enhanced Trace Options allows:-

By default HW trace automatically starts recording when you begin code execution. When you stop execution, the trace history is display automatically.

2) Simple Trace:  

Set a breakpoint in your code, and then select Go until it hits the breakpoint. When it stops, the hardware trace will be automatically uploaded to the trace window. If you wants to see Source level trace in C, in the trace window, right click and select "Display Mode" and chose "Source" view. Notice the below screen that the trace window shows the C execution history until it hit the breakpoint. 

  Nohau Trace Window allows you to synchronous the Trace Window to your source window. This save you time, by automatically scrolling your source windows to sync with your HW Trace window. You can change the Trace Display Mode to "Trace Mode". Right click on the Trace Window toolbar, and you can select what you wish to display in the Trace Window. 

Nohau Hardware Trace function has many feature to expediate Trace analysis by select the "Trace" menu.

Code Coverage

Code Coverage is available on all the Nohau hardware Trace (Advanced Trace or Enhanced Trace). It allows you to see which part of your code has been executed at least once, and which line of your code is never executed. It is a powerful software quality analysis tools that runs on the hardware target.

To runs code coverage, reset your CPU. Then select the Tools -> Code Coverage and the Code Coverage window will open. Click on Run. When you stop emulation, the code coverage window will be updated. You can view a summary of the code covearage results, or view the address range that had been executed or a syntax color of your source code for detailed coverage in color coded view.

 

Performance Analysis

PPA (performance analysis) allows you to find software bottleneck of your code, and tells you where the CPU spends its time. You setup the bin by using the symbol function browser, and then when you runs the PPA, it is dynamically updated while the code is running.

To run PPA, select "Tools" -> "PPA". Then click on the "+" icon to add bins to the window using the symbol browser. Then all the bins are added, you click on "RUN" to run the PPA and view the window being dynamically updated while the code is running on the target.

 

Memory Testing

Nohau tools menu provides a target memory test utility. You can use this to test the memory systems on your target board, checking devices, address bus and databus.

Select "Tools" -> "Memory Testing" and then enter the address and pattern that you wish to runs on your target board.

 

Advanced Feature of the Hardware Trace Functions.

You can configure the Trace for advanced capability. Use the "Trace Configuration" dialog box by selecting "Trace Config" from the Trace menu, or from "Config" Menu, click "Trace". This section is very comprehensive and you may skip this portion if it is not of interest, but it shows very powerful Trace trigger and condition capability of the Nohau Seehau debugger.

Trigger Conditions

No Trig: Disable trigger. Collects data continiously in FIFO buffer.
Trig on A: Trigger when A condition is met.
Trig on B: Trigger when B condition is met
A then B: A condition to be met first, follows by B condition.
A Loop: Trigger after A condition is met n times, where n is loop count field.
B Loop: Trigger after B condition is met n times, where n is loop count field.
A Loop then B: A condition met for n times, follows by B condition.
A then B Loop: A condition must be met first, follows by B codnition n times.

Trace Configuration Examples

This section describe how to setup the emulator trace to trigger on a specific condition with the following parameters:-

  1. From the file menu, select load code and load the timer.d07 code. Then do teh followings:
  2. From the Config menu, open the Trace Configuration dialog box.
  3. Set the Delay Field to 8,192 frames to collect 8K Bus cycles after trigger condition is met.
  4. Set the Trigger Condition field to A
  5. In the Break Emulator area of the dialog box, click No to allow the emulator to continue runnign after the trigger
  6. Click the Condition tab. This will allows you to configure condition A for the entry to function Main.
  7. Right Click on the A condition line, and select Edit. This opens the Condition A dialog box.
  8. In the Address field, type Main
  9. From teh Type pull down list, select Fetch.
  10. Click OK to complete the trace setup

To capture the trace, on the Seehau Speedbar, click the reset button and then click on GO icon. As soon as the trigger condition is met, the Trace display window automatically updates. Frame 0 is the trigger point which is entry to function Main.

Nohau Trace Conditions Tab (Enhanced Trace)

The follows explains the various field and their purpose in the Condition tab, for the Nohau enhanced trace options 

Type: Select one of the following Bus cycle types:

E0: External input pins on the Pod. Select High, Low or None (don't care).

E1: External Input pin on the pod. Select High, Low or None (don't care).

SY0: External Input pin on the pod. Select High, Low or None (don't care).

SY1: External Input pin on the pod. Select High, Low or None (don't care).

Below is a screen of the Trace Conditions setup window.

Trace Filter Example

This section describe how to setup the emulator to filter data writes with the following parameters:

  1. From the File menu, select Load Code. Select the file timer.d07 and then do the followings:-
  2. From the Config menu, open the Trace Configuration dialog box.'
  3. Set the delay field to 5,000 frames. This setting allows trace to collect 5,000 bus cycles after trigger condition is met.
  4. Set the Trigger Condition Field to A
  5. Set The Record Field to A.
  6. In the Break Emulator area of the dialog box, click No to allow the emulator to continue running after the trigger.
  7. Click the Condition tab. This will allow you to configure condition A for writes to the Timer.sec structure field.
  8. Right Click on the A condition line, select Edit. This opens the Condition A dialog box.
  9. In the Address field, type &timer.sec
  10. From the Type pull down list, select Write. Then click OK to complete the trace setup

To capture the trace, on the Seehau speedbar, click Reset Button, and then click GO button. 

As soon as the trigger condition is met, the Trace window automatically updates. Cycle 0 is the trigger point which is the first write to Timer.sec

Combination Of Conditions

It is possible to enter multiple qualifiers under a single condition. When a trace condition has multiple qualifiers the fields in the qualifiers are logically ORed together.

Integrating Nohau EMUL-ARM Seehau Debugger into IDE

Nohau Seehau debugger can be integrated into any third party IDE such as Tasking EDE, Keil uVision2, IAR Embedded WorkBench, Hitech 8051. This ensure that when you starts Seehau Debugger, it will launch only 1 instance of the Seehau51 Debugger. This program is provided by Nohau is called the SLaunch.exe

RTOS Awareness

Nohau supports the CMX RTX51 RTOS kernel Aware using an OCX plugin (optional) and the uCOS-II RTOS, as well as custom RTOS. See below RTOS aware for CMX RTX51.

 

Link: SeeHau Useful tips (Set environment, save macros and miscellanous confiugration.
Link: Device Programmer for MCS51 and Memories
Link: 8051 Compiler,  8051 Real Time RTOS and TCP-IP stack

Back To Nohau Tutorial Page   


 

  Back to Nohau Main Page    |    Back to Testech Home Page    |    Compiler    |     RTOS    |    Emulator/Debugging