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

day04_数组

Merkle Tree 存在性功能第一次修改

2022 summer second day information competition learning achievement sharing 2

day17_集合下

虹科方案 | 在数字化的变电站中低成本实现无缝集成的独特解决方案

Vivado IP核之RAM Block Memery Generator

虹科Automation softPLC | 虹科KPA MoDK运行环境与搭建步骤(3)——MoDK例程测试

六、 网络互联与互联网

虹科Automation softPLC | 虹科KPA MoDK运行环境与搭建步骤(2)——MoDK运行环境搭建

三、广域通信网
随机推荐
钓鱼邮件处置
Noi online 2022 popular group problem solving & personal understanding
Phishing mail disposal
NoClassDefFoundError processing
Vivado IP核之复数浮点数乘法 Floating-point
unsigned right shift
Common server faults and their solutions
Merkle Tree 存在性功能第一次修改
一文看懂网络安全五年之巨变
Sequence list and linked list
Vivado IP核之浮点数加减法 Floating-point
DDoS攻击与CC攻击的区别
day10_ Exception handling & enumeration
Clickhouse failed to import CSV without error but no data
Leetcode刷题记录
自动化测试的生命周期是什么?
摊余成本最牛例子
基于udp通信的在线多人聊天室
盘点 | 全球关键信息基础设施网络安全大事件
Idea practical shortcut key novice must see