编译显示错误Illegal base specifier in numeric constant.
时间:10-02
整理:3721RD
点击:
'timescale 10ns/1ps
module cnt_test();
reg[4:0]data;
reg rst,load,clk;
wire[4:0] dout;
'define period 10
cnt cl(.dout(dout),.clk(clk),.data(data),.rst(rst),.load(load));//counter(dout,clk,data,rst,load);
initial
clk=0;
always
begin
#5 clk=1'b1;
#5 clk=1'b0;
end
initial
begin
data=5'h15;
load=0;
rst=1;
#'period rst=0;
#('period*5) data=5'h1d;
load=1;
#'period load=0;
#('period*50)
$finish;
end
endmodule
编译显示错误:** Error: D:\workspace\ModelSim\work\cnt_test.v(1): near "'t": Illegal base specifier in numeric constant.
** Error: D:\workspace\ModelSim\work\cnt_test.v(1): near "'t": syntax error, unexpected BASE, expecting class
请问哪里错了,调用的函数编译没错。
module cnt_test();
reg[4:0]data;
reg rst,load,clk;
wire[4:0] dout;
'define period 10
cnt cl(.dout(dout),.clk(clk),.data(data),.rst(rst),.load(load));//counter(dout,clk,data,rst,load);
initial
clk=0;
always
begin
#5 clk=1'b1;
#5 clk=1'b0;
end
initial
begin
data=5'h15;
load=0;
rst=1;
#'period rst=0;
#('period*5) data=5'h1d;
load=1;
#'period load=0;
#('period*50)
$finish;
end
endmodule
编译显示错误:** Error: D:\workspace\ModelSim\work\cnt_test.v(1): near "'t": Illegal base specifier in numeric constant.
** Error: D:\workspace\ModelSim\work\cnt_test.v(1): near "'t": syntax error, unexpected BASE, expecting class
请问哪里错了,调用的函数编译没错。
timescale左上角的一点是数字键1的左边那个键的点,而不是双引号的点