Exemple #1
0
sim_commands.new_info_command("sbbc-pci", get_info)

def get_status(obj):
    return ([("Registers",
              [("Interrupt Enable", "0x%x" % obj.interrupt_enable),
               ("Interrupt Status", "0x%x" % obj.interrupt_status),
               ("EPLD Interrupt", "0x%x" % obj.epld_interrupt),
               ("Irq Generation 0", "0x%x" % obj.irq_generation_0),
               ("Irq Generation 1", "0x%x" % obj.irq_generation_1)]),
             (None,
              [("Access info", iff(obj.access_info, "enabled", "disabled"))])]
            + sim_commands.get_pci_status(obj))

sim_commands.new_status_command("sbbc-pci", get_status)

sim_commands.new_pci_header_command("sbbc-pci", None)

#
# ----------------- access-debug -----------------
#

def access_info_cmd(obj):
    try:
        cur = obj.access_info
        obj.access_info = 1 - cur
        print "%sabling access info" % iff(cur == 0, "En", "Dis")
    except Exception, msg:
        print msg
    
new_command("access-info", access_info_cmd,
            [],
##  Copyright 2003-2007 Virtutech AB

from cli import *
import sim_commands

device_name = get_last_loaded_module()

def get_info(obj):
    return [ (None,
              [ ("SCSI bus", obj.scsi_bus) ] ) ] + sim_commands.get_pci_info(obj)

def get_status(obj):
    return [] + sim_commands.get_pci_status(obj)

sim_commands.new_info_command(device_name, get_info)
sim_commands.new_status_command(device_name, get_status)
sim_commands.new_pci_header_command(device_name, None)
import sim_commands
import pci_common
from cli import *
import vga_common

vga_name = "ragexl"

sim_commands.new_pci_header_command(vga_name)
vga_common.new_vga_commands(vga_name)

#
# ------------ print GUI register ---------------
#


def pgreg_cmd(obj, reg):
    SIM_set_attribute(obj, "print_greg", reg)


new_command("pgreg",
            pgreg_cmd, [arg(int_t, "reg")],
            alias="",
            type="%s commands" % vga_name,
            short="print gui register contents",
            namespace=vga_name,
            doc="""Print GUI register contents""",
            filename="/mp/simics-3.0/src/devices/ragexl/commands.py",
            linenumber="18")

#
# ----------- print setup register --------------
Exemple #4
0
    else:
        return 0

def get_info(obj):
    return [ (None, [
        ("PHY object", obj.phy),
        ] ) ] + sim_commands.get_pci_info(obj)

def get_status(obj):
    csr0 = obj.csr_csr0
    csr0a = "INIT=%d STRT=%d STOP=%d TDMD=%d TXON=%d RXON=%d INEA=%d INTR=%d" % (
        checkbit(csr0, 0), checkbit(csr0, 1), checkbit(csr0, 2), checkbit(csr0, 3),
        checkbit(csr0, 4), checkbit(csr0, 5), checkbit(csr0, 6), checkbit(csr0, 7))
    csr0b = "IDON=%d TINT=%d RINT=%d MERR=%d MISS=%d CERR=%d BABL=%d ERR=%d" % (
        checkbit(csr0, 8), checkbit(csr0, 9), checkbit(csr0, 10), checkbit(csr0, 11),
        checkbit(csr0, 12), checkbit(csr0, 13), checkbit(csr0, 14), checkbit(csr0, 15))
    return ([ (None,
               [ ("CSR0", csr0a),
                 ("",  csr0b),
                 ("CSR1", "0x%x" % obj.csr_csr1),
                 ("CSR2", "0x%x" % obj.csr_csr2),
                 ("CSR3", "BCON=%d ACON=%d BSWP=%d" % (
        (checkbit(obj.csr_csr3, 0), checkbit(obj.csr_csr3, 1), checkbit(obj.csr_csr3, 2)))),
                 ("CSR15", "0x%x" % obj.csr_csr15),
                 ("RAP", obj.ioreg_rap) ]),
              ] + sim_commands.get_pci_status(obj))

sim_commands.new_pci_header_command('AM79C973', None)
sim_commands.new_info_command('AM79C973', get_info)
sim_commands.new_status_command('AM79C973', get_status)
Exemple #5
0
import sim_commands
import pci_common
from cli import *
import vga_common

vga_name = "ragexl"

sim_commands.new_pci_header_command(vga_name)
vga_common.new_vga_commands(vga_name)

#
# ------------ print GUI register ---------------
#

def pgreg_cmd(obj, reg):
    SIM_set_attribute(obj, "print_greg", reg)

new_command("pgreg", pgreg_cmd,
            [arg(int_t, "reg")], 
            alias = "",
            type  = "%s commands" % vga_name,
            short = "print gui register contents",
	    namespace = vga_name,
            doc = """Print GUI register contents""", filename="/mp/simics-3.0/src/devices/ragexl/commands.py", linenumber="18")


#
# ----------- print setup register --------------
#

def psreg_cmd(obj, reg):
Exemple #6
0
def get_info(obj):
    return [(None, [
        ("PHY object", obj.phy),
    ])] + sim_commands.get_pci_info(obj)


def get_status(obj):
    csr0 = obj.csr_csr0
    csr0a = "INIT=%d STRT=%d STOP=%d TDMD=%d TXON=%d RXON=%d INEA=%d INTR=%d" % (
        checkbit(csr0, 0), checkbit(csr0, 1), checkbit(
            csr0, 2), checkbit(csr0, 3), checkbit(csr0, 4), checkbit(
                csr0, 5), checkbit(csr0, 6), checkbit(csr0, 7))
    csr0b = "IDON=%d TINT=%d RINT=%d MERR=%d MISS=%d CERR=%d BABL=%d ERR=%d" % (
        checkbit(csr0, 8), checkbit(csr0, 9), checkbit(csr0, 10),
        checkbit(csr0, 11), checkbit(csr0, 12), checkbit(
            csr0, 13), checkbit(csr0, 14), checkbit(csr0, 15))
    return ([
        (None, [("CSR0", csr0a), ("", csr0b), ("CSR1", "0x%x" % obj.csr_csr1),
                ("CSR2", "0x%x" % obj.csr_csr2),
                ("CSR3", "BCON=%d ACON=%d BSWP=%d" %
                 ((checkbit(obj.csr_csr3, 0), checkbit(
                     obj.csr_csr3, 1), checkbit(obj.csr_csr3, 2)))),
                ("CSR15", "0x%x" % obj.csr_csr15), ("RAP", obj.ioreg_rap)]),
    ] + sim_commands.get_pci_status(obj))


sim_commands.new_pci_header_command('AM79C973', None)
sim_commands.new_info_command('AM79C973', get_info)
sim_commands.new_status_command('AM79C973', get_status)

def get_status(obj):
    return ([
        ("Registers", [("Interrupt Enable", "0x%x" % obj.interrupt_enable),
                       ("Interrupt Status", "0x%x" % obj.interrupt_status),
                       ("EPLD Interrupt", "0x%x" % obj.epld_interrupt),
                       ("Irq Generation 0", "0x%x" % obj.irq_generation_0),
                       ("Irq Generation 1", "0x%x" % obj.irq_generation_1)]),
        (None, [("Access info", iff(obj.access_info, "enabled", "disabled"))])
    ] + sim_commands.get_pci_status(obj))


sim_commands.new_status_command("sbbc-pci", get_status)

sim_commands.new_pci_header_command("sbbc-pci", None)

#
# ----------------- access-debug -----------------
#


def access_info_cmd(obj):
    try:
        cur = obj.access_info
        obj.access_info = 1 - cur
        print "%sabling access info" % iff(cur == 0, "En", "Dis")
    except Exception, msg:
        print msg