📄 se_pa_tst.tfw
字号:
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995-2003 Xilinx, Inc.
// All Right Reserved.
////////////////////////////////////////////////////////////////////////////////
// ____ ____
// / /\/ /
// /___/ \ / Vendor: Xilinx
// \ \ \/ Version : 8.1i
// \ \ Application : ISE
// / / Filename : se_pa_tst.tfw
// /___/ /\ Timestamp : Mon Nov 06 20:53:57 2006
// \ \ / \
// \___\/\___\
//
//Command:
//Design Name: se_pa_tst
//Device: Xilinx
//
`timescale 1ns/1ps
module se_pa_tst;
reg se_in = 1'b0;
wire [3:0] pa_out;
reg clr = 1'b1;
reg clk = 1'b0;
parameter PERIOD = 200;
parameter real DUTY_CYCLE = 0.5;
parameter OFFSET = 0;
initial // Clock process for clk
begin
#OFFSET;
forever
begin
clk = 1'b0;
#(PERIOD-(PERIOD*DUTY_CYCLE)) clk = 1'b1;
#(PERIOD*DUTY_CYCLE);
end
end
se_pa UUT (
.se_in(se_in),
.pa_out(pa_out),
.clr(clr),
.clk(clk));
integer TX_FILE = 0;
integer TX_ERROR = 0;
initial begin // Open the results file...
TX_FILE = $fopen("results.txt");
#1200 // Final time: 1200 ns
if (TX_ERROR == 0) begin
$display("No errors or warnings.");
$fdisplay(TX_FILE, "No errors or warnings.");
end else begin
$display("%d errors found in simulation.", TX_ERROR);
$fdisplay(TX_FILE, "%d errors found in simulation.", TX_ERROR);
end
$fclose(TX_FILE);
$stop;
end
initial begin // Process for clk
// ------------- Current Time: 85ns
#85;
se_in = 1'b1;
// -------------------------------------
// ------------- Current Time: 285ns
#200;
se_in = 1'b0;
// -------------------------------------
// ------------- Current Time: 485ns
#200;
se_in = 1'b1;
// -------------------------------------
// ------------- Current Time: 885ns
#400;
se_in = 1'b0;
// -------------------------------------
end
initial begin // Process for Asynchronous Signals
end
task CHECK_pa_out;
input [3:0] NEXT_pa_out;
#0 begin
if (NEXT_pa_out !== pa_out) begin
$display("Error at time=%dns pa_out=%b, expected=%b", $time, pa_out, NEXT_pa_out);
$fdisplay(TX_FILE, "Error at time=%dns pa_out=%b, expected=%b", $time, pa_out, NEXT_pa_out);
$fflush(TX_FILE);
TX_ERROR = TX_ERROR + 1;
end
end
endtask
endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -