E HEWrn 96

Download as pdf or txt
Download as pdf or txt
You are on page 1of 151

Hitachi Embedded Workshop

Version 1.0
Release Note

HS6400EWIW1SE-RN990615
Rev. 1.0
June 15, 1999
Hitachi Company or Division

Rev. 1.0, 06/99, page 1 of 49


Contents

Section 1 Notes on Using the HEW ................................................................4


1.1 Notes on network drive issues ........................................................................................ 4
1.1.1 Time discrepancies between computers........................................................... 4
1.1.2 Building a project on a network drive ............................................................. 4
1.1.3 Adding a file to a project................................................................................... 4
1.2 Note on a race condition on accessing a file.................................................................. 4
1.3 Note on adding an file extension to a project................................................................ 5
1.4 Note on workspace name and project name ................................................................. 5
1.5 Notes on comments of the C/C++ language .................................................................. 5
1.5.1 Syntax coloring of the HEW editor .................................................................. 5
1.5.2 File dependencies scanned by the HEW .......................................................... 6
1.6 Note on navigation to a definition of a C function ....................................................... 6
1.7 Note on file extensions of C++ source file ..................................................................... 7
1.8 Note on use of a relative path on a option dialog box .................................................. 7
1.9 Scope of a control in the Tools Customize dialog box.................................................. 8
1.10 Scope of a control in the Tools Options dialog box ...................................................... 8
1.11 Note on the Format tab of the Tools Options dialog box............................................. 8
1.12 Supplement to the Build tab of the Tools Options dialog box..................................... 9
1.13 Note on opening a file which caused an error............................................................... 9
1.14 Note on tool uninstallation ............................................................................................. 10
1.15 Note on an old release of Windows® 95........................................................................ 10
1.16 Errata............................................................................................................................... 11
1.16.1 The Hitachi Embedded Workshop User’s Manual......................................... 11
1.16.2 Hitachi Embedded Workshop Project Generator User’s Manual ................ 11

Section 2 Supplement on Hitachi Toolchain………………………………..12


2.1 File Extensions................................................................................................................. 12
2.2 Correspondence between Dialog box Item and Option/Command ............................ 14
2.2.1 SuperH™ RISC engine C/C++ Compiler ........................................................ 14
2.2.2 SuperH™ RISC engine Assembler................................................................... 19
2.2.3 SuperH™ RISC engine OptLinker .................................................................. 21
2.2.4 H8S,H8/300 C/C++ Compiler ........................................................................... 24
2.2.5 H8S,H8/300 Assembler...................................................................................... 28
2.2.6 H8S,H8/300 OptLinker ..................................................................................... 31
2.2.7 H Series Librarian Option ................................................................................ 35
2.2.8 H Series Stype Converter .................................................................................. 36

Rev. 1.0, 06/99, page 2 of 49


Section 3 HIM to HEW Project Conveter…………………………………37
3.1 Invoking HimToHew.exe ................................................................................................37
3.2 Project conversion...........................................................................................................37
3.2.1 Single tab.............................................................................................................38
3.2.2 Multiple tab ........................................................................................................41
3.3 Exiting from HimToHew.exe .........................................................................................44
3.4 Restrictions on the conversion........................................................................................44

Rev. 1.0, 06/99, page 3 of 49


Section 1 Notes on Using the HEW
This section shows notes on using the Hitachi Embedded Workshop (HEW) Version 1.0.

1.1 Notes on network drive issues

1.1.1 Time discrepancies between computers

The time kept by a computer differs between computers. The time when a source file or an
output file is updated differs depending on a computer. It may happen that building a
project can be incorrect because of difference of times kept by computers if a source file or
a output file is shared via network. If such problem occurs, build a project using [Build->
Build All].

1.1.2 Building a project on a network drive

When you build a project on the network an error might occur depending on the conditioin
of the network. For example, a C/C++ compiler might output the following error message

3019(F) Cannot open source file

If such an error occurs, build the project again.

1.1.3 Adding a file to a project

When you add a file on a remote drive on the network via [Project-> Add Files…] or else,
the HEW might cause an application error depending on the condition of the network. In
this case, try to add the file to the project again. If application errors occur many times,
consider copying the file to a local drive then adding to the project.

1.2 Note on a race condition on accessing a file


Take care of accesses to a single file by multiple users if the file is shared via network or if
more than one instance of the HEW is invoked on a single computer. For example, if a
configuration of a project is build by more than one instance of the HEW, the generated
files can be incorrect.

Rev. 1.0, 06/99, page 4 of 49


1.3 Note on adding an file extension to a project
When you specify a file extension on the “File extension” field of the “Define File
Extension” dialog box, use only alphanumerics and an underscore as characters of a file
extension string. The “Define File Extension” dialog box will be launched when the
“Add…” button is clicked on the File Extensions dialog box which is launched via
[Project->File Extensions…].

1.4 Note on workspace name and project name


Use only alphanumerics and an underscore in a project/workspace name specified in the
“Name” field of the “New Project Workspace” dialog box or in a project name specified in
the “Name” field of the “Insert New Project” dialog box. Especially, do not use a minus
sign, a space, or Japanese characters

1.5 Notes on comments of the C/C++ language

1.5.1 Syntax coloring of the HEW editor

With the syntax coloring capability of the HEW, comments and keywords in a source
program file are colored. But the syntax coloring of the HEW editor does not work
correctly depending on the way the source code is written. Disable the syntax coloring if
you are not satisfied with the syntax coloring. To disable it, select [Tools->Options…],
uncheck “Enable Syntax Coloring” on the “Editor” tab of the “Tools Options” dialog box,
and click the OK button.

Syntax colouring does not work correctly in the following cases:

Case 1. A comment is nested.

e.g. /* /* */ */ <-the underlined part is colored as comment

Case 2. “/*” or “*/” is placed in a string.

e.g. char A[]=“\”/*”; <-the underlined part is colored as comment


char B[]=“*/”; <-the underlined part is colored as comment

e.g. /* <-the underlined part is colored as comment


char A[]=“*/”; <-the underlined part is colored as comment
*/

Try to avoid using the * characters and the / characters placed adjacent to each other in a
C/C++ source file unless you specify a comment.

Rev. 1.0, 06/99, page 5 of 49


1.5.2 File dependencies scanned by the HEW

The HEW scans an include file of a C/C++ source file to show dependencies of source files
on the “Projects” tab of the “Workspace” window and to decide whether to build a file or
not. Even though the source code is syntactically correct, it may happen that a scan error
is detected; that an include file which is not actually included might be shown as a
dependent file; or that an include file which is included might not be shown as a dependent
file. In these cases, (a) build all files by selecting [Build->Build All] or (b) select the source
file in the “Projects” tab of the “Workspace” window and select [Build->Build File].

Dependencies are not scanned correctly in the following cases:


Case 1. Preprocessor directive such as #if, #ifdef, or #define is used.

e.g. #if 0 <- the condition fails


#include “file.h” <- this file is scanned as include file incorrectly
#endif

e.g. #define ABC “inc.h”


#include ABC <- dependency scan error

Case 2. “/*” or “*/” is placed in a string.

e.g. char A[] = “/*”; <- assumed as beginning of comment incorrectly


#include “file.h” <- this file is not scanned as include file
char B[] = “*/”; <- assumed as end of comment incorrectly

1.6 Note on navigation to a definition of a C function


The HEW scans a definition of a C function in a C/C++ source file and display a tag of the
definition on the “Navigation” tab of the “Workspace” window so that double-clicking the
tag will navigate you to the line of the definition in a corresponding file. The HEW ignores
preprocessor directives when it searches a definition of a C function. For example, two
definitions of func() might be displayed on the “Navigation” tab of the “Workspace”
window in the following code.

#define DEF 1
#ifdef DEF
void func(void)
{
}
#else
int func(int a)
{
}

Rev. 1.0, 06/99, page 6 of 49


1.7 Note on file extensions of C++ source file
Basically, use cpp as a file extension of a C++ source file. You need to take care when you
add a new file extension to the C source file or C++ source file group via [Project-> File
Extensions…].

cpp is a standard extension for the C++ source file group in the HEW while cpp, cp, and
cc are standard extensions for C++ source file in the C/C++ compiler of the Hitachi
toolchain. If you add cp or cc as a file extension to a file group, the file group must be the
C++ source file group. If cp or cc were added to the C source file group, a file with a file
extension of cp or cc would be compiled as a C++ source file instead of as a C source file. If
you specify the “–lang=c” option in the “User defined options” field of the “Other” tab of
an option dialog box of the C/C++ compiler, a file will be compiled as a C source file
regardless of its file extension.

If you add an extension other than cpp, cp, or cc to the C++ source file group, the HEW
regards a file with such an extension as C source file. For example, if cxx were added to the
C++ source file group, a file with the extension would be compiled as a C source file. If you
specify the “–lang=cpp” option in the “User defined options” field of the “Other” tab of an
option dialog box of a C/C++ compiler, a file will be compiled as a C++ source file
regardless of its file extension.

1.8 Note on use of a relative path on a option dialog box


Using the [Options] menu of the HEW, you can launch an option dialog box on which you
can specify options to a tool such as a compiler. Do NOT specify a relative path when you
specify a path on an option dialog box. Especially, when “Custom directory” is selected in
the “Relative to” field on a dialog box as shown in figure 1.8.1, do specify an absolute path
in the “Directory” field.

Figure 1.8.1 Dialog Box to Specify a Directory Path

Rev. 1.0, 06/99, page 7 of 49


1.9 Scope of a control in the Tools Customize dialog box
Scope of each control of each tab of the “Tools Customize” dialog box, which is launched
via [Tools-> Customize…], differs. Table 1.9.1 below shows the scope of each control on
each tab of the dialog box.

Table 1.9.1 Scope of a control in the Tools Customize dialog box

Tab Control Scope


Toolbar All The whole system
Command All The whole system
Menu All Each project
Debugger HDI location Each workspace
Session file Each project
Download module Each project
Log All Each workspace
Help All Each workspace

1.10 Scope of a control in the Tools Options dialog box


Scope of each control of each tab of the “Tools Options” dialog box, which is launched via
[Tools -> Options…], differs. Table 1.10.1 below shows the scope of each control on each
tab of the dialog box.

Table 1.10.1 Scope of a control in the Tools Options dialog box

Tab Control Scope


Build All The whole system
Editor All The whole system
Format Text categories: Each project
Colors: Each project
Text: The whole system
Workspace All The whole system

1.11 Note on the Format tab of the Tools Options dialog box
This is a note on the “Define Keywords” dialog box, which is launched when the “Add…”
button or the “Keywords…” button is clicked on the “Format” tab of the “Tools Options”
dialog box launched via [Tools->Options…]. On the “Keyword” field of the “Add
Keyword” dialog box launched by clicking the “Add…” button on the “Define Keywords”

Rev. 1.0, 06/99, page 8 of 49


dialog box, specify a keyword which consists of only alphanumerics, an underscore, and the
# character. Especially, do not use Japanese characters and other characters in a keyword.

1.12 Supplement to the Build tab of the Tools Options dialog box
This is a note on the “Stop build if no. of errors exceed” controls on the “Build” tab of the
“Tools Options” dialog box launched via [Tools-> Options…]. Note the following
descriptions when you check the check box and specify a number to the controls.

(1) “Stop build if no. of errors exceed” is not applied to a custom phase defined by a user.
This is applied only to system phases such as the C/C++ Compiler, the Assembler, the
IM OptLinker and the Stype Converter supplied from Hitachi.

(2) “no. of errors” in the statement means the number of errors output from an execution
of a tool. The total number of errors in more than one execution of a tool is irrelevant
to “Stop build if no. of errors exceed”. For example, the build stops when one execution
of the C/C++ Compiler outputs more than the number specified. If the number of
errors output from each compilation is no more than the specified number, the build
does not stop even though the total number of errors in more than one compilation
exceeds the specified number.

(3) The build stops after the whole phase is done. For example, suppose you compile more
than one file in a build. Even though the number of errors in the first compilation
exceeds the specified number, the HEW continues compilation of the other files and
stops the build after finishing the whole compiler phase.

(4) When the number of errors in one execution of a tool exceeds the specified number, the
number of error messages displayed on the “Output” window is the specified number
plus one. A message saying that the number of error has exceeded the specified
number is NOT displayed on the “Output” window.

The same things as “Stop build if no. of errors exceed” shown above hold also in “Stop
build if no. of warnings exceed”. There is no correlation between “Stop build if no. of
errors exceed” and “Stop build if no. of warnings exceed”. They are independent.

1.13 Note on opening a file which caused an error


This is a note when you double click an error/warning message of the C/C++ Compiler or
the Assembler on the “Output” window and open the corresponding line of the
corresponding file. If the corresponding file window, however, has been minimized in the
editor window area, the file is not opened on double clicking the error/warning message. In
this case, restore the file window or maximize it.

Rev. 1.0, 06/99, page 9 of 49


1.14 Note on tool uninstallation
If a file or a subdirectory which has not been installed exists in a directory to be uninstalled
by TUninst.EXE, it displays an error message shown in figure 1.14.1. In this case, click the
“Ignore” button and delete the file or subdirectory and the directory later.

Figure 1.14.1 Error Message from TUninst.EXE

1.15 Note on an old release of Windows® 95


If you use an old release of Windows® 95 (e.g. 4.00.950a), an application error occurs or an
option dialog will be corrupted as shown in figure 1.15.1 on your opening an option window
of the C/C++ Compiler, the Assembler, the IM OptLinker or the Stype Converter. This
problem occurs if COMCTL32.DLL in the System directory in the Windows directory is
out of date. To avoid this problem, upgrade Windows® 95.

Figure 1.15.1 Corrupted Option Window of the C/C++ Compiler

Rev. 1.0, 06/99, page 10 of 49


1.16 Errata

1.16.1 The Hitachi Embedded Workshop User’s Manual

Table 1.16.1 shows the errata of the Hitachi Embedded Workshop User’s Manual.

Table 1.16.1 Errata of Hitachi Embedded Workshop User’s Manual

Page Changed part Change


All the title Icon of the HEW on the HEW title The icon is changed from to .
bar of bar
HEW
98 Uninstalling Components Change “ToolUninstaller.EXE” to
“TUninst.EXE”.
110 Figure 6.10 Workspace Properties Add a title, “Workspace Properties”, to
Dialog the title bar.

1.16.2 Hitachi Embedded Workshop Project Generator User’s Manual

Table 1.16.2 shows the errata of the Hitachi Embedded Workshop Project Generator
User’s Manual.

Table 1.16.2 Errata of Hitachi Embedded Workshop Project Generator User’s Manual

Page Changed part Change


All the title Icon of the HEW on the HEW title The icon is changed from to .
bar of bar
HEW

Rev. 1.0, 06/99, page 11 of 49


Section 2 Supplement on Hitachi Toolchain

2.1 File Extensions


Table 2.1.1 shows the standard file extensions used in the Hitachi toolchains.

Table 2.1.1 Standard File Extensions of the Hitachi Toolchains

File File group Remark


extension
C C source file
H C header file
LST C list file
P Preprocessed C source file
CPP C++ source file
HPP C++ header file
LPP C++ list file
PP Preprocessed C++ source file
SRC Assembly source file
MAR Assembly source file Only in H8S,H8/300
INC Assembly include file
LIS Assembly list file
EXP Expanded assembly source file
FSY Linkage symbol file
OBJ Object file
LIB Library file
ABS Absolute file
REL Relocatable file
MAP Linkage map file
CPU CPU information file
LOP Optimized linkage list file
LSL Library list file
SCT Library section list file
MOT S-Record file

Rev. 1.0, 06/99, page 12 of 49


When the HEW executes a tool of the Hitachi toolchains in a build, the HEW leaves a
subcommand file in a configuration directory. A subcommand file of the C/C++ Compiler
or the Assembler uses a file extension shown in table 2.1.2 with the same filename as the
input file. the IM OptLinker, the Librarian or the Stype Converter uses a file extension
shown in table 2.1.2 with a project name as a filename. The subcommand file has an
attribute of a hidden file. If you want to see a hidden file, change the properties of a
directory window so that it can display hidden files.

Table 2.1.2 File Extensions of Subcommand Files of the Hitachi Toolchains

File File group Remark


extension
SHC Hitachi SuperH RISC engine C/C++ Compiler
SHA Hitachi SuperH RISC engine Assembler
SHL Hitachi SuperH RISC engine IM OptLinker
H8C Hitachi H8S,H8/300 C/C++ Compiler
H8A Hitachi H8S,H8/300 Assembler
H8L Hitachi H8S,H8/300 IM OptLinker
HLB Hitachi H Series Librarian
HCV Hitachi H Series Stype Converter

Rev. 1.0, 06/99, page 13 of 49


2.2 Correspondence between Dialog box Item and Option/Command
In this section, correspondence between an item on an option dialog box and an option or a
command of a tool will be described.

2.2.1 SuperH™ RISC engine C/C++ Compiler

Table 2.2.1 SuperH™ RISC engine C/C++ Compiler Option Dialog Box

tab item on dialog corresponding option


