Digital Signal Processing Reference
In-Depth Information
(1)
(1)
Behavior code adapt to HW
Build assembly library
(1)
C-HW-adapter
(2)
C-compiler
(3)
Compile C code to assembly
(2)
Assembly coding
(3)
Assembler
(4)
Link objective codes and allocate codes to program memory
(4)
Objective linker
Generate finally binary code and run it on simulator
(5) (6)
(5)
ASM simulator
(5) (6)
Verify codes, benchmarking, and release the design
(6)
Debugger
(a) The method translating source code to qualified assembly code
(b) Toolchain
Fig. 17
Firmware design flow using programmer's toolchain
A C-code adapter might be a tool or a step of programming methodology. To get
quality assembly code from C-compiler, the source C-code should adapt to hardware
including:
￿
Change or modify algorithms to adapt to hardware.
￿
Adapt data types to hardware.
￿
Add annotations to guide instruction selections during compiling.
After adapting the source C-code to hardware, the C-code is compiled to
assembly code by the compiler. A compiler consists of its frontend with source
code analyzer and optimizer, and its target code synthesizer, or the backend. Most
ASIP compilers are based on gcc (GNU Compiler Collection). Compiler design for
ASIP DSP can be found in other chapters in this handbook.
The assembler further translates assembly code into binary code. The translation
process has three major steps. The first step is to parse the code and set up symbol
tables. The second step is to set up the relationship between symbolic names and
addresses. The third step is to translate each assembly statement; opcode, registers,
specifiers, and labels into binary code. The input of an assembler is the source
assembly code. The output of an assembler is the relocatable binary code called
object file. The output file from an assembler is the input file to a linker, which
contains machine (binary) instructions, data, and book-keeping information (symbol
table for the linker).
The assembly instruction set simulator executes assembly instructions (in binary
machine code format) and behaves the same way as a processor. It is therefore
called the behavioral model of the processor. A simulator can be a processor core
simulator or a simulator of the whole ASIP DSP chip. The simulator of the core
covers the functions of the basic assembly instructions, which should be “bit and
cycle accurate” to the hardware of the core. The simulator of the ASIP chip covers
the functions of both the core and the peripherals, which should be “bit, cycle, and
pin accurate” meaning the result from the simulator should match the result from
the whole processor hardware.
 
Search WWH ::




Custom Search