dpdff1101.vmd
1.92 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
44
45
46
47
48
49
50
51
52
/**************************************************************/
/* Verilog module of datapath cell dpdff1101 */
/* Designed by Chunling Liu Compass Aug. 4, 92 */
/* */
/* The following is the port description */
/* Data ports */
/* D : the input port */
/* Z : the output port */
/* Control ports */
/* INST_CP : the clock signal */
/* INST_OE : load enable */
/* INST_INIT : initialization control input */
/* Parameters */
/* WORDSIZE : the word size of the datapath cell */
/* DELAY : the delay time from input to output */
/**************************************************************/
module dpdff1101(D, Z, INST_CP, INST_INIT, INST_OE);
parameter WORDSIZE = 8, initial_value = 'b00000000, DELAY = 3, BF = 1;
input [WORDSIZE-1:0] D;
output [WORDSIZE-1:0] Z;
input INST_CP, INST_INIT, INST_OE;
reg [WORDSIZE-1:0] Z;
initial begin
Z = {WORDSIZE{1'bx}};
end
always @ ( posedge INST_CP )
begin
Z = #DELAY ~(~D);
if ( !INST_INIT )
#DELAY assign Z = initial_value;
if ( !INST_OE )
#DELAY assign Z = {WORDSIZE {1'bz}};
end
always @ ( INST_INIT )
if ( !INST_INIT )
#DELAY assign Z = initial_value;
else
#DELAY deassign Z;
always @ ( INST_OE )
if ( !INST_OE )
#DELAY assign Z = {WORDSIZE {1'bz}};
else
#DELAY deassign Z;
endmodule