Source Show entries for:
Include file directories include = <directory>,…
Source Show entries for:
Preinclude files preinclude = <file>,…
Source Show entries for:
Defines define =
<macro name>=<name>
| <macro name>=<number>
| <macro name>
Object Output file type: code =
Machine code (*.obj) machinecode
Assembly source code (*.src) | asmcode
Preprocessed source file (*.p/*.pp) preprocessor
Object Generate debug information
(uncheched) nodebug
(checked) debug
Object Section: section =
Program section (P) program = <section name>
Const section (C) | const = <section name>
Data section (D) | data = <section name>
Uninitialized data section (B) | bss = <section name>
Object Store string data in: string =
Const section const
Date section | data
Object Use 16 bit short address abs16 =
Run run
All | all
None (without abs16 option)
Object Output directory: objectfile = <file>
preprocessor = <file>

Rev. 1.0, 06/99, page 14 of 49


Table 2.2.1 SuperH™ RISC engine C/C++ Compiler Option Dialog Box (cont)

tab item on dialog corresponding option


List Generate list file
(unchecked) nolistfile
(checked) listfile
List Contents: show =
Object list object | noobject
Statistics | statistics | nostatistics
Allocation information | source | nosource
Source code listing | include | noinclude
After preprocessor expansion | expansion | noexpansion
Optimize Optimization optimize =
(unchecked) 0
(checked) |1
Optimize Speed or size:
Optimize for speed speed
Optimize for size size
Optimize for both speed and size nospeed
Optimize Generate file for inter-module optimization
(unchecked) (without goptimize option)
(checked) goptimize
Optimize Inline function nesting
(unchecked) (without nestinline option)
(checked) nestinline
Nest level: = <number>
Optimize Automatic inline expansion
(unchecked) noinline
(checked) inline
Maximum: = <number>
Optimize Switch statement: case =
If then ifthen
Table | table
Auto (without case option)

Rev. 1.0, 06/99, page 15 of 49


Table 2.2.1 SuperH™ RISC engine C/C++ Compiler Option Dialog Box (cont)

tab item on dialog corresponding option


Other Check against EC++ language specification
(Misc.) (unchecked) (without ecpp option)
(checked) ecpp
Other Allow comment nest comment =
(Misc.) (unchecked) nonest
(checked) | nest
Other Display information level message
(Misc.) (unchecked) nomessage
(checked) message
Other Generate browser information
(Misc.) (unchecked) (without browser option)
(checked) browser
Other Callee save/restores MACH and MACL registers if
(Misc.) used macsave =
(unchecked) 0
(checked) |1
Other Pack struct, union and class pack =
(Misc.) (unchecked) 2
(checked) |1
Other Align labels after unconditional branches 16 byte
(Misc.) boundaries
(unchecked) noalign16
(checked) aligh16
Other Expand return value to 4 byte
(Misc.) (unchecked) nortnext
(checked) rtnext
Other Loop unrolling
(Misc.) (unchecked) noloop
(checked) loop
Other User defined options: N/A

Rev. 1.0, 06/99, page 16 of 49


Table 2.2.1 SuperH™ RISC engine C/C++ Compiler Option Dialog Box (cont)

tab item on dialog corresponding option


CPU CPU: cpu =
SH-1 sh1
SH-2 | sh2
SH-2E | sh2e
SH-3 | sh3
SH-3E | sh3e
SH-4 | sh4
CPU Division: division =
CPU cpu
Peripheral with interrupt mask | peripheral
Peripheral without interrupt mask | nomask
CPU Endian: endian =
Big big
Little | little
CPU FPU: fpu =
Single single
Double | double
Mix (without fpu option)
CPU Round to: round =
Zero zero
Nearest | nearest
CPU Denormalized number allowed as a result denormalization =
(unchecked) off
(checked) | on
CPU Position independent code (PIC) pic =
(unchecked) 0
(checked) |1
CPU Treat double as float
(unchecked) (without double option)
(checked) double = float

Rev. 1.0, 06/99, page 17 of 49


NOTE
(1) You cannot change the file name of an object file, an assembly source file or a
preprocessed C/C++ source file. You can change only the directory path.

(2) The list file will always be output into the configuration directory.

(3) In the “User defined options” edit box, you can specify options in the command line
format. Begin each option with a minus character like “-euc”. Specify one option per
line. In the “User defined options” edit box, specify only options which is not supported
on the option dialog box. Otherwise, do not use this box.

(4) The following options are not supported on the option window.
–sjis
–euc
–outcode=euc|sjis
–lang=c|cpp
–show=width=<number>,length=<number>
–help
–subcommand

(5) If you need to specify any of –euc, -sjis, or outcode=euc|sjis, specify it in the “User
defined options” edit box on the “Other” tab. (e.g. –euc)

(6) The compiler will choose one from C and C++ by looking at the file extension of an
input file. So the –lang=c|cpp option will not be output by the HEW.

(7) You cannot specify –show=width=<number>,length=<number> on the “List” tab. If


you specify the –show option on the “User defined options” edit box of the “Other” tab,
settings in the “Contents:” group of the “List” tab will be nullified.

Rev. 1.0, 06/99, page 18 of 49


2.2.2 SuperH™ RISC engine Assembler

Table 2.2.2 SuperH™ RISC engine Assembler Option Dialog Box

tab item on dialog corresponding option


Source Show entries for:
Include file directories include =
<directory>[,<directory>]…
Source Show entries for:
Defines define = <sysmbol>=”string”
[,<symbol>=”string”]…
Source Show entries for:
Preprocessor variables assigna =
<variable>=<number>
[,<variable>=<number>]…
assignc = < variable >=”string”
[,< variable>=”string”]…
Object Debug information:
Default (without debug/nodebug option)
With debug information debug
Without debug information nodebug
Object Generate assembly source file after preprocess
(unchecked) (without expand option)
(checked) expand = <file>
Object Output file directory: object = <file>
List Generate list file
(unchecked) nolist
(checked) list
List Contents:
Source program: [no]source
Conditionals: [no]show = conditionals
Definitions: | definitions
Calls: | calls
Expansions: | expansions
Code: | code
Cross reference: [no]cross_reference
Section: [no]section
Other Automatically generate literal pool for immediate
(Misc.) value
(unchecked) (without auto_literal option)
(checked) auto_literal
Other User defined options: N/A

Rev. 1.0, 06/99, page 19 of 49


Table 2.2.2 SuperH™ RISC engine Assembler Option Dialog Box (cont)

tab item on dialog corresponding option


CPU CPU: cpu =
SH-1 sh1
SH-2 | sh2
SH-2E | sh2e
SH-DSP | shdsp
SH-3 | sh3
SH-3E | sh3e
SH-3DSP | sh3dsp
SH-4 | sh4
CPU Endian: endian =
Big big
Little | little
Default (without endian option)
CPU Round to: round =
Nearest nearest
Zero | zero
Default (without round option)
CPU Denormalized number allowed as a result: denormalization =
ON on
OFF | off
Default (without denormalization option)
NOTE
(1) You cannot change the file name of an object file, or a preprocessed assembly
source file. You can change only the directory path.

(2) The list file will always be output into the configuration directory.

(3) In the “User defined options” edit box, you can specify options in the command line
format. Begin each option with a minus character like “-euc”. Specify one option per
line. In the “User defined options” edit box, specify only options which is not supported
on the option dialog box. Otherwise, do not use this box.

(4) The following options are not supported on the option window.
–lines
–columns
–sjis
–euc
–outcode=euc|sjis
–abort=warning|error
–subcommand

(5) If you need to specify any of –lines, -columns, –euc, -sjis or outcode=euc|sjis,
specify it in the “User defined options” edit box on the “Other” tab. (e.g. –euc)

Rev. 1.0, 06/99, page 20 of 49


2.2.3 SuperH™ RISC engine OptLinker

Table 2.3 SuperH™ RISC engine OptLinker Option Dialog Box

tab item on dialog corresponding option


Input Input files:
Relocatable files and object files input <file>
Input Input files:
Library files library <file>
Input Defines: define <symbol> ( <number>
| <address>
| <symbol> )
Input Use entry point: entry <symbol>
Output Format of load module:
ELF elf
SYSROF sysrof
SYSROFPLUS sysrofplus
Output Type of load module: form
Absolute a
Relocatable r
Output Debug information:
None nodebug
In output load module debug
In separate load module (*.dbg) sdebug
Output ROM to RAM mapped sections: rom ( <section1>, <section2> )
Output Generate map file
(unchecked) noprint
(checked) print
Output Load module directory: output

Rev. 1.0, 06/99, page 21 of 49


Table 2.2.3 SuperH™ RISC engine OptLinker Option Dialog Box (cont)

tab item on dialog corresponding option


Optimize Optimize:
All optimize
Speed speed
Safe safe
Custom
Unify strings string_unify
Eliminate dead code symbol_delete
Reallocate registers register
Eliminate same code same_code
Optimize branches branch
None nooptimize
Optimize Eliminated size: samesize <size>
Optimize Output information
(unchecked) (without information command)
(checked) information
Optimize Forbid item:
Elimination of dead code symbol_forbid = <symbol>
[,<symbol>]…
Elimination of same code samecode_forbid =
<function name>
[,<function name>]…
Section Relocatable section start address: start
Section Generate external symbol file: fsymbol <section>[,<section>]…
Verify CPU information check:
No check (without cpu command)
Check cpu
CPU information: <automatically generated
CPU information file>
Use CPU information file cpu
CPU information file path: <user defined CPU
information file>
Verify Stop linkage on CPU information warning
(unchecked) (without cpucheck command)
(checked) cpucheck

Rev. 1.0, 06/99, page 22 of 49


Table 2.2.3 SuperH™ RISC engine OptLinker Option Dialog Box (cont)

tab item on dialog corresponding option


Other Exclude unreferenced external symbol
(Misc.) (unchecked) noexclude
(checked) exclude
Other Align section
(Misc.) (unchecked) (without align_section command)
(checked) align_section
Other Check for undefined symbols
(Misc.) (unchecked) (without udfcheck command)
(checked) udfcheck
Other Check for unlinked sections
(Misc.) (unchecked) (without check_section command)
(checked) check_section
Other User defined options: N/A
Subcommand Subcommand file path subcommand <file>
NOTE
(1) You cannot change the file name of an absolute file (*.abs), or a relocatable file
(*.rel). You can change only the directory path.

(2) A map file (*.map). a linkage symbol file (external symbol file) (*.fsy) or an
optimized linkage list file (*.lop) will always be output into the configuration directory.

(3) In the “User defined options” edit box, you can specify options in the subcommand
file format. In the “User defined options” edit box, specify only options which is not
supported on the option dialog box. Otherwise, do not use this box.

(4) The following options are not supported on the option window.
directory
udf | noudf
exchange
rename
delete
exit
echo | noecho

Rev. 1.0, 06/99, page 23 of 49


2.2.4 H8S,H8/300 C/C++ Compiler

Table 2.2.4 H8S,H8/300 C/C++ Compiler Option Dialog Box

tab item on dialog corresponding option


Source Show entries for:
Include file directories include = <directory>,…
Source Show entries for:
Preinclude files preinclude = <file>,…
Source Show entries for:
Defines define =
<macro name>=<name>
| <macro name>=<number>
| <macro name>
Source Show entries for:
Messages
Display information level messages message
nomessage
[ =<error number>
[-<error number],…]
Object Output file type: code =
Machine code (*.obj) machinecode
Assembly source code (*.src) | asmcode
Preprocessed source file (*.p/*.pp) preprocessor
Object Generate debug information
(uncheched) nodebug
(checked) debug
Object Section: section =
Program section (P) program = <section name>
Const section (C) | const = <section name>
Data section (D) | data = <section name>
Uninitialized data section (B) | bss = <section name>
Object Store string data in: string =
Const section const
Date section | data
Object Mul/Div operation specification
Based on ANSI(Guarantee 16bit as result of nocpuexpand
16bit*16bit)
Non ANSI(Guarantee 32bit as a result of cpuexpand
16bit*16bit)
Object Output directory: object = <file>
preprocessor = <file>

Rev. 1.0, 06/99, page 24 of 49


Table 2.2.4 H8S,H8/300 C/C++ Compiler Option Dialog Box (cont)

tab item on dialog corresponding option


List Generate list file
(unchecked) nolist
(checked) list
List Contents: show =
Object list object | noobject
Statistics | statistics | nostatistics
Allocation information | allocation | noallocation
Source code listing | source | nosource
After preprocessor expansion | expansion | noexpansion
Optimize Optimization optimize =
(unchecked) 0
(checked) |1
Optimize Speed or size:
Size oriented optimization (without speed option)
Speed oriented optimization speed
Speed sub-options: [=
Register register
Shift to multiple | shift
Loop optimization | loop
Switch judgement | switch
Struct assignment | struct
Expression | expression
Maximum nodes of inline function: | inline = <number>]
Optimize Generate file for inter-module optimization
(unchecked) (without goptimize option)
(checked) goptimize
Optimize Switch statement: case =
Auto auto
If then | ifthen
Table | table
Optimize Function call:
@aa (without indirect option)
@@aa:8 indirect
Optimize Data access:
@aa (without abs8/abs16 option)
@aa:8 abs8
@aa:16 abs16

Rev. 1.0, 06/99, page 25 of 49


Table 2.2.4 H8S,H8/300 C/C++ Compiler Option Dialog Box (cont)

tab item on dialog corresponding option


Other Allow comment nest
(Misc.) (unchecked) (without comment option)
(checked) comment
Other Check against EC++ language specification
(Misc.) (unchecked) (without ecpp option)
(checked) ecpp
Other Generate browser information
(Misc.) (unchecked) (without browser option)
(checked) browser
Other Interrupt handler saves/restores MACH and MACL
(Misc.) registers if used
(unchecked) (without macsave option)
(checked) macsave
Other Pack struct, union and class pack =
(Misc.) (unchecked) 2
(checked) |1
Other Avoid optimizing external symbols treating them
(Misc.) as volatile
(unchecked) novolatile
(checked) volatile
Other Treat enum as char if it is in the range of char
(Misc.) (unchecked) (without byteenum option)
(checked) byteenum
Other Increase a register for register variable
(Misc.) (unchecked) noregexpansion
(checked) regexpansion
Other Put common subexpression on a register
(Misc.) temporarily (without cmncode option)
(unchecked) cmncode
(checked)
Other Use EEPMOV in block copy
(Misc.) (unchecked) (without eepmov option)
(checked) eepmov
Other User defined options: N/A

Rev. 1.0, 06/99, page 26 of 49


Table 2.2.4 H8S,H8/300 C/C++ Compiler Option Dialog Box (cont)

tab item on dialog corresponding option


CPU CPU:, Operating mode:, Address space: cpu =
2600n
| 2600a[:20|:24|:28|:32]
| 2000n
| 2000a[:20|:24|:28|:32]
| 300hn
| 300ha[:20|:24]
| 300
| 300l
CPU Change number of parameter registers from regparam=
2(default) to 3
(unchecked) 2
(checked) |3
NOTE
(1) You cannot change the file name of an object file, an assembly source file or a
preprocessed C/C++ source file. You can change only the directory path.

(2) The list file will always be output into the configuration directory.

(3) In the “User defined options” edit box, you can specify options in the command line
format. Begin each option with a minus character like “-euc”. Specify one option per
line. In the “User defined options” edit box, specify only options which is not supported
on the option dialog box. Otherwise, do not use this box.

(4) The following options are not supported on the option window.
–sjis
–euc
–outcode=euc|sjis
–lang=c|cpp
–show=width=<number>,length=<number>
–chgincpath
–subcommand

(5) If you need to specify any of –euc, -sjis, -latin1 or outcode=euc|sjis, specify it in the
“User defined options” edit box on the “Other” tab. (e.g. –euc)

(6) The compiler will choose one from C and C++ by looking at the file extension of an
input file. So the –lang=c|cpp option will not be output by the HEW.

(7) You cannot specify –show=width=<number>,length=<number> on the “List” tab. If


you specify the –show option on the “User defined options” edit box of the “Other” tab,
settings in the “Contents:” group of the “List” tab will be nullified.

(8) The –chgincpath option is always added by the HEW implicitly.

Rev. 1.0, 06/99, page 27 of 49


2.2.5 H8S,H8/300 Assembler

Table 2.2.5 H8S,H8/300 Assembler Option Dialog Box

tab item on dialog corresponding option


Source Show entries for:
Include file directories include =
<directory>[,<directory>]…
Source Show entries for:
Defines define = <sysmbol>=”string”
[,<symbol>=”string”]…
Source Show entries for:
Preprocessor variables assigna =
<variable>=<number>
[,<variable>=<number>]…
assignc = < variable >=”string”
[,< variable>=”string”]…
Object Debug information:
Default (without debug/nodebug option)
With debug information debug
Without debug information nodebug
Object Generate assembly source file after preprocess
(unchecked) (without expand option)
(checked) expand = <file>
Object Optimize
(unchecked) nooptimize
(checked) optimize
Object Default of branch displacement size: br_relative =
(unchecked) 8
(checked) | 16
Object Generate file for inter-module optimization
(unchecked) (without goptimize option)
(checked) goptimize
Object Output file directory: object = <file>

Rev. 1.0, 06/99, page 28 of 49


Table 2.2.5 H8S,H8/300 Assembler Option Dialog Box (cont)

tab item on dialog corresponding option


List Generate list file
(unchecked) nolist
(checked) list
List Contents:
Source program: [no]source
Conditionals: [no]show = conditionals
Definitions: | definitions
Calls: | calls
Expansions: | expansions
Structured: | structured
Code: | code
Cross reference: [no]cross_reference
Section: [no]section
Tuning Option to set:
@aa:8
Specify all symbols abs8
(Specify symbols in the list) abs8=<symbol>[,<symbol>…]
@aa:16
Specify all symbols abs16
(Specify symbols in the list) abs16=<symbol>[,<symbol>…]
Other Remove unreferenced external symbols
(Misc.) (unchecked) exclude
(checked) noexclude
Other User defined options: N/A
CPU CPU:, Operating mode:, Address space: cpu =
2600n
| 2600a[:20|:24|:28|:32]
| 2000n
| 2000a[:20|:24|:28|:32]
| 300hn
| 300ha[:20|:24]
| 300
| 300l

Rev. 1.0, 06/99, page 29 of 49


NOTE
(1) You cannot change the file name of an object file, or a preprocessed assembly
source file. You can change only the directory path.

(2) The list file will always be output into the configuration directory.

(3) In the “User defined options” edit box, you can specify options in the command line
format. Begin each option with a minus character like “-euc”. Specify one option per
line. In the “User defined options” edit box, specify only options which is not supported
on the option dialog box. Otherwise, do not use this box.

(4) The following options are not supported on the option window.
–lines
–columns
–sjis
–euc
–latin1
–outcode=euc|sjis
–abort
–subcommand

(5) If you need to specify any of –lines, -columns, –euc, -sjis, -latin1 or
outcode=euc|sjis, specify it in the “User defined options” edit box on the “Other” tab.
(e.g. –euc)

Rev. 1.0, 06/99, page 30 of 49


2.2.6 H8S,H8/300 OptLinker

Table 2.2.6 H8S,H8/300 OptLinker Option Dialog Box

tab item on dialog corresponding option


Input Input files:
Relocatable files and object files input <file>
Input Input files:
Library files library <file>
Input Defines: define <symbol> ( <number>
| <address>
| <symbol> )
Input Use entry point: entry <symbol>
Output Format of load module:
ELF elf
SYSROF sysrof
SYSROFPLUS sysrofplus
Output Type of load module: form
Absolute a
Relocatable r
Output Debug information:
None nodebug
In output load module debug
In separate load module (*.dbg) sdebug
Output ROM to RAM mapped sections: rom ( <section1>, <section2> )
Output Generate map file
(unchecked) noprint
(checked) print
Output Load module directory: output

Rev. 1.0, 06/99, page 31 of 49


Table 2.2.6 H8S,H8/300 OptLinker Option Dialog Box (cont)

tab item on dialog corresponding option


Optimize Optimize:
All optimize
Speed speed
Safe safe
Custom
Unify strings string_unify
Eliminate dead code symbol_delete
Use short addressing variable_access
Reallocate registers register
Eliminate same code same_code
Use indirect call/jump function_call
Optimize branches branch
None nooptimize
Optimize Eliminated size: samesize
Optimize Output information
(unchecked) (without information command)
(checked) information
Optimize Generate optimize list
(unchecked) (without mlist command)
(checked) mlist
Optimize Contents: show
Symbol symbol
Reference | reference
Optimize Forbid item:
Elimination of dead code symbol_forbid = <symbol>
[,<symbol>]…
Elimination of same code samecode_forbid =
<function name>
[,<function name>]…
Use of short addressing to variable_forbid = <variable>
[,<variable>]…
Use of indirect call/jump to function_forbid = <function name>
[,<function name>]…
Memory allocation in absolute_forbid =
<address>[+<size>]
[,<address>[+<size>]]…

Rev. 1.0, 06/99, page 32 of 49


Table 2.2.6 H8S,H8/300 OptLinker Option Dialog Box (cont)

tab item on dialog corresponding option


Section Relocatable section start address: start
Section Generate external symbol file: fsymbol <section>[,<section>]…
Verify CPU information check:
No check (without cpu command)
Check cpu
CPU information: <automatically generated
CPU information file>
Use CPU information file cpu
CPU information file path: <user defined CPU
information file>
Verify Stop linkage on CPU information warning
(unchecked) (without cpucheck command)
(checked) cpucheck
Other Exclude unreferenced external symbol
(Misc.) (unchecked) noexclude
(checked) exclude
Other Align section
(Misc.) (unchecked) (without align_section command)
(checked) align_section
Other Check for undefined symbols
(Misc.) (unchecked) (without udfcheck command)
(checked) udfcheck
Other Check for unlinked sections
(Misc.) (unchecked) (without check_section command)
(checked) check_section
Other User defined options: N/A
Subcommand Subcommand file path subcommand <file>

Rev. 1.0, 06/99, page 33 of 49


NOTE
You cannot change the file name of an absolute file (*.abs), or a relocatable file (*.rel).
You can change only the directory path.

A map file (*.map). a linkage symbol file (external symbol file) (*.fsy) or an optimized
linkage list file (*.lop) will always be output into the configuration directory.

In the “User defined options” edit box, you can specify options in the subcommand file
format. In the “User defined options” edit box, specify only options which is not
supported on the option dialog box. Otherwise, do not use this box.

The following options are not supported on the option window.


directory
udf | noudf
exchange
rename
delete
exit
echo | noecho

Rev. 1.0, 06/99, page 34 of 49


2.2.7 H Series Librarian Option

Table 2.2.7 H Series Librarian Option Dialog Box

tab item on dialog corresponding option


Output Library attribute:
User library (u)
System library | (s)
Output Library file output directory: create <file>
Output Generate list file
(unchecked) (without list command)
(checked) list
Output Show external symbol
(unchecked) (without (s) option)
(checked) (s)
Output Generate section list
(unchecked) (without slist command)
(checked) slist
Subcommand Subcommand file path subcommand <file>
NOTE
The following options are not supported on the option window.
directory
add
replace
delete
extract
rename
end
exit
abort

add, replace, delete, extract and rename command are available in Hitachi H Series
Librarian Interface.

Rev. 1.0, 06/99, page 35 of 49


2.2.8 H Series Stype Converter

Table 2.2.8 H Series Stype Converter Option Dialog Box

tab item on dialog corresponding option


Output Data record header record
Output Always output S9 record at the end
(unchecked) (without s9 option)
(checked) s9
Output Divide S type file
S type file output directory: <file>
Divided S type files: <file>[,<file>] …

Rev. 1.0, 06/99, page 36 of 49


Section 3 HIM to HEW Project Conveter
In this section, how to convert a project of the Hitachi Integration Manager (HIM) into a
workspace and a project of the HEW using HimToHew.exe is described.

3.1 Invoking HimToHew.exe


You have two ways in invoking the HIM to HEW Project Converter, HimToHew.exe.

(1) Open the “Start” menu of Windows®, select “Program”, select “Hitachi Embedded
Workshop” and select “HIM to HEW Project Converter”.

(2) Double click HimToHew.exe which is installed in the same directory as HEW.EXE.

3.2 Project conversion


HimToHew.exe has two tabs, “Single” and “Multiple”. Select the “Single” tab (figure
3.2.1.1) to convert one HIM project into a HEW workspace and a HEW project. Usually,
choose the “Single” tab. But if you want to convert more than one project under a
directory into HEW projects and put them in a HEW workspace, select the “Multiple” tab
(figure 3.2.2.1). Especially, if you want to convert HIM projects of HIOS into a HEW
workspace and projects, choose the “Multiple” tab.

Rev. 1.0, 06/99, page 37 of 49


3.2.1 Single tab

This section will describe how to convert a single HIM project into a HEW workspace and
a HEW project using the “Single” tab (figure 3.2.1.1)

Figure 3.2.1.1 HIM to HEW Project Converter, Single Tab

(1) In the “HIM Project filename” field, specify a path of a HIM project database file,
whose file extension is “*.him”. You have two ways to specify the path. One is to type
the path manually into the “HIM Project filename” field. The other is to use the
“Browse…” button. When you click the “Browse…” button, the “Select project
filename” dialog box (figure 3.2.1.2) will be displayed. Open the directory in which a
HIM project database file exists, and double click the project database file or select the
file and click the “Select” button.

Rev. 1.0, 06/99, page 38 of 49


Figure 3.2.1.2 “Select project name” Dialog Box

(2) In the “HEW workspace name” field on the “Single” tab, specify a workspace name.
Use only alphanumerics or an underscore (‘_’) in a workspace name.

(3) Click the “Convert” button, then conversion will start. The “Total complete” meter
shows the progress of the conversion. When the conversion finishes, “Project converted
successfully” will be shown in the “Results” field (figure 3.2.1.3).

Rev. 1.0, 06/99, page 39 of 49


Figure 3.2.13 HIM to HEW Project Converter, Single Tab (After Conversion)

HimToHew.exe will create a HEW workspace file whose directory path is the same as the
file specified in the “HEW Project filename” field, whose file name is the name specified in
the “HEW workspace name” field, and whose file extension is “*.hws”. Also
HimToHew.exe creates a HEW project database file which has the same file path as the
HIM project database file except that the extension is changed from “*.him” to “*.hws”.

Rev. 1.0, 06/99, page 40 of 49


3.2.2 Multiple tab

This section will describe how to use the “Multiple” tab (figure 3.2.2.1). Using the
“Multiple” tab, you can convert multiple HIM projects in a directory and in its
subdirectories into HEW projects at a time and register them into a HEW workspace.

Figure 3.2.2.1 HIM to HEW Project Converter, Multiple Tab

(1) In the “Workspace directory” field, specify a directory path under which one or more
HIM project database files (“*.him”) exist. When you choose the directory, note that all
the HIM project database files in this directory and its subdirectories will be converted
at a time and will be registered to a HEW workspace.
You have two ways to specify the directory path. One is to type the directory path
manually into the “Workspace directory” field. The other is to use the “Browse…”
button. When you click the “Browse…” button, the “Select workspace directory” dialog

Rev. 1.0, 06/99, page 41 of 49


box (figure 3.2.2.2) will be displayed. On this dialog box, open a directory and click the
“Select” button, then the opened directory path will be input to the “Workspace
directory” field.

Figure 3.2.2.2 Select Workspace Directory Dialog Box

(2) In the “HEW workspace name” field on the “Multiple” tab, specify a workspace name.
Use only alphanumerics or an underscore (‘_’) in a workspace name.

(3) In the “CPU family” field, select a CPU family of the projects to be converted. Select
one of “SuperH RISC engine” or “H8S,H8/300” from the drop-down list.

(4) Click the “Convert” button, then the conversion will start. The “Current project” meter
shows the progress of conversion of a current project database file. “Total complete”
meter shows the overall progress of the conversion. The “Status” field shows a
temporary status of the conversion. The “Results” field shows a HIM project database
file being converted. When the conversion finishes, “XX project(s) converted
successfully” will be displayed in the “Results” field (figure 3.2.2.3).

Rev. 1.0, 06/99, page 42 of 49


Figure 3.2.2.3 HIM to HEW Project Converter, Multiple Tab (After Conversion)

HimToHew.exe will create a HEW workspace file whose directory path is the directory
path file specified in the “Workspace directory” field, whose file name is the name in the
“HEW workspace name” field, and whose file extension is “*.hws”. Also HimToHew.exe
creates a HEW project database file which has the same file path as each HIM project
database file except that the extension is changed from “*.him” to “*.hws”.

Rev. 1.0, 06/99, page 43 of 49


3.3 Exiting from HimToHew.exe
To exit from HimToHew.exe, click the close button or click the cancel button located at the
upper left corner of the title bar.

3.4 Restrictions on the conversion


Note the following restrictions on converting HIM projects into HEW workspaces and
HEW projects.

(1) External tools shown on the HIM toolbar will not be converted into the HEW.

(2) A build phase which is not shown on the “Build Order” tab of the “Phase Order” dialog
box of the HIM project builder will not be converted into the HEW. To launch the
“Phase Order” dialog box, select [Options->Build Phases…] on the HIM project builder
and click the “Phase Order…” button on the “Build Phases” dialog box.

(3) The output filename is unchangeable in the HEW. The filename here means a filename
excluding a directory path and a file extension. In the HIM, you can change a filename.
In HEW, however, you cannot change a filename. In table 3.4.1, output file groups
whose filenames are unchangeable by a user are shown.

Rev. 1.0, 06/99, page 44 of 49


Table 3.4.1 Output files whose filenames are unchangeable in the HEW

Phase name in the HEW Output file group Filename after


conversion
SH C/C++ Compiler Object file $(FILELEAF)
Preprocessed C source file $(FILELEAF)
Preprocessed C++ source file $(FILELEAF)
C list file $(FILELEAF)
C++ list file $(FILELEAF)
H8S,H8/300 C/C++ Compiler Object file $(FILELEAF)
Preprocessed C source file $(FILELEAF)
Preprocessed C++ source file $(FILELEAF)
C list file $(FILELEAF)
C++ list file $(FILELEAF)
SH Assembler Object file $(FILELEAF)
Assembly list file $(FILELEAF)
Expanded assembly source file $(FILELEAF)
H8S,H8/300 Assembler Object file $(FILELEAF)
Assembly list file $(FILELEAF)
Expanded assembly source file $(FILELEAF)
SH IM OptLinker Absolute file $(PROJECTNAME)
Relocatable file $(PROJECTNAME)
Linkage map file $(PROJECTNAME)
Linkage symbol file $(PROJECTNAME)
H8S,H8/300 IM OptLinker Absolute file $(PROJECTNAME)
Relocatable file $(PROJECTNAME)
Linkage map file $(PROJECTNAME)
Linkage symbol file $(PROJECTNAME)
H Series Librarian Library file $(PROJECTNAME)
Library list file $(PROJECTNAME)
Library section file $(PROJECTNAME)
H Series Stype Converter S-Record file $(PROJECTNAME)

(4) Furthermore, the output directory of some files will be fixed to $(CONFIGDIR) after
conversion into the HEW. In table 3.4.2, output file groups whose output directories are
unchangeable by a user are shown.

Rev. 1.0, 06/99, page 45 of 49


Table 3.4.2 Output files whose output directory are unchangeable in the HEW

Phase name in the HEW Output file group Output directory


after conversion
SH C/C++ Compiler C list file $(CONFIGDIR)
C++ list file $(CONFIGDIR)
H8S,H8/300 C/C++ Compiler C list file $(CONFIGDIR)
C++ list file $(CONFIGDIR)
SH Assembler Assembly list file $(CONFIGDIR)
H8S,H8/300 Assembler Assembly list file $(CONFIGDIR)
SH IM OptLinker Linkage map file $(CONFIGDIR)
H8S,H8/300 IM OptLinker Linkage map file $(CONFIGDIR)
H Series Librarian Library list file $(CONFIGDIR)
Library section file $(CONFIGDIR)

(5) You have a restriction regarding the “-speed=inline” option of H8S,H8/300 C Compiler
Version 2.x in the HIM. In this version of the compiler, you can not specify a number to
the “inline” sub-option. In version 3.0 or greater, however, you can do so. When options
of version 2.x of H8S,H8/300 C Compiler of the HIM are converted to those of version
3.0A of H8S,H8/300 C/C++ Compiler of the HEW, the “speed=inline” options will be
converted as shown in table 3.4.3.

Table 3.4.3 Conversion of –speed=inline option from ver. 2.x of H8S,H8/300 C Compiler

HIM HEW
H8S,H8/300 C Compiler option window H8S,H8/300 C/C++ Compiler option window
Optimize tab Optimize tab
Speed Sub-options group Speed sub-options group
Inline Expansion check box Maximum nodes of inline function
checked 105
unchecked 0 (same as without –speed=inline)

(6) You will have a restriction regarding the “-optimize” option of the H8S,H8/300 Inter-
Module Optimizer. On the “Optimize” tab of SH IM OptLinker in the HEW, selecting
“All” from the “Optimize” drop-down list has the same result as selecting “Customize”
from the drop-down list and checking all the sub-options. But graphical representations
of the selections are different. In H8S,H8/300 IM Optimizer Ver. 1.x in the HIM, the
“Optimize” tab does not have a drop-down list as the HEW does, and sub-options are
specified only though check boxes. If all the sub-options are checked in H8S,H8/300 IM
Optimizer Ver. 1.x, they will be converted into “All” in HEW. The same conversion
method holds in the “Safe” and “Speed” options.

Rev. 1.0, 06/99, page 46 of 49


(7) This is a note about an output file of a custom build phase (hereafter, custom phase). In
a HIM project, if the two conditions (a) and (b) below are satisfied simultaneously, an
output file from a custom phase defined by a user will be input to SH IM OptLinker,
H8S,H8/300 IM Optimizer or H Series Linkage Editor automatically in build.

(a) The custom phase is a multiple phase;


(b) An output file path is specified on the “Output Files” tab on the option dialog box
of the custom phase. And the file extension of the output file is OBJ, REL or LIB.

After you convert the HIM project into the HEW, the output file from the custom phase
will not be input to SH IM OptLinker or H8S,H8/300 IM OptLinker automatically. To
solve this problem, add a file mapping to a HEW project in the way shown below.

How to add a file mapping:


Open the “Build Phases” dialog box via [Options->Build Phases…] on the HEW. Select
the “File Mappings” tab on this dialog box and click the “Add…” button. Then the
“Define File Mapping” dialog box will be displayed. On this dialog box, specify the
following in the three fields.

File group:
“Object file” (if OBJ is an extension of an output file of the custom phase.)
“Relocatable file” (if REL is an extension of an output file of the custom phase.)
“Library file” (if LIB is an extension of an output file of the custom phase.)
Source phase:
The name of the custom phase
Destination phase:
SH IM OptLinker or H8S,H8/300 IM OptLinker

For example, suppose you have added a file group, “aaa source file”, to a HIM project
and have defined a multiple phase “aaa phase”, which takes the “aaa source file” file
group as input, as a custom phase in the project. Also suppose that you have specified a
file path, whose file extension is OBJ, on the “Output Files” tab of the “aaa phase
Options” dialog box via [Options->aaa phase]. After you convert this HIM project into
the HEW, define a file mapping as shown in figure 3.4.1 on the “Define File Mapping”
dialog box. Thus an OBJ file generated from the “aaa phase” will be input to SH IM
OptLinker or H8S,H8/300 IM OptLinker automatically in build.

Rev. 1.0, 06/99, page 47 of 49


Figure 3.4.1 Definition of a File Mapping (example)

(8) A HIM project cannot be converted into the HEW if a user has added to the project an
extension which is the same as an extension already defined in the HEW and the file
group the extension belongs to differs from the file group of the extension in the HEW.
In this case, open the project with the HIM, remove that extension from the HIM
project, and then convert the project into the HEW again.

For example, assume that, to a HIM project, a user has added an extension, “INC”, in
a “ASM header file” file group, which is defined by a user. In the HEW, the extension,
“INC”, is defined as an extension in the “Assembly include file” file group instead of the
“ASM header file” file group. When you convert the HIM project into the HEW with
HimToHew.exe, an error message shown in figure 3.4.2 will be displayed. In this case,
open the HIM project with the HIM and remove the extension, “INC”, from the project.
Then convert it into the HEW again.

For another example, assume that, to a HIM project, a user has added an extension,
“INC”, in the “Assembly source file” file group, which is already defined by the HEW.
But in the HEW, the extension, “INC”, is defined as an extension in the “Assembly
include file” file group instead of the “Assembly include file” file group. When you
convert the HIM project into the HEW with HimToHew.exe, an error message shown
in figure 3.4.3 will be displayed. In this case, open the HIM project with the HIM and
remove the extension, “INC”, from the project. Then convert it into the HEW again.

Rev. 1.0, 06/99, page 48 of 49


Figure 3.4.2 Error during conversion from HIM to HEW (1)

Figure 3.4.3 Error during conversion from HIM to HEW (2)

(9) If you have added a custom phase whose input file group is the “Preprocessed C Source
file” or “Preprocessed C++ Source file” file group of the HIM to a HIM project, you
need to modify the project after conversion into the HEW. You need to remove that
custom phase from the HEW project. Then add the phase again as a custom phase
whose input file group is “Preprocessed C source file” or “Preprocessed C++ source
file” if necessary.

(10) If you have added a file group whose name is the same as one of file groups shown
in table 2.2.1, “Standard File Extensions of the Hitachi Toolchains” EXCEPT for the
cases of the letters, you need to modify the project converted into the HEW. You need to
remove all the file extensions of that file group from the converted HEW project. (To do
so, you might need to remove a custom phase whose input file group is that file group
and a project file in that file group.) Then reconstruct your settings if necessary.

Rev. 1.0, 06/99, page 49 of 49


Hitachi Embedded Workshop
Tutorial
(Hitachi Tool Chain)

HS6400EWIW1SE-TU990601
Rev. 1.0
June 01, 1999
Hitachi Company or Division
Cautions
1. Hitachi neither warrants nor grants licenses of any rights of Hitachi’s or any third party’s
patent, copyright, trademark, or other intellectual property rights for information contained in
this document. Hitachi bears no responsibility for problems that may arise with third party’s
rights, including intellectual property rights, in connection with use of the information
contained in this document.
2. Products and product specifications may be subject to change without notice. Confirm that
you have received the latest product standards or specifications before final design, purchase
or use.
3. Hitachi makes every attempt to ensure that its products are of high quality and reliability.
However, contact Hitachi’s sales office before using the product in an application that
demands especially high quality and reliability or where its failure or malfunction may
directly threaten human life or cause risk of bodily injury, such as aerospace, aeronautics,
nuclear power, combustion control, transportation, traffic, safety equipment or medical
equipment for life support.
4. Design your application so that the product is used within the ranges guaranteed by Hitachi
particularly for maximum rating, operating supply voltage range, heat radiation
characteristics, installation conditions and other characteristics. Hitachi bears no
responsibility for failure or damage when used beyond the guaranteed ranges. Even within
the guaranteed ranges, consider normally foreseeable failure rates or failure modes in
semiconductor devices and employ systemic measures such as fail-safes, so that the
equipment incorporating Hitachi product does not cause bodily injury, fire or other
consequential damage due to operation of the Hitachi product.
5. This product is not designed to be radiation resistant.
6. No one is permitted to reproduce or duplicate, in any form, the whole or part of this
document without written approval from Hitachi.
7. Contact Hitachi’s sales office for any questions regarding this document or Hitachi
semiconductor products.
Preface
This tutorial will introduce you to the basic usage of the Hitachi Embedded Workshop
(hereafter referred to as HEW). The tutorial describes a series of usage such as how to
invoke the HEW, how to create and modify a project, how to build a program, and how to
invoke Hitachi Debugging Interface (hereafter referred to as HDI) from the HEW. For the
details of the HEW, the HEW project generator, a C/C++ compiler, an assembler, an inter-
module optimizer, the librarian, and the object converter, refer to the following manuals.

• Hitachi Embedded Workshop User’s Manual

• Hitachi Embedded Workshop Project Generator User’s Manual

• SuperH™ RISC engine C/C++ Compiler User’s Manual

• SuperH™ RISC engine Cross Assembler User’s Manual

• H8S, H8/300 Series C/C++ Compiler User’s Manual

• H8S, H8/300 Series Cross Assembler User’s Manual

• H Series Linkage Editor, Librarian, Object Converter User’s Manual

• Hitachi Debugging Interface User’s Manual

For details on the SuperH™ RISC engine CPU or the H8S, H8/300 CPU, refer to a
programming manual or a hardware manual of the corresponding CPU.

For the description in this manual, the Microsoft® Windows NT® 4.0 operating system
was used.

Microsoft®, Windows®, Windows® 95, Windows® 98, and Windows NT® are registered
trademarks of Microsoft Corporation in the United States and/or in other countries.

All other brand or product names used in this manual are trademarks or registered
trademarks of their respective companies or organizations.

Rev. 1.0, 06/99, page i of v


This tutorial is written assuming that all the tools included in the SuperH™ RISC engine
C/C++ compiler Package are installed. If you are using the H8S,H8/300 Series C/C++
Compiler Package, read the notes regarding [H8S,H8/300].

If “->” is written inside [ and ], the left hand side of “->” means the menu title and the right
hand side of “->” means a menu option of the menu. For example, in figure 1, the menu
option “Exit” in the “File” menu is described as [File->Exit].

Figure 1 A Menu of the HEW

Rev. 1.0, 06/99, page ii of v


Contents

Section 1 Invoking the HEW.......................................................................... 1

Section 2 Creating a Project........................................................................... 3

Section 3 Modifying the Project..................................................................... 9


3.1 Editing and Creating a Source Program File ...............................................................9
3.2 Adding / Removing a File To / From a Project.............................................................11
3.3 File Groups Used in a Project ........................................................................................14
3.4 Customizing the Workspace Window ...........................................................................16

Section 4 Building a Project…………………………………………………18


4.1 Build Overview ................................................................................................................18
4.2 Setting Options ................................................................................................................18
4.3 Customizing the Configuration......................................................................................20
4.4 Excluding a Project File from Build ..............................................................................21
4.5 Correcting Errors in a Build .........................................................................................22

Section 5 Launching HDI……………………………………………………23

Section 6 Exiting From the HEW…………………………………………...27

Rev. 1.0, 06/99, page iii of v


Figures
Figure 1 A Menu of the HEW ii

Figure 1.1 Invoking the HEW from the “Start” Menu 1

Figure 1.2 Welcome! Dialog Box 2

Figure 2.1 Project Files 4

Figure 2.2 CPU Selection of the Project Generator 5

Figure 2.3 Summary Dialog Box of the Project Generator 6

Figure 2.4 Sub-windows of the HEW 7

Figure 2.5 The HEW after Building a Project 8

Figure 3.1 Opening a Project File 9

Figure 3.2 Editing a Project File 10

Figure 3.3 Adding a File To a Project 11

Figure 3.4 Project With a File Added 12

Figure 3.5 Remove Project Files Dialog Box 13

Figure 3.6 File Extensions Dialog Box (Initial Screen) 14

Figure 3.7 Define File Extension Dialog Box 15

Figure 3.8 File Extension Dialog Box (After Adding an File Extension) 16

Figure 3.9 Configure View Dialog Box 16

Figure 3.10 Configuration of the Workspace Window 17

Figure 4.1 Option Dialog Box of C/C++ Compiler 19

Figure 4.2 Build Configurations Dialog Box 20

Figure 4.3 Excluding a Project File from Build 21

Figure 4.4 Correcting the Line which Caused an Error 22

Figure 5.1 Tools Customize Dialog Box, Debugger Tab 24

Rev. 1.0, 06/99, page iv of v


Figure 5.2 Source Window of the HDI 25

Figure 5.3 The Editor Windows of the HEW Opened by the HDI 26

Figure 6.1 Confirmation Dialog Box for Saving Workspace on Exiting from the HEW 27

Rev. 1.0, 06/99, page v of v


Section 1 Invoking the HEW
After the installation of the HEW, the installer creates a folder whose name is “Hitachi
Embedded Workshop” in the “Program” folder of the “Start” menu of the Windows®. In
the “Hitachi Embedded Workshop” folder, short cuts of the HEW support files will be
registered. The contents of the “Start” menu and its submenus differ depending on your
installation.

Figure 1.1 Invoking the HEW from the “Start” Menu

Rev. 1.0, 06/99, page 1 of 27


If you click “Hitachi Embedded Workshop, form the menu, the HEW will be invoked and
the “Welcome!” dialog box (figure 1.2) will be displayed. You can open the project
promptly without the “Welcome!” dialog if you change the setting via [Tools->Options].
For details of this setting, refer to chapter5, “Customizing the Environment”, of the
Hitachi Embedded Workshop User’s Manual.

Figure 1.2 Welcome! Dialog Box

If you use the HEW for the first time or if you want to work on a new project, select the
[Create a new project workspace] radio button and click [OK]. If you want to work on an
existing project, select the [Open a recent project workspace] or [Browse to another project
workspace] radio button and click [OK].

In this tutorial, select the [Create a new project workspace] radio button and click [OK].

Rev. 1.0, 06/99, page 2 of 27


Section 2 Creating a Project
When you have selected the [Create a new project workspace] radio button and clicked
[OK] on the “Welcome!” dialog box, the “New Project Workspace” dialog box (figure 2.1),
which is used to create a new workspace and project, will be launched. You will specify a
CPU family, a project type, and so on, on this dialog box.

Enter “tutorial”, for example, in the [Name] field, then the [Directory] field will show
“c:\tutorial”. If you want to change the directory used for the new workspace, click the
[Browse…] button and specify a directory, or enter a directory path manually in the
[Directory] field.

When you create a project of [H8S,H8/300], select “H8S,H8/300” in the [CPU family] field
and select “Hitachi H8S,H8/300 Standard” in the [Tool chain] field. Then you will have a
chance to select a project type other than the project types shown in the [Project type] field
of figure 2.1. For details, refer to the Hitachi Embedded Workshop Project Generator
User’s Manual.

Rev. 1.0, 06/99, page 3 of 27


Figure 2.1 Project Files

Rev. 1.0, 06/99, page 4 of 27


When you click [OK] on the “New Project Workspace” dialog box, the project generator
will be invoked. CPU types shown in the [CPU Type] list are classified into the CPU series
shown in the [CPU Series] list. In this tutorial, select “SH-3” in the [CPU Series] list and
select “SH7708” in the [CPU Type] list (figure 2.2). This tutorial does not detail the project
generator. So click the [Finish] button after selecting one from the [CPU Type] list.

For the details of the project generator, refer to the Hitachi Embedded Workshop Project
Generator User’s Manual.

Figure 2.2 CPU Selection of the Project Generator

Rev. 1.0, 06/99, page 5 of 27


The project generator shows a list of generated files on the “Summary” dialog box (figure
2.3). Confirm the contents of the dialog box and click [OK].

Figure 2.3 Summary Dialog Box of the Project Generator

Then the HEW will open a project generated by the project generator.

Rev. 1.0, 06/99, page 6 of 27


By default, the HEW has:

the “Workspace” window (on the left hand side of the HEW), which shows the contents of
the project, the “Output” window (on the lower side of the HEW), which shows outputs
from a build or a string search, and the editor window (on the right hand side of the
window), which is used to edit text files. Refer to the Hitachi Embedded Workshop User’s
Manual for how to change the state of the HEW and how to use each window such as the
editor window.

Figure 2.4 Sub-windows of the HEW

Rev. 1.0, 06/99, page 7 of 27


The project generated by the project generator includes minimum options for the C/C++
compiler, the assembler, the inter-module optimizer and the object converter. Thus you
can build the project (figure 2.5) by selecting [Build->Build]. Selecting the button (shown
below) on the toolbar works in the same way as selecting [Build->Build].

Those minimum options are set by default for each tool. When you add a new file to the
project, the minimum options will automatically be added to the file. You do not have to
specify options from scratch. For details of the options specified by the project generator,
refer to the Hitachi Embedded Workshop Project Generator User’s Manual.

Figure 2.5 The HEW after Building a Project

Rev. 1.0, 06/99, page 8 of 27


Section 3 Modifying the Project
When you create a project using the project generator, basic program such as reset routine
and initialization of RAM area will already be given in the project. This tutorial describes
how to modify a file and how to add a file to the project.

3.1 Editing and Creating a Source Program File


To open and edit a file in the project, double click the file in the [Projects] tab of the
“Workspace” window. In this tutorial, double click “tutorial.c”. (figure 3.1)

Figure 3.1 Opening a Project File

Rev. 1.0, 06/99, page 9 of 27


Then you can edit the file opened. If you edit the file, an asterisk (*) will be added to the file
path shown on the title bar of the HEW (figure 3.2). If you save the file, the asterisk will
disappear.

Figure 3.2 Editing a Project File

If you want to open an existing text file with the editor of the HEW, select [File->Open]. If
you want to edit a new text file with the editor, select [File->New]. In this tutorial, select
[File->New], input the three lines shown below, select [File->Save As…] and save the file as
“newprog.c”.

void NewProgram(void);
{
}

Rev. 1.0, 06/99, page 10 of 27


3.2 Adding / Removing a File To / From a Project
This section describes how to add a file to a project and how to delete a file from a project.
In this tutorial, add the file, “newprog.c” created in the previous section to the project as
follows. Select [Project->Add Files…], then the “Add File(s)” dialog box (figure 3.3) will be
launched. Select a file, “newprog.c” in this example, to be added and click the [Add] button.
Thus “newprog.c” will be added to the project.

Figure 3.3 Adding a File To a Project

Rev. 1.0, 06/99, page 11 of 27


The added file will be displayed on the [Projects] tab of the “Workspace” window as shown
in figure 3.4.

Figure 3.4 Project With a File Added

Rev. 1.0, 06/99, page 12 of 27


Next, how to delete a file from a project will be shown. Select [Project->Remove File…],
then the “Remove Project Files” dialog box (figure 3.5) will be displayed. Select one or
more project files on this dialog box and click the [Remove] button. Then the selcted file(s)
will disappear from the list of the dialog box. Clicking [OK] actually removes the file(s)
from the project. Clicking [Cancel] instead will nullify the removal.

You have another way to delete a file from a project. Select the file in the [Projects] tab of
the “Workspace” window and push the [Delete] key. Then the file will be deleted from the
project. In this way, you cannot cancel the deletion although you can cancel it on the
[Remove Project Files] dialog box.

If you want to exclude a file from a build temporarily instead of removing the file from the
project, refer to section 4.4, “Excluding a Project File”.

Figure 3.5 Remove Project Files Dialog Box

Rev. 1.0, 06/99, page 13 of 27


3.3 File Groups Used in a Project
In this section, a file group to which a file added to a project belongs is described. For
example, the project generator adds a file described in C programming language or
assembly language to the project. A file with a file extension “.c” belongs to the “C source
file” group, and a file with a file extension “.src” belongs to the “Assembly source file”
group.

The HEW identifies a group to which a file belongs by checking the file extension. Select
[Project->File Extensions…], then the “File Extensions” dialog box (figure 3.6) will be
displayed. File extensions used in the project are shown on this dialog box. Every file
extension belongs to a file group. A file group can be associated to a tool in a build process.

If you want to use your own file extension in the project, define a new file extension by
clicking the [Add…] button.

The icon displayed in the [Extension] column of the “File Extensions” dialog box can show
a tool which opens the file. If the icon of a file extension is the same as the icon shown below,
a file with that file extension can be opened by the editor of the HEW.

Figure 3.6 File Extensions Dialog Box (Initial Screen)


Rev. 1.0, 06/99, page 14 of 27
Click the [Add…] button on the “File Extensions” dialog box, then the “Define File
Extension” dialog box (figure 3.7) will be launched. Enter a new file extension in the [File
extension] field and specify the [File group] group box. If you want to add an extension to
an existing file group, select the [Existing group] radio button and select a file group from
the drop-down list. If you want to create a new file group, select the [New group] radio
button and enter the name of the file group in the edit field.

In this tutorial, enter “asm” in the [File extension] field, select “Assembly source file” from
the drop-down list and click [OK]. Then a file with the extension, “*.asm”, will be treated
as a file in the “Assembly source file” group (figure 3.8).

Figure 3.7 Define File Extension Dialog Box

Rev. 1.0, 06/99, page 15 of 27


Figure 3.8 File Extension Dialog Box (After Adding an File Extension)

3.4 Customizing the Workspace Window


Click the right mouse button on the [Projects] tab of the “Workspace” window, then a pop-
up menu will be displayed. Select [Configure View…] on this menu, then “Configure
View” dialog box (figure 3.9) will be launched. On this dialog box, you can specify whether
the file dependencies are shown for each file or not, whether a file is shown in a file group
folder (figure 3.10) or not, and so on, can be selected.

Figure 3.9 Configure View Dialog Box

Rev. 1.0, 06/99, page 16 of 27


Figure 3.10 Configuration of the Workspace Window

Rev. 1.0, 06/99, page 17 of 27


Section 4 Building a Project

4.1 Build Overview


The HEW provides two ways in building a project. One is “Build All”, which applies a
series of tools like a compiler, an assembler and a linker to all the source program files. The
other is “Build”, which applies a tool only to a source program file updated after the last
build. (The update means not only the update of a source program file, but also an update
of a file included by the source program file and an update of an option applied to the
source program file.) The “Build” corresponds to [Build->Build] and the “Build All”
corresponds to [Build->Build All].

If you want to compile or assemble a single source program file, select the file on the
[Projects] tab of the “Workspace” window and select [Build->Build File].

CAUTION ON BUILD
1. Depending of the setting of the editor window, a file being edited might be
saved on executing a build. So close a file which you do NOT want to be saved
beforehand. For details of customizing the editor, refer to the Hitachi
Embedded Workshop User’s Manual.
2. Do not save a file used in a project during the build because doing so might
disturb the build process.

4.2 Setting Options


In this section, overview of the option setting is described.

When the project generator generates a project, the minimum options required for a build
are already specified. If you want to modify the options, however, select [Options-> <Tool
name>] and set options on the option dialog box of each tool.

Rev. 1.0, 06/99, page 18 of 27


Figure 4.1 shows the option dialog box of a C/C++ compiler. On the left hand side of the
dialog box is a file list, and on the right hand side are option controls divided into some tabs.
If you select a file in the file list, you can specify options only to the selected file. If you
select a file group folder in the file list, you can specify the same option to all the files in the
file group. To specify the same options to specific files, select the files while pushing the
[Ctrl] key or the [Shift] key.

If you select “Default Options” in a file group folder, you can specify initial options for the
file group. The HEW automatically adds the options specified to the “Default Options” to a
file of the corresponding file group of the corresponding file extension of the file. For
example, if you add a file with an extension “C” (“*.C”) to the project, the settings of the
“Default Options” of the “C source file” group will be added to the file automatically.

For the details of the options refer to the manual of the corresponding tool.

Figure 4.1 Option Dialog Box of C/C++ Compiler

Rev. 1.0, 06/99, page 19 of 27


4.3 Customizing the Configuration
In the previous section, how to set options to a project file is described. In this section, how
to create more than one suite of option settings for a build will be described. A suite of
option settings for a build is called a configuration.

The project generator creates two configurations, [Debug] and [Release]. Difference
between them is only the setting of the debug option. To switch the current configuration to
another, launch the “Build Configurations” dialog box (figure 4.2) by selecting [Options-
>Build Configurations…], select a configuration from the “Current configuration” drop-
down list, and click [OK]. You can also change the current configuration by selecting one
from the drop-down list on the toolbar.

On the “Build Configurations” dialog box, you can create a new configuration or delete a
configuration. For details, refer to chapter 2, “Build Basics”, of the Hitachi Embedded
Workshop User’s Manual.

Figure 4.2 Build Configurations Dialog Box

Rev. 1.0, 06/99, page 20 of 27


4.4 Excluding a Project File from Build
In this section, how to exclude a project file from build will described. Excluding a project
file from build does not delete the file from a project, but exclude a project file from build
in configuration by configuration basis.

Select a file on the “Projects” tab of the “Workspace” window, click the right mouse button,
and select [Exclude Build <file>] on the pop-up menu. Then a red cross will be added to the
icon of this file as shown in figure 4.3. This file will be excluded from a build.

To include an excluded file into build, select the file on the “Projects” tab of the
“Workspace” window, click the right mouse button, and select [Include Build <file>] on the
pop-up menu.

Figure 4.3 Excluding a Project File from Build

Rev. 1.0, 06/99, page 21 of 27


4.5 Correcting Errors in a Build
In this section, how to jump to a line of a file which caused an error in compiling or
assembling will be described.

Figure 4.4 shows an example in which a compiler detected a syntax error in a source
program file. When you build a project, messages, including error messages, from a tool in
a build will be displayed on the “Output” window. If you double click the line of the error
message the [Build] tab of the “Output” window, the file which caused the error will be
opened and the cursor will be placed on the line which caused the error. (The cursor might
not be placed on the line which caused the error if you have already edited the file.)

Figure 4.4 Correcting the Line which Caused an Error

Rev. 1.0, 06/99, page 22 of 27


Section 5 Launching HDI
The HEW can launch the HDI (Version 4.0 or greater). To register the HDI in the HEW,
open the [Debugger] tab (figure 5.1) of the “Tools Customize” dialog box which is
launched by selecting [Tools->Customize…]. Specify the path of the HDI.EXE in the [HDI
location (V4.0 or greater)] field. In the [Session file] field, specify the path of the session file
to be loaded. If you set the two fields, the toolbar button shown below will be activated.

Thus clicking the button will launch the HDI and it will load the session file.

If you specify the path of the load module file on the [Download module] field, the HDI will
be focused immediately after the load module file is updated by the HEW.

Rev. 1.0, 06/99, page 23 of 27


Figure 5.1 Tools Customize Dialog Box, Debugger Tab

If you double click a line on the source window (figure 5.2) of the HDI, the corresponding
file will be opened by the HEW and the cursor will be placed on the same line as you have
double clicked.

Figure 5.3 shows the HEW after the 17th line of “tutorial.c” is double clicked on the source
window of the HDI.

Rev. 1.0, 06/99, page 24 of 27


Figure 5.2 Source Window of the HDI

Rev. 1.0, 06/99, page 25 of 27


Figure 5.3 The Editor Windows of the HEW Opened by the HDI

Rev. 1.0, 06/99, page 26 of 27


Section 6 Exiting From the HEW
Selecting [File->Exit] will close the HEW. Depending on the setting, the message box
(figure 6.1) which asks you whether to save the workspace or not will be launched. Not
only the setting like this regarding exiting from the HEW but also setting regarding
initiation of the HEW can to specified via [Tools->Options…]. For details, refer to the
Hitachi Embedded Workshop User’s Manual.

The HDI and the other tools launched from the HEW will not be closed when the HEW is
closed. Close the tools by yourself.

Figure 6.1 Confirmation Dialog Box for Saving Workspace on Exiting from the HEW

Rev. 1.0, 06/99, page 27 of 27


Hitachi Embedded Workshop
Project Generator
User’s Manual

HS6400EWIW1SE-PG990601
Rev. 1.0
June 01, 1999
Hitachi Company or Division
Cautions
1. Hitachi neither warrants nor grants licenses of any rights of Hitachi’s or any third party’s
patent, copyright, trademark, or other intellectual property rights for information contained in
this document. Hitachi bears no responsibility for problems that may arise with third party’s
rights, including intellectual property rights, in connection with use of the information
contained in this document.
2. Products and product specifications may be subject to change without notice. Confirm that
you have received the latest product standards or specifications before final design, purchase
or use.
3. Hitachi makes every attempt to ensure that its products are of high quality and reliability.
However, contact Hitachi’s sales office before using the product in an application that
demands especially high quality and reliability or where its failure or malfunction may
directly threaten human life or cause risk of bodily injury, such as aerospace, aeronautics,
nuclear power, combustion control, transportation, traffic, safety equipment or medical
equipment for life support.
4. Design your application so that the product is used within the ranges guaranteed by Hitachi
particularly for maximum rating, operating supply voltage range, heat radiation
characteristics, installation conditions and other characteristics. Hitachi bears no
responsibility for failure or damage when used beyond the guaranteed ranges. Even within
the guaranteed ranges, consider normally foreseeable failure rates or failure modes in
semiconductor devices and employ systemic measures such as fail-safes, so that the
equipment incorporating Hitachi product does not cause bodily injury, fire or other
consequential damage due to operation of the Hitachi product.
5. This product is not designed to be radiation resistant.
6. No one is permitted to reproduce or duplicate, in any form, the whole or part of this
document without written approval from Hitachi.
7. Contact Hitachi’s sales office for any questions regarding this document or Hitachi
semiconductor products.
Preface
The project generator generates a project for the Hitachi Embedded Workshop (hereafter
referred to as HEW). The project generator will help you in generating the initial routine
files of an application program and in setting options for every tool of the project.

CPUs supported by the project generator differ depending on the CPU family that your
software package supports. Check beforehand whether the CPU family of your package is
the SuperH™ RISC engine or the H8S, H8/300 series.

This manual provides an overview of the project generator and its usage. Read this
manual before using the project generator. For details about the HEW, C/C++ compiler,
assembler, inter-module optimizer, librarian, and object converter, refer to the following
manuals.

• Hitachi Embedded Workshop User’s Manual

• SuperH™ RISC engine C/C++ Compiler User’s Manual

• SuperH™ RISC engine Cross Assembler User’s Manual

• H8S, H8/300 Series C/C++ Compiler User’s Manual

• H8S, H8/300 Series Cross Assembler User’s Manual

• H Series Linkage Editor, Librarian, Object Converter User’s Manual

For details on the SuperH™ RISC engine CPU or the H8S, H8/300 CPU, refer to a
programming manual or a hardware manual for the corresponding CPU.

For the description in this manual, the Microsoft® Windows® 95 operating system is used.

Microsoft®, Windows®, Windows® 95, Windows® 98, and Windows NT® are registered
trademarks of Microsoft Corporation in the United States and/or in other countries.

IBM PC is a registered trademark of International Business Machines Corporation in the


United States.

All other brand or product names used in this manual are trademarks or registered
trademarks of their respective companies or organizations.

Rev. 1.0, 06/99, page i of v


Contents

Section 1 Overview............................................................................................1
1.1 Overview .......................................................................................................................... 1
1.2 Environment ..................................................................................................................... 4

Section 2 Tutorial...............................................................................................5
2.1 Project Types .................................................................................................................... 5
2.2 Operation .......................................................................................................................... 6
2.2.1 How to Create a New Project in a New Workspace ............................................ 6
2.2.2 How to Insert a New Project into an Existing Workspace................................... 8
2.2.3 Selecting the Target CPU .................................................................................... 9
2.2.4 Option Setting (for the SuperH™ RISC engine) ................................................. 11
2.2.5 Option Setting (for the H8S, H8/300 Series) ....................................................... 13
2.2.6 Setting the Contents of Files to be Generated...................................................... 15
2.2.7 Setting the Stack Area ......................................................................................... 20
2.2.8 Setting the Vector................................................................................................ 23
2.2.9 Changing the File Names to be Created .............................................................. 25
2.2.10 Confirming Settings (Summary Dialog Box) ...................................................... 27
2.3 Automatic Project Generation .......................................................................................... 29

Section 3 Functions of the Project Generator………………………………..31


3.1 Created Files ..................................................................................................................... 31
3.2 Phase Order ...................................................................................................................... 43
3.3 File Mapping..................................................................................................................... 44
3.4 Options ............................................................................................................................. 45

Section 4 Project Change..…………………………………………………...56


4.1 Adding/Deleting a Project File ......................................................................................... 56
4.2 Changing Options ............................................................................................................. 59

Rev. 1.0, 06/99, page ii of v


Figures
Figure 1.1 Project Files 1

Figure 1.2 Phase Order of Application Project 2

Figure 1.3 Phase Order of Library Project 2

Figure 1.4 Build Operation 3

Figure 2.1 New Project Workspace Dialog Box 6

Figure 2.2 Insert Project Dialog Box 8

Figure 2.3 Insert New Project Dialog Box 8

Figure 2.4 New Project Wizard Dialog Box (Step-1 Screen) 9

Figure 2.5 New Project Wizard Dialog Box (Step-2 Screen) for the SuperH™ 11

Figure 2.6 New Project Wizard Dialog Box (Step-2 Screen) for the H8S,H8/300 Series 13

Figure 2.7 New Project Wizard Dialog Box (Step-3 Screen) 15

Figure 2.8 [Number of I/O Streams:] Message Box against Empty Input 16

Figure 2.9 [Heap Size:] Message Box against Illegal Value Input 16

Figure 2.10 [Heap Size:] Message against Odd Value Input 17

Figure 2.11 New Project Wizard Dialog Box (Step-4 Screen) 20

Figure 2.12 [Stack Pointer Address:] Message Box against Empty Input 21

Figure 2.13 [Stack Pointer Address:] Message Box against Illegal Value Input 21

Figure 2.14 [Stack Pointer Address:] Message Box against Odd Value Input 21

Figure 2.15 Message Box against [Stack Size:] > [Stack Pointer Address:] 22

Figure 2.16 New Project Wizard Dialog Box (Step-5 Screen) 23

Figure 2.17 Message Box when No Handler is Input 24

Figure 2.18 Message Box when 129 or More Characters are Input as Handler Name 24

Figure 2.19 Message Box against Illegal Handler Name Input 24

Rev. 1.0, 06/99, page iii of v


Figure 2.20 New Project Wizard Dialog Box (Step-6 Screen) 25

Figure 2.21 Message Box when No File Name Is Input 26

Figure 2.22 Message Box when 252 or More Characters are Input as File Name 26

Figure 2.23 Message Box when Illegal Characters are Input as File Name 26

Figure 2.24 Summary Dialog Box 27

Figure 2.25 HEW (When a Project is Created) 29

Figure 3.1 File Mapping Example 44

Figure 4.1 Add Dialog Box 56

Figure 4.2 Remove Project Files Dialog Box 57

Figure 4.3 Remove a File from the Project Window 58

Figure 4.4 Option Setting Dialog Box 59

Rev. 1.0, 06/99, page iv of v


Tables
Table 2.1 Project Types (SuperH™ RISC engine) 5

Table 2.2 Project Types (H8S, H8/300 Series) 5

Table 2.3 Items of [Project type:] 7

Table 2.4 Files Created by Step-3 Settings (SuperH™ Application) 18

Table 2.5 Files Created by Step-3 Settings (H8S, H8/300 Application) 18

Table 2.6 Files Created by Step-3 Settings (H8S, H8/300 Assembly Application) 19

Table 3.1 Created Files 31

Table 3.2 Set Phase Order (SuperH™ RISC engine) 43

Table 3.3 Set Phase Order (H8S, H8/300 Series) 43

Table 3.4 Set File Mapping (SuperH™ RISC engine) 44

Table 3.5 Set File Mapping (H8S, H8/300 Series) 45

Table 3.6 Default Options (Super HTM RISC engine C/C++ Compiler) 46

Table 3.7 User Options (Super HTM RISC engine C/C++ Compiler) 47

Table 3.8 Default Options (Super HTM RISC engine Assembler) 48

Table 3.9 User Options (Super HTM RISC engine Assembler) 49

Table 3.10 Default Options (SuperHTM RISC Engine Inter-Module Optimizer) 50

Table 3.11 User Options (SuperHTM RISC Engine Inter-Module Optimizer) 51

Table 3.12 Default Options (H8S,H8/300 Series C/C++ Compiler) 51

Table 3.13 User Options (H8S, H8/300 Series C/C++ Compiler) 52

Table 3.14 Default Options (H8S, H8/300 Series Assembler) 53

Table 3.15 User Options (H8S, H8/300 Series Assembler) 53

Table 3.16 Default Options (H8S, H8/300 Series Inter-Module Optimizer) 54

Table 3.17 Default Options (H8S, H8/300 Series Inter-Module Optimizer) 55

Rev. 1.0, 06/99, page v of v


Section 1 Overview
This section provides an overview of the project generator and the operating environment.

1.1 Overview
When a program is developed using the HEW, the development process unit can be
considered a project. A project manages the information necessary for configuring a
program (hereafter referred to as a build) listed below.

• Files necessary for the build


• Tools necessary for the build

The project manages the files by registering the files necessary for the build (hereafter
referred to as the project files). When the project files are registered, the build operation is
automatically applied to all the files.

Figure 1.1 Project Files

The tools needed for the build must also be registered. The necessary tools and the order of
the tool execution during the build operation differ depending on the kind of program to be
developed. Each stage of the build in which a tool is executed is called a build phase or a
phase.

For example, phases consisting of a C/C++ compiler, an assembler, an inter-module


optimizer, and an object converter are used to build an application (figure 1.2). Phases
consisting of a C/C++ compiler, an assembler, and a librarian are used to build a library in
a certain phase order (figure 1.3). These settings are managed by the project.

Rev. 1.0, 06/99, page 1 of 59


Figure 1.2 Phase Order of Application Project

Figure 1.3 Phase Order of Library Project

Each tool can determine the input files from the project files. (Note that a project file
refers to a file registered to a project.) However, it cannot determine the input files from
the intermediate files output by other tools. Therefore, a project must manage the
information of directing an intermediate file from one phase to another. This information
is called file mapping. The option for executing each tool is also required. The project
always manages the options set by the user.

Those pieces of information are necessary in building a project. Figure 1.4 shows the
relation between the tools and the project files at build.

Rev. 1.0, 06/99, page 2 of 59


Figure 1.4 Build Operation

Rev. 1.0, 06/99, page 3 of 59


The project generator automatically specifies settings managed by the project and creates a
project. The project generator has the following functions:

• Creating the initial routine file for the SuperHTM RISC engine or the H8S, H8/300 series
• Creating the vector table definition and the sample files defined by the I/O registers for
the SuperHTM RISC engine or the H8S, H8/300 series
• Registering the project files
• Setting the phase order
• File mapping settings
• Option settings

NOTE
For the contents of the vector table definition and I/O register definitions created
by the project generator, refer to the appropriate CPU hardware manual and
confirm the correctness of the program of the generated files.

1.2 Environment
The project generator operates in the following environment.

Host computer: IBM PC compatible machine which can run Windows® 95, Windows® 98
or Windows NT® 4.0.

OS: Microsoft® Windows® 95, Windows® 98 or Windows NT® 4.0

Memory: 32 Mbytes or more recommended

Display: SVGA or better

Rev. 1.0, 06/99, page 4 of 59


Section 2 Tutorial
This section describes how to use the project generator. The following typographical
conventions are used later in this document.

[(A)->(B)]: (A) is a menu title of HEW, and (B) is a menu option.

[ ]: A control shown in a dialog box

2.1 Project Types


The project generator generates the project types shown in the tables below.

Table 2.1 Project Types (SuperH™ RISC engine)

Project Type Description


Application The project to build the execution program including the initial
routine file written in C or assembly language.
Library Project to build a library (no project files are generated)
Demonstration Project to build a demonstration program written in C or
assembly language

Table 2.2 Project Types (H8S, H8/300 Series)

Project Type Description


Application The project to build the execution program including the initial
routine file written in C or assembly language.
Assembly Application The project to build the execution program including the initial
routine file written only in assembly language
Library Project to build a library (no project files are generated)
Demonstration Project to build a demonstration program written in C or
assembly language

The operation of the project generator differs slightly depending on the project type
selected. Hereafter, however, an application project of the SuperH™ RISC engine will be
mainly discussed as an example.

Rev. 1.0, 06/99, page 5 of 59


2.2 Operation
The project generator is invoked when you create a new project. You will have two
occasions to create a new project. One occurs when a new workspace (a workspace can
hold several projects) is created and the other occurs when a new project is inserted into an
existing workspace. To create a new workspace, select [File->New Workspace...] (refer to
section 2.2.1, “How to Create a New Project in a New Workspace”). To insert a new project
into an existing project, select [Project->Insert Project…] (refer to section 2.2.2, “How to
Insert a New Project into an Existing Workspace”).

2.2.1 How to Create a New Project in a New Workspace

When [File->New Workspace...] is selected or the [OK] button is clicked after selecting
[Create a new project workspace] in the “Welcome!” dialog box, the following dialog box
will be launched.

Figure 2.1 New Project Workspace Dialog Box

Rev. 1.0, 06/99, page 6 of 59


Specify the following in this dialog box.

• Enter “tutorial” in the [Name:] field. The [Directory:] field will be automatically
updated.

• Select “SuperH™ RISC engine” in the [CPU family:] field, and select “Hitachi
SuperH Standard” in the [Tool chain:] field. The available project types will then be
displayed in the [Project type:] list.

• Select “Application” from the [Project type:] list.

• Click the [OK] button. The project generator will then launch a wizard dialog box.
This dialog box will be detailed in section 2.2.3, “Selecting the Target CPU”.

If you want to develop a program for the H8S, or the H8/300, select “H8S, H8/300” in the
[CPU family:] field and “Hitachi H8S,H8/300 Standard” in the [Tool chain:] field.

Items displayed in the [Project type:] list depend on the selection in both the [CPU family:]
and [Tool chain:] fields. Select an appropriate item from the [Project type:] list. Refer to
the description of project types in section 2.1, “Project Types”.

Table 2.3 Items of [Project type:]

[CPU family:] [Tool chain:] Items of [Project type:]


SuperH™ RISC engine Hitachi SuperH Standard Application
Library
Demonstration
H8S, H8/300 Hitachi H8S,H8/300 Standard Application
Assembly Application
Library
Demonstration

Rev. 1.0, 06/99, page 7 of 59


2.2.2 How to Insert a New Project into an Existing Workspace

When [Project->Insert Project…] is selected, the dialog box shown in figure 2.2 will be
launched. Select the [New project] radio button and click the [OK] button.

Figure 2.2 Insert Project Dialog Box

Then the dialog box shown in figure 2.3 will then be launched.

Figure 2.3 Insert New Project Dialog Box

Specify the following in this dialog box.

• Enter “tutorial2” in the [Name:] field. The [Directory:] field will be updated
automatically.
Rev. 1.0, 06/99, page 8 of 59
• Select “Application” from the [Project type:] list.

• Click the [OK] button. The project generator will then launch a wizard dialog box.
This dialog box will be detailed in section 2.2.3, “Selecting the Target CPU”.

Items displayed in the [Project type:] list depend on the selection in both the [CPU family:]
and [Tool chain:] fields when the workspace is newly created. Refer to section 2.2.1, “How
to Create a New Project in a New Workspace” for details. Select an appropriate item from
the [Project type:] list.

2.2.3 Selecting the Target CPU

If you click [OK] in the “New Project Workspace” dialog box or the “Insert New Project”
dialog box, the project generator launches the wizard dialog box shown in figure 2.4.

Figure 2.4 New Project Wizard Dialog Box (Step-1 Screen)

Select the target CPU in this dialog box. Specify, for example, the following settings.

• Select “SH-3” in the [CPU Series:] list. The [CPU Type:] list will then be updated.

Rev. 1.0, 06/99, page 9 of 59


• Select “SH7708” from the [CPU Type:] list.

• Click [Next >]. The Step-2 screen (in section 2.2.4, “Option Setting (for the SuperH™
RISC engine)”), will then be launched.

The [CPU Type:] list box shows the products included in the CPU series selected in the
[CPU Series:] list box. The CPU product selected in the [CPU Type:] list is called the CPU
type hereafter. The [CPU Series:] selection sets the CPU option of the SuperHTM RISC
engine C/C++ Compiler and the SuperHTM RISC engine Assembler. The selected items in
the [CPU Series:] list box and the [CPU Type:] list box specify the files to be generated.
Select the CPU type of the program to be developed. If the CPU type which you want to
select is not displayed in the [CPU Type:] list, select a CPU type with similar hardware
specifications or select “Other”.

Clicking [Next>] moves to the next display. Clicking [<Back] moves to the previous display
or the previous dialog box. Clicking [Finish] opens the “Summary” dialog box. Clicking
[Cancel] returns the display to the “New Project Workspace” dialog box or the “Insert
New Project” dialog box. [<Back], [Next>], [Finish], and [Cancel] are common buttons of
all the wizard dialog boxes.

For the H8S, H8/300 series, the CPU series and the CPU types in the H8S, H8/300 series
are displayed. For the selections in Step-2, refer to section 2.2.5, “Option Setting (for the
H8S, H8/300 Series)”. In Step-2, the more detailed CPU specification for the H8S, H8/300
Series C/C++ Compiler and the H8S, H8/300 Series Assembler can be selected.

Rev. 1.0, 06/99, page 10 of 59


2.2.4 Option Setting (for the SuperH™ RISC engine)

Clicking the [Next>] button on the Step-1 screen opens the dialog box shown in figure 2.5.
This screen differs between that of the SuperH™ RISC engine and that of the H8S, H8/300
series. The screen for H8S, H8/300 series is described in section 2.2.5, “Option Setting (for
the H8S, H8/300 Series)”.

Figure 2.5 New Project Wizard Dialog Box (Step-2 Screen) for the SuperH™

On this screen, you can specify options common to all project files.

Click the [Next>] button without changing the setting. The Step-3 screen will be displayed.
Refer to section 2.2.6, “Setting the Created File”.

On the Step-2 screen, you can specify the options listed below.

For the SuperH™ RISC engine C/C++ Compiler:

• Endian
• FPU
• Rounding direction
Rev. 1.0, 06/99, page 11 of 59
• Denormalized number
• Position independent program section
• Double-type single precision

For the SuperH™ RISC engine Assembler

• Endian
• Rounding direction
• De-normalized number

For the SuperH™ RISC engine Inter-Module Optimizer

• Library file setting

The library file shown below [Required C Runtime Library:] will be specified in the
SuperH™ RISC engine Inter-Module Optimizer phase for linkage. The library file is
automatically selected according to the settings in the [CPU Series:] list of the Step-1 screen
and the settings in the Step-2 screen. Confirm the name of the library file below [Required
C Runtime Library:]. A library file name will not be displayed there if the project type is
“Library”.

A control of an option, which is not supported by the CPU series selected in the Step-1
screen, is grayed. In figure 2.5, since “SH-3” has been selected in the Step-1 screen, [FPU:],
[Round:], and [Denormalized number allowed as a result:] are grayed, meaning these
options are not available for SH-3.

If the project type is “Library”, do not click the [Next>] button. Click the [Finish] button.

When the project type is “Demonstration”, clicking the [Next>] button displays a Step-3
screen, whose contents are the same as the Step-6 screen shown in section 2.2.9, “Changing
the File Names to be Created”.

Rev. 1.0, 06/99, page 12 of 59


2.2.5 Option Setting (for the H8S, H8/300 Series)

Click the [Next>] button on the Step-1 screen. The screen shown in figure 2.6 will be
displayed.

Figure 2.6 New Project Wizard Dialog Box (Step-2 Screen) for the H8S,H8/300 Series

On this screen, you can specify the options listed below.

For the H8S, H8/300 Series C/C++ Compiler:

• CPU operating mode


• Parameter storage register

For the H8S, H8/300 Series Assembler:

• CPU operating mode

For the H8S, H8/300 Series Inter-Module Optimizer:

• Library file specification

Rev. 1.0, 06/99, page 13 of 59


The library file shown below [Required C Runtime Library:] will be specified in the H8S,
H8/300 Series Inter-Module Optimizer phase for linkage. The library file is automatically
selected according to the settings in the [CPU Series:] list of the Step-1 screen and the
settings in the Step-2 screen. Confirm the name of the library file below [Required C
Runtime Library:]. A library file name will not be displayed there if the project type is
“Assembly Application”, or “Library”,

[Operating Mode:] cannot be specified if the CPU series specified in the Step-1 screen has
no operating modes. Figure 2.6 shows a screen in which 2600 has been selected in [CPU
Series:] in the Step-1 screen.

If [Operating Mode:] can be specified, and if “Advanced” is selected in [Operating Mode:],


[Address Space:] can be selected. Items shown in [Address Space:] differ depending on the
CPU type selected in the Step-1 screen.

If the project type is “Application” or “Assembly Application”, click the [Next>] button.
Then the Step-3 screen will be displayed. Refer to section 2.2.6, “Setting the File Contents”.

If the project type is “Library”, the [Next>] button cannot be clicked. Click the [Finish]
button.

When the project type is “Demonstration”, clicking the [Next>] button displays a Step-3
screen, whose contents are the same as the Step-6 screen shown in section 2.2.9, “Changing
the File Names to be Created”.

Rev. 1.0, 06/99, page 14 of 59


2.2.6 Setting the Contents of Files to be Generated

Click the [Next>] button on the Step-2 screen to display the screen shown in figure 2.7.

Figure 2.7 New Project Wizard Dialog Box (Step-3 Screen)

On this screen, specify information which is necessary to generate files.

In this tutorial, click the [Next>] button without changing the setting. The Step-4 screen
will be displayed. Refer to section 2.2.7, “Setting the Stack Area”.

If [Use I/O Library] is checked, the standard I/O library can be used. Then the setting of
[Number of I/O Streams:] will be enabled and the number of I/O streams simultaneously
used can be specified. However, when the project type is “Application” for the SuperH™
RISC engine or “Assembly Application” for the H8S, H8/300 series, the inputs are disabled.

NOTE
If you use a function of the standard I/O library, check the stack size consumed by
the function by referring to the supplementary information of the C/C++ compiler.

Rev. 1.0, 06/99, page 15 of 59


If [Use Runtime Library] is checked, the function sbrk() for heap area management will be
generated. Specify the number of bytes of the heap area in the [Heap Size:] edit box.

If [I/O Register Definition Files] is checked, an I/O register definition file, which is written
in C language, can be created. Then the setting of [Generate Hardware Setup Function] is
enabled. However, when the project type is “Assembly Application” for the H8S, H8/300
series, the setting of [I/O Register Definition Files] is disabled.

[Heap Size:] can be entered as a hexadecimal or a decimal value as shown below:

Example 1: H’ABCDE (hexadecimal)

Example 2: 0xABCDE (hexadecimal)

Example 3: 1234 (decimal)

If nothing is entered at [Number of I/O Streams:] or [Heap Size:], clicking the [Next>] or
[Finish] button displays the message shown in figure 2.8. In the figure, “Heap Size” instead
of “Number of I/O Streams” will be displayed if nothing is entered in [Heap Size]. Thus
the Step-4 screen or the “Summary” dialog box will not be displayed.

Figure 2.8 [Number of I/O Streams:] Message Box against Empty Input

If an illegal value is entered in [Heap Size:], clicking the [Next>] or [Finish] button displays
the message shown in figure 2.9. Thus the Step-4 screen or the “Summary” dialog box will
not be displayed.

Figure 2.9 [Heap Size:] Message Box against Illegal Value Input

Rev. 1.0, 06/99, page 16 of 59


If an odd number is entered in [Heap Size:], clicking the [Next>] or [Finish] button displays
the message shown in figure 2.10. Thus the Step-4 screen or the “Summary” dialog box will
not be displayed.

Figure 2.10 [Heap Size:] Message against Odd Value Input

Files to be created differ depending on the project type and the settings on the Step-3
screen. Tables 2.4, 2.5, and 2.6 show the files to be created. For details, refer to section 3.1,
“Created Files”.

NOTE
If you want to use an existing main (or _main) function, uncheck [Generate main()
function], add the file of the function after generating the project. If the name of the
function differs from main (or _main), change the caller of the function in
resetprg.src (or resetprg.c in “Application” of H8S,H8/300). Also, change the entry
point option of the inter-module optimizer.

When the project type is “Application” for the SuperH™ RISC engine, the setting of
[Number of I/O Streams:] cannot be changed.

Rev. 1.0, 06/99, page 17 of 59


Table 2.4 Files Created by Step-3 Settings (SuperH™ Application)

Control Setting Created File


[Use I/O Library] Checked lowlvl.src
lowsrc.c
[Number of I/O Streams:] Cannot be specified −
[Use Runtime Library] Checked sbrk.c
[Heap Size:] Can be specified sbrk.h
[Generate main() Function] Checked tutorial.c (the file name is the
same as the project name)
[I/O Register Definition Files] Checked iodefine.h
[Generate Hardware Setup None −
Function]
Assembly source file hwsetup.src
C source file hwsetup.c

Table 2.5 Files Created by Step-3 Settings (H8S, H8/300 Application)

Control Setting Created File


[Use I/O Library] Checked lowlvl.src
lowsrc.c
[Number of I/O Streams:] Can be specified lowsrc.h
[Use Runtime Library] Checked sbrk.c
[Heap Size:] Can be specified sbrk.h
[Generate main() Function] Checked tutorial.c (the file name is the
same as the project name)
[I/O Register Definition Files] Checked iodefine.h
[Generate Hardware Setup None −
Function]
C source file hwsetup.c

The [Number of I/O Streams:], [Use Runtime Library], [Heap Size], [I/O Register
Definition Files], and [Generate Hardware Setup Function] cannot be changed for
“Assembly Application” of the H8S, H8/300 series.

Rev. 1.0, 06/99, page 18 of 59


Table 2.6 Files Created by Step-3 Settings (H8S, H8/300 Assembly Application)

Control Setting Created File


[Use I/O Library] Checked lowlvl.src
[Number of I/O Streams:] Cannot be specified −
[Use Runtime Library] Cannot be Checked −
[Heap Size:] Cannot be specified −
[Generate _main Function] Checked tutorial.src (the file name is the
same as the project name)
[I/O Register Definition Files] Cannot be checked −
[Generate Hardware Setup Cannot be set −
Function]

Rev. 1.0, 06/99, page 19 of 59


2.2.7 Setting the Stack Area

The screen shown in figure 2.11 is displayed when the [Next>] button is clicked in the Step-
3 screen.

Figure 2.11 New Project Wizard Dialog Box (Step-4 Screen)

This screen is used to specify the stack area.

In this tutorial, click the [Next>] button without changing the settings. Then the Step-5
screen will be displayed. Refer to section 2.2.8, “Setting the Vector”.

[Stack Pointer Address:] and [Stack Size:] can be entered in hexadecimal or decimal values
as shown below:

Example 1: H’ABCDE (hexadecimal)

Example 2: 0xABCDE (hexadecimal)

Example 3: 1234 (decimal)

Rev. 1.0, 06/99, page 20 of 59


If nothing is entered in [Stack Pointer Address:] or [Stack Size:], clicking the [Next>] or
[Finish] button displays the message shown in figure 2.12. In the figure, “Stack Size”
instead of “Stack Pointer Address” will be displayed if nothing is entered in [Stack Size].
Thus the Step-5 screen or the “Summary” dialog box will not be displayed.

Figure 2.12 [Stack Pointer Address:] Message Box against Empty Input

If an illegal value is entered in [Stack Pointer Address:] or [Stack Size:], clicking the
[Next>] or [Finish] button displays the message shown in figure 2.13. In the figure, “Stack
Size” instead of “Stack Pointer Address” will be displayed if an illegal value is entered in
[Stack Size]. Thus the Step-5 screen or the “Summary” dialog box will not be displayed.

Figure 2.13 [Stack Pointer Address:] Message Box against Illegal Value Input

If an odd number is entered in [Stack Pointer Address:] or [Stack Size:], clicking the
[Next>] or [Finish] button displays the message shown in figure 2.14. In the figure, “Stack
Size” instead of “Stack Pointer Address” will be displayed if an odd number is entered in
[Stack Size]. Thus the Step-5 screen or the “Summary” dialog box will not be displayed.

Figure 2.14 [Stack Pointer Address:] Message Box against Odd Value Input
Rev. 1.0, 06/99, page 21 of 59
If the [Stack Size:] value is larger than the [Stack Pointer Address:] value, clicking the
[Next>] or [Finish] button displays the message shown in figure 2.15. Thus the Step-5
screen or the “Summary” dialog box will not be displayed.

Figure 2.15 Message Box against [Stack Size:] > [Stack Pointer Address:]

The initial value of the stack area differs depending on [CPU Type:] selected in the Step-1
screen. In this tutorial, since SH7708 has been selected for [CPU Type:] in the Step-1
screen, [Stack Pointer Address:] is set to H’7FFFFFF0 and [Stack Size:] is set to H’400.

The setting of [Stack Size:] is written into stacksct.src for the SuperH™ RISC engine or
into stacksct.h for the H8S, H8/300 series. The stack section address is determined by the
start option of the inter-module optimizer for the SuperH™ RISC engine or the H8S,
H8/300 series. The start address of the stack section is calculated using the formula shown
below:

Stack Section Address = Value of [Stack Pointer Address:] – Value of [Stack Size:]

Rev. 1.0, 06/99, page 22 of 59


2.2.8 Setting the Vector

Clicking the [Next>] button in the Step-4 screen displays the screen shown in figure 2.16.

Figure 2.16 New Project Wizard Dialog Box (Step-5 Screen)

In this screen, a vector is specified.

In this tutorial, click the [Next>] button without changing the settings. Then the Step-6
screen will be displayed. Refer to section 2.2.9, “Changing the File Names to be Created”.

If [Vector Table Definition Files] is checked, the HEW creates a vector table definition file.
The name of the reset vector can be changed by [Vector Handlers:].

The [Handler] column of [Vector Handlers:] displays the handler program name, and the
[Vector] column displays the vector description. To change the handler program, click the
name of the handler program to be changed, and enter a new name.

If nothing is entered in [Handler], the message shown in figure 2.17 will be displayed. Click
[OK] to return to the previous display.

Rev. 1.0, 06/99, page 23 of 59


Figure 2.17 Message Box when No Handler is Input

If a character string which has 129 or more characters is entered as the handler name in
[Handler], the message shown in figure 2.18 will be displayed. Click [OK] to return to the
previous display.

Figure 2.18 Message Box when 129 or More Characters are Input as Handler Name

If an illegal character string is entered in [Handler], the message shown in figure 2.19 will
be displayed. Click [OK] to return to the previous display.

Figure 2.19 Message Box against Illegal Handler Name Input

If [Vector Table Definition File] is checked, the HEW creates the following files:

• vecttbl.src
• intprg.src
• vect.inc
• resetprg.src (restprg.c for “Application” of the H8S, H8/300 series)

Rev. 1.0, 06/99, page 24 of 59


If the handler name in the [Vector Handlers:] list is changed, the HEW does not create
resetrg.src (resetprg.c).

2.2.9 Changing the File Names to be Created

When the [Next>] button is clicked in the Step-5 screen, the screen shown in figure 2.20 is
displayed.

Figure 2.20 New Project Wizard Dialog Box (Step-6 Screen)

The screen shown in figure 2.20 is the final step of the “New Project” wizard. The screen
displays a list of files created according to the previous settings. The [File Name] column in
the list shows a file name, [Extension] shows an extension, and [Description] shows the
description of a file. The file name can be changed. To change a file name, select it by
clicking it and change it to a new file name.

In this tutorial, click the [Finish] button without changing the settings. When the button is
clicked, the “Summary” dialog box will be displayed. Refer to section 2.2.10, “Confirming
Settings (Summary Dialog Box)”.

Rev. 1.0, 06/99, page 25 of 59


NOTE
A file with an extension “h” or “inc” (shown in the “Extension” column) is an
include file. If you change the file name of an include file, the file name at the
include directive have to be modified.

If nothing is entered in [File Name], the message shown in figure 2.21 will be displayed.
Clicking [OK] returns to the previous display.

Figure 2.21 Message Box when No File Name Is Input

If a character string which has 252 or more characters is entered in [File Name], the
message shown in figure 2.22 will be displayed. Clicking [OK] returns to the previous
display.

Figure 2.22 Message Box when 252 or More Characters are Input as File Name

If an illegal character is entered in [File Name], the message shown in figure 2.23 will be
displayed. Clicking [OK] returns to the previous display.

Figure 2.23 Message Box when Illegal Characters are Input as File Name
Rev. 1.0, 06/99, page 26 of 59
2.2.10 Confirming Settings (Summary Dialog Box)

When the [Finish] button is clicked on the Step-6 screen, the dialog box shown in figure
2.24 will be displayed.

Figure 2.24 Summary Dialog Box

[Project Summary:] has the following contents. Confirm the contents and click the [OK]
button. To change the setting, click the [Cancel] button.

• Project name
• Project directory
• CPU series
• CPU type
• Toolchain name
• Toolchain version

Rev. 1.0, 06/99, page 27 of 59


The displayed contents are output as a text file (Readme.txt). If this file is not necessary,
clear the [Generate Readme.txt as a summary file in the project directory] check box.

Click the [OK] button to generate the project.

Rev. 1.0, 06/99, page 28 of 59


2.3 Automatic Project Generation
After [OK] in the “Summary” dialog box is clicked, the project will be generated, and the
HEW will display the project files on the left hand side. (figure 2.25)

Figure 2.25 HEW (When a Project is Created)

The following items are included in the project. For details, refer to section 3, “Functions of
the Project Generator”.

• Project files
• Phase order
• File mapping
• Options for each tool

Rev. 1.0, 06/99, page 29 of 59


NOTE
If you create a project on a network drive, the project generator might detect an
error when generating the project depending on the condition of the network. Then
try creating the project again, or create the project in a local drive and copy the
project to the network drive.

Rev. 1.0, 06/99, page 30 of 59


Section 3 Functions of the Project Generator
This section describes the files created by the project generator, phase order, file mapping,
and option settings.

3.1 Created Files


Table 3.1 lists the files created by the project generator. Each file is described mainly using
a source file of the “Application” project of the SH7708 as an example.

Table 3.1 Created Files

File name Description


initsct.c Initializes the RAM data
dbsct.src(.c) Sets the address of the D and B sections
lowlvl.src Simulated I/O functions
lowsrc.c Standard Input and output functions
lowsrc.h Definition of the number of standard input/output streams
sbrk.c Function for heap area control
sbrk.h Heap area definition
<Project name>.src(.c) Main function
iodefine.h I/O register definition
hwsetup.src(.c) Hardware setting function
intprg.src Interrupt function
vecttbl.src Vector table definition
vect.inc Declaration of functions in the vector table
env.inc Definition of interrupt source register
vhandler.src Reset vector handler
resetprg.src(.c) Reset program
stacksct.src(.h) Stack area setting (definition)
Note: initsct.c is created only for the Super HTM RISC engine. env.inc and vhandler.src are
created only for some CPUs of the Super HTM RISC engine.

NOTE
Confirm the correctness of the definition of the vector table and the definition of the
I/O registers in the generated files reading the hardware manual of the CPU of your
choice.

Rev. 1.0, 06/99, page 31 of 59


(1) initsct.c

This file initializes the RAM area. The section B area is cleared by the numerical value 0,
and the contents of the section D area is copied to the section R area.

Coding example:

extern int *_D_ROM, *_B_BGN, *_B_END, *_D_BGN, *_D_END;


extern void _INITSCT( )
{
char *p, *q;
/*zero clear*/
for( p = (char *)_B_BGN; p < (char *)_B_END; p++)
*p = 0;
/*ROM to RAM*/
for(p = (char *)_D_BGN, q = (char *)_D_ROM; p < (char *)_D_END;
p++, q++)
*p = *q;
}

