OpenCores
URL https://opencores.org/ocsvn/pci/pci/trunk

Subversion Repositories pci

[/] [pci/] [tags/] [rel_3/] [rtl/] [verilog/] [out_reg.v] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mihad
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  File name "out_reg.v"                                       ////
4
////                                                              ////
5
////  This file is part of the "PCI bridge" project               ////
6
////  http://www.opencores.org/cores/pci/                         ////
7
////                                                              ////
8
////  Author(s):                                                  ////
9
////      - Miha Dolenc (mihad@opencores.org)                     ////
10
////                                                              ////
11
////  All additional information is avaliable in the README       ////
12
////  file.                                                       ////
13
////                                                              ////
14
////                                                              ////
15
//////////////////////////////////////////////////////////////////////
16
////                                                              ////
17
//// Copyright (C) 2001 Miha Dolenc, mihad@opencores.org          ////
18
////                                                              ////
19
//// This source file may be used and distributed without         ////
20
//// restriction provided that this copyright statement is not    ////
21
//// removed from the file and that any derivative work contains  ////
22
//// the original copyright notice and the associated disclaimer. ////
23
////                                                              ////
24
//// This source file is free software; you can redistribute it   ////
25
//// and/or modify it under the terms of the GNU Lesser General   ////
26
//// Public License as published by the Free Software Foundation; ////
27
//// either version 2.1 of the License, or (at your option) any   ////
28
//// later version.                                               ////
29
////                                                              ////
30
//// This source is distributed in the hope that it will be       ////
31
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
32
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
33
//// PURPOSE.  See the GNU Lesser General Public License for more ////
34
//// details.                                                     ////
35
////                                                              ////
36
//// You should have received a copy of the GNU Lesser General    ////
37
//// Public License along with this source; if not, download it   ////
38
//// from http://www.opencores.org/lgpl.shtml                     ////
39
////                                                              ////
40
//////////////////////////////////////////////////////////////////////
41
//
42
// CVS Revision History
43
//
44
// $Log: not supported by cvs2svn $
45
//
46
 
47
`include "constants.v"
48
 
49
// module inferes a single IOB output block as known in FPGA architectures
50
// It provides data flip flop with clock enable and output enable flip flop with clock enable
51
// This is tested in Xilinx FPGA - active low output enable
52
// Check polarity of output enable flip flop for specific architecure.
53
module OUT_REG
54
(
55
    reset_in,
56
    clk_in,
57
    dat_en_in,
58
    en_en_in,
59
    dat_in,
60
    en_in,
61
    en_out,
62
    dat_out
63
);
64
 
65
input   reset_in,
66
        clk_in,
67
        dat_en_in,
68
        en_en_in,
69
        dat_in,
70
        en_in ;
71
 
72
output dat_out ;
73
output en_out ;
74
 
75
reg dat_out,
76
    en_out ;
77
 
78
wire en_n = ~en_in ;
79
 
80
always@(posedge reset_in or posedge clk_in)
81
begin
82
    if ( reset_in )
83
        dat_out <= #`FF_DELAY 1'b0 ;
84
    else if ( dat_en_in )
85
        dat_out <= #`FF_DELAY dat_in ;
86
end
87
 
88
always@(posedge reset_in or posedge clk_in)
89
begin
90
    if ( reset_in )
91
        en_out <= #`FF_DELAY 1'b1 ;
92
    else if ( en_en_in )
93
        en_out <= #`FF_DELAY en_n ;
94
end
95
 
96
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.