Bus Slave Factory
Introduction
In many situation it’s needed to implement a bus register bank. The BusSlaveFactory
is a tool that provide an abstract and smooth way to define them.
To see capabilities of the tool, an simple example use the Apb3SlaveFactory variation to implement an memory mapped UART. There is also another example with an Timer which contain a memory mapping function.
You can find more documentation about the internal implementation of the BusSlaveFactory
tool there
Functionality
BusSlaveFactory
tool : AHB3-lite, APB3, APB4, AvalonMM, AXI-lite 3, AXI4, BMB, Wishbone, Tilelink, BRAM bus and PipelinedMemoryBus.Name |
Return |
Description |
---|---|---|
busDataWidth |
Int |
Return the data width of the bus |
read(that,address,bitOffset) |
When the bus read the |
|
write(that,address,bitOffset) |
When the bus write the |
|
onWrite(address)(doThat) |
Call |
|
onRead(address)(doThat) |
Call |
|
nonStopWrite(that,bitOffset) |
Permanently assign |
|
readAndWrite(that,address,bitOffset) |
Make |
|
readMultiWord(that,address) |
Create the memory mapping to read
that from ‘address’.If
that is bigger than one word it extends the register on followings addresses |
|
writeMultiWord(that,address) |
Create the memory mapping to write
that at ‘address’.If
that is bigger than one word it extends the register on followings addresses |
|
createWriteOnly(dataType,address,bitOffset) |
T |
Create a write only register of type |
createReadWrite(dataType,address,bitOffset) |
T |
Create a read write register of type |
createAndDriveFlow(dataType,address,bitOffset) |
Flow[T] |
Create a writable Flow register of type |
drive(that,address,bitOffset) |
Drive |
|
driveAndRead(that,address,bitOffset) |
Drive |
|
driveFlow(that,address,bitOffset) |
Emit on |
|
readStreamNonBlocking(that,
address,
validBitOffset,
payloadBitOffset)
|
Read
that and consume the transaction when a read happen at address .valid <= validBitOffset bit
payload <= payloadBitOffset+widthOf(payload) downto
payloadBitOffset |
|
doBitsAccumulationAndClearOnRead(that,
address,
bitOffset)
|
Instantiate an internal register which at each cycle do :
reg := reg | that
Then when a read occur, the register is cleared. This register is readable at
address and placed at bitOffset in the word |