Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to clear/reset my BRAM in VHDL Xilinx

Status
Not open for further replies.

TuAtAu

Advanced Member level 4
Joined
May 22, 2011
Messages
119
Helped
9
Reputation
18
Reaction score
9
Trophy points
1,298
Location
Jupiital
Activity points
2,149
Ok, this is my most origin code to declare BRAM and it is really synthesized into RAM block!

Code:
process (CLK)
	begin
		if (CLK'event and CLK = '1') then
			if (ENABLE = '1') then
				if (WRENABLE = '1') then
					BRAM(conv_integer(ADDRESS(13 downto 0))) <= DATA_IN;
				end if;
				DATA_OUT <= BRAM(conv_integer(ADDRESS(13 downto 0))); --if correct, cache out
			end if;
		end if;
	end process;

The problem is now i want to reset~!! means when reset is '0', set all RAM to '0'
so i add a reset code
Code:
process (CLK)
	begin
		
		if (CLK'event and CLK = '1') then
			if (RESET = '0') then
				BRAM <= (others => (others => '0'));
			elsif (ENABLE = '1') then
				if (WRENABLE = '1') then
					BRAM(conv_integer(ADDRESS(13 downto 0))) <= DATA_IN;
				end if;
				DATA_OUT <= BRAM(conv_integer(ADDRESS(13 downto 0))); --if correct, cache out
			end if;
		end if;
	end process;

or

Code:
process (CLK)
	begin
		
	if (RESET = '0') then
			BRAM <= (others => (others => '0'));
		elsif (CLK'event and CLK = '1') then
			if (ENABLE = '1') then
				if (WRENABLE = '1') then
					BRAM(conv_integer(ADDRESS(13 downto 0))) <= DATA_IN;
				end if;
				DATA_OUT <= BRAM(conv_integer(ADDRESS(13 downto 0))); --if correct, cache out
			end if;
		end if;
	end process;

BOTH also become unsynthesizable! The ISE is hanging and showing the process is running and i already wait for an hour.. still running.. seems like hanged. Then I just need to stop the synthesizer..

So is it any way to RESET the BRAM data?
 

you cannot reset a bram, they have no reset input. why do you want to reset it anyway?

to reset it you will have to manually reset each location.
 

I suggest to consult the respective FPGA datasheets. Block RAM can be written one memory location per clock cycle. This also applies for intended reset operation. There's no way to reset the memory array in a single clock cycle. The memory content will be asynchronously reset (or set to a specifies pattern) at power on. Runtime reset would need a state machine, addressing the memory sequentially.
 

I use as a cache, and I want to clear it when user reset the IP core.

Since it cannot reset, then nevermind.

PS:User guide doesn't talk about BRAM reset.
Only found a SSR, set and reset..
 

check the XST user guide. This manual is helpful for BRAM/SRL/DSP48 coding styles. It is not exaustive though -- there are other ways to write code that will also work.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top