关于FPGA设计语言Verilog的error问题
时间:10-02
整理:3721RD
点击:
程序如下:
// SN74AHCT595.v
module SN(
//SN74AHCT595
output wire LED,
output wire LCLK,
output wire SCLK,
//system
// clock and reset
input wire clock, // clock 60M
input wire reset // reset
?;
// registers
reg SCLK_int;
reg LED_int; //
reg [15:0] data;
reg LCLK_int;
reg 4:0] count;
//assign
assign LED = LED_int;
assign SCLK = SCLK_int;
assign LCLK = LCLK_int;
assign SCLK_int = ~clock;
//
always @ (posedge clock, posedge reset)
begin
if (reset) begin
LED_int =0)&&(count >1;
count =16)&&(count =0)&&(count<=15) 需要在外面再加一个括号。
3.assign SCLK_int = ~clock;语法错误。寄存器不能这样赋值,只能在always里。可以改为SCLK=~clock;
4. end else if 倒数几行的这里出现低级错误,if后必须加内容啊!
// SN74AHCT595.v
module SN(
//SN74AHCT595
output wire LED,
output wire LCLK,
output wire SCLK,
//system
// clock and reset
input wire clock, // clock 60M
input wire reset // reset
?;
// registers
reg SCLK_int;
reg LED_int; //
reg [15:0] data;
reg LCLK_int;
reg 4:0] count;
//assign
assign LED = LED_int;
assign SCLK = SCLK_int;
assign LCLK = LCLK_int;
assign SCLK_int = ~clock;
//
always @ (posedge clock, posedge reset)
begin
if (reset) begin
LED_int =0)&&(count >1;
count =16)&&(count =0)&&(count<=15) 需要在外面再加一个括号。
3.assign SCLK_int = ~clock;语法错误。寄存器不能这样赋值,只能在always里。可以改为SCLK=~clock;
4. end else if 倒数几行的这里出现低级错误,if后必须加内容啊!