当前位置:网站首页>AHB_ Bus_ Matrix_ 3x3 design
AHB_ Bus_ Matrix_ 3x3 design
2022-06-11 19:39:00 【Starry and】
Catalog
1. Function description
When more than one AHB master With many AHB slave When communicating , You can use a AHB Agreed bus matrix Realize interconnection .
for example

2. framework
According to the previous description , One master multi slave system needs decoder Yes Master Of HADDR To decode different Slave Make a selection , meanwhile Slave The read data also needs MUX Return to according to the film selection result Master. here bus matrix Design will decoder And MUX Merge into decoder, And for each Master Match one decoder.
For each of these Slave Come on , There may be more than one at the same time Master Visit it , Therefore need arbiter Implement arbitration , Therefore, tentative bus matrix The architecture of is as follows :

2.1. ahb_bus_matrix_3x3
The interface is as follows
| Group | Signal | Direction | Width(bits) | Description |
|---|---|---|---|---|
| HCLK | input | 1 | The clock | |
| HRSTn | input | 1 | Reset , Low efficiency | |
| MST_IO0 | HADDR_mst0 | input | HADDR_WIDTH | AHB Write the address |
| HBURST_mst0 | input | 3 | AHB burst The number of transmission times and increasing mode during transmission | |
| HSIZE_mst0 | input | 3 | Determines the bit width of the transmitted data | |
| HTRANS_mst0 | input | 2 | Transmission status | |
| HWDATA_mst0 | input | HDATA_WIDTH | AHB Writing data | |
| HWRITE_mst0 | input | 1 | Gao Weiwen , Low for reading | |
| HRDATA_mst0 | output | HDATA_WIDTH | AHB Reading data | |
| HREADY_mst0 | output | 1 | Master Received from Slave Effective signal | |
| MST_IO1 | HADDR_mst1 | input | HADDR_WIDTH | AHB Write the address |
| HBURST_mst1 | input | 3 | AHB burst The number of transmission times and increasing mode during transmission | |
| HSIZE_mst1 | input | 3 | Determines the bit width of the transmitted data | |
| HTRANS_mst1 | input | 2 | Transmission status | |
| HWDATA_mst1 | input | HDATA_WIDTH | AHB Writing data | |
| HWRITE_mst1 | input | 1 | Gao Weiwen , Low for reading | |
| HRDATA_mst1 | output | HDATA_WIDTH | AHB Reading data | |
| HREADY_mst1 | output | 1 | Master Received from Slave Effective signal | |
| MST_IO2 | HADDR_mst2 | input | HADDR_WIDTH | AHB Write the address |
| HBURST_mst2 | input | 3 | AHB burst The number of transmission times and increasing mode during transmission | |
| HSIZE_mst2 | input | 3 | Determines the bit width of the transmitted data | |
| HTRANS_mst2 | input | 2 | Transmission status | |
| HWDATA_mst2 | input | HDATA_WIDTH | AHB Writing data | |
| HWRITE_mst2 | input | 1 | Gao Weiwen , Low for reading | |
| HRDATA_mst2 | output | HDATA_WIDTH | AHB Reading data | |
| HREADY_mst2 | output | 1 | Master Received from Slave Effective signal |
| Group | Signal | Direction | Width(bits) | Description |
|---|---|---|---|---|
| SLV_IO0 | HADDR_slv0 | output | HADDR_WIDTH | AHB Write the address |
| HSEL_slv0 | input | 1 | Chip selection | |
| HBURST_slv0 | output | 3 | AHB burst The number of transmission times and increasing mode during transmission | |
| HSIZE_slv0 | output | 3 | Determines the bit width of the transmitted data | |
| HTRANS_slv0 | output | 2 | Transmission status | |
| HWDATA_slv0 | output | HDATA_WIDTH | AHB Writing data | |
| HWRITE_slv0 | output | 1 | Gao Weiwen , Low for reading | |
| HRDATA_slv0 | input | HDATA_WIDTH | AHB Reading data | |
| HREADYOUT_slv0 | input | 1 | Slave Prepare the signal | |
| SLV_IO1 | HADDR_slv0 | output | HADDR_WIDTH | AHB Write the address |
| HSEL_slv1 | input | 1 | Chip selection | |
| HBURST_slv1 | output | 3 | AHB burst The number of transmission times and increasing mode during transmission | |
| HSIZE_slv1 | output | 3 | Determines the bit width of the transmitted data | |
| HTRANS_slv1 | output | 2 | Transmission status | |
| HWDATA_slv1 | output | HDATA_WIDTH | AHB Writing data | |
| HWRITE_slv1 | output | 1 | Gao Weiwen , Low for reading | |
| HRDATA_slv1 | input | HDATA_WIDTH | AHB Reading data | |
| HREADYOUT_slv1 | input | 1 | Slave Prepare the signal | |
| SLV_IO2 | HADDR_slv0 | output | HADDR_WIDTH | AHB Write the address |
| HSEL_slv2 | input | 1 | Chip selection | |
| HBURST_slv2 | output | 3 | AHB burst The number of transmission times and increasing mode during transmission | |
| HSIZE_slv2 | output | 3 | Determines the bit width of the transmitted data | |
| HTRANS_slv2 | output | 2 | Transmission status | |
| HWDATA_slv2 | output | HDATA_WIDTH | AHB Writing data | |
| HWRITE_slv2 | output | 1 | Gao Weiwen , Low for reading | |
| HRDATA_slv2 | input | HDATA_WIDTH | AHB Reading data | |
| HREADYOUT_slv2 | input | 1 | Slave Prepare the signal |
| Parameter | Units | Description |
|---|---|---|
| HADDR_WIDTH | bit | AHB Address width |
| HDATA_WIDTH | bit | AHB Data width |
2.2. decoder
Combine the decoder and sorter into decoder, The following interfaces can be obtained
| Group | Signal | Direction | Width(bits) | Description |
|---|---|---|---|---|
| HCLK | input | 1 | The clock | |
| HRSTn | input | 1 | Reset , Low efficiency | |
| MST_IO | HADDR | input | HADDR_WIDTH | AHB Write the address |
| HRESP | output | 1 | AHB Transmit feedback | |
| HRDATA | output | HDATA_WIDTH | from Slave Read out data | |
| HREADY | output | 1 | Transmission success flag | |
| SLV_IO0 | HSEL_slv0 | output | 1 | Yes AHB Slave0 The movie selection of |
| HREADYOUT_slv0 | input | 1 | AHB Slave0 Input preparation signal | |
| HRESP_slv0 | input | 1 | AHB Slave0 Input feedback signal | |
| HRDATA_slv0 | input | HDATA_WIDTH | AHB Slave0 Input read data signal | |
| SLV_IO1 | HSEL_slv1 | output | 1 | Yes AHB Slave1 The movie selection of |
| HREADYOUT_slv1 | input | 1 | AHB Slave1 Input preparation signal | |
| HRESP_slv1 | input | 1 | AHB Slave1 Input feedback signal | |
| HRDATA_slv1 | input | HDATA_WIDTH | AHB Slave1 Input read data signal | |
| SLV_IO2 | HSEL_slv2 | output | 1 | Yes AHB Slave2 The movie selection of |
| HREADYOUT_slv2 | input | 1 | AHB Slave2 Input preparation signal | |
| HRESP_slv2 | input | 1 | AHB Slave2 Input feedback signal | |
| HRDATA_slv2 | input | HDATA_WIDTH | AHB Slave2 Input read data signal |
| Parameter | Units | Description |
|---|---|---|
| HADDR_WIDTH | bit | AHB Address width |
| HDATA_WIDTH | bit | AHB Data width |
2.3. arbiter
Here arbiter Is based on multiple AHB Master For this Slave The result of the film selection , Which one will be arbitrated AHB Master With this Slave signal communication , And with the real AHB Slave Interact
But actually aribiter There are many algorithms , This article will implement .
| Group | Signal | Direction | Width(bits) | Description |
|---|---|---|---|---|
| HCLK | input | 1 | The clock | |
| HRSTn | input | 1 | Reset , Low efficiency | |
| MST_IO0 | HADDR_mst0 | input | HADDR_WIDTH | AHB Write the address |
| HBURST_mst0 | input | 3 | AHB burst The number of transmission times and increasing mode during transmission | |
| HSIZE_mst0 | input | 3 | Determines the bit width of the transmitted data | |
| HTRANS_mst0 | input | 2 | Transmission status | |
| HWDATA_mst0 | input | HDATA_WIDTH | AHB Writing data | |
| HWRITE_mst0 | input | 1 | Gao Weiwen , Low for reading | |
| HREADY_mst0 | input | 1 | Indicates whether the transmission is correct | |
| HSEL_mst0 | input | 1 | Said to the Slave Strobe | |
| HRDATA_mst0 | output | HDATA_WIDTH | AHB Reading data | |
| HREADYOUT_mst0 | output | 1 | Master Received from Slave Effective signal | |
| MST_IO1 | HADDR_mst1 | input | HADDR_WIDTH | AHB Write the address |
| HBURST_mst1 | input | 3 | AHB burst The number of transmission times and increasing mode during transmission | |
| HSIZE_mst1 | input | 3 | Determines the bit width of the transmitted data | |
| HTRANS_mst1 | input | 2 | Transmission status | |
| HWDATA_mst1 | input | HDATA_WIDTH | AHB Writing data | |
| HWRITE_mst1 | input | 1 | Gao Weiwen , Low for reading | |
| HREADY_mst1 | input | 1 | Indicates whether the transmission is correct | |
| HSEL_mst1 | input | 1 | Said to the Slave Strobe | |
| HRDATA_mst1 | output | HDATA_WIDTH | AHB Reading data | |
| HREADYOUT_mst1 | output | 1 | Master Received from Slave Effective signal | |
| MST_IO2 | HADDR_mst2 | input | HADDR_WIDTH | AHB Write the address |
| HBURST_mst2 | input | 3 | AHB burst The number of transmission times and increasing mode during transmission | |
| HSIZE_mst2 | input | 3 | Determines the bit width of the transmitted data | |
| HTRANS_mst2 | input | 2 | Transmission status | |
| HWDATA_mst2 | input | HDATA_WIDTH | AHB Writing data | |
| HWRITE_mst2 | input | 1 | Gao Weiwen , Low for reading | |
| HREADY_mst2 | input | 1 | Indicates whether the transmission is correct | |
| HSEL_mst2 | input | 1 | Said to the Slave Strobe | |
| HRDATA_mst2 | output | HDATA_WIDTH | AHB Reading data | |
| HREADYOUT_mst2 | output | 1 | Master Received from Slave Effective signal | |
| SLV_IO | HADDR | output | HADDR_WIDTH | AHB Write the address |
| HBURST | output | 3 | AHB burst The number of transmission times and increasing mode during transmission | |
| HSIZE | output | 3 | Determines the bit width of the transmitted data | |
| HTRANS | output | 2 | Transmission status | |
| HWDATA | output | HDATA_WIDTH | AHB Writing data | |
| HWRITE | output | 1 | Gao Weiwen , Low for reading | |
| HREADY | output | 1 | Indicates whether the transmission is correct | |
| HSEL | output | 1 | Said to the Slave Strobe | |
| HRDATA | input | HDATA_WIDTH | AHB Reading data | |
| HREADYOUT | input | 1 | come from Slave Effective signal |
| Parameter | Units | Description |
|---|---|---|
| HADDR_WIDTH | bit | AHB Address width |
| HDATA_WIDTH | bit | AHB Data width |
3. logic design
3.1. decoder
decoder The meaning of It's based on Master Of HADDR Information on the corresponding Slave Make a selection , Will be Slave The output signal of is fed back to Master.
module decoder#(
parameter HADDR_WIDTH = 8,
parameter HDATA_WIDTH = 16
)(
input hrstn,
input hclk,
input [HADDR_WIDTH-1:0] haddr,
output hresp,
output [HDATA_WIDTH-1:0] hrdata,
output hready,
output hsel_slv0,
input hreadyout_slv0,
input hresp_slv0,
input [HDATA_WIDTH-1:0] hrdata_slv0,
output hsel_slv1,
input hreadyout_slv1,
input hresp_slv1,
input [HDATA_WIDTH-1:0] hrdata_slv1,
output hsel_slv2,
input hreadyout_slv2,
input hresp_slv2,
input [HDATA_WIDTH-1:0] hrdata_slv2
);
reg hresp_r;
reg [HDATA_WIDTH-1:0] hrdata_r;
reg hready_r;
reg hsel_slv0_r;
reg hsel_slv1_r;
reg hsel_slv2_r;
[email protected](*) begin
case(haddr[31:16])
16'h0000:
hresp_r = hresp_slv0;
16'h0001:
hresp_r = hresp_slv1;
16'h0002:
hresp_r = hresp_slv2;
default:
hresp_r = 1'b0;
endcase
end
assign hresp = hresp_r;
[email protected](*) begin
case(haddr[31:16])
16'h0000:
hrdata_r = hrdata_slv0;
16'h0001:
hrdata_r = hrdata_slv1;
16'h0002:
hrdata_r = hrdata_slv2;
default:
hrdata_r = 'h0;
endcase
end
assign hrdata = hrdata_r;
[email protected](*) begin
case(haddr[31:16])
16'h0000:
hready_r = hreadyout_slv0;
16'h0001:
hready_r = hreadyout_slv1;
16'h0002:
hready_r = hreadyout_slv2;
default:
hready_r = 1'b0;
endcase
end
assign hready = hready_r;
[email protected](*) begin
case(haddr[31:16])
16'h0000:
begin
hsel_slv0_r = 1'b1;
hsel_slv1_r = 1'b0;
hsel_slv2_r = 1'b0;
end
16'h0001:
begin
hsel_slv0_r = 1'b0;
hsel_slv1_r = 1'b1;
hsel_slv2_r = 1'b0;
end
16'h0002:
begin
hsel_slv0_r = 1'b0;
hsel_slv1_r = 1'b0;
hsel_slv2_r = 1'b1;
end
default:
begin
hsel_slv0_r = 1'b0;
hsel_slv1_r = 1'b0;
hsel_slv2_r = 1'b0;
end
endcase
end
assign hsel_slv0 = hsel_slv0_r;
assign hsel_slv1 = hsel_slv1_r;
assign hsel_slv2 = hsel_slv2_r;
endmodule
3.2. fixed_prio_arb
3.3. fixed_prio_arb
3.4. fixed_prio_arb
边栏推荐
- STL application (unfinished
- Anaconda installation, jupyter notebook default startup path modification and nbextensions plug-in installation
- On the selection and design of management subsystem of collection system
- Zzulioj 2903: the power of warriors
- Golang学习笔记—基础篇
- WinCC flexible 2008项目移植到博途WinCC的具体方法
- Pyqt5 tips - button vertical display method, QT designer sets button vertical display.
- [Lao Wang's fallacy of brain science] Why do blind people "seem" to be more "sensitive" than normal people?
- Skywalking source code analysis Part 5 - server configuration configuration module startup
- Building web applications
猜你喜欢

巴比特 | 元宇宙每日必读:数字藏品二级市场乱象丛生,00后成新韭菜,监管迫在眉睫?...

Yolov3 pytoch code and principle analysis (I): runthrough code

干货丨MapReduce的工作流程是怎样的?

司空见惯 - 会议室名称

Go语言入门(六)——循环语句

Introduction to go language (VI) -- loop statement

CMU 15 - 445 cours de base de données Leçon 5 version texte - Pool tampon

NR LDPC punched
![[assembly] analysis of Experiment 7 of the fourth edition of assembly language](/img/ac/a3c5bfeb2dcb93b123dd337993bab3.jpg)
[assembly] analysis of Experiment 7 of the fourth edition of assembly language

3D建模有什么技巧吗?
随机推荐
【求助】请问如何让微信公众号文章在外部浏览器中打开后还能显示下方的精选留言?
Learn about random library · 1
[image denoising] impulse noise image denoising based on absolute difference median filter, weighted median filter and improved weighted median filter with matlab code attached
"Case sharing" based on am57x+ artix-7 FPGA development board - detailed explanation of Pru Development Manual
Postman configuration Chinese
YOLOv3 Pytorch代码及原理分析(二):网络结构和 Loss 计算
collect. stream(). Use of the collect() method
Introduction to go language (VI) -- loop statement
Loop filtering to uncover the technical principle behind video thousand fold compression
全名单!2022泰晤士亚洲大学排名公布!
MongoDB 什么兴起的?应用场景有哪些?
[bug resolution] unpickingerror: a load persistent ID instruction was encoded, but no persistent_ load.
2022各大厂最新总结的软件测试宝典,看完不怕拿不到offer
Picture bed: picgo+ Tencent cloud +typera
5g communication test manual based on Ti am5728 + artix-7 FPGA development board (dsp+arm)
pstack和dmesg
Xmake help 2
Multimodal learning toolkit paddlemm based on propeller
Use Mysql to determine the day of the week
On high availability architecture