wiki:Component/ARM7TDMI

Version 16 (modified by Joel Porquet, 14 years ago) (diff)

modified an erroneous command

SocLib Components General Index

UNDER DEVELOPMENT

ARM7TDMI Processor Functional Description

This hardware component is a ARM7TDMI processor core. This is only an ISS, which should be wrapped with an IssWrapper.

The simulation model is actually an instruction set simulator with an ARM7TDMI pipeline.

Currently it only exists in bigendian form.

IMPORTANT: steps to apply before using the ARM7TDMI

Before compiling any SoClib simulator using the ARM7TDMI you will need to download the UNISIM ( http://www.unisim.org ) library (well, just a piece of it, the unisim_lib).

To do so just download it using svn from https://unisim.org/svn/devel/unisim_lib with the following command:

You will have to enter a username and password. If you do not have access to the UNISIM development, you can simply use 'guest' for username (no password is needed). Once you have downloaded UNISIM you will need to create a link in trunk/soclib/lib/arm7tdmi/include/iss/ and trunk/soclib/lib/arm7tdmi/src/iss/ to <your_path_to_unisim_lib>/unisim.

If you wish you can download the full UNISIM library by downloading unisim_tools and unisim_simulators:

Finally you will have to set your soclib.conf (source:trunk/soclib/utils/conf/soclib.conf) file to compile correctly the ARM7TDMI component. Here you have an example of configuration that correctly sets the flags to compile ARM7TDMI:

# -*- python -*-

def _platform():
        """
        Retrieves platform information and make it look-like systemc's
        lib-xxx thing.

        Working so far with:
         * linux
         * darwin
        """
        import sys
        pf = sys.platform
        # Strip numeric suffix from platform name
        while pf[-1] in "0123456789":
                pf = pf[:-1]

        remap_pf = {'darwin':'macosx'}
        if pf in remap_pf:
                pf = remap_pf[pf]
        return pf

config.systemc = Config(
        base = config.systemc,
        dir = "${SYSTEMC}",
        os = _platform(),
        )

config.my_toolchain = Config(
        base = config.toolchain,
        cflags = ['-ggdb', '-DSOCLIB', '-D__STDC_CONSTANT_MACROS', '-Wall', '-Wno-pmf-conversions'],
        )

config.default = Config(
        base = config.build_env,
        systemc = config.systemc,
        toolchain = config.my_toolchain,
        repos = "/tmp/build/sc",
        )

The flags you will need to compile the ARM7TDMI component are: -DSOCLID and -D__STDC_CONSTANT_MACROS. In the previous example you can see that the default toolchain has been augmented to define those flags.

Component definition

Available in source:trunk/soclib/soclib/lib/arm7tdmi/metadata/arm7tdmi.sd

Usage

ARM7TDMI has no parameters.

Uses('iss_wrapper', iss_t = 'common:arm7tdmi')

ARM7TDMI Processor ISS Implementation

The implementation is in

The previous files use the ARM7TDMI implementation provided in the UNISIM library.

Template parameters

This component has no template parameters.

Constructor parameters

ARM7TDMIIss( 
     sc_module_name name,   //  Instance Name
     int  ident);   // processor id

Visible registers

UNDER DEVELOPMENT

Interrupts

UNDER DEVELOPMENT

The handling and prioritization of the interrupts is deferred to software.

Ports

None, it is to the wrapper to provide them.

Compiling programs for ARM7TDMI with SoClib

Before compiling a program for the ARM7TDMI with the SoClib framework you will need to define some system variables (usually on the ~/.soclib/soft_compilers.conf) needed to find the ARM compiler. Below you have an example:

arm7tdmi_CC_PREFIX = armv5b-softfloat-linux-
arm7tdmi_CFLAGS = -nostdinc -gstabs+
arm7tdmi_LDFLAGS = -nostdlib