(2) dbsct.src

This file sets the area information for sections B, D, and R to be used for initialization in (1).

Coding example:

.SECTION D,DATA,ALIGN=4
.SECTION R,DATA,ALIGN=4
.SECTION B,DATA,ALIGN=4
.SECTION C,DATA,ALIGN=4
__D_ROM .DATA.L (STARTOF D) ;Start Address of Section D
__D_BGN .DATA.L (STARTOF R) ;Start Address of Section R
__D_END .DATA.L (STARTOF R) + (SIZEOF R);End Address of Section R
__B_BGN .DATA.L (STARTOF B) ;Start Address of Section B
__B_END .DATA.L (STARTOF B) + (SIZEOF B);End Address of Section B
.EXPORT __D_ROM
.EXPORT __D_BGN
.EXPORT __D_END
.EXPORT __B_BGN
.EXPORT __B_END
.END

Rev. 1.0, 06/99, page 32 of 59


(3) lowlvl.src

This file includes modules, which handle input/output of one character, used by the
simulated I/O in the simulator/debugger. For details on the standard input/output, refer to
the user’s manual of the simulator/debugger of the corresponding CPU family. For details
on creating the low-level interface routine, refer to the C/C++ compiler user’s manual.
When using the simulated I/O in the demonstration program or the like, open the “System
Configuration” dialog box from the [Setup->Configure Platform...] menu of the
simulator/debugger. In the dialog box, set H’0 (set H’4 if SH-4 is selected in [CPU Series])
to [System Call Address], and check [Enable].

