我只有对site1bin,site2bin,site3bin,site4bin赋值的操作,如下,但是它的输出居然有其他值(例如site3bin值为6‘b010111)
硬件应该没有问题,因为我们用原理图替代verilog的方式一直没有出现问题!
求救!!
源代码:
always @(posedge MCLK or posedge rst )
if(rst)
begin
site1bin_buf<=6'h3f;
site2bin_buf<=6'h3f;
site3bin_buf<=6'h3f;
site4bin_buf<=6'h3f;
end
else if(!DB50_START)
begin
site1bin_buf<=6'h3f;
site2bin_buf<=6'h3f;
site3bin_buf<=6'h3f;
site4bin_buf<=6'h3f;
end
else
begin
case(CPLD_IN)
12'b1110_1101_1111: site1bin_buf<=6'b01_1111;
12'b1110_1110_1111: site1bin_buf<=6'b10_1111;
12'b1110_1111_0111: site1bin_buf<=6'b11_0111;
12'b1110_1111_1011: site1bin_buf<=6'b11_1011;
12'b1110_1111_1101: site1bin_buf<=6'b11_1101;
12'b1110_1111_1110: site1bin_buf<=6'b11_1110;
12'b1101_1101_1111: site2bin_buf<=6'b01_1111;
12'b1101_1110_1111: site2bin_buf<=6'b10_1111;
12'b1101_1111_0111: site2bin_buf<=6'b11_0111;
12'b1101_1111_1011: site2bin_buf<=6'b11_1011;
12'b1101_1111_1101: site2bin_buf<=6'b11_1101;
12'b1101_1111_1110: site2bin_buf<=6'b11_1110;
12'b1011_1101_1111: site3bin_buf<=6'b01_1111;
12'b1011_1110_1111: site3bin_buf<=6'b10_1111;
12'b1011_1111_0111: site3bin_buf<=6'b11_0111;
12'b1011_1111_1011: site3bin_buf<=6'b11_1011;
12'b1011_1111_1101: site3bin_buf<=6'b11_1101;
12'b1011_1111_1110: site3bin_buf<=6'b11_1110;
12'b0111_1101_1111: site4bin_buf<=6'b01_1111;
12'b0111_1110_1111: site4bin_buf<=6'b10_1111;
12'b0111_1111_0111: site4bin_buf<=6'b11_0111;
12'b0111_1111_1011: site4bin_buf<=6'b11_1011;
12'b0111_1111_1101: site4bin_buf<=6'b11_1101;
12'b0111_1111_1110: site4bin_buf<=6'b11_1110;
default:;
endcase
end
always @(posedge MCLK or posedge rst )
if(rst)
begin
{site1bin,site2bin,site3bin,site4bin}<=24'hff_ffff;
DB50_EOT_en<=1'b1;
end
else if(!DB50_START)
begin
{site1bin,site2bin,site3bin,site4bin}<=24'hff_ffff;
DB50_EOT_en<=1'b1;
end
else if(DB25_EOT_buf==16'h7fff)
begin
site1bin<=site1bin_buf;
site2bin<=site2bin_buf;
site3bin<=site3bin_buf;
site4bin<=site4bin_buf;
DB50_EOT_en<=1'b0;
end
|