在ISE中创建两个源文件,一个仿真文件。创建仿真文件时默认为文件一仿真文件,又在仿真文件中include另一个文件,同时对两个文件仿真。但在仿真编译报错(大致意思出现另一文见命名问题。望高手指点。
文件一:
module blocking(b,c,a,clk); output [3:0]b; output [3:0]c; input [3:0] a; input clk;
reg[3:0] b,c; always@(posedge clk) begin b=a; c=b;$displsy("Blocking :a=%d,b=%d,c=%d ",a,b,b); end
endmodule
文件二:
module nonblocking(b,c,a,clk); output [3:0] b; output [3:0] c; input [3:0] a; input clk; reg[3:0] b,c; always@(posedge clk) begin b<=a; c<=b;$displsy("Blocking :a=%d,b=%d,c=%d ",a,b,b); end
endmodule
仿真文件:
`include"nonblocking.v" `timescale 1ns/100ps module blocking_blockingt_v_tf();
// DATE: 20:58:07 04/20/2006 // MODULE: blocking // DESIGN: blocking // FILENAME: blockingt.v // PROJECT: project1 // VERSION: reg [3:0] a; reg clk; wire [3:0] b; wire [3:0] c;
blocking uut ( .b(b), .c(c), .a(a), .clk(clk) ); nonblocking uut2 ( .b(b), .c(c), .a(a), .clk(clk) );
initial begin a = 0; clk = 0; forever #50 clk=~clk; end
initial begin a=4'h3; $display("_"); #100 a=4'h7; $display("_"); #100 $stop; end
endmodule
|