(4) lowsrc.c

This file includes interface modules related to standard input/output. For details, refer to
the section describing the low-level interface routine in the C/C++ compiler user’s manual
of the corresponding CPU family.

(5) lowsrc.h (“Application” project of the H8S, H8/300 series only)

This file defines a value (3 in the example) for [Number of I/O Streams:]. To modify the
number of standard I/O streams, change this value.

Coding example:

/*Number of I/O Stream*/


#define IOSTREAM 3

(6) sbrk.c

This file includes a low level interface routine used to allocate space of requested size in the
heap area. In H8S,H8/300, you can specify the minimum reservation unit size (_sbrk_size)
allocated in the heap area. Since the definition of _sbrk_size is commented by default,
activate the definition and specify the minimum block size including a management area of
the block. The size of the management area (6 or 12 bytes) depends on the CPU option. For
details, refer to section 8.4, “Setting the Execution Environment at Library Function
Usage”, in the H8S,H8S/300 C/C++ Compiler User’s Manual.

(7) sbrk.h

Defines a value (H’400 in the example) for [Use Runtime Library]. To change the heap
area size, change this value.

Coding example:

/* size of area managed by sbrk */


Rev. 1.0, 06/99, page 33 of 59
#define HEAPSIZE 0x400

(8) <Project name>.c

