general_io.py revision 5322
15322Sgblack@eecs.umich.edu# Copyright (c) 2008 The Regents of The University of Michigan
25322Sgblack@eecs.umich.edu# All rights reserved.
35322Sgblack@eecs.umich.edu#
45322Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without
55322Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are
65322Sgblack@eecs.umich.edu# met: redistributions of source code must retain the above copyright
75322Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer;
85322Sgblack@eecs.umich.edu# redistributions in binary form must reproduce the above copyright
95322Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the
105322Sgblack@eecs.umich.edu# documentation and/or other materials provided with the distribution;
115322Sgblack@eecs.umich.edu# neither the name of the copyright holders nor the names of its
125322Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from
135322Sgblack@eecs.umich.edu# this software without specific prior written permission.
145322Sgblack@eecs.umich.edu#
155322Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
165322Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
175322Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
185322Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
195322Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
205322Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
215322Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
225322Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
235322Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
245322Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
255322Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
265322Sgblack@eecs.umich.edu#
275322Sgblack@eecs.umich.edu# Authors: Gabe Black
285322Sgblack@eecs.umich.edu
295322Sgblack@eecs.umich.edu# Copyright (c) 2007-2008 The Hewlett-Packard Development Company
305081Sgblack@eecs.umich.edu# All rights reserved.
315081Sgblack@eecs.umich.edu#
325081Sgblack@eecs.umich.edu# Redistribution and use of this software in source and binary forms,
335081Sgblack@eecs.umich.edu# with or without modification, are permitted provided that the
345081Sgblack@eecs.umich.edu# following conditions are met:
355081Sgblack@eecs.umich.edu#
365081Sgblack@eecs.umich.edu# The software must be used only for Non-Commercial Use which means any
375081Sgblack@eecs.umich.edu# use which is NOT directed to receiving any direct monetary
385081Sgblack@eecs.umich.edu# compensation for, or commercial advantage from such use.  Illustrative
395081Sgblack@eecs.umich.edu# examples of non-commercial use are academic research, personal study,
405081Sgblack@eecs.umich.edu# teaching, education and corporate research & development.
415081Sgblack@eecs.umich.edu# Illustrative examples of commercial use are distributing products for
425081Sgblack@eecs.umich.edu# commercial advantage and providing services using the software for
435081Sgblack@eecs.umich.edu# commercial advantage.
445081Sgblack@eecs.umich.edu#
455081Sgblack@eecs.umich.edu# If you wish to use this software or functionality therein that may be
465081Sgblack@eecs.umich.edu# covered by patents for commercial use, please contact:
475081Sgblack@eecs.umich.edu#     Director of Intellectual Property Licensing
485081Sgblack@eecs.umich.edu#     Office of Strategy and Technology
495081Sgblack@eecs.umich.edu#     Hewlett-Packard Company
505081Sgblack@eecs.umich.edu#     1501 Page Mill Road
515081Sgblack@eecs.umich.edu#     Palo Alto, California  94304
525081Sgblack@eecs.umich.edu#
535081Sgblack@eecs.umich.edu# Redistributions of source code must retain the above copyright notice,
545081Sgblack@eecs.umich.edu# this list of conditions and the following disclaimer.  Redistributions
555081Sgblack@eecs.umich.edu# in binary form must reproduce the above copyright notice, this list of
565081Sgblack@eecs.umich.edu# conditions and the following disclaimer in the documentation and/or
575081Sgblack@eecs.umich.edu# other materials provided with the distribution.  Neither the name of
585081Sgblack@eecs.umich.edu# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
595081Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from
605081Sgblack@eecs.umich.edu# this software without specific prior written permission.  No right of
615081Sgblack@eecs.umich.edu# sublicense is granted herewith.  Derivatives of the software and
625081Sgblack@eecs.umich.edu# output created using the software may be prepared, but only for
635081Sgblack@eecs.umich.edu# Non-Commercial Uses.  Derivatives of the software may be shared with
645081Sgblack@eecs.umich.edu# others provided: (i) the others agree to abide by the list of
655081Sgblack@eecs.umich.edu# conditions herein which includes the Non-Commercial Use restrictions;
665081Sgblack@eecs.umich.edu# and (ii) such Derivatives of the software include the above copyright
675081Sgblack@eecs.umich.edu# notice to acknowledge the contribution from this software where
685081Sgblack@eecs.umich.edu# applicable, this list of conditions and the disclaimer below.
695081Sgblack@eecs.umich.edu#
705081Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
715081Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
725081Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
735081Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
745081Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
755081Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
765081Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
775081Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
785081Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
795081Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
805081Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
815081Sgblack@eecs.umich.edu#
825081Sgblack@eecs.umich.edu# Authors: Gabe Black
835081Sgblack@eecs.umich.edu
845161Sgblack@eecs.umich.edumicrocode = '''
855161Sgblack@eecs.umich.edu    def macroop IN_R_I {
865161Sgblack@eecs.umich.edu        .adjust_imm trimImm(8)
875322Sgblack@eecs.umich.edu        limm t1, "IntAddrPrefixIO", dataSize=8
885322Sgblack@eecs.umich.edu        ld reg, intseg, [1, t1, t0], imm, addressSize=8
895161Sgblack@eecs.umich.edu    };
905161Sgblack@eecs.umich.edu
915161Sgblack@eecs.umich.edu    def macroop IN_R_R {
925322Sgblack@eecs.umich.edu        limm t1, "IntAddrPrefixIO", dataSize=8
935239Sgblack@eecs.umich.edu        zexti t2, regm, 15, dataSize=2
945161Sgblack@eecs.umich.edu        ld reg, intseg, [1, t1, t2], addressSize=8
955161Sgblack@eecs.umich.edu    };
965161Sgblack@eecs.umich.edu
975161Sgblack@eecs.umich.edu    def macroop OUT_I_R {
985161Sgblack@eecs.umich.edu        .adjust_imm trimImm(8)
995322Sgblack@eecs.umich.edu        limm t1, "IntAddrPrefixIO", dataSize=8
1005161Sgblack@eecs.umich.edu        st reg, intseg, [1, t1, t0], imm, addressSize=8
1015161Sgblack@eecs.umich.edu    };
1025161Sgblack@eecs.umich.edu
1035161Sgblack@eecs.umich.edu    def macroop OUT_R_R {
1045322Sgblack@eecs.umich.edu        limm t1, "IntAddrPrefixIO", dataSize=8
1055239Sgblack@eecs.umich.edu        zexti t2, reg, 15, dataSize=2
1065161Sgblack@eecs.umich.edu        st regm, intseg, [1, t1, t2], addressSize=8
1075161Sgblack@eecs.umich.edu    };
1085161Sgblack@eecs.umich.edu'''
109