问一个初级仿真的问题 希望有人指点
时间:10-02
整理:3721RD
点击:
我遇到了个问题 怎么也想不通 1bit全加器程序和 testbench程序 我的想法是在输入a
> 管脚上产生周期方波 但是做仿真之后a上面没有方波出现 不知道问题出在哪里 很困惑
是在modelsim环境里运行的
module add(cout,sum,a,b,cin);
> input a,b;
> input cin;
> output cout;
> output sum;
> assign {cout,sum}=a+b+cin;
> endmodule
>
>
> `timescale 1ns/100ps
> module testbench();
> reg a,b,cin;
> reg clk;
> wire cout,sum;
> add U1(
> .cout(cout),
> .sum(sum),
> .a(a),
> .b(b),
> .cin(cin)
> );
>
> initial
> begin a=1'b0;
> forever #10 a=!a;
> end
> endmodule
> 管脚上产生周期方波 但是做仿真之后a上面没有方波出现 不知道问题出在哪里 很困惑
是在modelsim环境里运行的
module add(cout,sum,a,b,cin);
> input a,b;
> input cin;
> output cout;
> output sum;
> assign {cout,sum}=a+b+cin;
> endmodule
>
>
> `timescale 1ns/100ps
> module testbench();
> reg a,b,cin;
> reg clk;
> wire cout,sum;
> add U1(
> .cout(cout),
> .sum(sum),
> .a(a),
> .b(b),
> .cin(cin)
> );
>
> initial
> begin a=1'b0;
> forever #10 a=!a;
> end
> endmodule
testbench改动之后也一样没有方波出现
`timescale 1ns/100ps
module testbench();
reg ax,bx,cinx;
reg clkx;
wire coutx,sumx;
add U1(
.cout(coutx),
.sum(sumx),
.a(ax),
.b(bx),
.cin(cinx)
);
initial ax=1'b0;
always
begin
#10 ax=~ax;
end
endmodule
kankan
kankan 不是很懂啊
不会吧!这么简单的电路!
是不是软件安装有问题!
没有license?
initial ax=1'b0; always begin #10 ax=~ax; end 改一下,改成 initial begin ax=1'b0; forever #10 ax=~ax; end
没看出什么问题,估计是软件的问题吧
把a设置成信号,跟产生始终一样产生a不就可以了吗
