-1
我想對具有8位數的長度爲16的數組進行排序。我使用了bubblesort,它工作正常。 現在我想從BRAM讀取輸入數組,並將排序後的輸出寫入BRAM。我已經使用單端口RAM作爲測試臺,這是它的外觀。在BRAM中讀寫2d數組VHDL
library IEEE;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity testbench is
end testbench;
architecture Behavioral of testbench is
--temporary signal declarations.
signal ena : std_logic := '0';
signal wea : std_logic_VECTOR(0 downto 0):="0";
signal addra,dina,douta : std_logic_VECTOR(7 downto 0) := (others => '0');
signal clk : std_logic := '0';
begin
--Instantiating BRAM.
BRAM : entity work.BRAM_test
port map(
clka => clk, --clock for writing data to RAM.
ena => ena, --Enable signal.
wea => wea, --Write enable signal for Port A.
addra => addra, --8 bit address for the RAM.
dina => dina, --8 bit data input to the RAM.
douta => douta); --8 bit data output from the RAM.
--Simulation process.
process(clk)
begin
addra <= X"00"; --reset the address value for reading from memory location "0"
end process;
--Clock generation - Generates 500 MHz clock with 50% duty cycle.
process
begin
clk <= '1';
wait for 1 ns; --"ON" time.
clk <= '0';
wait for 1 ns; --"OFF" time.
end process;
end Behavioral;
我無法做到這一點。請幫幫我。
請說清楚,如果您期望的答案:無法做到什麼?代碼是否給出錯誤?結果不是你所期望的(在這種情況下指定獲得的和預期的結果) – 2013-03-10 07:23:47