当前位置:网站首页>Learn the customization and testing of fpga---ram IP from the bottom structure
Learn the customization and testing of fpga---ram IP from the bottom structure
2022-07-01 05:34:00 【Lonely single blade】
List of articles
2、RAM IP Example and simulation test of
2.1、 Exemplify a RAM IP nucleus
Series catalog and portal
《 Start with the underlying structure FPGA》 Directory and portal
Customizing one RAM IP Before nuclear , It is strongly recommended that you read : Start with the underlying structure FPGA----RAM IP Introduction to nuclear and key parameters . In this article , Have been to RAM IP The key factors of nuclear are explained in detail .
1、RAM IP The custom of
- After creating a new project , Click on IP Catalog
- It will appear after clicking IP Catalog page , stay IP Search in the search box of the kernel block
- According to the screening , Double click to select RAM & ROM nucleus “Block Memory Generator”
①、 first page
②、 The second page
③、 The third page
④、 Page four
⑤、 Page 5
2、RAM IP Example and simulation test of
2.1、 Exemplify a RAM IP nucleus
Follow the above steps to generate IP after , Copy IP nucleus The self-contained instantiation template .
And then in our RTL In the code , Instantiate to generate a 4*16 Of SDP RAM.
The RTL No other functions , Only instantiate RAM that will do .
module test(
input clk, // Input clock
input [3:0] data_in, // input data
input en_wr, // Write enable signal
input en_rd, // Read enable signal
input [3:0] addr_wr, // Write the address
input [2:0] addr_rd, // Read the address
input we_wr, // Write enable
output [7:0] data_out // Output data
);
// Exemplification RAM IP nucleus
ram_w4_d16 ram_w4_d16_inst (
// port A-- Write the port
.clka (clk),
.ena (en_wr),
.wea (we_wr),
.addra (addr_wr),
.dina (data_in),
// port B-- Read the port
.clkb (clk),
.enb (en_rd),
.addrb (addr_rd),
.doutb (data_out)
);
endmodule
2.2、 The simulation test
Write a testbench, Yes RAM IP Test it .
Test behavior : First go to the address 0-15 Write data 0-15, And then from the address 0-7 Read the data ( Because the read data bit width is the write data bit width 2 times , So reading the data once will read 2 Write address data ).
`timescale 1ns / 1ns
module tb_test();
reg clk;
reg [3:0] data_in;
reg en_wr;
reg en_rd;
reg [3:0] addr_wr;
reg [2:0] addr_rd;
reg we_wr;
wire [7:0] data_out;
initial begin
clk = 0;
en_wr = 0;en_rd = 0;we_wr = 0;
data_in = 4'd0;
addr_wr = 4'd0;
addr_rd = 3'd0;
#110
en_wr = 1;we_wr = 1; // Start writing data
repeat(15) begin // To address 0-15 Write data 0-15
#10
data_in = data_in + 1;
addr_wr = addr_wr + 1;
end
#10
en_wr = 0; // Stop writing data
en_rd = 1;we_wr = 0; // Start reading data
repeat(10) begin // From address 0-7 Reading data
#10 addr_rd = addr_rd + 1;
end
en_rd = 0; // Stop reading data
#20 $finish; // End the simulation
end
always #5 clk = ~clk; // Generate clock , cycle 10ns
// Instantiate the tested module test
test test_inst(
.clk (clk ),
.data_in (data_in ),
.en_wr (en_wr ),
.en_rd (en_rd ),
.addr_wr (addr_wr ),
.addr_rd (addr_rd ),
.we_wr (we_wr ),
.data_out (data_out )
);
endmodule
Use vivado Built in simulation tools simulator Run the simulation , The simulation results are as follows :
In line with the expected results .
3、 Summary and reference
- You can see RAM IP The customization of is quite simple , After knowing its parameters , It can be fast 、 It is very convenient to instantiate one that you need RAM modular .
- It's not easy to create , If this article helps you , Please give me more praise 、 Reviews and collections . Your support is the biggest driving force for me to continuously update !
Reference material 1:Block Memory Generator v8.4
边栏推荐
- Memtable for leveldb source code analysis
- Lock free concurrency of JUC (leguan lock)
- Ebpf cilium practice (2) - underlying network observability
- 第05天-文件操作函数
- Rainbow combines neuvector to practice container safety management
- Multi table operation - foreign key cascade operation
- Use and principle of reentrantlock
- Is it safe for a novice to open a securities account?
- busybox生成的东西
- JS random verification code
猜你喜欢
LevelDB源码分析之memtable
[excel] column operation, which performs specific column for data in a cell, such as text division by comma, colon, space, etc
el-form表单新增表单项动态校验;el-form校验动态表单v-if不生效;
Causes of short circuit of conductive slip ring and Countermeasures
[data recovery in North Asia] a data recovery case of raid crash caused by hard disk drop during data synchronization of hot spare disk of RAID5 disk array
[RootersCTF2019]babyWeb
液压滑环的特点讲解
How to create a progress bar that changes color according to progress
Copier le matériel de conseils de bébé ne peut pas être vide, comment résoudre?
mysql 将毫秒数转为时间字符串
随机推荐
Intelligent operation and maintenance: visual management system based on BIM Technology
What things you didn't understand when you were a child and didn't understand until you grew up?
Receiving package install and uninstall events
[excel] column operation, which performs specific column for data in a cell, such as text division by comma, colon, space, etc
Chapitre d'apprentissage mongodb: Introduction à la première leçon après l'installation
Set集合详细讲解
数字金额加逗号;js给数字加三位一逗号间隔的两种方法;js数据格式化
Cockroachdb: the resistant geo distributed SQL database paper reading notes
json数据比较器
Rainbond结合NeuVector实践容器安全管理
Tar command
移动端常用解决方案
[RootersCTF2019]babyWeb
积分商城游戏能够给商家带来什么?怎么搭建积分商城?
Mathematical knowledge: finding the number of divisors
Usage and principle of synchronized
Unity 使用Sqlite
LevelDB源码分析之LRU Cache
LRU cache for leveldb source code analysis
tese_Time_2h