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

Subversion Repositories embedded_risc

[/] [embedded_risc/] [trunk/] [Verilog/] [cmd_internal_reg.v] - Blame information for rev 27

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 hosseinami
/*********************************************************
2
 MODULE:                Sub Level Command Interface Internal Register
3
 
4
 FILE NAME:     cmd_internal_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 will store the timing and refresh commands into internal registers.
13
 
14
 
15
 Hossein Amidi
16
 (C) April 2002
17
 
18
*********************************************************/
19
 
20
// DEFINES
21
`timescale 1ns / 10ps
22
 
23
module internal_reg(// Input
24
                                                                reset,
25
                                                                clk0,
26
                                                                load_time,
27
                                                                load_rfcnt,
28
                                                                caddr,
29
                                                                // Output
30
                                                                cas_lat,
31
                                                                ras_cas,
32
                                                                ref_dur,
33
                                                                page_mod,
34
                                                                bur_len,
35
                                                                refresh_count
36
                                                                );
37
 
38
 
39
// Parameter
40
`include        "parameter.v"
41
 
42
// Input
43
input reset;
44
input clk0;
45
input load_time;
46
input load_rfcnt;
47
input [padd_size - 1 : 0]caddr;
48
 
49
// Output
50
output [cas_size - 1 : 0]cas_lat;
51
output [rc_size - 1 : 0]ras_cas;
52
output [ref_dur_size - 1 : 0]ref_dur;
53
output page_mod;
54
output [burst_size - 1 : 0]bur_len;
55
output [15:0]refresh_count;
56
 
57
// Internal wire and reg signals
58
reg [cas_size - 1 : 0]cas_lat;
59
reg [rc_size - 1 : 0]ras_cas;
60
reg [ref_dur_size - 1 : 0]ref_dur;
61
reg page_mod;
62
reg [burst_size - 1 : 0]bur_len;
63
reg [15:0]refresh_count;
64
 
65
 
66
// Assignment
67
 
68
 
69
// Loading Reg1 and Reg2
70
always @(posedge reset or posedge clk0)
71
begin
72
        if(reset == 1'b1)
73
        begin
74
                cas_lat                 <= 2'b00;
75
                ras_cas                 <= 2'b00;
76
                ref_dur                 <= 4'b0000;
77
                page_mod                <= 1'b0;
78
                bur_len        <= 4'b0000;
79
                refresh_count  <= 16'h0000;
80
        end
81
        else
82
        begin
83
                if(load_time == 1'b1)
84
                begin
85
                        cas_lat  <= caddr[1:0];
86
                        ras_cas  <= caddr[3:2];
87
                        ref_dur  <= caddr[7:4];
88
                        page_mod <= caddr[8];
89
                        bur_len  <= caddr[12:9];
90
                end
91
 
92
                if(load_rfcnt == 1'b1)
93
                        refresh_count  <= caddr[15:0];
94
 
95
        end
96
end
97
 
98
endmodule

powered by: WebSVN 2.1.0

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