BRAM Exercise
BRAM Exercise
BRAM Exercise
Deliverable
Test bench project which has the IP as its
peripheral and verify the correctness in SDK.
Comments
BRAM Design
IP Catalog Block Memory Generator
1. Create a new vivado vhdl project
2. Use Block Memory Generator from IP Catalog
to generate a single port native block RAM Fig.2 Core Summary
having 32-bit data, 1024 addresses. Figure 1
shows the component parameters. 3. Block RAM Core Wrapper
Create a vhdl source, call it say,
BRAM_1032_wrapper (10-bit address 32-bit
data). Declare blk_mem_gen_0 as a component
and instantiate it using the instantiation
template file blk_mem_gen_0.vho found in the
IP Sources as shown in Fig. 3.
Fig. 1 Block RAM Parameters Below is the code in the .vho file use for the
component declaration and instantiation. Note
Figure 2 shows the component blk_mem_gen_0 the comment at the end of the template code
summary. The read latency is one clock cycle. on instructions regarding compiling a wrapper
This results from not selecting primitive and file and reference library.
-- The following code must appear in the VHDL architecture header.
------------- Begin Cut here for COMPONENT Declaration ------ COMP_TAG
COMPONENT blk_mem_gen_0
PORT (
clka : IN STD_LOGIC; Fig. 4 Simulation Waves
ena : IN STD_LOGIC;
wea : IN STD_LOGIC_VECTOR(0 DOWNTO 0); 5. Create and Package BRAM IP
addra : IN STD_LOGIC_VECTOR(9 DOWNTO 0); Note that the file
dina : IN STD_LOGIC_VECTOR(31 DOWNTO 0); bram_1032_ip_v1_0_S_AXI_ip.vhd in the test
douta : OUT STD_LOGIC_VECTOR(31 DOWNTO 0) bench is under
); ipshare/bram_1032_ip_v1_0/Xilinx.com/fe838d
END COMPONENT; b4/hdl
ATTRIBUTE SYN_BLACK_BOX : BOOLEAN;
ATTRIBUTE SYN_BLACK_BOX OF blk_mem_gen_0 : COMPONENT IS 6. Create BRAM embedded design test Bench
TRUE; and test application. Figure 5 shows example of
ATTRIBUTE BLACK_BOX_PAD_PIN : STRING; the terminal output.
ATTRIBUTE BLACK_BOX_PAD_PIN OF blk_mem_gen_0 : COMPONENT
IS "clka,ena,wea[0:0],addra[9:0],dina[31:0],douta[31:0]";
-- COMP_TAG_END ------ End COMPONENT Declaration ------------