This repository is a development sandbox. The respository contains three related development efforts:
- VHDL to Verilog conversion of the first JPEG-encoder reference (rational explained below).
- MyHDL verification and co-simulation environment, tests will functionally verify and compare the reference JPEG-encoders.
- A MyHDL implementation of a JPEG-encoder.
The JPEG encoders used are the cores available at open-cores in addition to JPEG encoders being developed. This is a WIP and not fully complete.
A stimulus and verification environment was created with Python and MyHDL. An image is streamed to the encoder and the output is captured. The hardware generated JPEG bitstream is compared to a software JPEG bitstream with similar settings.
In the future the output of the various encoders will be compared to each other as well as the encoder performance (.e.g. max fps).
- hdl/jpegenc_v1: VHDL JPEG encoder converted to Verilog
- hdl/jpegenc_v2: OC Verilog JPEG encoder.
- jpegenc: A fresh (non-ported) MyHDL implementation,
jpegenc
is a Python package being developed.
To run the test the following needs to be installed:
- Icarus Verilog
- Python (currently using 2.7)
- MyHDL
- Python Imaging Library (e.g. pip install Pillow)
The MyHDL VPI module needs to be built and copied to the test directory.
>> cd myhdl/cosimulation/icarus
>> make
>> cp myhdl.vpi <somewhere>/test_jpeg/test
Once the tools and installed and the VPI module built the test can be run.
>> cd test
>> python test_jpecenc.py
Depending on the test file the test can take significant time to run. Majority of the time is spent in the Verilog simulator (as seen from top).
PID COMMAND %CPU TIME MEM
3061 vvp 82.7 09:45.51 8200K
3048 Python 18.7 02:16.07 14M
Cosimulation time for a 80x80 pixel image and not VCD tracing.
CPython execution time:
pypy execution time:
Cosimulation time for a 80x80 pixel image and VCD tracing.
CPython execution time:
pypy execution time:
As mentioned, majority of the time is spent in the Verilog simulator the Python run-time has little effect.
Someday (probably never) this section might contain some useful information.
They must work ...
awesomely ...
and fast ... correct?
28-Dec-2014 : Conversion error was found in V1, V1 finishes compressing the frame. V2 has error with small images, this might be a design limitation.
07-Dec-2014 : Neither encoder completes successfully with a small test image, currently debugging (design1 (v1) conversion complete need to find any errors in conversion). The test environment will stream the image in and complete shortly after the image has been streamed in.
05-Dec-2014 : Design1 conversion to verilog is mostly complete, spending some time verifying.
09-Nov-2014 : The test environment will stream an image to both the design1 and design2 encoders. The output is not interrogated (yet). Design1 conversion to verilog is incomplete.
-
Use Python3 as the default python verson.
-
Check encoded bitstreams, determine metrics to compare encoders.
-
Debug the small test image, neither encoder appears to finish.
-
Finish converting desing1 to Verilog.
80b1864
: 16-Jul-20157c7bb58
: 27-Apr-2015