URL
https://opencores.org/ocsvn/eco32/eco32/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 27 |
Rev 119 |
Line 1... |
Line 1... |
|
//
|
|
// ram.v -- main memory, using SDRAM
|
|
//
|
|
|
|
|
module ram(clk, clk_ok, reset,
|
module ram(clk, clk_ok, reset,
|
en, wr, size, addr,
|
en, wr, size, addr,
|
data_in, data_out, wt,
|
data_in, data_out, wt,
|
sdram_cke, sdram_cs_n,
|
sdram_cke, sdram_cs_n,
|
sdram_udqm, sdram_ldqm,
|
sdram_udqm, sdram_ldqm,
|
sdram_ras_n, sdram_cas_n,
|
sdram_ras_n, sdram_cas_n,
|
sdram_we_n, sdram_ba,
|
sdram_we_n, sdram_ba,
|
sdram_a, sdram_dq);
|
sdram_a, sdram_dq);
|
|
// internal interface signals
|
input clk;
|
input clk;
|
input clk_ok;
|
input clk_ok;
|
input reset;
|
input reset;
|
input en;
|
input en;
|
input wr;
|
input wr;
|
input [1:0] size;
|
input [1:0] size;
|
input [24:0] addr;
|
input [24:0] addr;
|
input [31:0] data_in;
|
input [31:0] data_in;
|
output reg [31:0] data_out;
|
output reg [31:0] data_out;
|
output reg wt;
|
output reg wt;
|
|
// SDRAM interface signals
|
output sdram_cke;
|
output sdram_cke;
|
output sdram_cs_n;
|
output sdram_cs_n;
|
output sdram_udqm;
|
output sdram_udqm;
|
output sdram_ldqm;
|
output sdram_ldqm;
|
output sdram_ras_n;
|
output sdram_ras_n;
|
Line 71... |
Line 78... |
|
|
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
|
|
// the SDRAM is organized in 16-bit halfwords
|
// the SDRAM is organized in 16-bit halfwords
|
// address line 0 is controlled by the state machine
|
// address line 0 is controlled by the state machine
|
// this is necessary for word accesses
|
// (this is necessary for word accesses)
|
assign cntl_addr[23:1] = addr[24:2];
|
assign cntl_addr[23:1] = addr[24:2];
|
assign cntl_addr[0] = a0;
|
assign cntl_addr[0] = a0;
|
|
|
// state machine for SDRAM access
|
// state machine for SDRAM access
|
always @(posedge clk) begin
|
always @(posedge clk) begin
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.