# -*- coding: utf-8 -*- # This code is part of Amoco # Copyright (C) 2006-2014 Axel Tillequin ([email protected]) # published under GPLv2 license from os import path from PySide6.QtWidgets import QApplication from PySide6.QtCore import QPointF from amoco.ui.render import Formats,conf from amoco.logger import Log logger = Log(__name__) logger.debug("loading module") #from . import rc_icons try: # integrate Qt mainloop into IPython console: # (the name qt4 here is a relic of the API but what happens # really is not restricted to Qt4...) from IPython.lib.guisupport import get_app_qt4, start_event_loop_qt4 app = get_app_qt4() start_event_loop_qt4(app) except ImportError: app = QApplication.instance() or QApplication([]) app.setApplicationName("amoco-qt") # set default styleSheet:
emu.py ====== The emu module of amoco. """ # This code is part of Amoco # Copyright (C) 2019 Axel Tillequin ([email protected]) # published under GPLv2 license from amoco.config import conf from amoco.arch.core import DecodeError from amoco.logger import Log logger = Log(__name__) logger.debug('loading emu') try: IntType = (int, long) except NameError: IntType = (int, ) else: conf.Cas.unicode = False class emul(object): def __init__(self, task): self.task = task self.cpu = task.cpu self.pc = task.cpu.PC() self.psz = self.pc.size
# published under GPLv2 license """ cfg.py ====== This module provides elements to define *control flow graphs* (CFG). It is based essentially on classes provided by the `grandalf`_ package. .. _grandalf: https://grandalf.readthedocs.io/ """ from amoco.logger import Log logger = Log(__name__) logger.debug('loading module') from grandalf.graphs import Vertex,Edge,Graph from amoco.cas.mapper import mapper from amoco.system.memory import MemoryZone from amoco.code import defaultdict,_code_misc_default #------------------------------------------------------------------------------ class node(Vertex): """A node is a graph vertex that embeds a :mod:`code` object. It extends the :ref:`Vertex <grandalf:Vertex>` class in order to compare nodes by their data blocks rather than their id. Args: acode : an instance of :class:`block`, :class:`func` or :class:`xfunc`.
emu.py ====== The emu module of amoco implements the emulator class :class:`emul`. """ from collections import deque from amoco.config import conf from amoco.arch.core import DecodeError from amoco.sa import lsweep from amoco.ui.views import emulView from amoco.logger import Log logger = Log(__name__) logger.debug("loading emu") class EmulError(Exception): pass class emul(object): def __init__(self, task): self.task = task self.cpu = task.cpu self.pc = task.cpu.PC() self.psz = self.pc.size self.hooks = [] self.watch = {} self.handlers = {}