Introduction to Wishbone Bus Interface Module wb_biu in or1200 Processor

Source: Internet
Author: User

The following is an excerpt from the book "Step by Step surprise core-software core processor internal design analysis ".

 

The wb_biu module is the interface module connecting the or1200 processor to the external WISHBONE bus. section 15.1 describes the external connection relationship of the wb_biu module and points out the three functions of the wb_biu module. Because the or1200 processor supports wishbone B3, the storage feedback Bus Cycle in wishbone B3 is introduced in Section 15.2, it focuses on the role of cti_o/cti_ I, and bte_o/bte_ I in the periodic type recognition.

15.1 external connection relationship of wb_biu Module

Figure 1.6 shows that the or1200 processor uses two wb_biu (WishBone Bus Interface Unit) modules as the processor's command WishBone Bus Interface Unit and data WishBone Bus Interface Unit. The processor uses these bus interface units to perform operations such as picking and loading stored data. Readers may wonder why the icache AND Sb are directly connected to the external WISHBONE bus without removing wb_biu. After all, the external interface signals of the icache and SB modules comply with the WishBone Bus Specifications. This involves the role of the wb_biu module. In this section, we will introduce the function of the wb_biu module in the introduction to its interfaces. Readers will then understand it.

The interface and external connection relationship of the wb_biu module are shown in Figure 15.1.

In Figure 15.1, The wb_biu module treats the interface names outside the processor in the form of wb_xxx_x, and the interface names inside the processor are in the form of biu_xxx_x. Note that in the code analysis, based on this, we can determine whether a signal is between wb_biu and the external module of the processor, or between wb_biu and the internal module of the processor.

From figure 15.1, we can also find that the signal between wb_biu and the external module of the processor is more than that between wb_biu and the internal module of the processor. The focus is the 6 signals marked in italic text in the figure, these six signals reveal the role of the wb_biu module:

(1) clmode, wb_rst_ I, wb_clk_ I

The external WISHBONE bus clock of the processor can be smaller than the processor clock, so as to reduce the power consumption of the system. These three signals are used when the WishBone Bus clock is different from the processor clock, the wb_biu module coordinates the WishBone Bus signal inside and outside the processor to make it work normally. Here, wb_rst_ I and wb_clk_ I are the reset and clock signals of the external WISHBONE bus. clmode is the signal selected in the clock mode and the length is two digits. You can set them as follows:

  • 2 'b00: External WISHBONE bus clock wb_clk_ I equals processor clock CLK
  • 2 'b01: The External WISHBONE bus clock wb_clk_ I equals half of the CPU clock CLK
  • 2 'b10: Undefined
  • 2 'b11: The External WISHBONE bus clock wb_clk_ I is equal to 1/4 of the CPU clock CLK

(2) wb_rty_ I

When the external device replies to the retry signal (wb_rty_ I is 1), The wb_biu module starts the wishbone bus operation cycle with the external device again. Only when the number of retries exceeds one threshold (the default value is 64) the WISHBONE bus operation error is reported to the processor, which can improve the fault tolerance capability of the system.

(3) wb_cti_ I, wb_bte_ I

Wb_cti_ I is the periodic recognition address label, and wb_bte_ I is the burst type extended address label. Both of them are signals used in wishbone specification B3 to implement wishbone storage and feedback bus cycle, in section 2nd of this chapter, we will introduce the meaning of the wishbone storage feedback bus cycle. Here, the reader only needs to know that the wishbone bus in the processor does not have these two signals, so the wb_biu module also plays a role in conversion between different WishBone Bus Specifications. Currently, wishbone has developed version B4. To enable or1200 to support the new version, you only need to modify the wb_biu module to improve the system porting capability.

In the above interface analysis, the role of the wb_biu module has been revealed. If wb_biu is removed, these functions must be implemented in the icache and SB modules respectively, obviously it is not a good design method, so wb_biu module cannot be removed.

 

15.2 wishbone storage feedback Bus Cycle

If you read from the beginning of this book, you should have a basic impression on the operation cycle of the wishbone bus:

(1) The process of one read operation: the master device sets cyc_o/stb_o to indicate that the bus operation cycle starts, and then sends the address signal through the adr_o interface, and the we_ I sets low to indicate the read operation, after several clock cycles, the ack_ I of the master device changes to a high level, indicating that the data is read, the master device reads data from dat_ I, and the low cyc_o/stb_o indicates that the bus operation cycle ends, the slave device also sets ack_o low.

(2) single write operation process: the master device sets cyc_o/stb_o to indicate that the bus operation cycle starts, and then sends the address signal through the adr_o interface, and the dat_o interface sends the data to be written, when we_ I is set to high, it indicates the write operation. After several clock cycles, ack_ I of the master device changes to high, indicating Data Writing. When the master device is set to low cyc_o/stb_o, the bus operation cycle ends, the slave device also sets ack_o low.

(3) block read operation process: the master device sets cyc_o/stb_o to indicate the start of the bus operation cycle, and then sends the address signal through the adr_o interface, after several clock cycles, the ack_ I of the master device changes to a high level, indicating that the data is read. The master device reads data from dat_ I and sets ack_o down from the device. The master device sends a new address signal through the adr_o interface again, after several clock cycles, the ack_ I of the master device changes to a high level, indicating that the new data is read. The master device reads data from dat_ I and sets ack_o again from the device, if cyc_o/stb_o is set low on the master device, the bus operation cycle ends.

(4) block write operation process: the master device sets cyc_o/stb_o to indicate that the bus operation cycle starts, and then sends the address signal through the adr_o interface, and the dat_o interface sends the data to be written, when we_ I is set to high, it indicates the write operation. After several clock cycles, the ack_ I of the master device changes to high, indicating that data is written, and ack_o is set to low from the device, the primary device sends a new address signal and data signal through the adr_o and dat_o interfaces again. After several clock cycles, the ack_ I of the primary device changes to a high level, indicating that new data is written, the bus operation cycle ends when ack_o is set to low again on the device until cyc_o/stb_o is set to low on the master device.

