VIRTUTECH CONFIDENTIAL    Previous - Up - Next

sparc_v9

Implemented By
ultrasparc-ii, ultrasparc-iii, ultrasparc-iii-i, ultrasparc-iii-plus, ultrasparc-iv, ultrasparc-iv-plus, ultrasparc-t1
Description
SPARC V9 specific functions.

This interface is implemented by SPARC V9 processors to provide various functionality that is specific for this class of processors.

The install_default_class_asi_handler installs a function, handler, that is called each time an address is accessed in the asi address space a processor of the same class that cpu belongs to. This function will override the Simics default handling of the selected ASI. The install_user_class_asi_handler is similar, but is called before the default handler. If this function returns Sim_PE_Default_Semantics the default handler will be called. A return of Sim_PE_No_Exception will override the default handler.

The function can also return Sim_PE_Ignore_Semantics, this will tell Simics not to update the destination register on loads.

The function access_asi_handler allows user access to a specific ASI. In no handler is installed, or the ASI is a memory ASI, 'Data_Access_Exception' will be returned. The real_address pointer in the memory_transaction struct should point to an aligned buffer with big-endian data.

Note that installing and accessing ASI handlers using this interface is only supported for non-memory ASIs.

The get_asi_info function is used to query Simics about the characteristics of a specified ASI. For example if the ASI is translating, refers to a block access, etc. All available queries/characteristics are listed in the asi_info_t enum. Several characteristics can be checked at once and the function will return a mask of matching ones.

The read_window_register and write_window_register functions can be used to access registers in any register window. Similarly the read_global_register and write_global_register functions provide access to all global registers. The globals argument is used to select the set of global registers to read from. The mapping between global set and set number can be found in the global_set_name attribute in the processor class.

The register number when accessing windowed registers is 0 - 7 for accesses to the current global registers, 8 - 15 for the out registers of the selected window, 16 - 23 for the local registers, and 24 - 32 for the in registers.

There are several functions that can be used to read and write floating point register values. The _i versions use single-precision (32bit) with integer representation, the _s versions use single-precision float representation, _x versions use double-precision (64 bit) integer representation, and the _d versions use double-precision and double float representation. Single-precision registers are numbered 0, 1 to 31 and double-precision 0, 2, 62.

typedef struct sparc_v9_interface {

        void (*install_default_class_asi_handler)(
                conf_object_t *cpu,
                exception_type_t (*handler)(conf_object_t *,
                                            generic_transaction_t *),
                int asi);
        void (*install_user_class_asi_handler)(
                conf_object_t *cpu,
                exception_type_t (*handler)(conf_object_t *,
                                            generic_transaction_t *),
                int asi);
        void (*remove_default_class_asi_handler)(
                conf_object_t *cpu,
                exception_type_t (*handler)(conf_object_t *,
                                            generic_transaction_t *),
                int asi);
        void (*remove_user_class_asi_handler)(
                conf_object_t *cpu,
                exception_type_t (*handler)(conf_object_t *,
                                            generic_transaction_t *),
                int asi);

        exception_type_t (*access_asi_handler)(conf_object_t *cpu,
                                               v9_memory_transaction_t *mem_op);

        int (*get_asi_info)(conf_object_t *cpu, int asi, asi_info_t info);

        uinteger_t (*read_window_register)(conf_object_t *cpu,
                                           int window, int reg);

        void (*write_window_register)(conf_object_t *cpu,
                                      int window, int reg,
                                      uinteger_t value);

        uinteger_t (*read_global_register)(conf_object_t *cpu,
                                           int globals, int reg);

        void (*write_global_register)(conf_object_t *cpu,
                                      int globals, int reg,
                                      uinteger_t value);

        uint32  (*read_fp_register_i)(conf_object_t *cpu, int reg);
        uint64  (*read_fp_register_x)(conf_object_t *cpu, int reg);
        float   (*read_fp_register_s)(conf_object_t *cpu, int reg);
        double  (*read_fp_register_d)(conf_object_t *cpu, int reg);
        void   (*write_fp_register_i)(conf_object_t *cpu,
                                      int reg, uint32 value);
        void   (*write_fp_register_x)(conf_object_t *cpu,
                                      int reg, uint64 value);
        void   (*write_fp_register_s)(conf_object_t *cpu,
                                      int reg, float value);
        void   (*write_fp_register_d)(conf_object_t *cpu,
                                      int reg, double value);

        /* obsolete installers */
        void (*install_default_asi_handler)(
                exception_type_t (*handler)(conf_object_t *,
                                            generic_transaction_t *),
                int asi);
        void (*install_user_asi_handler)(
                exception_type_t (*handler)(conf_object_t *,
                                            generic_transaction_t *),
                int asi);
        void (*remove_default_asi_handler)(
                exception_type_t (*handler)(conf_object_t *,
                                            generic_transaction_t *),
                int asi);
        void (*remove_user_asi_handler)(
                exception_type_t (*handler)(conf_object_t *,
                                            generic_transaction_t *),
                int asi);
} sparc_v9_interface_t;

#define SPARC_V9_INTERFACE "sparc-v9"

Command List
list-asisList all ASIs
pregs-fpuprint the floating point registers

Command Descriptions

<sparc_v9>.list-asis
Synopsis
<sparc_v9>.list-asis [asi]
Description
Print a list of all ASIs for the currently selected frontend processor.
<sparc_v9>.pregs-fpu
Synopsis
<sparc_v9>.pregs-fpu [-s] [-d] [-q] [-f] [-x] [-i] [-b]
Description
Prints the contents of the floating point registers.
This command can take one subregister size flag and one formatting flag.
The subregister size is selected using the either the -s flag (32-bit single precision), the -d flag (64-bit double precision), or the -q flag (128-bit quad precision).
The formatting flags -f, -x, and -i select the formatting of the output. The -f flag prints the floating-point values of the registers. The -x flag prints the contents of the registers as hexadecimal integers. The -i flag prints the contents of the registers as decimal integers. With the -b flag, the registers are printed in binary floating point form.

VIRTUTECH CONFIDENTIAL    Previous - Up - Next