用的是xillinx的XC2C32A,很老的CPLD。就是一个流水灯小程序。XST能实现流水灯显示。但是在synplify综合后,4个LED一直常亮。到底是哪里的问题呢?
代码如下:
module Main(
iCLK,
oLED
);
input iCLK;
output [3:0]oLED;
reg [24:0]sr_counter = 25'b0;
reg [3:0]sr_led = 4'b1110;
assign oLED = sr_led;
always@(posedge iCLK)
if(sr_counter >= 25'd25000000)
sr_counter <= 1'b0;
else
sr_counter <= sr_counter + 1'b1;
always@(posedge iCLK)
if(sr_counter >= 25'd25000000)
sr_led <= {sr_led[2:0],sr_led[3]};
else
sr_led <= sr_led;
endmodule |