当前位置:网站首页>Ram block memory generator of vivado IP core
Ram block memory generator of vivado IP core
2022-07-29 06:39:00 【Doze in the wind】
Vivado IP Nuclear RAM Block Memery Generator
Catalog
Preface
This introduction vivado in RAM(Block Memery Generator)IP nucleus Use , I hope that's helpful .
Tips : The following is the main body of this article , All are original by the author , It's not easy to write an article , I hope you will attach a link to this article when reprinting .
One 、 Configuration steps
stay vivado Mid search Block Memery Generator, To find the IP After the core, you can complete the corresponding configuration according to the following operations . This configuration is Single port mode .
1. First configuration Basic Interface , Pictured 1 Shown .

2. Next configuration Port A Options Interface , Pictured 2 Shown .

3. Then configure Other Options Interface , Pictured 3 Shown . Here you can add initialization files , namely coe file , Used to initialize stored data .

4. Finally, there is a Summary Interface , Pictured 4 Shown , We don't need to configure , A profile page .

above 4 After all the interfaces are configured, you can click on the lower right corner OK Button generation IP nucleus .
Two 、 Simulation
1. Top level code
Build a top-level module , Name it ram_read, Used to instantiate the just generated IP nucleus .
The code is as follows :
`timescale 1ns / 1ps
//
// Company: cq university
// Engineer: clg
// Create Date: 2022/07/27 16:43:07
// Design Name:
// Module Name: ram_read
// Project Name:
// Target Devices:
// Tool Versions: 2017.4
// Description:
// Dependencies:
// Revision:1.0
// Revision 0.01 - File Created
// Additional Comments:
//
// Although it is ram, This time, we will ram When rom Use
module ram_read(
input clk, // Input clock signal
input rst_n, // Input reset signal
input start, // Input the start reading signal
input [10 : 0] addr, // Enter read address
input [31 : 0] din, // Not used this time
output reg over, // Output read data valid signal
output reg [31 : 0] dout // Output the read data
);
//reg define
reg en; // Read enable signal
reg we; // Reading and writing choices
reg [1:0] cnt; // Counter
//wire define
wire [31:0] data; // Reading data
always @(negedge clk or negedge rst_n)
begin
if(!rst_n)
cnt<=0;
else if( (start==1)&(cnt<3))
cnt<=cnt+1;
else
cnt<=0;
end
always @(negedge clk or negedge rst_n) // Falling edge setting enable
begin
if(!rst_n)
begin en<=0;we<=0;end
else if(0<cnt<3)
begin en<=1;we<=0;end
else
begin en<=0;we<=0;end
end
always @(posedge clk or negedge rst_n) // The rising edge reads stable data
begin
if(!rst_n)
begin over<=0;dout<=0;end
else if(cnt==3)
begin over<=1;dout<=data;end
else
begin over<=0;dout<=0;end
end
ram_sam_re_ip u1_ram_sam_re_ip ( // Exemplification ram
.clka(clk), // input wire clka
.ena(en), // input wire ena
.wea(we), // input wire [0 : 0] wea
.addra(addr), // input wire [10 : 0] addra
.dina(din), // input wire [31 : 0] dina
.douta(data) // output wire [31 : 0] douta
);
endmodule
2. Simulation code
Build a simulation module , Name it ram_read_tb, It is used to simulate the instantiation of the top-level module just now IP nucleus .
The code is as follows :
`timescale 1ns / 1ps
//
// Company: cq university
// Engineer: clg
// Create Date: 2022/07/27 16:52:23
// Design Name:
// Module Name: ram_read_tb
// Project Name:
// Target Devices:
// Tool Versions: 2017.4
// Description:
// Dependencies:
// Revision:1.0
// Revision 0.01 - File Created
// Additional Comments:
//
module ram_read_tb();
reg clk;
reg rst_n;
reg start;
reg [10 : 0] addr;
reg [31 : 0] din;
wire over;
wire [31 : 0] dout;
ram_read u1_ram_read(
.clk(clk),
.rst_n(rst_n),
.start(start),
.over(over),
.addr(addr),
.din(din),
.dout(dout)
);
always #5 clk=~clk;
initial begin
clk=1'b0;rst_n=1'b1;
#5; rst_n=1'b0;
#15; rst_n=1'b1;
start=1'b1;
addr=11'd0;
#30 start=1'b0;
end
endmodule
3、 ... and 、 Simulation analysis
Some initial stored data are shown in the figure 5 Shown , The simulation results are shown in the figure 6 Shown , It can be seen that the simulation results are correct , Successfully read the address 0 The data of , Due to output buffer , So there's a delay .


summary
This is the introduction , A brief introduction vivado in RAM IP The use of the core .
边栏推荐
猜你喜欢

FIR filter design (1) -- using the FDATool toolbox of MATLAB to design FIR filter parameters

FIR滤波器设计(2)——Vivado调用IP核设计FIR滤波器

浅谈缺陷描写样式

EtherCAT主站掉线后,如何保证目标系统免受故障影响?

day16-集合上

八、 网络安全

day17_ Under collection

day09_ Static & Final & code block & abstract class & Interface & internal class

FIR filter design (2) -- vivado calls IP core to design FIR filter

虹科Automation softPLC | 虹科KPA MoDK运行环境与搭建步骤(2)——MoDK运行环境搭建
随机推荐
FIR filter design (2) -- vivado calls IP core to design FIR filter
Network Security Learning (I)
day09_static&final&代码块&抽象类&接口&内部类
基于FPGA的4位减法器设计及仿真代码
IGMP protocol software development experiment
What is DNS amplification attack
FIR滤波器设计(2)——Vivado调用IP核设计FIR滤波器
NoClassDefFoundError processing
Why are the job requirements for software testing in 2022 getting higher and higher? Is there any secret in it?
Thinking about MySQL taking shell through OS shell
2022 summer second day information competition learning achievement sharing 2
虹科分享 | FPGA 实现的直通与存储转发切换延迟
Ultra low cost DDoS attacks are coming. See how WAF protects Jedi
FPGA里两个数的大小直接进行比较就可以吗?
day17_集合下
虹科分享 | 为什么说EtherCAT是提高控制系统性能的最佳解决方案?
Personal views on time complexity
day04_数组
网站受DDoS攻击的表现以及查看方法
Those vulnerability attacks on app