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 | |
i wrote this to create a 4*32 RAM but when i simulate i get a 4*4 RAM. pls help me to find the error.
vhdl RAM module
i wrote this to create a 4*32 RAM but when i simulate i get a 4*4 RAM. pls help me to find the error.
Guest
#3349027
vhdl newbie wrote: > use ieee.std_logic_arith.all; > use ieee.std_logic_unsigned.all; Why do you use obsolete librarys? Link: http://www.vhdl.org/comp.lang.vhdl/FAQ1.html#integer_bit_vector
> i wrote this to create a 4*32 RAM but when i simulate i get a 4*4 RAM.
Beside the librarys the code looks ok. Did you restart your simulation?
How did you recognize the non-functionality?
Duke
vhdl newbie wrote: > process(clock,read) > process(clock,write) These processes are synchronous and therefore only dependent on the clock. So read and write are too much in the sensitivity lists... > depth:integer:=32; addr:integer:=5 These two values are relatives to themselves. So it would be enough to define one of them, then the other can be calculated: type ram_type is array (0 to (2**addr)-1) of ... > i wrote this to create a 4*32 RAM but when i simulate i get a 4*4 RAM. How did you find this out?
Guest
#3365896
1.It is advisable to perform a write cycle first and then read the data ad the data will be in undefined state if you read first. 2. There is no need for 3 parameters(width, depth, addr.). Two are enough. And data_in and data_out must be (depth - 1 downto 0) if you want a 4*32 RAM. If you declare them as (width - 1 downto 0), a 4*4 RAM will be created. In your code, you can remove the width parameter. Depth and addr. are enough. --Regards ReplyPlease log in before posting. |