This file defines the main program of the application to be developed. This is the start of
the program description. In the “Demonstration” project (only a C source program), the
sample program is written.

Coding example:

void main(void);
void main(void)
{

(9) iodefine.h

The I/O registers of the CPU is defined in C language. The typical instance of definitions
for the selected CPU series is used. Check the contents using the hardware manual.

(10) hwsetup.c

This file initializes the CPU and the peripheral hardwares. The coding example using the
I/O definition of iodefine.h is written as a comment to be used if you want.

Coding example:

#include "iodefine.h"
extern void HardwareSetup();

void HardwareSetup()
{
/* SCI.SCSMR.BYTE = 0;
SCI.SCSMR.BIT.CA = 1;
SCI.SCSMR.BIT.CHR = 1;
.
.
. */

Rev. 1.0, 06/99, page 34 of 59


(11) intprg.src

This file defines a dummy program of the interrupt function. To install the interrupt
program, extract the function name and perform coding. To change the name of an
interrupt function, this file, (12), and (13) must be changed.

Coding example:

.include "vect.inc"
.section IntPRG, code
;H’040 TLB miss/invalid (load)
_INT_TLBMiss_Load
;H’060 TLB miss/invalid (store)
_INT_TLBMiss_Store
;H’080 Initial page write
_INT_TLBInitial_Page
.
.
.
;H’5A0 REF ROVI
_INT_REF_ROVI
sleep
nop
.end

Rev. 1.0, 06/99, page 35 of 59


(12) vecttbl.src

This file defines the interrupt vector table.

Coding example:

.include "vect.inc"

.section VECTTBL,data
.export _RESET_Vectors
_RESET_Vectors:
;<<VECTOR DATA START (POWER ON RESET)>>
;H’000 Power On Reset
.data.l _PowerON_Reset
;<<VECTOR DATA END (POWER ON RESET)>>
;<<VECTOR DATA START (MANUAL RESET)>>
;H’020 Manual Reset
.data.l _Manual_Reset
;<<VECTOR DATA END (MANUAL RESET)>>

.section INTTBL,data
.export _INT_Vectors
_INT_Vectors:
;H’040 TLB miss/invalid (load)
.data.l _INT_TLBMiss_Load
;H’060 TLB miss/invalid (store)
.data.l _INT_TLBMiss_Store
.
.
.

Rev. 1.0, 06/99, page 36 of 59


(13) vect.inc

This file declares an external reference declaration of an interrupt function.

Coding example:

SR_Init: .equ B’01110000000000000000000011110000

;<<VECTOR DATA START (POWER ON RESET)>>


;H’000 Power On Reset
.global _PowerON_Reset
;<<VECTOR DATA END (POWER ON RESET)>>
;<<VECTOR DATA START (MANUAL RESET)>>
;H’020 Manual Reset
.global _Manual_Reset
;<<VECTOR DATA END (MANUAL RESET)>>
;H’040 TLB miss/invalid (load)
.global _INT_TLBMiss_Load
;H’060 TLB miss/invalid (store)
.global _INT_TLBMiss_Store
;H’080 Initial page write
.global _INT_TLBInitial_Page
;H’0A0 TLB protect (load)
.global _INT_TLBProtect_Load
;H’0C0 TLB protect (store)
.global _INT_TLBProtect_Store
.
.
.

(14) env.inc (For the SH3 and later)

This file defines address definition of the interrupt source register.

Coding example:

EXPEVT: .equ H’FFFFFFD4


INTEVT: .equ H’FFFFFFD8

Rev. 1.0, 06/99, page 37 of 59


(15) vhandler.src (For the SH3 and later)

This file defines a function in which a processing function is selected on interrupt.

Coding example:

.include "env.inc"
.include "vect.inc"
.import _RESET_Vectors
.import _INT_Vectors
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; reset ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.section RSTHandler,code
_ResetHandler:
mov.l #EXPEVT,r0
mov.l @r0,r0
shlr2 r0
shlr r0
mov.l #_RESET_Vectors,r1
add r1,r0
mov.l @r0,r0
jmp @r0
nop

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; exceptional interrupt ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.section INTHandler,code
.export INTHandlerPRG
INTHandlerPRG:
_ExpHandler:
mov.l #EXPEVT,r0
mov.l @r0,r0
add.l #-64,r0
shlr2 r0
shlr r0
mov.l #_INT_Vectors,r1
add r1,r0
mov.l @r0,r0
jmp @r0
Rev. 1.0, 06/99, page 38 of 59
nop
.
.
.

(16) resetprg.src

This file defines the initial routine after the reset and calls the main program.

Coding example (SH7708):

.include "vect.inc"

.import _PowerON_Reset_SP
.import INTHandlerPRG
.import __INITSCT
.import _main

.AIFDEF USES_SIMIO
.import __INIT_IOLIB
.import __CLOSEALL
.AENDI

.AIFDEF OTHERLIB
.import __INIT_OTHERLIB
.AENDI

.AIFDEF HWSETUP
.import _HardwareSetup
.AENDI

.section ResetPRG,code
_PowerON_Reset:
_Manual_Reset:
mov.l #_PowerON_Reset_SP, R15 ; Initialize SP
mov.l #INTHandlerPRG,r0
mov.l #H’100,r1
sub.l r1,r0
ldc r0,vbr ; VBR addr set

Rev. 1.0, 06/99, page 39 of 59


mov.l #__INITSCT,r1
jsr @r1
nop

.AIFDEF USES_SIMIO
mov.l #__INIT_IOLIB,r1
jsr @r1
nop
.AENDI

.AIFDEF OTHERLIB
mov.l #__INIT_OTHERLIB,r1
jsr @r1
nop
.AENDI

.AIFDEF HWSETUP
mov.l #_HardwareSetup,r1
jsr @r1
nop
.AENDI

mov.l #SR_Init,r0
ldc r0,sr ; SR set (User AP mode)
mov.l #_main,r1
jsr @r1
nop

.AIFDEF USES_SIMIO1
mov.l #__CLOSEALL,r1
jsr @r1
nop
.AENDI

sleep
nop
.pool
.end

Rev. 1.0, 06/99, page 40 of 59


Coding example (H8S/2655 C source program):

#include <machine.h>
#include "stacksct.h"

#pragma entry PowerON_Reset

extern void main(void);


extern void _INITSCT(void);

#ifdef USES_SIMIO
extern void _INIT_IOLIB(void);
extern void _CLOSEALL(void);
#endif

#ifdef OTHERLIB
extern void _INIT_OTHERLIB(void);
#endif

#ifdef HWSETUP
extern void HardwareSetup(void);
#endif

#pragma section ResetPRG

void PowerON_Reset(void);
void PowerON_Reset(void)
{
set_imask_ccr(1);
_INITSCT();

#ifdef USES_SIMIO
_INIT_IOLIB();
#endif

#ifdef OTHERLIB
_INIT_OTHERLIB();
#endif

#ifdef HWSETUP

Rev. 1.0, 06/99, page 41 of 59


HardwareSetup();
#endif

main();

#ifdef USES_SIMIO
_CLOSEALL();
#endif

sleep();
}

(17) stacksct.src

In this file, the stack area (H’400 in size in the example) is set. To change the stack size,
change the value of the [StackEND] (when SH7708 is used).

Coding example (SH7708):

.section Stack,STACK
.export _PowerON_Reset_SP
.export _Manual_Reset_SP

StackEND: .res.b H’400


_PowerON_Reset_SP: .equ $
_Manual_Reset_SP: .equ $
.end

Coding example (H8S/2655 C header file):

#pragma stacksize 0x200

Rev. 1.0, 06/99, page 42 of 59


3.2 Phase Order
Phase orders set by the project generator are listed in tables 3.2 and 3.3. The phase order
differs depending on the purchased package and the project type.

Table 3.2 Set Phase Order (SuperH™ RISC engine)

Project Type Phase Order


Application SuperH™ RISC engine C/C++ Compiler
Demonstration SuperH™ RISC engine Assembler
SuperH™ RISC engine Inter-Module Optimizer
H Series Object Converter
Library SuperH™ RISC engine C/C++ Compiler
SuperH™ RISC engine Assembler
H Series Librarian

Table 3.3 Set Phase Order (H8S, H8/300 Series)

Project Type Phase Order


Application H8S,H8/300 Series C/C++ Compiler
Assembly Application H8S,H8/300 Series Assembler
Demonstration H8S,H8/300 Series Inter-Module Optimizer
H Series Object Converter
Library H8S,H8/300 Series C/C++ Compiler
H8S,H8/300 Series Assembler
H Series Librarian

Rev. 1.0, 06/99, page 43 of 59


3.3 File Mapping
File mapping can be set by the project generator. For example, as shown in figure 3.1, a file
output by the Tool A can be the input file for the Tool B.

Figure 3.1 File Mapping Example

File mapping set by the project generator is listed in tables 3.4 and 3.5. The file mapping
differs depending on the purchased package and the project type.

Table 3.4 Set File Mapping (SuperH™ RISC engine)

Configuration File mapping


Tool A File group Tool B
Application SuperH™ RISC engine Object file SuperH™ RISC engine
C/C++ Compiler Inter-Module Optimizer
Demonstration SuperH™ RISC engine Object file SuperH™ RISC engine
Assembler Inter-Module Optimizer
SuperH™ RISC engine Assembly source file SuperH™ RISC engine
C/C++ Compiler Assembler
SuperH™ RISC engine Absolute file H Series
Inter-Module Optimizer Object Converter
Library SuperH™ RISC engine Object file H Series Librarian
C/C++ Compiler
SuperH™ RISC engine Object file H Series Librarian
Assembler
SuperH™ RISC engine Assembly source file SuperH™ RISC engine
C/C++ Compiler Assembler

Rev. 1.0, 06/99, page 44 of 59


Table 3.5 Set File Mapping (H8S, H8/300 Series)

Configuration File mapping


Tool A File group Tool B
Application H8S,H8/300 Series Object file H8S,H8/300 Series
C/C++ Compiler Inter-Module Optimizer
Assembly H8S,H8/300 Series Object file H8S,H8/300 Series
Application Assembler Inter-Module Optimizer
H8S,H8/300 Series Assembly source file H8S,H8/300 Series
Demonstration Compiler Assembler

H8S,H8/300 Series Absolute file H Series


Inter-Module Optimizer Object Converter
Library H8S,H8/300 Series Object file H Series Librarian
C/C++ Compiler
H8S,H8/300 Series Object file H Series Librarian
Assembler
H8S,H8/300 Series Assembly source file H8S,H8/300 Series
C/C++ Compiler Assembler

3.4 Options
The project generator sets the options for the C/C++ compiler, assembler, and inter-
module optimizer. (A set of options for all the tools is called the configuration.) When the
project type is “Demonstration”, only the “Debug” configuration is created. For other
project types, both the “Debug” configuration and “Release” configuration are created.
Tables 3.6 to 3.17 list the options set for each tool (called the default options hereafter), and
the options that can be set by users through the project generator wizard dialog box (called
the user options hereafter).

For details on option items, refer to the user’s manual of each tool.

Options set by the project generator can be changed in the [Options] menu of the HEW.
For details, see section 4.2, “Changing Options”, or the Hitachi Embedded Workshop
User’s Manual.

Placeholders, “$(***)” in the tables, are converted as follows:

$(CONFIGDIR): Directory in which the target configuration results are output


$(FILELEAF): Target file name (excluding a file extension)
$(PROJECTNAME): Target project name

NOTE
Options such as section names and start addresses specified by the project
Rev. 1.0, 06/99, page 45 of 59
generator are set to show examples of usage. You might observe a warning message
(e.g. “1210 CANNOT FIND SECTION (C)” of the inter-module optimizer) when
you build the project right after it is generated. Tailor the options for your CPU
setting (e.g. mode and memory map).

(1) SuperHTM RISC engine options

Table 3.6 Default Options (Super HTM RISC engine C/C++ Compiler)

Configuration Option Item Contents


Debug Debug information ON
Object file ON. File: $(CONFIGDIR)\$(FILELEAF).obj
List file OFF
Macro definition Macro name USES_SIMIO is defined
(the main file of
Demonstration
only)
Release Debug information OFF
Object file ON. File: $(CONFIGDIR)\$(FILELEAF).obj
List file OFF

Rev. 1.0, 06/99, page 46 of 59


Table 3.7 User Options (Super HTM RISC engine C/C++ Compiler)

Dialog Box
Item Option Item Contents
Target CPU CPU type [SH-1]: Creates SH-1 object
setting screen <SH1 to SH4> [SH-2]: Creates SH-2 object
[CPU Series:] [SH-DSP]: Creates SH-2 object
[SH-2E]: Creates SH-2E object
[SH-3]: Creates SH-3 object
[SH3-DSP]: Creates SH-3 object
[SH-3E]: Creates SH-3E object
[SH-4]: Creates SH-4 object
Option setting Endian type [Big]: Big endian
screen <SH-3 to SH-4> [Little]: Little endian
[Endian:]
Option setting FPU <SH-4> [Mix]: Float type is calculated as single-precision floating
screen [FPU:] point. Double type is calculated as double-precision
floating point
[Single]: All floating point operations are calculated as a
single-precision floating point
[Double]: All floating point operations are calculated as a
double-precision floating point
Option setting Rounding direction [Zero]: Rounded to zero
screen <SH-4> [Nearest]: Rounded to the nearest value
[Round:]
Option setting Handling of [Not checked]: Assumes the denormalized number is 0.
screen denormalized [Checked]: Assumes the denormalized number is valid.
[Denormalized number <SH-4>
number
allowed as a
result]
Option setting Position [Not checked]: Does not generate program section as
screen independent position independent code
[Position program section [Checked]: Generates program section as position
independent <SH-2 to SH-4> independent code
code (PIC)]
Option setting double type [Checked]: Compiles the source code treating double
screen [Treat calculated as (double-precision floating point) type as the float (single-
double as single-precision precision floating point) type
float] <SH-1 to SH-3E>

Rev. 1.0, 06/99, page 47 of 59


Table 3.8 Default Options (Super HTM RISC engine Assembler)

Configuration Option Item Contents


Debug Debug information ON
Object file ON. File: $(CONFIGDIR)\$(FILELEAF).obj
List file OFF
Release Debug information OFF
Object file ON. File: $(CONFIGDIR)\$(FILELEAF).obj
List file OFF

Rev. 1.0, 06/99, page 48 of 59


Table 3.9 User Options (Super HTM RISC engine Assembler)

Dialog Box
Item Option Item Contents
Target CPU CPU type [SH-1]: Creates SH-1 object
setting screen <SH1 to SH4> [SH-2]: Creates SH-2 object
[CPU Series:] [SH-DSP]: Creates SH-2 object
[SH-2E]: Creates SH-2E object
[SH-3]: Creates SH-3 object
[SH3-DSP]: Creates SH-3 object
[SH-3E]: Creates SH-3E object
[SH-4]: Creates SH-4 object
Option setting Endian type [Big]: Big endian
screen <SH-3 to SH-4> [Little]: Little endian
[Endian]
Option setting Rounding direction [Zero]: Rounded to zero
screen <SH-4> [Nearest]: Rounded to the nearest value
[Round:]
Option setting Handling of [Not checked]: Assumes the denormalized number as 0.
screen denormalized [Checked]: Accepts the denormalized number as it is
[Denormalized number <SH-4>
number
allowed as a
result]
Created file Definition of [Checked]: Replacement symbol USES_SIMIO is
setting screen replacement defined as character string “1”
[Use I/O character string
Library] (resetprg.src only)
Created file Definition of [Checked]: Replacement symbol OTHERLIB is defined
setting screen replacement as character string “1”
[Use Runtime character string
Library] (resetprg.src only)
Created file Definition of [Assembly source file]: Replacement symbol HWSETUP
setting screen replacement is defined as character string “1”
[Generate character string [C source file]: Replacement symbol HWSETUP is
Hardware (resetprg.src only) defined as character string “1”
Setup
Function]

Rev. 1.0, 06/99, page 49 of 59


Table 3.10 Default Options (SuperHTM RISC Engine Inter-Module Optimizer)

Configuration Option Item Contents


Debug Optimization Suppresses optimization
Debug information ON
Output file ON. File: $(CONFIGDIR)\$(PROJECTNAME).abs
Entry address Sets the address of the external definition symbol
_main as the execution start address
Specification to Reserves the R section in the output load module as
facilitate ROM a RAM area for variables with initial values. The R
support function section has the same size as the D section, which is
a ROM area to store the initial values.
Section start address Specifies the linkage order of the sections shown
and linkage order below and their start addresses (the start address
specification and section to be set depends on the target CPU).
Example: SH7708
<address> <section>
H’00002000 P
C
D
H’7F000000 B
R
Release Optimization Suppresses optimization
Debug information OFF
Output file ON. File: $(CONFIGDIR)\$(PROJECTNAME).abs
Entry address Sets the address of the external definition symbol
_main as the execution start address
Specification to Reserves the R section in the output load module as
facilitate ROM a RAM area for variables with initial values. The R
support function section has the same size as the D section, which is
a ROM area to store the initial values.
Section start address Specifies the linkage order of the sections shown
and linkage order below and their start addresses (the start address
specification and section to be set depends on the target CPU).
Example: SH7708
<address> <section>
H’00002000 P
C
D
H’7F000000 B
R

Rev. 1.0, 06/99, page 50 of 59


Table 3.11 User Options (SuperHTM RISC Engine Inter-Module Optimizer)

Dialog Box
Item Option Item Contents
Target CPU Library file Specifies the standard library of the SuperHTM RISC
setting screen specification engine C/C++ compiler
[CPU Series:]
Option setting
display (all
controls)
Stack area Section start address Specifies the linkage order of the section shown
setting screen and linkage order below and its start address
[Stack Pointer specification <address> <section>
Address:] (Address A) Stack
[Stack Size:] Address A = [Stack Pointer Address:] − [Stack Size:]
Vector setting Section start address Specifies the linkage order of sections shown below
screen [Vector and linkage order and their start addresses
Table Definition specification <address> <section>
Files] H’00000000 RSTHandler
H’00000800 INTHandler
VECTTBL
INTTBL
IntPRG
H’00001000 ResetPRG

(2) H8S, H8/300 Series Options

Table 3.12 Default Options (H8S,H8/300 Series C/C++ Compiler)

Configuration Option Item Contents


Debug Debug information ON
Object file ON. File: $(CONFIGDIR)\$(FILELEAF).obj
List file OFF
Macro definition (the main file of Defines macro name USES_SIMIO
Demonstration only)
Release Debug information OFF
Object file ON. File: $(CONFIGDIR)\$(FILELEAF).obj
List file OFF

Rev. 1.0, 06/99, page 51 of 59


Table 3.13 User Options (H8S, H8/300 Series C/C++ Compiler)

Dialog Box Item Option Item Contents


Target CPU setting CPU type / Operating [2600]: H8S/2600
screen [CPU Series:] mode [Normal]: H8S/2600 normal mode
(*1) [Advanced]: H8S/2600 advanced mode
Option setting screen [1M byte]: Address space of 1 Mbyte
[Operating Mode:] (*2) [16M byte]: Address space of 16 Mbytes
[Address Space:] (*3) [256M byte]: Address space of 256 Mbytes
[4G byte]: Address space of 4 Gbytes
(*1) item:
[2600], [2000], [300H], [2000]: H8S/2000
[300], or [300L] [Normal]: H8S/2000 normal mode
(*2) item: [Advanced]: H8S/2000 advanced mode
[Normal] or [Advanced] [1M byte]: Address space of 1 Mbyte
(when (*1) is [2600], [16M byte]: Address space of 16 Mbytes
[2000], or [300H]) [256M byte]: Address space of 256 Mbytes
[4G byte]: Address space of 4 Gbytes
(*3) item (depends on
the (*1) selection):
[300H]: H8/300H
[1M byte], [16M byte],
[Normal]: H8/300H normal mode
[256M byte], or [4G byte]
[Advanced]: H8/300H advanced mode
(when the (*2) item is
[1M byte]: Address space of 1 Mbyte
[Advanced])
[16M byte]: Address space of 16 Mbytes

[300]: H8/300

[300L]: H8/300L
Option setting screen Parameter storage [Checked]: (E)R0 and (E)R1 are used
[Change number of register [Not checked]: (E)R0, (E)R1, and (E)R2 are
parameter registers from used
2 (default) to 3]
Created file setting Definition of character [Checked]: Defines a macro name
screen string replacement USES_SIMIO
[Use I/O Library] (resetprg.c only)
Created file setting Definition of character [Checked]: Defines a macro name
screen string replacement OTHERLIB
[Use Runtime Library] (resetprg.c only)
Created file setting Definition of character [Assembly source file]: Defines a macro
screen [Generate string replacement name HWSETUP
Hardware Setup (resetprg.c only) [C source file]: Defines a macro name
Function] HWSETUP

Rev. 1.0, 06/99, page 52 of 59


Table 3.14 Default Options (H8S, H8/300 Series Assembler)

Configuration Option Item Contents


Debug Debug information ON
Object file ON. File: $(CONFIGDIR)\$(FILELEAF).obj
List file OFF
Release Debug information OFF
Object file ON. File: $(CONFIGDIR)\$(FILELEAF).obj
List file OFF

Table 3.15 User Options (H8S, H8/300 Series Assembler)

Dialog Box Item Option Item Contents


Target CPU setting screen CPU type / [2600]: H8S/2600
[CPU Series:] (*1) Operating [Normal]: H8S/2600 normal mode
Option setting screen mode [Advanced]: H8S/2600 advanced mode
[Operating Mode:] (*2) [1M byte]: Address space of 1 Mbyte
[Address Space:] (*3) [16M byte]: Address space of 16 Mbytes
[256M byte]: Address space of 256 Mbytes
(*1) item: [4G byte]: Address space of 4 Gbytes
[2600], [2000], [300H],
[300], or [300L] [2000]: H8S/2000
(*2) item: [Normal]: H8S/2000 normal mode
[Normal] or [Advanced] [Advanced]: H8S/2000 advanced mode
(when (*1) is [2600], [1M byte]: Address space of 1 Mbyte
[2000], or [300H]) [16M byte]: Address space of 16 Mbytes
[256M byte]: Address space of 256 Mbytes
(*3) item (depends on the
[4G byte]: Address space of 4 Gbytes
(*1) selection):
[1M byte], [16M byte],
[300H]: H8/300H
[256M byte], or [4G byte]
[Normal]: H8/300H normal mode
(when the (*2) item is
[Advanced]: H8/300H advanced mode
[Advanced])
[1M byte]: Address space of 1 Mbyte
[16M byte]: Address space of 16 Mbytes

[300]: H8/300

[300L]: H8/300L

Rev. 1.0, 06/99, page 53 of 59


Table 3.16 Default Options (H8S, H8/300 Series Inter-Module Optimizer)

Configuration Option Item Contents


Debug Optimization Suppresses optimization
Debug information ON
Output file ON. File: $(CONFIGDIR)\$(PROJECTNAME).abs
Entry address Sets the address of the external definition symbol
_main as the execution start address
Specification to Reserves the R section in the output load module as a
facilitate ROM RAM area for variables with initial values. The R
support function section has the same size as the D section, which is a
ROM area to store the initial values.
Section start Specifies the linkage order of the sections shown below
address and linkage and their start addresses (the start address and section
order specification to be set depends on the target CPU)
Example: H8S/2655 normal mode
<address> <section>
H’00000800 P
C
D
H’0000EC00 B
R
Release Optimization Suppresses optimization
Debug information OFF
Output file ON. File: $(CONFIGDIR)\$(PROJECTNAME).abs
Entry address Sets the address of the external definition symbol
_main as the execution start address
Specification to Reserves the R section in the output load module as a
facilitate ROM RAM area for variables with initial values. The R
support function section has the same size as the D section, which is a
ROM area to store the initial values.
Section start Specifies the linkage order of the sections shown below
address and linkage and their start addresses (the start address and section
order specification to be set depends on the target CPU).
Example: H8S/2655 normal mode
<address> <section>
H’00000800 P
C
D
H’0000EC00 B
R

Rev. 1.0, 06/99, page 54 of 59


Table 3.17 Default Options (H8S, H8/300 Series Inter-Module Optimizer)

Dialog Box
Item Option Item Contents
Target CPU Library file Specifies the standard library of the H8S, H8/300
setting screen specification series C/C++ compiler
[CPU Series:]
Option setting
display (all
contols)
Stack area Section start Specifies the linkage order of the section shwon below
setting screen address and linkage and its start addresses
[Stack Pointer order specification <address> <section>
Address:] (Address A) S
[Stack Size:] Address A = [Stack Pointer Address:] − [Stack Size:]
Vector setting Section start Specifies the linkage order of the sections shown below
screen [Vector address and linkage and their start addresses
Table Definition order specification <address> <section>
Files] H’00000000 VECTTBL
INTTBL
H’00000400 PRsetPRG
IntPRG

Rev. 1.0, 06/99, page 55 of 59


Section 4 Project Change
This section describes how to modify the project generated by the project generator.

4.1 Adding/Deleting a Project File


The file generated by the HEW depends on the settings made in the “New Project” wizard
dialog box. To add or delete a project file after the project is created, follow the
instructions shown below:

To Add a Project File:

When the [Project->Add Files…] menu is selected, or the [Insert] key is pressed in the
workspace window, the dialog box shown in figure 4.1 will be displayed. Select the file to be
added and click the [Add] button.

The common options in the project such as [CPU] will be automatically set to the added file.
To set an additional option, refer to section 4.2, “Changing Options”.

Figure 4.1 Add Dialog Box

Rev. 1.0, 06/99, page 56 of 59


To Delete a Project File:

When the [Project->Remove Files...] menu is clicked, the dialog box shown in figure 4.2 will
be displayed. Select the file to be deleted, click the [Remove] button, and click the [OK]
button. A file can also be deleted by selecting the file in the workspace window and pressing
the [Delete] key as shown in figure 4.3.

Figure 4.2 Remove Project Files Dialog Box

Rev. 1.0, 06/99, page 57 of 59


Figure 4.3 Remove a File from the Project Window

Rev. 1.0, 06/99, page 58 of 59


4.2 Changing Options
When an option specified by the project generator is to be changed, select [Options -> <tool
name>]. Figure 4.4 shows the option setting dialog box of the SuperH™ RISC engine
C/C++ compiler. An option specified to a file newly added to the project can be changed if
you specify an option to the “Default Options” icon of the corresponding file group.

Figure 4.4 Option Setting Dialog Box

Rev. 1.0, 06/99, page 59 of 59

You might also like