|
楼主 |
发表于 2012-12-21 09:38:21
|
显示全部楼层
本帖最后由 nono2000 于 2012-12-21 09:42 编辑
把调用vlog的命令行贴出来看看?
tigerjade 发表于 2012-12-21 03:28
使用 Quartus II 运行 ModelSim 就会错误?
"Cyclone II"
DEVICE EP2C70F896C6
Quartus II 12.1
tp_clk_tb.v
module tp_clk_tb;
reg rst_n;
reg clk;
wire [2:0] a;
wire b;
wire c;
wire d;
tp_clk u0 (
.RST_N(rst_n),
.CLKIN(clk),
.a(a),
.b(b),
.c(c),
.d(d)
);
parameter clkper = 100;
initial begin
clk = 1'b0;
end
always begin
#(clkper / 2) clk = ~clk;
end
initial begin
rst_n = 1'b0;
#225;
rst_n = 1'b1;
#100;
#100;
#100;
#100;
#100;
end
endmodule
=============================================
tp_clk.v
module tp_clk(
RST_N,
CLKIN,
a,
b,
c,
d
);
input RST_N;
input CLKIN;
output [2:0] a;
output b;
output c;
output d;
reg [2:0] c33;
reg c31;
always @(posedge CLKIN or negedge RST_N )
begin
if (!RST_N)
c33 <= 3'b000;
else
begin
c33[0] <= (c33[1:0]==2'b00);
c33[2:1] <= c33[1:0];
end
end
reg c16,c16n;
always @(posedge b or negedge RST_N)
begin
if (!RST_N)
begin
c16n <= 1'b0;
c16 <= 1'b0;
end
else
begin
c16n <= c33[1];
c16 <= ~c16;
end
end
always @(negedge CLKIN or negedge RST_N)
begin
if (!RST_N)
c31 <= 1'b0;
else
c31 <= c33[1];
end
assign a = c33;
assign b = c33[0] | c31;
assign c = c16;
assign d = c16n;
endmodule |
|