1.建工程、起名字、选芯片、仿真
2.代码
3.仿真
1)tools——options——EDA tools options
2)assignments——settings
添加testbench
`timescale 10 ns/ 10 ps
module decoder38_vlg_tst();
reg clk;
// test vector input registers*******输入激励设置为reg型
reg A1,B1,C1,G11,G21;
wire [7:0] Y1;
// test vector output wires *******输出相应设置为wire类型
ls138m i1 (
.A(A1),
.B(B1),
.C(C1),
.G1(G11),
.G2(G21),
.Y(Y1)
);//*******例化待测模块
initial
begin
// *******initial产生激励
{C1,B1,A1}=0;
{G11,G21}=2'b00;
clk=0;
repeat (4)
begin
repeat(8)
begin
#1
clk= ~clk;
{C1,B1,A1}={C1,B1,A1}+1;
end
{G11,G21}={G11,G21}+1;
end
end
endmodule
3)
4.
5.封装
右键 导出设计分区
6.调用
1)新建文件夹,把刚刚生成的 ls138.qxp 复制到文件夹内
2)新建工程
添加qxp文件、选择芯片
3)
保存、编译
4)
无法做仿真