以下内容源自资源
仅供学习交流使用
请您阅读文章声明,默认同意该声明
Modelsim SE-64 2020.4-windows(内含和谐文件)网盘分享:
链接:https://pan.baidu.com/s/1sJHqoj6VEwrmf6GBMLXshQ
提取码:161d
网盘下载速率提升
最新验证码:7678
安装成功
或老师演示视频
补充:
若出错
** Error (suppressible): (vsim-12110) All optimizations are disabled because the -novopt option is in effect. This will cause your simulation to run very slowly. If you are using this switch to preserve visibility for Debug or PLI features, please see the User’s Manual section on Preserving Object Visibility with vopt. -novopt option is now deprecated and will be removed in future releases.
出错解决
Modelsim SE-64 2020.4 不能关闭优化的错误及其解决 Error (suppressible): (vsim-12110)
若没有Wave窗口
点击View勾选Wave
在Objects中右键变量->点击Add Wave使其添加到Wave窗口中
设计代码
module mux41(
input wire in0,
input wire in1,
input wire in2,
input wire in3,
input wire [1:0] sel,
output reg out);
always@(*)
case(sel)
2'b00: out=in0;
2'b01: out=in1;
2'b10: out=in2;
2'b11: out=in3;
default: out=1'b0;
endcase
endmodule
测试代码
module mux41_tb;
reg in0,in1,in2,in3;
reg [1:0] sel;
wire out;
mux41 uut(.in0(in0), .in1(in1), .in2(in2), .in3(in3),
.sel(sel), .out(out));
initial
begin
in0=0;in1=0;in2=0;in3=0; sel=2'b00;
#100 in0=1;in1=0;in2=0;in3=0; sel=2'b00;
#100 in0=1;in1=0;in2=0;in3=0; sel=2'b01;
#100 in0=1;in1=1;in2=0;in3=0; sel=2'b01;
#100 in0=1;in1=1;in2=0;in3=0; sel=2'b10;
#100 in0=1;in1=1;in2=1;in3=0; sel=2'b10;
#100 in0=1;in1=1;in2=1;in3=0; sel=2'b11;
#100 in0=1;in1=1;in2=1;in3=1; sel=2'b11;
end
endmodule
若出错
** Error (suppressible): (vsim-12110) All optimizations are disabled because the -novopt option is in effect. This will cause your simulation to run very slowly. If you are using this switch to preserve visibility for Debug or PLI features, please see the User’s Manual section on Preserving Object Visibility with vopt. -novopt option is now deprecated and will be removed in future releases.
出错解决
Modelsim SE-64 2020.4 不能关闭优化的错误及其解决 Error (suppressible): (vsim-12110)
若没有Wave窗口
点击View勾选Wave
在Objects中右键变量->点击Add Wave使其添加到Wave窗口中
点击运行按钮
四选一功能是正确的
sel是00
out和in0保持一致
File -> Open
在弹出的窗口中,文件类型选.mpf
然后路径指到工程所在文件夹,选择建立的.mpf文件即可
module mux21(in1,in2,sel,out);
input[3:0]in1,in2;
input sel;
output[3:0]out;
wire[3:0]out;
assign out = (!sel)?in1:in2;
endmodule
module mux21_tb;
reg in1,in2;
reg sel;
wire out;
mux21 uut(.in1(in1), .in2(in2),.sel(sel),.out(out));
initial
begin
in1 = 0; in2 = 0; sel = 0;
#100 in1 = 1; in2 = 0; sel = 0;
#100 in1 = 1; in2 = 1; sel = 1;
#100 in1 = 0; in2 = 1; sel = 1;
end
endmodule
设计代码
module mux41(
input wire in0,
input wire in1,
input wire in2,
input wire in3,
input wire [1:0] sel,
output reg out);
always@(*)
case(sel)
2'b00: out=in0;
2'b01: out=in1;
2'b10: out=in2;
2'b11: out=in3;
default: out=1'b0;
endcase
endmodule
测试代码
module mux41_tb;
reg in0,in1,in2,in3;
reg [1:0] sel;
wire out;
mux41 uut(.in0(in0), .in1(in1), .in2(in2), .in3(in3),
.sel(sel), .out(out));
initial
begin
in0=0;in1=0;in2=0;in3=0; sel=2'b00;
#100 in0=1;in1=0;in2=0;in3=0; sel=2'b00;
#100 in0=1;in1=0;in2=0;in3=0; sel=2'b01;
#100 in0=1;in1=1;in2=0;in3=0; sel=2'b01;
#100 in0=1;in1=1;in2=0;in3=0; sel=2'b10;
#100 in0=1;in1=1;in2=1;in3=0; sel=2'b10;
#100 in0=1;in1=1;in2=1;in3=0; sel=2'b11;
#100 in0=1;in1=1;in2=1;in3=1; sel=2'b11;
end
endmodule
若出错
** Error (suppressible): (vsim-12110) All optimizations are disabled because the -novopt option is in effect. This will cause your simulation to run very slowly. If you are using this switch to preserve visibility for Debug or PLI features, please see the User’s Manual section on Preserving Object Visibility with vopt. -novopt option is now deprecated and will be removed in future releases.
出错解决
Modelsim SE-64 2020.4 不能关闭优化的错误及其解决 Error (suppressible): (vsim-12110)
若没有Wave窗口
点击View勾选Wave
在Objects中右键变量->点击Add Wave使其添加到Wave窗口中
点击运行按钮
四选一功能是正确的
sel是00
out和in0保持一致
设计代码
module dff(din,clk,q);
input din,clk;
output q;
reg q;
always @(posedge clk)
q<=din;
endmodule
测试代码
`timescale 1ns/1ns
module dff_tb;
reg clk,data_in;
wire data_out;
dff U1(data_in,clk,data_out);
always #5 clk=~clk;
initial
begin
clk=0;
data_in=0;
#20 data_in=1;
#20 data_in=0;
#20 data_in=1;
#15 data_in=0;
#15 data_in=1;
end
endmodule
右键 simulate
分析波形。
在时钟上升沿,Dout=Din。
D触发器功能正确。
请您阅读文章声明,默认同意该声明
打赏通道