24
Chapter 4:
Design for Implementation
In the previous chapter, the first steps of the GSEG
algorithm were modified to
achieve an efficient implementation in an FPGA. The design flow used during this process
was documented and a set of design guidelines were generated from observations. The
design flow and guidelines have been paired to develop a general methodology for tailoring
algorithms for implementation. In this chapter, the Design for Implementation (DFI)
methodology is presented in detail.
4.1
Design for Implementation Flow
In order to justify or validate the algorithm modifications presented in the previous
chapter, a metric is needed to observe and evaluate changes in the resulting image. With a
metric
selected, a threshold is chosen based on what is considered acceptable image
degradation for the given application. The selection of image
quality metrics and the
definition of tolerable error serve as the initial step in the DFI flow, which is illustrated in
Figure 4.1. The image quality metrics used to evaluate the GSEG algorithm modifications
are discussed in more detail in the next chapter.
25
Figure 4.1: The Design for Implementation Iterative Flow.
As mentioned in the Introduction, the next step in the implementation process of an
algorithm is to replace the intrinsic functions. The reduction of these intrinsic functions to
fundamental operations, or low-level code, is a vital step since any HDL code needs to be
written in terms of these operations. The low-level code serves as a basis for justifying all
modifications made to the original algorithm and is recommended to be written in the same
high-level programming language as the original image processing algorithm. Next, the
conversion of the low-level algorithm to C-code is performed. This step is not absolutely
necessary, but can be used to generate a bit-exact model
to compare with future HDL
results. Finally, functions for different image quality metrics can also be easily written in
these languages, may even be intrinsic, or exist already.
Once the sequence of fundamental operations has been detailed in low-level code
or C-code, the operations are partitioned into pipeline stages. These pipeline stages
represent a series of operations that can each be performed within a clock cycle, and can
also serve as intermediate test points. The chosen image quality metrics can be generated
after each stage in order to validate a small number of algorithm modifications at a time.
In addition to the testing of the fundamental operations, the high-level modeling languages
26
lend well to the generation of test vectors that are necessary to validate any C and HDL
code. After laying out the pipeline stages, the design is prototyped using an HDL such as
Verilog or VHDL. Again, the results generated from the HDL, whether from a test bench
or emulation, can be verified using the same high-level programming language as before.
Do'stlaringiz bilan baham: