Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > to access an array defined in some other file ?

Reply
Thread Tools

to access an array defined in some other file ?

 
 
charsi
Guest
Posts: n/a
 
      07-04-2005
hi all
i wrote a code for a RAM, which essentially comprises of an array. Now i
want to read some location in the RAM (array) in some other file..here
lies the problem..

1. simply accessing that array gives me error.
2. i tried writing the array declaration in package, i dont get any syntax
error but then i dont get any data either.
can u help me with a possible solution ?

plz help...thanks

 
Reply With Quote
 
 
 
 
Jonathan Bromley
Guest
Posts: n/a
 
      07-05-2005
On Mon, 04 Jul 2005 17:42:13 -0400, "charsi"
<> wrote:

>i wrote a code for a RAM, which essentially comprises of an array. Now i
>want to read some location in the RAM (array) in some other file..here
>lies the problem..
>
>1. simply accessing that array gives me error.
>2. i tried writing the array declaration in package, i dont get any syntax
>error but then i dont get any data either.


Oh dear.

Please repeat after me, very slowly and very many times:

VHDL IS NOT C.

If you are writing software in VHDL (for example, if you are
creating a big complicated test bench) then it is sometimes
reasonable to use shared variables declared in packages.
However, the behaviour of shared variables changed
significantly in VHDL-2002 and it's not a good place for
beginners to start their VHDL learning curve.

If you are writing hardware, then you must understand how
VHDL tries to represent hardware. Of course it gives an
error to access the array from somewhere else. I don't know
whether you have ever used a real RAM device, but even if you
haven't I guess you would not expect to read its contents
by removing its package and looking inside. Why, then, do
you expect VHDL to behave like that? To access a RAM you
must manipulate its connections (ports) correctly - supply
an address, wiggle its read strobe and chip select signals,
and pick up the data.

Tell us more and we may be able to guide you better. But
please don't forget to learn the very basic stuff about
entities, ports and signals. The comp.lang.vhdl FAQ will
point you to some excellent textbooks and online advice.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 
Reply With Quote
 
 
 
 
Andy Peters
Guest
Posts: n/a
 
      07-05-2005
charsi wrote:
> hi all
> i wrote a code for a RAM, which essentially comprises of an array. Now i
> want to read some location in the RAM (array) in some other file..here
> lies the problem..
>
> 1. simply accessing that array gives me error.
> 2. i tried writing the array declaration in package, i dont get any syntax
> error but then i dont get any data either.
> can u help me with a possible solution ?


Ummmmmmmmmmmmmmmmmmmmmmmmmmmm, the obvious answer is that you put your
RAM into an entity and then you instantiate the entity into your design
in the usual way.

-a

 
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
Re: __STDC_IEC_559__ (defined or !defined ?) Keith Thompson C Programming 0 08-17-2010 04:36 PM
User-defined exception: "global name 'TestRunError' is not defined" jmike@alum.mit.edu Python 1 07-10-2008 12:37 PM
How to access web.sitemap file from other virtual directories other than the current application root folder? hvajja@gmail.com ASP .Net 0 08-07-2006 08:26 PM
Using parenthesis with defined (#if defined(...)) Angel Tsankov C++ 1 04-05-2006 10:00 PM
#if (defined(__STDC__) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) Oodini C Programming 1 09-27-2005 07:58 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57