Buses¶
bust generates one bus endpoint per module, for the bus you choose with type
in the bus object of the register map:
"bus": {
"type": "axi",
"addr_width": 32,
"data_width": 32
}
|
Bus |
Endpoint entity |
Reset |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Besides the bus ports listed below, the endpoint has the to_hw and from_hw
ports of the register file. The starter top level <module> that bust writes
has the same generics and ports. See Generated HDL.
Common behaviour¶
Every endpoint is a thin bridge to the same register file, so all buses behave the same apart from the handshake.
Transfers¶
An endpoint handles one single-beat transfer at a time. There are no bursts and no outstanding transactions.
No endpoint has byte enables or write strobes, so software must read and write whole registers. A write always writes the whole register, so a byte or halfword write to a register writes all its bytes. A read of an address inside a register, such as a byte read of byte 1, gets an error.
Every endpoint answers in the clock cycle after the request, never later. A transfer therefore takes at least two clock cycles.
Addressing¶
The address port is
addr_widthbits wide and the data ports aredata_widthbits wide. IPBus is the exception, with fixed 32-bit ports.The endpoint passes the address to the register file unchanged, except that IPBus passes the low
addr_widthbits. By default it is a byte address on every bus except IPBus, where it is a word address. When bust assigns the addresses, with 32-bit data, the registers are at0x0,0x4,0x8and so on, and on IPBus at0x0,0x1,0x2. Addresses you set in the JSON are used as they are. See Register map format.The register file compares the whole address, low bits included, with the register addresses. An address between two registers or inside one, such as
0x2on a byte-addressed bus, matches no register and gets an error.Some masters and interconnects drive word addresses on a bus other than IPBus. For those, set
"byte_addressable": falsein the module, and bust places the registers at0x0,0x1,0x2. See Byte and word addresses.
Errors¶
Only an address that does not decode produces an error:
a register offset where no register sits, or an address above the registers in the module’s address range when
G_MODULE_ADDR_WIDTHis larger thanC_<MODULE>_MODULE_ADDR_WIDTH, orwith
G_CHECK_BASE_ADDRESSset totrue, an address whose base address bits differ fromG_BASE_ADDRESS.
Base address and address range shows which bits are which. A write
that fails changes nothing, and a read that fails returns
G_UNMAPPED_READ_DATA, 0 by default. Every access to a register address
completes normally, whatever the access mode, unless G_ERR_ON_BAD_ACCESS is
true, see Access modes.
Writing a read-only field has no effect, and reading a write-only field returns
0. See Access modes.
Bus |
Error response |
|---|---|
AXI4-Lite |
|
IPBus |
|
SBI |
None. The transfer completes with |
Avalon-MM |
None. The transfer completes as usual. |
Wishbone |
|
APB |
|
Reset¶
The register file resets synchronously on every bus. The registers take their reset values on a rising clock edge while the reset is asserted, so hold the reset for at least one clock cycle. On AXI4-Lite and APB, the endpoint’s own handshake state also resets asynchronously.
Base address¶
All endpoints have the generics G_BASE_ADDRESS, G_CHECK_BASE_ADDRESS and
G_MODULE_ADDR_WIDTH. Base address and address range describes
them.
Testbenches¶
bust generates a self-checking testbench for every bus. It drives the module with a UVVM verification IP where one exists, and with a bus master inside the testbench otherwise. See Testbenches.
Bus |
Bus master in the testbench |
|---|---|
AXI4-Lite |
UVVM AXI4-Lite VIP ( |
IPBus |
|
SBI |
UVVM SBI VIP ( |
Avalon-MM |
UVVM Avalon-MM VIP ( |
Wishbone |
A master inside the testbench |
APB |
A master inside the testbench |
AXI4-Lite¶
AXI4-Lite
is the axi bus type. The endpoint is <module>_axi_endpoint.
Port |
Direction |
Width |
|---|---|---|
|
in |
1 |
|
in |
1 |
|
in |
|
|
in |
1 |
|
out |
1 |
|
in |
|
|
in |
1 |
|
out |
1 |
|
out |
2 |
|
out |
1 |
|
in |
1 |
|
in |
|
|
in |
1 |
|
out |
1 |
|
out |
|
|
out |
2 |
|
out |
1 |
|
in |
1 |
The endpoint accepts a write when
awvalidandwvalidare both high, and raisesawreadyandwreadytogether for that one cycle. It does not accept the address and the data in different cycles.It accepts a read when
arvalidis high, and raisesarreadyfor one cycle. Ifawvalid,wvalidandarvalidare all high in the same cycle, the write goes first.bvalidorrvalidrises in the cycle after the accept and stays high untilbreadyorrreadyis high. The endpoint accepts the next transfer in the cycle after that.brespandrrespareOKAY("00") orSLVERR("10").rdatais 0 withSLVERR.There are no
awprot,arprotorwstrbports.awready,wreadyandarreadyare combinational fromawvalid,wvalidandarvalid. If your interconnect or your timing needs registered ready signals, put a register slice in front of the module.areset_nis active low.AXI4-Lite allows a
data_widthof 32 or 64.
IPBus¶
IPBus is the ipbus bus type. The endpoint
is <module>_ipb_endpoint.
Port |
Direction |
Type |
|---|---|---|
|
in |
|
|
in |
|
|
in |
|
|
out |
|
ipb_wbus and ipb_rbus are the records of the IPBus package. The endpoint
and the starter top level use it as library ipbus; use ipbus.ipbus.all;, so
compile components/ipbus_core/firmware/hdl/ipbus_package.vhd from the
IPBus firmware into a library called
ipbus before the module. The endpoint uses these members:
Member |
Width |
Use |
|---|---|---|
|
32 |
Word address. The low |
|
32 |
Write data. |
|
1 |
Starts a transfer. |
|
1 |
High for a write, low for a read. |
|
32 |
Read data. |
|
1 |
The transfer completed. |
|
1 |
The address did not decode. |
ipb_strobestarts a transfer.ipb_ackoripb_erris high for one cycle, in the cycle after the strobe, withipb_rdatavalid on a read.ipb_rdatais 0 when a read getsipb_err.resetis active high.data_widthmust be 32 andaddr_widthat most 32. bust stops with an error for other values.With an
addr_widthbelow 32, the endpoint ignores the upper bits ofipb_addr, so decode them before the module, as an IPBus fabric does.bust also writes an IPBus address table for uHAL. See Headers and documentation.
SBI¶
SBI is the Simple Bus Interface of UVVM, the
bus of its bitvis_vip_sbi verification IP. It is the sbi bus type. The
endpoint is <module>_sbi_endpoint.
Port |
Direction |
Width |
|---|---|---|
|
in |
1 |
|
in |
1 |
|
in |
1 |
|
in |
|
|
in |
1 |
|
in |
1 |
|
in |
|
|
out |
1 |
|
out |
|
The master raises
cstogether withwenaorrena, and holds the request untilreadyis high.readyis high for one cycle, in the cycle after the request, withrdatavalid on a read.SBI has no error signal. An access that does not decode completes with
readyas usual, withrdata0 on a read.SBI defines no reset. bust adds
reset, active high.
Avalon-MM¶
Avalon-MM
is the avalon bus type. The endpoint is <module>_avalon_endpoint, an
Avalon-MM agent.
Port |
Direction |
Width |
|---|---|---|
|
in |
1 |
|
in |
1 |
|
in |
1 |
|
in |
|
|
in |
1 |
|
in |
1 |
|
in |
|
|
out |
1 |
|
out |
|
A transfer starts when
chipselectis high together withreadorwrite. The host holds the command whilewaitrequestis high.waitrequestis high whenever the endpoint is not completing a transfer, also while idle. It goes low for one cycle, in the cycle after the command, andreaddatais valid in that cycle. Every transfer therefore has one wait state.There is no
readdatavalid, so reads are not pipelined. There is also nobyteenable,burstcountorresponse.An access that does not decode completes as usual, with
readdata0 on a read.If your host has no chip select, tie
chipselectto'1'.resetis active high.
Wishbone¶
Wishbone is the wishbone bus
type. The endpoint is <module>_wishbone_endpoint, a Wishbone B4 slave for
classic cycles.
Port |
Direction |
Width |
|---|---|---|
|
in |
1 |
|
in |
1 |
|
in |
1 |
|
in |
1 |
|
in |
1 |
|
in |
|
|
in |
|
|
out |
|
|
out |
1 |
|
out |
1 |
A transfer starts when
cyc_iandstb_iare both high, andwe_iselects write or read.ack_oorerr_ois high for one cycle, in the cycle after, withdat_ovalid on a read. The master holds the request until then.dat_ois 0 when a read getserr_o.There are no
sel_i,rty_o,stall_o,cti_i,bte_iorlock_iports, so the endpoint supports neither the pipelined mode nor registered feedback bursts.rst_iis active high.
APB¶
APB (AMBA APB) is the
apb bus type. The endpoint is <module>_apb_endpoint.
Port |
Direction |
Width |
|---|---|---|
|
in |
1 |
|
in |
1 |
|
in |
1 |
|
in |
1 |
|
in |
1 |
|
in |
|
|
in |
|
|
out |
|
|
out |
1 |
|
out |
1 |
The ports are the APB3 signal set, with
preadyandpslverr. The APB4 signalspprotandpstrbare not there.The endpoint starts the access in the SETUP cycle and raises
preadyin the first ACCESS cycle, so transfers have no wait states.On an error,
pslverris high together withpready, andprdatais 0 on a read.presetnis active low.