How-To: LM32 Soft-CPU - Accessing Another SoC Wishbone Device
Introduction
This how-to demonstrates how to access another Wishbone device on the same SoC from the LM32 Soft-CPU.
Checkout the example contained in .../bel_projects/modules/lm32-example/example.c .
Inspect Code
lxpc1234:/opt/GITSCC/bel_projects/modules/lm32-example> emacs example.c //use your favourite editor
Remarks
- Wishbone devices should have a header file containing their register map. Look for "SOMETHING_regs.h". For some Wishbone devices, such a header file does not exist. As a hack, constants such as vendor ID, product ID, and register offsets for some devices can be found in
../../tools/wb_slaves.h
.
- Writing to a register of Wishbone device:
-
uint32_t *pData
: This is the address of the register of the Wishbone device where to write
-
*(pData) = value
: Writes to register
- Reading from a register of a Wishbone device:
-
uint32_t *pData
: This is the address of the register of the Wishbone device where to read
-
value = *pData
: Reades from register
- Perspective is important: The Wishbone address of the device to be accessed depends on the perspective: From the point of view of the LM32 Soft-CPU this address will be different than the address displayed by
eb-ls
from the host system.
--
DietrichBeck - 09 Mar 2017