The process of block read and write operations has been met in Chapter 13th when analyzing dcache. In chapter 13th, step 1 of the sample program was used for the first time. when the SW command loads data, dcache may fail. If you configure a write-back statement, then, the processor will read four words from the external Ram and fill them into the dcache (also known as sudden reading of four words). The Code is as follows:

############################# 8th ######## ##################### command address command binary 0x800078 L. addi R1, R0, 0x10 0x9c200010_loop1: 0x80007c L. SW 0x0 (R1), R1 0xd4010800 // dcache will fail when this command is executed for the first time. 0x800080 L. sfeqi R1, 0x1c 0xbc01001c0x800084 L. BNF _ loop1 0x0ffffffe0x800088 L. addi R1, R1, 0x4 0x9c210004

The Modelsim simulation waveform 15.2 is shown. Here is the block read operation process.

It can be seen that each time the master device receives a new address after ack_ I is 1, the next operation starts from the device based on the new address, if the device knows in advance that the master device is about to initiate a new operation and the new address, you can start the next operation immediately after the previous operation, instead, you do not need to wait for the master device to receive the new address, which can save the clock cycle and improve the system throughput. This is the "wishbone storage feedback Bus Cycle ".

In the wishbone storage feedback bus cycle, the device needs to know in advance whether the master device will initiate a new bus operation after the current operation is completed, this is done by identifying the address label cti_o/cti_ I through the periodic type, and the burst type Extension address label bte_o/bte_ I.

Cti_o/cti_ I provides information about the current operation burst mode. The device can determine how to operate in the next clock cycle based on this information, as shown in table 15.1.

 

A constant address burst Bus Cycle refers to the process of completing multiple operations in a bus cycle, but the address remains unchanged. A typical application of this method is to read/write FIFO in DMA mode; incremental sudden increase refers to the number of operations performed multiple times in a bus cycle, but the address increases progressively. In addition, the address increase methods include linear increase and fold increase. Bte_o/bte_ I describes the address adding method, as shown in table 15.2.

In linear increase, the new address is always greater than the old address. The Unit added value depends on the bus width and granularity. For a bus with a granularity of 8, when the bus width is 8, the Unit added value is 1. When the bus width is 16, the Unit added value is 2. When the width is 32, the Unit added value is 4. In fold increase, it can be divided into 4 fold increase, 8 fold increase, and 16 fold increase. The new address is obtained by adding 1 to the part of the old address, for example: 4 fold increase, when the unit value is 4, a new address is obtained by adding 1 to the 2-3 digits of the old address. This address calculation method is used when four words are suddenly read in icache and dcache.

The device can know the address of the next operation in advance based on the cti_ I and bte_ I values of the input signal, so that the operation can be performed in advance, saving the clock cycle. When the master device sets cti_o to 3'b111, it indicates that the current operation is the last burst operation. The master device no longer initiates the operation in the clock cycle immediately after the current operation ends, the WISHBONE storage feedback bus cycle ends.

If the master and slave devices work in a storage feedback bus cycle, at least cti_o/cti_ I signals must be supported at the same time. If the master or slave device does not support cti_o/cti_ I, it can only work in a traditional bus cycle, at this time, the master or slave device must set cti_o/cti_ I to 3 'b000 or 3' b111, Which is equivalent.

In section 11.5, the code of the wb_biu module in or1200 was modified during the establishment of a simple system-based system, the reader may temporarily consider the signal wb_cti_nxt as the cti_o interface signal between wb_biu and the external WISHBONE bus of the processor:

Export always @ (partition or burst_len or wb_err_ I or partition or wb_ack or wb_cti_o or wb_sel_o or wb_stb_o or wb_we_o or partition or biu_stb or partition) Begin case (partition) begin: begin wb_cyc_nxt = biu_cyc_ I & biu_stb; wb_stb_nxt = biu_cyc_ I & biu_stb; // The original value is wb_cti_nxt = {! Biu_cab_ I, 1 'b1 ,! Biu_cab_ I}; wb_cti_nxt = {1 'b1, 1 'b1, 1 'b1 };......


 

With the knowledge of the wishbone storage feedback bus cycle, the reader can understand why the above changes are made. The explanation is as follows:

Before modification, the value of wb_cti_nxt is {! Biu_cab_ I, 1 'b1 ,! Biu_cab_ I}, taking command WISHBONE bus interface as an example, biu_cab_ I is from icache output icbiu_cab_o. Recall section 12.8.3. When icache fails to target, it needs to read four words from external Ram consecutively, at this time, icbiu_cab_o is set to 1, so that the value of wb_cti_nxt in the wb_biu module is 3 'b010. See table 15.1, that is, the incremental burst bus cycle is used, however, the or1200 processor is attached to the wb_conmax module of the WishBone Bus Interconnection Matrix in a simple system. wb_conmax does not support wishbone B3, that is, it does not have cti_o/cti_ I, bte_ I/bte_o interfaces, the above modification is to keep the wb_cti_nxt signal of wb_biu to 3'b111, so as to force the use of the traditional bus operation cycle. Although the efficiency is lower, there will be no error. The same problem exists with the interface unit of the wishbone bus.

In addition, we can also find that the value of wb_cti_nxt before modification is {! Biu_cab_ I, 1 'b1 ,! Biu_cab_ I}, the center of a constant is 1, which indicates that the wb_biu module in or1200 processor only supports the traditional Bus Cycle or incremental burst bus cycle, but does not support the constant address burst bus cycle.

 

 


 

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.