Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Read and write bitmap file in vhdl

Status
Not open for further replies.

mawais

Junior Member level 2
Joined
Mar 4, 2009
Messages
20
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
1,433
reading file with testbench vhdl

Hi!
I am tryint to write a vhdl code for downsampling of image. I have to actually write a test bench that cna can read a grayscale bitmap image and then write a downscaled version of image as a result in the bitmap format. Any help?.
thanks in advance.
Awais
 

reading image file in vhdl

I guess you require the testbench to act as a behavioral model of your design and downsample the image, so that you can compare it with design output. If this is your intention, you can use any other script like perl, shell script or C/C++ or MATLAB to downsample the image. Store the output in normal text format. Use your testbench only to read the image, feed the design inputs and capture the output. Then using another script you can compare the design output file with actual downsampled output from the script.
 

bitmap to byte conversion vhdl

thanks for the reply. But this is not what i intend to do. Rather I am sorry, I think I asked question which was ambiguous itself.
Actually I want my test bench to read an image file and pass the pixel data to the design with other control signals. And the design in return pass the pixels of processed image (a down sampled image) to the test bench. Where the test bench will write a new bitmap image. The test bench needs not to downsample the image, it will be done by the design itself.
And secondly I want to read the bitmap file directly in test bench instead of first converting it to text file.
thanks.
Awais
 

bmp in vhdl

ok. it requires normal file read operations from your testbench. but reading a bitmap is quite different from normal text file. you need to understand the format of bitmap, which is available in many website (wiki). The initial few bits are header, which gives information about the file. Read the initial X bytes which are header. decode this information and configure the testbench to understand the actual image data. From here on it is like normal file read. I also guess that normally bitmap data is actually the inverted data, ie the last pixel data is first.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top