aboutsummaryrefslogtreecommitdiffstats
path: root/backends/intersynth
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-04-09 10:32:58 -0700
committerEddie Hung <eddie@fpgeh.com>2019-04-09 10:32:58 -0700
commitbd523abef5babcc16fbdd67dbf868bd601acaced (patch)
tree9941030362618faa3cde147b7cec15655a58654f /backends/intersynth
parent3b6f85b0a6fb08b44dfa7417fce1aeefe9f20e3e (diff)
downloadyosys-bd523abef5babcc16fbdd67dbf868bd601acaced.tar.gz
yosys-bd523abef5babcc16fbdd67dbf868bd601acaced.tar.bz2
yosys-bd523abef5babcc16fbdd67dbf868bd601acaced.zip
Add 'setundef -zero' call prior to aigmap in abc9
Diffstat (limited to 'backends/intersynth')
0 files changed, 0 insertions, 0 deletions
n87' href='#n87'>87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
#============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#============================================================================
# Copyright (C) 2006-2007 XenSource Inc.
#============================================================================
#
# Parts of this file are based upon xmlrpclib.py, the XML-RPC client
# interface included in the Python distribution.
#
# Copyright (c) 1999-2002 by Secret Labs AB
# Copyright (c) 1999-2002 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# and will comply with the following terms and conditions:
#
# Permission to use, copy, modify, and distribute this software and
# its associated documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice appears in
# all copies, and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of
# Secret Labs AB or the author not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# --------------------------------------------------------------------

import gettext
import xmlrpclib

import xen.util.xmlrpcclient as xmlrpcclient

def gettext_noop(str):
    return str

N_ = gettext_noop

errormap = {
    "INTERNAL_ERROR": N_("Internal error: %(1)s."),
    "MAP_DUPLICATE_KEY": N_("This map already contains %(1)s -> %(2)s."),
    "MESSAGE_METHOD_UNKNOWN": N_("The method %(1)s is unsupported."),
    "MESSAGE_PARAMETER_COUNT_MISMATCH": N_("The method %(1)s takes %(2)s argument(s) (%(3)s given)."),
    "SESSION_AUTHENTICATION_FAILED": N_("Permission denied."),
    "VALUE_NOT_SUPPORTED": N_("Value \"%(2)s\" for %(1)s is not supported by this server.  The server said \"%(3)s\"."),
    "HANDLE_INVALID": N_("The %(1)s handle %(2)s is invalid."),
    "OPERATION_NOT_ALLOWED": N_("You attempted an operation that was not allowed."),
    "NETWORK_ALREADY_CONNECTED": N_("The network you specified already has a PIF attached to it, and so another one may not be attached."),
    "SECURITY_ERROR": N_("%(2)s"),
    }

translation = gettext.translation('xen-xm', fallback = True)

class Failure(Exception):
    def __init__(self, details):
        try:
            # If this failure is MESSAGE_PARAMETER_COUNT_MISMATCH, then we
            # correct the return values here, to account for the fact that we
            # transparently add the session handle as the first argument.
            if details[0] == 'MESSAGE_PARAMETER_COUNT_MISMATCH':
                details[2] = str(int(details[2]) - 1)
                details[3] = str(int(details[3]) - 1)

            self.details = details
        except Exception, exn:
            self.details = ['INTERNAL_ERROR', 'Client-side: ' + str(exn)]

    def __str__(self):
        try:
            return translation.ugettext(errormap[self.details[0]]) % self._details_map()
        except TypeError, exn:
            return "Message database broken: %s.\nXen-API failure: %s" % \