当前位置:网站首页>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 .
边栏推荐
猜你喜欢

Personal views on time complexity

Design and simulation code of 4-bit subtracter based on FPGA

虹科分享 | 带你全面了解“CAN总线错误”(三)——CAN节点状态与错误计数器

虹科分享 | FPGA 实现的直通与存储转发切换延迟

Merkletree builds QT implementation UI

JVM memory structure

Design of IIR filter based on FPGA

使用STP生成树协议解决网络中的二层环路问题

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

虹科分享 | 为什么说EtherCAT是提高控制系统性能的最佳解决方案?
随机推荐
Handwritten digit recognition using neural network
虹科分享 | 带您全面认识“CAN总线错误”(一)——CAN总线错误与错误帧
MerkleTree 构建QT实现UI
高级套接口编程(选项和控制信息)
基于FPGA的IIR型滤波器设计
不安全的第三方组件的漏洞如何做前置规避?
Inventory | major network security events of global key information infrastructure
超低成本DDoS攻击来袭,看WAF如何绝地防护
Several misunderstandings about DDoS
Six common ways for hackers to attack servers
3、 Wide area communication network
服务器常见故障及其解决方法
day06_ Classes and objects
Clickhouse failed to import CSV without error but no data
钓鱼邮件处置
What is the basic principle of Library collision and library collision attack
day16-集合上
day04_数组
FIR滤波器设计(2)——Vivado调用IP核设计FIR滤波器
2022 summer second day information competition learning achievement sharing 2