dplat0001.vmd
1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**************************************************************/
/* Verilog module of datapath cell dplat0001 */
/* Designed by Chunling Liu Compass Aug. 4, 92 */
/* Changed by Matt Rohm SGI May 27, 94 */
/* (fixed the DELAY assigments) */
/* */
/* The following is the port description */
/* Data ports */
/* D : the input port */
/* Q : the output port */
/* Control ports */
/* INST_CP : the clock signal */
/* Parameters */
/* WORDSIZE : the word size of the datapath cell */
/* DELAY : the delay time from input to output */
/**************************************************************/
module dplat0001(D, Q, INST_CP);
parameter WORDSIZE = 8, DELAY = 4, BF = 1;
input [WORDSIZE-1:0] D;
output [WORDSIZE-1:0] Q;
input INST_CP;
reg [WORDSIZE-1:0] Q;
initial Q = {WORDSIZE{1'bx}};
function [WORDSIZE-1:0] lat;
input [WORDSIZE-1:0] d;
integer i;
begin
case (INST_CP)
'b 0 : lat = Q;
'b 1 : lat = ~(~d);
default lat = {WORDSIZE{1'b x}};
endcase
end
endfunction
always @ (INST_CP or D) Q = #DELAY lat(D);
endmodule