|
各位大虾 ,以下程序为什么在modelsim compile成功而在Quartus II却报错, 另外modelsim编写的TB,在波形仿真时为什么找不到该引脚?
module sell_1(clk,rst,half,one,retur,led,sum);
input clk,rst,half,one;
output[3:0] sum;
output retur,led;
reg[3:0] sum;
reg retur,led;
reg[1:0] half_cnt,one_cnt;
wire[3:0] totall;
always @(posedge clk)
begin
if(rst)
begin
retur<=0;led<=0;
half_cnt=0;one_cnt=0; end
else if(half)
begin half_cnt<=half_cnt+1;end
if(one)
begin one_cnt<=one_cnt+1; end
end
assign totall=half_cnt+one_cnt;
always @(totall)
begin
if(totall==4'b1101)
begin
led=1; sum<=sum+1;
half_cnt<=0;one_cnt<=0;
end
if(totall>4'b1101)
begin
led=1;retur=1;sum<=sum+1;
half_cnt<=0;one_cnt<=0; end
else
begin
retur<=0;led<=0; end
end
endmodule |
|