2019-05-03 17:35:26 -05:00
|
|
|
module test (
|
|
|
|
input EN, CLK,
|
|
|
|
input [3:0] D,
|
|
|
|
output reg [3:0] Q
|
|
|
|
);
|
|
|
|
always @(posedge CLK)
|
|
|
|
if (EN) Q <= D;
|
|
|
|
|
|
|
|
specify
|
|
|
|
if (EN) (CLK *> (Q : D)) = (1, 2:3:4);
|
|
|
|
$setup(D, posedge CLK &&& EN, 5);
|
|
|
|
$hold(posedge CLK, D &&& EN, 6);
|
|
|
|
endspecify
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module test2 (
|
2019-05-03 17:42:02 -05:00
|
|
|
input A, B,
|
2019-05-03 17:35:26 -05:00
|
|
|
output Q
|
|
|
|
);
|
2019-05-03 17:42:02 -05:00
|
|
|
xor (Q, A, B);
|
2019-05-03 17:35:26 -05:00
|
|
|
specify
|
|
|
|
//specparam T_rise = 1;
|
2019-05-03 17:42:02 -05:00
|
|
|
//specparam T_fall = 2;
|
|
|
|
`define T_rise 1
|
|
|
|
`define T_fall 2
|
|
|
|
(A => Q) = (`T_rise,`T_fall);
|
2019-05-03 17:54:25 -05:00
|
|
|
//(B => Q) = (`T_rise+`T_fall)/2.0;
|
|
|
|
(B => Q) = 1.5;
|
2019-05-03 17:35:26 -05:00
|
|
|
endspecify
|
|
|
|
endmodule
|