Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > vhdl complex memory addressing

Reply
Thread Tools

vhdl complex memory addressing

 
 
Alex
Guest
Posts: n/a
 
      01-31-2006
Hi to all,
I'm new in vhdl. My problem is that I have to address a memory composed
of 2 banks, M muxes, N pages and K words.

The address is 15 bits long:

14 13 11 10 9 8 0
-----------------------------------------------------------------------------
| BANK | MUX | PAGE | WORD |
-----------------------------------------------------------------------------

My question is: how can I define the structure to write/read a word?
I think I must declare a sort of array of arrays of arrays... but in
the web and in my book I have found only examples of simple memory with
a single type declaration like this:

type ram_type is array (0 to 255) of std_logic_vector(15 downto 0);

Thanks,
Alex.

 
Reply With Quote
 
 
 
 
a1_nocrap_exh@hotmail.com
Guest
Posts: n/a
 
      01-31-2006
> My problem is that I have to address a memory composed
> of 2 banks, M muxes, N pages and K words.


You're not really giving us enough information to help.... You need to
provide details on how the REAL RAM handles it's paging etc. How wide
is your RAM? Timings etc.

> My question is: how can I define the structure to write/read a word?


Erm, you cannot. You have to determine what I/O your memory has
(address, data, write strobe, chip select etc.) then any requirements
of timing between asserting your address and the data being valid etc.
You may have to create a state-machine to do the reads and writes as
chances they may be multi-cycle.

> type ram_type is array (0 to 255) of std_logic_vector(15 downto 0);


This is a description of a register array, not a RAM/memory. Used for
small internal usage and perhaps used as part of a behavioural model of
real RAMs

 
Reply With Quote
 
 
 
 
Alex
Guest
Posts: n/a
 
      01-31-2006
Hi,
thank you... yes, I have post too few data.

I have defined the entity of that memory and now the problem is to
describe a behavioural description.

This is the entity:

entity memory is

generic (
logbanks : integer := 1; -- log2 of banks
logpages : integer := 3; -- log2 of pages
logmuxes : integer := 2; -- log2 of muxes
logwords : integer := 9; -- log2 of words
addsize : integer := 15; --
logbanks+logpages+logmux+logwords
datasize : integer := 16);

port (
datain : in std_logic_vector(datasize-1 downto 0);
dataout : out std_logic_vector(datasize-1 downto 0);
address : in std_logic_vector(addsize-1 downto 0);
ck : in std_logic; -- clock
rst : in std_logic; -- asynchronous reset
ce : in std_logic; -- chip enable
rw : in std_logic); -- rw ='1'=>read, rw
='0'=>write

end memory;

 
Reply With Quote
 
Mike Treseler
Guest
Posts: n/a
 
      01-31-2006
Alex wrote:

> I'm new in vhdl. My problem is that I have to address a memory composed
> of 2 banks, M muxes, N pages and K words.


Sounds more like a homework problem,
than a real memory device.

> My question is: how can I define the structure to write/read a word?


I would design a synchronous controller to
implement all of the read and write cycles
I cared about from the device data sheet.

> type ram_type is array (0 to 255) of std_logic_vector(15 downto 0);


A type like that might be used to infer
an internal block ram or register bank.

-- Mike Treseler
 
Reply With Quote
 
a1_nocrap_exh@hotmail.com
Guest
Posts: n/a
 
      02-02-2006
That still is not enough information. Real memories usually have delays
between asserting address and data being valid. Even more so with
memories with pages and banks. Find out what the behaviour is.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is memory addressing ? cnoe C Programming 15 11-30-2008 05:15 PM
Memory addressing Simon Berube Python 12 04-29-2007 07:03 AM
VHDL-2002 vs VHDL-93 vs VHDL-87? afd VHDL 1 03-23-2007 09:33 AM
Indirect Memory Addressing Larry Bates Python 2 06-04-2004 06:49 AM
MEMORY ADDRESSING QUESTION Rob Computer Information 2 05-27-2004 12:35 PM



Advertisments