Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Super Contributor
eng.amr2009
Posts: 152
Registered: ‎12-21-2009
0
Accepted Solution

distributed dual clock RAM Coding

[ Edited ]

I'm trying to implement distributed dual clock RAM but the XST implements it as block RAM. I'm using the recommended coding styles for RAM implementation in the xst user guide. I tried the attribute distributed_ram but it did not work.

 

The code:

 

                process(wrclk,rstn)
		begin
			if rstn='0' then
				aRAM	<=	(others=>(others=>'0'));
			ElsIf rising_edge(wrclk) then
				if wrreq='1' then
					aRAM(conv_integer(wr_Address))	<=	wr_data;
				end if;
			end if;	
		end process;

		process(rdclk,rstn)
		begin
			if rstn='0' then 
				rd_data	<=	(others=>'0');
			Elsif rising_edge(rdclk) then
				if rdreq='1' then
					rd_data	<=	aRAM(conv_integer(rd_address));
				end if;
			end if;
		end process;

 

Another question : If i implemented a dual clock RAM with data width equal 1 bit with with 16 memory locations so, Am I in this case missusing the block RAM resources ? Should be there a minimum data width of the Block RAM ?

 

Thanks in advance.

Super Contributor
markcurry
Posts: 117
Registered: ‎09-16-2009
0

Re: distributed dual clock RAM Coding

 

Try removing the reset clause from all your statements.  None of the RAMS have resets.

 

--Mark

 

 

Super Contributor
eng.amr2009
Posts: 152
Registered: ‎12-21-2009
0

Re: distributed dual clock RAM Coding

May be you did not understand my problem. I need to implement this code as DISTRIBUTED ram but the XST implements it as BLOCK ram. I added the reset to prevent the XST from implementing the code as BLOCK ram.

Moderator
viviany
Posts: 480
Registered: ‎05-14-2008

Re: distributed dual clock RAM Coding

Are you referring to "ram_style" attribute when you say "attribute distributed_ram"? How do you add this attribute in your code? I suspect you used incorrect attribute so XST does not infer the RAM as you expected.

 

Vivian

Super Contributor
eng.amr2009
Posts: 152
Registered: ‎12-21-2009
0

Re: distributed dual clock RAM Coding

	attribute syn_ramstyle : string;
	attribute syn_ramstyle of aRAM : signal is "distributed_ram";

 

May be there is a problem with the attribute. Check my code above and correct me.

Super Contributor
eng.amr2009
Posts: 152
Registered: ‎12-21-2009
0

Re: distributed dual clock RAM Coding

there was a problem with the attribute i used

 

the correct attribute is

 

	attribute ram_style : string;
	attribute ram_style of aRAM : signal is "distributed";