ARM System on Chip (Introductory ASIC version)

2022


This walkthough aims to introduce you to a simple ARM SoC and the hardware/software design flow.

This walkthough is one of a number which help to illustrate the principles of ARM SoC design:

While the first three versions include examples of custom interface hardware typical of a System-on-Chip design, the "Introductory" version(s) include non-specific input and output ports in the manner of a microcontroller system. While the use of custom interface hardware is likely to yield better results (if it doesn't yield better results you will probably be better off using a microcontroller rather than an SoC), the use of non-specific input and output ports can aid understanding and can offer a starting point for the design of custom interface hardware.


Overview of a Simple ARM SoC

A very simple ARM System on Chip has been designed:

The design includes four slaves:

  1. ROM
    16K bytes for program memory

  2. RAM
    256 bytes for data memory (including stack)

  3. Input Port
    Occupying one 32-bit memory location

  4. Output Port
    Occupying one 32-bit memory location

Memory Map

Files

In order to build the ARM SoC, we need SystemVerilog files to model the hardware plus 'C' program files and other support files to build the software. Further files are required to support simulation:


Preparation

Compile C Program

Simulate ARM SoC


Create a custom interface

The key to system-on-chip design is the creation of custom interface hardware.

A modified ARM System on Chip including a simple custom interface is to be designed:

The steps required are:

  1. Create the custom interface

    The file name for the interface should be ahb_custom_interface.sv and it should be placed in the existing behavioural/ directory.

    A template for the custom interface can be found here: ahb_custom_interface.sv

    You will need to take the template and fill in the code where it is missing. You can base the code that you enter on the code from the output port module: ahb_output_port.sv. Since the custom interface supports more than one address, you will need to add code to generate a word_address signal during the address phase. An example of this sort of code can be found in this example module: ahb_switches.sv

  2. Create a new SoC top-level module

    The file name for the top-level module should be arm_soc_custom.sv and it should be placed in the existing behavioural/ directory.

    You can base the new module on the existing SoC module code: arm_soc.sv.

    Changes that you should make are:

    Note that there is no need to change the interconnect module (ahb_interconnect.sv) because the new interface occupies the same area of the memory map (0x5000000-0xFFFFFFFF) as was previously occupied by the output port.

  3. Simulate the complete design

    The testbench/ directory already includes a arm_soc_custom_stim.sv testbench file to test the new system. The command to use is:

        ./simulate testbench/arm_soc_custom_stim.sv &
    

    If all goes well, the behaviour of the new system will match that of the old one since the the 'C' program is unchanged. The only difference is that the the output values are being written via oA rather than oPort.

  4. Modify the 'C' program

    Now modify the 'C' program to access the other registers in the custom interface.

    Changes that you should make are:

    After each change you should recompile the code then re-run the simulation and check that the new behaviour is as you expect.


Having completed this lab walkthrough, you should have a basic understanding of SoC design including an ability to build a simple custom interface and write a 'C' program to access the interface.

At this stage you can experiment with other changes to the system but you should try to make only small changes between simulations to increase the chances of being able to debug the system.


Iain McNally
18-3-2022