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
  1. 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.
  2. 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
  3. 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
  4. 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
Topic revision: r2 - 28 Mar 2017, DietrichBeck
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback