Description: This directory contains a VHDL implementation of the versatility stressmark based on image compression. This is a low complexity implementation (see benchmark specification document) of the stressmark. In this implementation, the 2D Wavelet and quantization functions were implemented on the FPGA, and the remaining functions were implemented in software. Because this stressmark implementation was evaluating reconfiguration overhead, a collection of configurations was sequentially downloaded into a Xilinx 4013 FPGA, computations were performed, and the results were returned to the host. Once the results were returned to the host, the software functions, run-length encoding and entropy coding, were performed on the host (Pentium PC). More specifically, the sequence of operations was as follows: - load the image data into the memory of the WILDFORCE board - download a configuration which copies the bytes associated with the image into 4 byte words in the upper portion of the WILDFORCE board's memory (fix_mem512.vhd) - download the 2D wavelet configuration and perform the transform, leaving the results in the on-board WILDFORCE memory (wavelet512.vhd) - download the quantization configuration, leaving the results in the on-board WILDFORCE memory (remaining VHDL files shown below, except those used for simulation) - copy the results from the WILDFORCE on-board memory to the host - perform the run-length encoding and entropy coding functions on the host - run the software decompress routine - run the compare routine Implementation Status: This was implemented on the Annapolis Micro Systems WILDFORCE board and tested. Although it works, it does not comply with the specification, but it is close. Files: fix_mem512.vhd - Front end to wavelet512.vhd, maps input data to architecture wavelet512.vhd - Performs a wavelet transform on 512 x 512 image pe1lca.vhd - Top level VHDL file for quantization FPGA implementation quant.vhd - Instantiates all components needed to perform quantization operation state.vhd - State machine for the quantization implementation. min_max.vhd - Determines the minimum and maximum values for a given block of data thresh.vhd - Calculates threshold values for classification address.vhd - Responsible for address generation class.vhd - Performs classification interface.vhd - Provides the host and memory interface dut.vhd - Top level VHDL simulation file sram.vhd - File modeling WILDFORCE memory ram16x1s.vhd - File modeling Xilinx synchronous memory The files in this directory provide a sample software implementation of the versatility stressmark. Please refer to the the stressmark specification and methodology documents for more information on the benchmarking process. Please note that the stressmark specification only requires that the compression procedure be performed on the configurable computing device. Decompression can be carried out in software on the host platform. The sample compression implementation provided in this release has been designed to avoid the use of floating point arithmetic and integer multiplications and divisions. The compression process can be naturally divided into four functionally independent steps: 1. Wavelet transform, 2. Quantization, 3. Run-length encoding and 4. Entropy coding. Each of these steps can be implemented as separate device configurations to decrease area requirements and/or increase performance. This directory contains the following files: README : This file compress.c : Source code for the image compression step decompress.c : Source code for the image decompression step compare.c : Source code for the image comparison utility lena.pgm \ barbara.pgm > Three test "pgm" image files used to validate implementation goldhill.pgm / run_benchmark : runs through all steps for a given image results_matrix: results tabulated for old and new versions of "compare" Each of the three source files are complete and independent entities and should be compiled independently. Specific compilation procedures will depend on your specific systems, but a typical procedure would simply be: gcc compress.c -o compressimage gcc decompress.c -o decompressimage gcc compare.c -o compare -lm You can validate your implementation by using the test images provided. This can be done by compressing, decompressing and comparing the original and decompressed images. For example: %compressimage lena.pgm Compressed size is 5556 bytes % decompressimage lena.cmp decompress.pgm % compare lena.pgm decompress.pgm Root Mean Square Error(RMSE) = 8.046825 Signal to Noise Ratio (PSNR) = 30.018312 Maximum Pixel Difference = 77.000000 Since the original image required 262159 bytes and the compressed version only required 5556 bytes, the compression ratio is 47.18. We can compute the number of bits per pixel (bpp) as required by the stressmark spec by simply dividing the number of bits (5556x8) by the number of pixels (512x512) This gives us ~0.17bpp, which is better than the 0.25bpp requirement. We also see that the PSNR of 30db meets the minimum signal to noise requirement defined in the spec. The compression utility accepts an optional compression level parameter. The compression level parameter can be set to an integer between 0 and 255; when omitted, a default compression level of 128 is used. Please note that this parameter is not required by the benchmark specification and need not be supported by a compliant implementation. The following examples demonstrates the use of this feature: %compressimage barbara.pgm 0 Compressed size is 29708 bytes % decompressimage barbara.cmp decompress.pgm % compare barbara.pgm decompress.pgm Root Mean Square Error(RMSE) = 14.299732 Signal to Noise Ratio (PSNR) = 25.024246 Maximum Pixel Difference = 122.000000 % compressimage barbara.pgm 255 Compressed size is 4915 bytes % decompressimage barbara.cmp decompress.pgm % compare barbara.pgm decompress.pgm Root Mean Square Error(RMSE) = 16.932775 Signal to Noise Ratio (PSNR) = 23.556241 Maximum Pixel Difference = 133.000000 % compressimage barbara.pgm Compressed size is 8187 bytes % decompressimage barbara.cmp decompress.pgm % compare barbara.pgm decompress.pgm Root Mean Square Error(RMSE) = 15.033756 Signal to Noise Ratio (PSNR) = 25.589454 Maximum Pixel Difference = 122.000000 For convenience, the script "run_benchmark" is provided, which goes through the compress, decompress and compare steps of the benchmark for a given image. This script should be run as shown below. % run_benchmark [imagename] [compression level] % run_benchmark barbara 128 % run_benchmark lena 128 % run_benchmark goldhill 256 ================