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

Subversion Repositories embedded_risc

[/] [embedded_risc/] [trunk/] [Verilog/] [data_in_reg.v] - Blame information for rev 26

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

Line No. Rev Author Line
1 26 hosseinami
/*********************************************************
2
 MODULE:                Sub Level SDRAM Controller Data input register
3
 
4
 FILE NAME:     data_in_reg.v
5
 VERSION:       1.0
6
 DATE:          April 28th, 2002
7
 AUTHOR:                Hossein Amidi
8
 COMPANY:
9
 CODE TYPE:     Register Transfer Level
10
 
11
 DESCRIPTION:   This module is the sub level RTL code of SDRAM Controller ASIC verilog
12
 code. It is the Controller input Data Port register block.
13
 
14
 
15
 Hossein Amidi
16
 (C) April 2002
17
 
18
*********************************************************/
19
 
20
// DEFINES
21
`timescale 1ns / 10ps
22
 
23
module data_in_reg(// Input
24
                                                        reset,
25
                                                        clk0,
26
                                                        dm,
27
                                                        datain,
28
                                                        // Out
29
                                                        dqm,
30
                                                        datain2
31
                                                        );
32
 
33
 
34
// Parameter
35
`include        "parameter.v"
36
 
37
// Input
38
input reset;
39
input clk0;
40
input [dqm_size - 1 : 0]dm;
41
input [data_size - 1 : 0]datain;
42
 
43
// Output
44
output [dqm_size - 1 : 0]dqm;
45
output [data_size - 1 : 0]datain2;
46
 
47
 
48
// Internal wires and reg
49
reg [data_size - 1 : 0]datain1;
50
reg [data_size - 1 : 0]datain2;
51
reg [dqm_size - 1 : 0]dqm;
52
 
53
wire [data_size - 1 : 0]datain;
54
wire [dqm_size - 1 : 0]dm;
55
 
56
 
57
 
58
// Assignment
59
 
60
// Register the input data from the host to match the internal timing
61
// and avoid metastability issues by double registering it.
62
always @(posedge reset or posedge clk0)
63
begin
64
        if(reset == 1'b1)
65
        begin
66
                datain1 <= 32'h0;
67
                datain2 <= 32'h0;
68
                dqm     <= 4'h0;
69
        end
70
        else
71
        begin
72
                datain1 <= datain;
73
                datain2 <= datain1;
74
                dqm <= dm;
75
        end
76
end
77
 
78
endmodule

powered by: WebSVN 2.1.0

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