Overview
The AMX Prototyping System (TAPSTM) is a prototyping system that you can use to develop and debug AMX applications on a Windows workstation, without any real target hardware.
Requirements
CPU Pentium (or better) at 100 MHz (or greater) with
32 Mb of RAMOS Any Windows 32-bit OS including:
Windows XP, NT 4.0 or 2000Tools Microsoft Visual C++.NET
Multitasking Model
A TAPS application runs as a single thread within a Win32 application. TAPS includes a fully functional AMX implementation which does not use Win32 services to simulate multitasking operation.
Instead, TAPS provides a complete AMX multitasking environment which operates within the single TAPS Win32 thread. The TAPS version of AMX executes in a non-preemptive manner without support for interrupts.
As with any AMX implementation, the current task will always be the highest priority task which is ready for execution. However, under TAPS, the current task cannot be preempted by an external event such as an interrupt. The current task will only be suspended if it calls some AMX function which forces the task to wait for some event.
When used with TAPS, your application tasks must not be compute bound. Any compute bound task will prevent TAPS from generating its simulated AMX clock ticks, thereby precluding the use of AMX timing services. If your task must "spin", be sure to call AMX function
cjtkdelay(1)from time to time.
External Event Simulation
External events are simulated by the TAPS Event Generator, a function which is called by the TAPS Control Task, the built-in task that runs at the lowest AMX priority. The TAPS Event Generator simulates "hardware" clock ticks at the frequency specified in your application User Parameter File.
Device I/O operations can be simulated if your application uses the
cjcfinXX/cjcfinpXXandcjcfoutXX/cjcfoutpXXfunctions provided by AMX. These low-level I/O operations are all funneled through the TAPS I/O Access Procedure which can be modified to mimic the results of I/O operations on your hardware.All of the functions which can be adapted by you to test your AMX application are provided in source file
CJ302AIF.C.
Simulated Hardware Devices
The TAPS AMX Library provides support for two simulated hardware devices: a clock and a UART.
The simulated clock device provides timing based on the Windows Performance Counters. These counters provide a very accurate timing source. Since TAPS does not support interrupts, the clock ticks are generated by calls from the TAPS Event Generator to the TAPS function taps_clocktick().
The simulated serial I/O device is a polled (not interrupt driven) device that is accessed via the simple AMX
chuart()interface provided with the AMX Sample Program. Character input is read from thestdindata stream and written to thestdoutdata stream that is available to Win32 console applications.
Getting Started with the AMX Sample Program
TAPS includes a copy of the AMX Sample Program ready for use on a Windows workstation using the Visual C++.NET IDE. For more detailed information about the AMX Sample Program for TAPS, read Chapter 2.4 of the AMX Getting Started manual.
To build and run the sample program, start the Visual C++.NET IDE and follow these simple steps:
- Open the project file
C:\TAPS302\SAMPLE\SAMPLE.DSP
via theFile ==> Open Project...dialog using
Files of type: Visual C++ Projects.
TheSAMPLE.DSPproject will be automatically
converted to the new "solution" format used by
the Visual C++.NET tools.
- Build the AMX Sample Program using the
Build ==> Build SAMPLEdirective.
- Run the AMX Sample Program using the
Debug ==> Start...directive.
The AMX Sample Program will run in its own console window.
New messages will appear in the window periodically.
After one minute, the sample program will stop.
Comparison of AMX and TAPS Development
| Target Specific AMX Application | TAPS Application | |
|---|---|---|
| A. | Create a MAKE file to compile, assemble and link your AMX application modules, following the compilation, assembly and linking instructions described in the AMX Tool Guide. |
Create a new TAPS project using the Visual C++.NET IDE. In the project's settings, set the appropriate compilation options for all C/C++ modules. |
| B. | Select the AMX Clock Driver which most closely matches your target hardware. Compile the driver. | TAPS provides its own built-in clock driver. |
| C. | Use the AMX Configuration Manager to create a User Parameter File describing your AMX application requirements. Use the Manager to generate your System Configuration Module. Compile the module. | Use the TAPS version of the AMX Configuration Manager to create
your User Parameter File and to generate your
System Configuration Module from it. You can add commands to your Visual C++ project to generate the System Configuration Module from your User Parameter File by following these instructions. |
| D. | Use the AMX Configuration Manager to create a Target Parameter File defining your target hardware. Use the Manager to generate your Target Configuration Module. Assemble the module. | Skip this step. TAPS does not use a Target Configuration Module. |
| E. | Review the AMX startup module CJnnnUF.C and, if your needs
warrant, add enhancements to the default error handling procedures. Compile
the module. |
Review the TAPS Application Interface Module CJ302AIF.C
and, if necessary, add enhancements to the TAPS Event Generator, the TAPS
I/O function and the AMX error handling procedures. Compile the module.
|
| F. | Compile your main() C program and AMX application modules. |
Add your application modules to the TAPS Visual C++ project. |
| G. | Link the modules from the previous steps with the AMX Library and the C Library to create your AMX application load module. | Link the modules from the previous steps with the TAPS
Library (CJ302.LIB) to create your TAPS application executable
file. |
| H. | Using a debugger, load your application into your target hardware and then execute it. | Using the Visual C++ debugger, run your application executable.
Set breakpoints on functions cjksbreak() and
taps_notavail() if you want to trap these events.
Use the built-in TAPS version of KwikLook
to help you with your testing. |
Creating a TAPS Project using the Visual C++.NET IDE
It will be assumed that TAPS has been installed in directory
C:\TAPS302. It is assumed that your AMX User Parameter File is namedSAMPLSCF.UP. For purposes of illustration, a project namedSAMPLEwill be created in directoryC:\SAMPLE. Be sure to change all strings marked as blue text to match your particular TAPS installation directory and file names.
Step 1: Create a new Visual C++ Project
From the Visual C++.NET IDE, select the
File ==> New ==> Project...menu option and create a new Win32 Project. In the New Project dialog that appears, enter the properties as shown.
In the Win32 Application Wizard dialog that appears next, set the Application Settings to create a Console Application as an Empty Project.
Step 2: Set the project options
There are three options that must be set to compile a TAPS application correctly. From the main menu select the
Project ==> Propertiesmenu option to invoke the project's Property Pages dialog.Begin by adding the directory containing the TAPS header files to the list of include directories to be searched. In the C/C++ folder, select the General category and append the text
C:\TAPS302\DEFto the Additional Include Directories field. If you specify multiple include directories, each must be separated from its predecessors by a semicolon.
Next, the application must be set to use the Multi-threaded runtime library. This option is located in the Code Generation category of the C/C++ folder. The TAPS AMX Library was compiled for use with the Multi-threaded runtime library.
If you wish, you may compile your application with the Multi-threaded Debug runtime library. In this case, you must tell the linker to ignore the default runtime library requested by the TAPS AMX Library. To do so, go to the Linker folder, select the Input category and tell the linker to ignore the
LIBCMTlibrary.Additionally, in the Input category of the Linker folder, you must include the
WINMM.LIBlibrary in the link. This library is needed by the TAPS Application Interface Module. Unfortunately, the library is not automatically included when Visual C++ generates a project.
Step 3: Add the System Configuration Module to the Visual C++ Project
Step 3.1: Create the User Parameter File
Use the TAPS version of the AMX Configuration Manager to create your User Parameter File. Note that the TAPS version of the manager does not permit editing of an AMX Target Parameter File.
If you wish, you can use the Configuration Manager to generate the System Configuration Module. If you choose to do so, skip forward to Step 3.5. Be aware that the downside of this method is that every time you change your User Parameter File, you will have to remember to regenerate your System Configuration Module as well.
It is recommended that you follow Steps 3.2 through 3.5 so that your project will automatically regenerate and compile your System Configuration Module if your User Parameter File is edited.
Step 3.2: Add the User Parameter File to the Visual C++ Project
From the main menu, select the
Project ==> Add Existing Item...command to bring up the Add Existing Item dialog box. In this dialog box, select your User Parameter File (SAMPLSCF.UP). You may need to set the Files of type: selection to "All Files (*.*)" to make your User Parameter File visible in the file list.
Step 3.3: Set the Build Options for the User Parameter File
Go to the solution pane of your project and open the tree branch for your project..
Right click on the icon for your User Parameter File (
SAMPLSCF.UP) and select thePropertiescommand from the popup menu to bring up the file's Property Pages dialog box.
In the Property Pages dialog, go to the Configuration drop-down list box and select the "All Configurations" option.
Next, select the General category of the Custom Build Step folder and enter the following strings in the specified fields:
Command Line c:\taps302\cfgbldw\cj302cg.exe $(InputPath)
c:\taps302\cfgbldw\cj302cg.ct .\$(InputName).CDescription Generating $(InputName).COutputs .\$(InputName).C
Step 3.4: Generate the System Configuration Module
Go back to the TAPS project solution pane.
Right click on the icon for your User Parameter File (
SAMPLSCF.UP) and select the CompileSAMPLSCF.UPcommand from the popup menu to generate your System Configuration Module (SAMPLSCF.C).
Step 3.5: Add the System Configuration Module to the Project
From the main menu, select the
Project ==> Add Existing Item...command to bring up the Add Existing Item dialog box again. Select the newly generated System Configuration Module (SAMPLSCF.C).
Your Visual C++ project is now setup to generate and compile your System Configuration Module.
Step 4: Add the TAPS Application Interface Module
Copy the TAPS Application Interface Module (
C:\TAPS302\SAMPLE\CJ302AIF.C) to your TAPS project directory. If necessary, edit the file to provide the event and I/O simulation services required to meet the needs of your AMX application.Next, from the Visual Studio main menu, select the
Project ==> Add Existing Item...command to bring up the Add Existing Item dialog box. In this dialog box, select theCJ302AIF.Cmodule.
Step 5: Add your AMX Application Modules
From the main menu, select the
Project ==> Add Existing Item...command to bring up the Add Existing Item dialog box. In this dialog box, select all of the C and C++ files which make up your AMX application.
Step 6: Link with the TAPS AMX Library
From the main menu, select the
Project ==> Add Existing Item...command to bring up the Add Existing Item dialog box. In this dialog box, select theCJ302.LIBlibrary from theC:\TAPS302\LIBdirectory.
Debugging with KwikLook for TAPS
TAPS includes its own version of the KwikLook Fault Finder integrated with the Visual C++.NET IDE. KwikLook gives you quick fingertip access to everything controlled by AMX and its managers.
When TAPS is installed, it automatically integrates KwikLook with your Visual C++.NET IDE. When you open the Visual C++.NET IDE, you will find a new KADAK toolbar with a button which can be used to invoke KwikLook.
To use KwikLook, start your AMX application with the Microsoft debugger and begin debugging your system. When the debugger stops at a breakpoint, you can activate KwikLook by clicking its toolbar button.
Editing the Application Interface Module
The TAPS Application Interface Module,
CJ302AIF.C, contains fragments of code that can be modified to simulate external events and target hardware. There are two types of code: device I/O functions and error handlers.Device I/O functions are used to simulate access to hardware devices and to generate the events that would normally be caused by device interrupts.
Error handlers are procedures that are called by AMX when abnormal conditions are detected. By default, these functions provide basic error reporting. If you wish, you can modify them to provide more extensive error handling and/or recovery features.
TAPS API Functions
TAPS provides a number of functions to aid in hardware simulation and debugging.














