Line 31... |
Line 31... |
parameter clkL = clkP - clkH;
|
parameter clkL = clkP - clkH;
|
|
|
wire [31:0] JPEG_DATA;
|
wire [31:0] JPEG_DATA;
|
reg DATA_ENABLE;
|
reg DATA_ENABLE;
|
wire READ_ENABLE;
|
wire READ_ENABLE;
|
reg JPEG_START;
|
|
wire JPEG_IDLE;
|
wire JPEG_IDLE;
|
|
|
wire OutEnable;
|
wire OutEnable;
|
wire [15:0] OutWidth;
|
wire [15:0] OutWidth;
|
wire [15:0] OutHeight;
|
wire [15:0] OutHeight;
|
Line 62... |
Line 61... |
.clk(clk),
|
.clk(clk),
|
|
|
.DataIn (JPEG_DATA),
|
.DataIn (JPEG_DATA),
|
.DataInEnable (DATA_ENABLE),
|
.DataInEnable (DATA_ENABLE),
|
.DataInRead (READ_ENABLE),
|
.DataInRead (READ_ENABLE),
|
.JpegDecodeStart (JPEG_START),
|
|
.JpegDecodeIdle (JPEG_IDLE),
|
.JpegDecodeIdle (JPEG_IDLE),
|
|
|
.OutEnable ( OutEnable ),
|
.OutEnable ( OutEnable ),
|
.OutWidth ( OutWidth ),
|
.OutWidth ( OutWidth ),
|
.OutHeight ( OutHeight ),
|
.OutHeight ( OutHeight ),
|
Line 113... |
Line 111... |
end
|
end
|
end // initial begin
|
end // initial begin
|
|
|
assign JPEG_DATA = JPEG_MEM[DATA_COUNT];
|
assign JPEG_DATA = JPEG_MEM[DATA_COUNT];
|
|
|
initial begin
|
|
JPEG_START <= 1'b0;
|
|
wait (rst == 1'b1);
|
|
@(posedge clk);
|
|
JPEG_START <= 1'b1;
|
|
@(posedge clk);
|
|
JPEG_START <= 1'b0;
|
|
end
|
|
|
|
integer i;
|
integer i;
|
|
|
/*
|
/*
|
initial begin
|
initial begin
|
@(posedge u_jpeg_decode.ImageEnable);
|
@(posedge u_jpeg_decode.ImageEnable);
|
Line 331... |
Line 320... |
|
|
while(1) begin
|
while(1) begin
|
if(u_jpeg_decode.OutEnable == 1'b1) begin
|
if(u_jpeg_decode.OutEnable == 1'b1) begin
|
address = u_jpeg_decode.OutWidth * u_jpeg_decode.OutPixelY +
|
address = u_jpeg_decode.OutWidth * u_jpeg_decode.OutPixelY +
|
u_jpeg_decode.OutPixelX;
|
u_jpeg_decode.OutPixelX;
|
|
/*
|
$display(" RGB[%4d,%4d,%4d,%4d](%d): %3x,%3x,%3x = %2x,%2x,%2x",OutPixelX,OutPixelY,u_jpeg_decode.OutWidth,u_jpeg_decode.OutHeight,
|
$display(" RGB[%4d,%4d,%4d,%4d](%d): %3x,%3x,%3x = %2x,%2x,%2x",OutPixelX,OutPixelY,u_jpeg_decode.OutWidth,u_jpeg_decode.OutHeight,
|
address,
|
address,
|
u_jpeg_decode.u_jpeg_ycbcr.u_jpeg_ycbcr2rgb.Phase3Y,
|
u_jpeg_decode.u_jpeg_ycbcr.u_jpeg_ycbcr2rgb.Phase3Y,
|
u_jpeg_decode.u_jpeg_ycbcr.u_jpeg_ycbcr2rgb.Phase3Cb,
|
u_jpeg_decode.u_jpeg_ycbcr.u_jpeg_ycbcr2rgb.Phase3Cb,
|
u_jpeg_decode.u_jpeg_ycbcr.u_jpeg_ycbcr2rgb.Phase3Cr,
|
u_jpeg_decode.u_jpeg_ycbcr.u_jpeg_ycbcr2rgb.Phase3Cr,
|
OutR,OutG,OutB);
|
OutR,OutG,OutB);
|
|
*/
|
rgb_mem[address] = {OutR,OutG,OutB};
|
rgb_mem[address] = {OutR,OutG,OutB};
|
end
|
end
|
@(posedge clk);
|
@(posedge clk);
|
end
|
end
|
end
|
end
|
|
|
|
|
initial begin
|
initial begin
|
while(!(u_jpeg_decode.OutPixelX == u_jpeg_decode.OutWidth -1 & u_jpeg_decode.OutPixelY == u_jpeg_decode.OutHeight -1 & count > 1000)) @(posedge clk);
|
wait(!JPEG_IDLE);
|
@(posedge clk);
|
wait(JPEG_IDLE);
|
|
|
$display(" End Clock %d",count);
|
$display(" End Clock %d",count);
|
fp = $fopen("sim.dat");
|
fp = $fopen("sim.dat");
|
$fwrite(fp,"%0d\n",OutWidth);
|
$fwrite(fp,"%0d\n",OutWidth);
|
$fwrite(fp,"%0d\n",OutHeight);
|
$fwrite(fp,"%0d\n",OutHeight);
|
|
|