kissmoh
Junior Member level 1
- Joined
- Jan 17, 2013
- Messages
- 16
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,443
hi
im trying to make an image processor using virtex5, and im using modelsim for simulation tool.
my question is,
in testbench file, how to read multiple sequential images?
i can open and read 1 frame image but dont know how to do when the next frame is needed.
this is part of my test bench code
....
im trying to make an image processor using virtex5, and im using modelsim for simulation tool.
my question is,
in testbench file, how to read multiple sequential images?
i can open and read 1 frame image but dont know how to do when the next frame is needed.
this is part of my test bench code
....
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 initial begin // Initialize Inputs nRESET = 0; CL0_CLK = 0; CL0_DATA = 0; IN_SW1 = 1; read_image_point = $fopen("address/a.raw","rb+"); read_image_point2 = $fread(read_reg, read_image_point); write_image_point = $fopen("address/b.raw","wb+"); ... // Wait 100 ns for global reset to finish #100; nRESET = 1; // Add stimulus here end always begin #20 CL0_CLK <= ~CL0_CLK; //25MHz end always@(posedge CL0_CLK or negedge nRESET) begin // CL0_DATA : 2 latency if(!nRESET) begin ... read_count <= 0; read_data <= 0; ... end else begin if(DVAL) begin if(read_count == width*height - 1) begin read_data <= read_reg[read_count]; ... read_count <= 0; end else begin read_data <= read_reg[read_count]; ... read_count <= read_count + 1'b1; end end else begin ... end end end
Last edited: