FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-03-2004, 04:13 PM
Tobias Möglich
Guest
 
Posts: n/a
Default dual port RAM - write cycle problems

Hello,

I use the Sapartan-IIE from Xilinx.
In my application I'm writing with an µC to the dual port block RAM of
the FPGA.
If I'm writing only once to the dual port RAM, I succeed.
If I write several times to the RAM it get's confusing. The error is not
the same all the time. It differs.
I attempt to write 32 bit values to the dual port RAM.
To see the result, I read out data from the second port. I use a 7
segment LED the display the results. The addresses of
the second port are input be DIP switches. The second port is only read
(enable pin active all the time; read/write line permanently set to
READ).
And that's my test software:
The first value is written to adress 0x0 of the dual port RAM. The
second value to adress 0x1 (and so on...)
The first port, I use for the interface with the µC, is actually
configured as a 32 Bit port (generated by the
CoreGenerator from Xilinx ISE 6.1.01i)

And that's the result:
Sometimes the first write cycle of the µC seems o write data to
address 0x1 of the block RAM and with the
second write cycle data seems to be written to address 0x0. Data seems
to get interchanged.
Sometimes it seems that in address 0x0 there are no reasonable
values at all (Nothing that could have been
written by the first or second write cycle of the µC; but data at
address 0x1 is correct).
Writing 4 times to the dual port RAM can result in various errors.
Sometimes the values seem to be shifted through.
This means: data values that are written to adress 0x0 are found at
adress 0x1; data written to adress 0x1 is found
at adress 0x2. Data written to adress 0x2 is found at address 0x3. And
data written to address 0x3 is found in 0x0.
There seems to be a kind of shifting in the dual port RAM.

How can this be?
Is there something wrong.
I attach the code I use for the write process for the FPGA.
Is it possible, that the problem comes from "if rising_edge ..."?
Should it be "if IOSTRB_DSP='0' " ?
But then the process is not synchron anymore. Isn't it.


WRITE_DSP : process(IOSTRB_DSP) -- Daten
schreiben ins RAM (data -> ram)
begin
if rising_edge(IOSTRB_DSP) then
if CS_DSP = '0' and IORW_DSP = '0' then --
IORW=0: WRITE; CS and EN are active low
dinb <= data_DSP;
else
dinb <= (others=>'Z'); -- synthetisiert Tristate buffer;
end if;
end if;
end process;



It would be nice, if someone could give me an good advice.
Something I haven't yet cinsidered.

Greating, Tobias.

Reply With Quote
  #2 (permalink)  
Old 02-03-2004, 11:03 PM
MM
Guest
 
Posts: n/a
Default Re: dual port RAM - write cycle problems

Tobias,

"Tobias Möglich" <[email protected]> wrote in message
news:[email protected]

> WRITE_DSP : process(IOSTRB_DSP) -- Daten
> schreiben ins RAM (data -> ram)
> begin
> if rising_edge(IOSTRB_DSP) then
> if CS_DSP = '0' and IORW_DSP = '0' then --
> IORW=0: WRITE; CS and EN are active low
> dinb <= data_DSP;
> else
> dinb <= (others=>'Z'); -- synthetisiert Tristate buffer;
> end if;
> end if;
> end process;


From this code it is not clear what the timing relationship between the
address bus, write enable, clock and your data when they are all applied to
the memory. You have to make sure that your address is stable when you do
your write. Have you simulated this? Have you looked with a scope or a logic
analyzer? Do you have Xilinx Chipscope? I would suggest starting with
simulation if you haven't done so yet...

/Mikhail

--
To reply directly:
matusov at square peg ca
(join the domain name in one word and add a dot before "ca")





Reply With Quote
  #3 (permalink)  
Old 02-05-2004, 10:32 PM
Mike Treseler
Guest
 
Posts: n/a
Default Re: dual port RAM - write cycle problems

Tobias Möglich wrote:

> begin
> if rising_edge(IOSTRB_DSP) then



Consider synching everything to the uC clk.

if rising_edge(clk) then
. . .

And use IOSTRB_DSP as an input.


-- Mike Treseler
Reply With Quote
  #4 (permalink)  
Old 02-17-2004, 04:15 PM
Tobias Möglich
Guest
 
Posts: n/a
Default Re: dual port RAM - write cycle problems

>
>


Thank you for your advice.
I tried to use ModelSim Starter XE. But it has not much resources (free
version).
But now I downloaded ChipScope (free version) and it seems to help !!!

Question:
Is it also possible to analyse signals of IO pins. It seems to me that they are
not available in the "ChipScope Analyser".
Is it so? Or is it a mistake of mine. Yet I couldn't manage to display signals
which come directly from a IO pad in the scope

Tobias

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make dual-port RAM from single port RAM? Frank @ CN Verilog 34 03-06-2006 12:33 PM
Dual-port and single-port BlockRAM instantiation arkaitz FPGA 5 12-09-2003 08:30 AM


All times are GMT +1. The time now is 12:49 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved