wudiacheng 2022-06-14 17:29
浏览 17
已结题

Quqrtus Ⅱ运行出现报错 always语句出现错误

问题遇到的现象和发生背景

使用Quartus II 时出现10170错误 always语句和if else 的嵌套出现问题

问题相关代码,请勿粘贴截图

//CUR_RD_R初始值为RD-
always @(posedge clk )begin
if(start) CUR_RD_R<=CUR_RD;
else CUR_RD_R<=RD_N; end //与5b6b编码表对应 always @(posedge clk )begin if(encode_start_r[2]) begin case(data_in_r) 5'd0:if(CUR_RD_R==RD_N)begin
data_out_r<=6'b100111;
PRE_RD_R<=RD_P; end else begin data_out_r<=6'b011000; PRE_RD_R<=RD_N;
end
5'd1:if(CUR_RD_R==RD_N)begin data_out_r<=6'b011101; PRE_RD_R<=RD_P;
end
else begin
data_out_r<=6'b100010;
PRE_RD_R<=RD_N; end 5'd2:if(CUR_RD_R==RD_N)begin
data_out_r<=6'b101101;
PRE_RD_R<=RD_P; end else begin data_out_r<=6'b010010; PRE_RD_R<=RD_N;
end
5'd3:begin
data_out_r<=6'b110001;
PRE_RD_R<=CUR_RD;
end
5'd4:if(CUR_RD_R==RD_N)begin data_out_r<=6'b110101; PRE_RD_R<=RD_P;
end
else begin
data_out_r<=6'b001010;
PRE_RD_R<=RD_N; end 5'd5:begin data_out_r<=6'b101001; PRE_RD_R<=CUR_RD; end 5'd6:begin data_out_r<=6'b011001; PRE_RD_R<=CUR_RD; end 5'd7:if(CUR_RD_R==RD_N)begin
data_out_r<=6'b111000;
PRE_RD_R<=CUR_RD;
end
else begin
data_out_r<=6'b000111;
PRE_RD_R<=CUR_RD;
end
5'd8:if(CUR_RD_R==RD_N)begin data_out_r<=6'b111001; PRE_RD_R<=RD_P;
end
else begin
data_out_r<=6'b000110;
PRE_RD_R<=RD_N; end 5'd9:begin data_out_r<=6'b100101; PRE_RD_R<=CUR_RD; end 5'd10:begin data_out_r<=6'b010101; PRE_RD_R<=CUR_RD; end 5'd11:begin data_out_r<=6'b110100; PRE_RD_R<=CUR_RD; end 5'd12:begin data_out_r<=6'b001101; PRE_RD_R<=CUR_RD; end 5'd13:begin data_out_r<=6'b101100; PRE_RD_R<=CUR_RD; end 5'd14:begin data_out_r<=6'b011100; PRE_RD_R<=CUR_RD; end 5'd15:if(CUR_RD_R==RD_N)begin
data_out_r<=6'b010111;
PRE_RD_R<=RD_P; end else begin data_out_r<=6'b101000; PRE_RD_R<=RD_N;
end
5'd16:if(CUR_RD_R==RD_N)begin data_out_r<=6'b011011; PRE_RD_R<=RD_P;
end
else begin
data_out_r<=6'b100100;
PRE_RD_R<=RD_N; end 5'd17:begin data_out_r<=6'b100011; PRE_RD_R<=CUR_RD; end 5'd18:begin data_out_r<=6'b010011; PRE_RD_R<=CUR_RD; end 5'd19:begin data_out_r<=6'b110010; PRE_RD_R<=CUR_RD; end 5'd20:begin data_out_r<=6'b001011; PRE_RD_R<=CUR_RD; end 5'd21:begin data_out_r<=6'b101010; PRE_RD_R<=CUR_RD; end 5'd22:begin data_out_r<=6'b011010; PRE_RD_R<=CUR_RD; end 5'd23:if(CUR_RD_R==RD_N)begin
data_out_r<=6'b111010;
PRE_RD_R<=RD_P; end else begin data_out_r<=6'b000101; PRE_RD_R<=RD_N;
end
5'd24:if(CUR_RD_R==RD_N)begin data_out_r<=6'b110011; PRE_RD_R<=RD_P;
end
else begin
data_out_r<=6'b001100;
PRE_RD_R<=RD_N; end 5'd25:begin data_out_r<=6'b100110; PRE_RD_R<=CUR_RD; end 5'd26:begin data_out_r<=6'b010110; PRE_RD_R<=CUR_RD; end 5'd27:if(CUR_RD_R==RD_N)begin
data_out_r<=6'b110110;
PRE_RD_R<=RD_P; end else begin data_out_r<=6'b001001; PRE_RD_R<=RD_N;
end
5'd28:begin
data_out_r<=6'b001110;
PRE_RD_R<=CUR_RD;
end
5'd29:if(CUR_RD_R==RD_N)begin data_out_r<=6'b101110; PRE_RD_R<=RD_P;
end
else begin
data_out_r<=6'b010001;
PRE_RD_R<=RD_N; end 5'd30:if(CUR_RD_R==RD_N)begin
data_out_r<=6'b011110;
PRE_RD_R<=RD_P; end else begin data_out_r<=6'b100001; PRE_RD_R<=RD_N;
end
5'd31:if(CUR_RD_R==RD_N)begin data_out_r<=6'b101011; PRE_RD_R<=RD_P;
end
else begin
data_out_r<=6'b010100;
PRE_RD_R<=`RD_N;
end
endcase
end
end

assign PRE_RD=PRE_RD_R;
assign data_out=data_out_r;
assign encode_end= encode_start_r[2];

运行结果及报错内容

img

img

我的解答思路和尝试过的方法

修改过顺序没有用

我想要达到的结果

希望运行出来不报错

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 6月22日
    • 创建了问题 6月14日

    悬赏问题

    • ¥50 array数据同步问题
    • ¥15 pic16F877a单片机的外部触发中断程序仿真失效
    • ¥15 Matlab插值拟合差分微分规划图论
    • ¥15 keil5 target not created
    • ¥15 C/C++数据与算法请教
    • ¥15 怎么找志同道合的伙伴
    • ¥20 如何让程序ab.eXe自已删除干净硬盘里的本文件自己的ab.eXe文件
    • ¥50 爬虫预算充足,跪巨佬
    • ¥15 滑块验证码拖动问题悬赏
    • ¥15 Wanted but not invoked:Actually, there were zero interactions with this moc