求助:verilog仿真,编译没错,仿真error loading design
时间:10-02
整理:3721RD
点击:
modelsim仿真遇到问题 两个子模块仿真都没有错 顶层模块无法仿真 显示error loading design,用的modelsim10.1b
模块1:
module alu(r0,clk,vs_bcd,over);
input [3:0] r0;
input clk;
output reg [15:0] vs_bcd;
output reg over;
模块2:
module seg_code(vs_bcd,clk,scan,out);
input [15:0] vs_bcd;
input clk;
output reg [3:0] scan;
output reg [6:0] out;
top模块:
module top(clk,r0,out,scan,over);
input clk;
input [3:0] r0;
output reg [6:0] out;
output reg [3:0] scan;
output reg over;
wire [15:0] vs_bcd;
alu c1(r0,clk,vs_bcd,over);
seg_code c2(vs_bcd,clk,scan,out);
endmodule
top测试
module top_test;
wire [6:0] out;
wire[3:0] scan;
wire over;
reg clk;
reg [3:0] r0;
top a3(clk,r0,out,scan,over);
initial
begin
#15
clk=0;
#10 r0=4'b1111; //clear
#10 r0=4'b1000;
#10 r0=4'b0001;//number
#10 r0=4'b1100; //+
#10 r0=4'b0010;
#10 r0=4'b0011;
#10 r0=4'b1110;
#200 $stop;
end
always #5 clk=~clk;
endmodule
个人感觉是模块调用问题。求大神指导!谢谢!
模块1:
module alu(r0,clk,vs_bcd,over);
input [3:0] r0;
input clk;
output reg [15:0] vs_bcd;
output reg over;
模块2:
module seg_code(vs_bcd,clk,scan,out);
input [15:0] vs_bcd;
input clk;
output reg [3:0] scan;
output reg [6:0] out;
top模块:
module top(clk,r0,out,scan,over);
input clk;
input [3:0] r0;
output reg [6:0] out;
output reg [3:0] scan;
output reg over;
wire [15:0] vs_bcd;
alu c1(r0,clk,vs_bcd,over);
seg_code c2(vs_bcd,clk,scan,out);
endmodule
top测试
module top_test;
wire [6:0] out;
wire[3:0] scan;
wire over;
reg clk;
reg [3:0] r0;
top a3(clk,r0,out,scan,over);
initial
begin
#15
clk=0;
#10 r0=4'b1111; //clear
#10 r0=4'b1000;
#10 r0=4'b0001;//number
#10 r0=4'b1100; //+
#10 r0=4'b0010;
#10 r0=4'b0011;
#10 r0=4'b1110;
#200 $stop;
end
always #5 clk=~clk;
endmodule
个人感觉是模块调用问题。求大神指导!谢谢!
先综合一下就知道RTL设计是否正确。
不懂呀?仿真都不正确,可以综合吗?
求大神指导
弱弱的问句,你的子模块可加入到了仿真工程里?
子模块可以
解决了
我把output 中的reg 去掉了。
就可以了 也可以综合
但我也不知道为什么?
