general_io.py revision 8672
17087Snate@binkert.org# Copyright (c) 2007-2008 The Hewlett-Packard Development Company 27087Snate@binkert.org# All rights reserved. 37087Snate@binkert.org# 47087Snate@binkert.org# The license below extends only to copyright in the software and shall 57087Snate@binkert.org# not be construed as granting a license to any other intellectual 67087Snate@binkert.org# property including but not limited to intellectual property relating 77087Snate@binkert.org# to a hardware implementation of the functionality of the software 87087Snate@binkert.org# licensed hereunder. You may use the software subject to the license 97087Snate@binkert.org# terms below provided that you ensure that this notice is replicated 107087Snate@binkert.org# unmodified and in its entirety in all distributions of the software, 117087Snate@binkert.org# modified or unmodified, in source code or in binary form. 127087Snate@binkert.org# 135322Sgblack@eecs.umich.edu# Copyright (c) 2008 The Regents of The University of Michigan 145322Sgblack@eecs.umich.edu# All rights reserved. 155322Sgblack@eecs.umich.edu# 165322Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without 175322Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are 185322Sgblack@eecs.umich.edu# met: redistributions of source code must retain the above copyright 195322Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer; 205322Sgblack@eecs.umich.edu# redistributions in binary form must reproduce the above copyright 215322Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the 225322Sgblack@eecs.umich.edu# documentation and/or other materials provided with the distribution; 235322Sgblack@eecs.umich.edu# neither the name of the copyright holders nor the names of its 245322Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from 255322Sgblack@eecs.umich.edu# this software without specific prior written permission. 265322Sgblack@eecs.umich.edu# 275322Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 285322Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 295322Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 305322Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 315322Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 325322Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 335322Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 345322Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 355322Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 365322Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 375322Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 385322Sgblack@eecs.umich.edu# 395322Sgblack@eecs.umich.edu# Authors: Gabe Black 405322Sgblack@eecs.umich.edu 415161Sgblack@eecs.umich.edumicrocode = ''' 425161Sgblack@eecs.umich.edu def macroop IN_R_I { 435161Sgblack@eecs.umich.edu .adjust_imm trimImm(8) 445418Sgblack@eecs.umich.edu limm t1, imm, dataSize=asz 458672Snilay@cs.wisc.edu mfence 468103Sgblack@eecs.umich.edu ld reg, intseg, [1, t1, t0], "IntAddrPrefixIO << 3", addressSize=8, \ 478103Sgblack@eecs.umich.edu nonSpec=True 488672Snilay@cs.wisc.edu mfence 495161Sgblack@eecs.umich.edu }; 505161Sgblack@eecs.umich.edu 515161Sgblack@eecs.umich.edu def macroop IN_R_R { 525927Sgblack@eecs.umich.edu zexti t2, regm, 15, dataSize=8 538672Snilay@cs.wisc.edu mfence 548103Sgblack@eecs.umich.edu ld reg, intseg, [1, t2, t0], "IntAddrPrefixIO << 3", addressSize=8, \ 558103Sgblack@eecs.umich.edu nonSpec=True 568672Snilay@cs.wisc.edu mfence 575161Sgblack@eecs.umich.edu }; 585161Sgblack@eecs.umich.edu 595161Sgblack@eecs.umich.edu def macroop OUT_I_R { 605161Sgblack@eecs.umich.edu .adjust_imm trimImm(8) 615418Sgblack@eecs.umich.edu limm t1, imm, dataSize=8 628672Snilay@cs.wisc.edu mfence 638103Sgblack@eecs.umich.edu st reg, intseg, [1, t1, t0], "IntAddrPrefixIO << 3", addressSize=8, \ 648103Sgblack@eecs.umich.edu nonSpec=True 658672Snilay@cs.wisc.edu mfence 665161Sgblack@eecs.umich.edu }; 675161Sgblack@eecs.umich.edu 685161Sgblack@eecs.umich.edu def macroop OUT_R_R { 695927Sgblack@eecs.umich.edu zexti t2, reg, 15, dataSize=8 708672Snilay@cs.wisc.edu mfence 718103Sgblack@eecs.umich.edu st regm, intseg, [1, t2, t0], "IntAddrPrefixIO << 3", addressSize=8, \ 728103Sgblack@eecs.umich.edu nonSpec=True 738672Snilay@cs.wisc.edu mfence 745161Sgblack@eecs.umich.edu }; 755161Sgblack@eecs.umich.edu''' 76