14–8
Chapter 14: Using Jam STAPL for ISP via an Embedded Processor
Software Development
■
Generic code that performs the Player’s internal functions (all other C files)
Figure 14–5 illustrates the organization of the source code files by function. Keeping
the platform-specific code inside the jbistub.c file simplifies the process of porting the
Jam STAPL Byte-Code Player to a particular processor.
Figure 14–5. Jam STAPL Byte-Code Player Source Code Structure
Jam STAPL Player
Error
Message
I/O Functions
(jbistub.c file)
TCK
TMS
TDI
.jbc
TDO
Main Program
Compare
and Export
Parse
Interpret
Porting the Jam STAPL Byte-Code Player
The default configuration of the jbistub.c file includes code for DOS, 32-bit Windows,
and UNIX so that the source code can be easily compiled and evaluated for the correct
functionality and debugging of these pre-defined operating systems. For the
embedded environment, this code is easily removed using a single preprocessor
#definestatement. In addition, porting the code involves making minor changes to
specific parts of the code in the jbistub.c file.
To port the Jam Player, you need to customize several functions in the jbistub.c file,
which are shown in Table 14–1.
Table 14–1. Functions Requiring Customization
Function
Description
jbi_jtag_io()
Interface to the four IEEE 1149.1 JTAG signals, TDI, TMS, TCK, and
TDO
jbi_export()
jbi_delay()
Passes information such as the User Electronic Signature (UES) back to
the calling program
Implements the programming pulses or delays needed during execution
jbi_vector_map() Processes signal-to-pin map for non-IEEE 1149.1 JTAG signals
jbi_vector_io() Asserts non-IEEE 1149.1 JTAG signals as defined in the VECTOR MAP
To ensure that you have customized all of the necessary code, follow these four steps:
1. Set preprocessor statements to exclude extraneous code.
2. Map JTAG signals to hardware pins.
3. Handle text messages from jbi_export().
4. Customize delay calibration.
MAX II Device Handbook
© October 2008 Altera Corporation