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

Subversion Repositories embedded_risc

[/] [embedded_risc/] [trunk/] [Verilog/] [sdram_port.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 Controller, SDRAM Data Port
3
 
4
 FILE NAME:     sdram_port.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 SDRAM Data Port block.
13
 
14
 
15
 Hossein Amidi
16
 (C) April 2002
17
 
18
*********************************************************/
19
 
20
// DEFINES
21
`timescale 1ns / 10ps
22
 
23
module sdram_port(// Input
24
                                                reset,
25
                                                clk0_2x,
26
                                                oe,
27
                                                datain2,
28
                                                dq,
29
                                                // Output
30
                                                sdram_in,
31
                                                sdram_out
32
                                                );
33
 
34
 
35
// Parameter
36
`include        "parameter.v"
37
 
38
// Input
39
input reset;
40
input clk0_2x;
41
input oe;
42
input [data_size - 1 : 0]datain2;
43
input [data_size - 1 : 0]dq;
44
 
45
// Output
46
output [data_size - 1 : 0]sdram_in;
47
output [data_size - 1 : 0]sdram_out;
48
 
49
// Internal wires and reg
50
wire reset;
51
wire clk0_2x;
52
wire oe;
53
wire [data_size - 1 : 0]datain2;
54
wire [data_size - 1 : 0]dq;
55
 
56
reg [data_size - 1 : 0]sdram_in;
57
reg [data_size - 1 : 0]sdram_out;
58
 
59
 
60
// Assignment
61
 
62
 
63
// Register the output tri-state bidirectional Data Signals
64
always @(posedge reset or negedge clk0_2x)
65
begin
66
        if(reset == 1'b1)
67
   begin
68
                sdram_in  <= 32'hzzzzzzzz;
69
                sdram_out <= 32'hzzzzzzzz;
70
        end
71
        else
72
        begin
73
                if(oe == 1'b1)
74
                begin
75
                        sdram_out <= datain2;
76
                        sdram_in  <= 32'hzzzzzzzz;
77
                end
78
                else
79
                if(oe == 1'b0)
80
                begin
81
                        sdram_in  <= dq;
82
                        sdram_out <= 32'hzzzzzzzz;
83
                end
84
        end
85
end
86
 
87
endmodule

powered by: WebSVN 2.1.0

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