mem.isa (7590:27dbb92bbad5) mem.isa (7646:a444dbee8c07)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010 ARM Limited
4// All rights reserved
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

--- 34 unchanged lines hidden (view full) ---

43 def __init__(self):
44 self.fullExecTemplate = eval(self.execBase + 'Execute')
45 self.initiateAccTemplate = eval(self.execBase + 'InitiateAcc')
46 self.completeAccTemplate = eval(self.execBase + 'CompleteAcc')
47 self.declareTemplate = eval(self.decConstBase + 'Declare')
48 self.constructTemplate = eval(self.decConstBase + 'Constructor')
49
50 def fillTemplates(self, name, Name, codeBlobs, memFlags, instFlags,
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010 ARM Limited
4// All rights reserved
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

--- 34 unchanged lines hidden (view full) ---

43 def __init__(self):
44 self.fullExecTemplate = eval(self.execBase + 'Execute')
45 self.initiateAccTemplate = eval(self.execBase + 'InitiateAcc')
46 self.completeAccTemplate = eval(self.execBase + 'CompleteAcc')
47 self.declareTemplate = eval(self.decConstBase + 'Declare')
48 self.constructTemplate = eval(self.decConstBase + 'Constructor')
49
50 def fillTemplates(self, name, Name, codeBlobs, memFlags, instFlags,
51 base = 'Memory'):
51 base = 'Memory', wbDecl = None):
52 # Make sure flags are in lists (convert to lists if not).
53 memFlags = makeList(memFlags)
54 instFlags = makeList(instFlags)
55
56 eaCode = codeBlobs["ea_code"]
57
58 # This shouldn't be part of the eaCode, but until the exec templates
59 # are converted over it's the easiest place to put it.
60 eaCode += '\n unsigned memAccessFlags = '
61 eaCode += (string.join(memFlags, '|') + ';')
62
63 codeBlobs["ea_code"] = eaCode
64
52 # Make sure flags are in lists (convert to lists if not).
53 memFlags = makeList(memFlags)
54 instFlags = makeList(instFlags)
55
56 eaCode = codeBlobs["ea_code"]
57
58 # This shouldn't be part of the eaCode, but until the exec templates
59 # are converted over it's the easiest place to put it.
60 eaCode += '\n unsigned memAccessFlags = '
61 eaCode += (string.join(memFlags, '|') + ';')
62
63 codeBlobs["ea_code"] = eaCode
64
65 iop = InstObjParams(name, Name, base, codeBlobs, instFlags)
65 macroName = Name
66 instFlagsCopy = list(instFlags)
67 codeBlobsCopy = dict(codeBlobs)
68 if wbDecl is not None:
69 instFlagsCopy.append('IsMicroop')
70 Name = Name + 'Acc'
71 codeBlobsCopy['acc_name'] = Name
72 codeBlobsCopy['wb_decl'] = wbDecl
73 codeBlobsCopy['use_uops'] = 0
66
74
67 # (header_output, decoder_output, decode_block, exec_output)
68 return (self.declareTemplate.subst(iop),
69 self.constructTemplate.subst(iop),
70 self.fullExecTemplate.subst(iop)
71 + self.initiateAccTemplate.subst(iop)
72 + self.completeAccTemplate.subst(iop))
75 iop = InstObjParams(name, Name, base,
76 codeBlobsCopy, instFlagsCopy)
73
77
78 header_output = self.declareTemplate.subst(iop)
79 decoder_output = self.constructTemplate.subst(iop)
80 exec_output = self.fullExecTemplate.subst(iop) + \
81 self.initiateAccTemplate.subst(iop) + \
82 self.completeAccTemplate.subst(iop)
83
84 if wbDecl is not None:
85 iop = InstObjParams(name, macroName, base,
86 { "wb_decl" : wbDecl,
87 "acc_name" : Name,
88 "use_uops" : 1 },
89 ['IsMacroop'])
90 header_output += self.declareTemplate.subst(iop)
91 decoder_output += self.constructTemplate.subst(iop)
92 exec_output += PanicExecute.subst(iop) + \
93 PanicInitiateAcc.subst(iop) + \
94 PanicCompleteAcc.subst(iop)
95
96 return (header_output, decoder_output, exec_output)
97
74 def pickPredicate(blobs):
75 for val in blobs.values():
76 if re.search('(?<!Opt)CondCodes', val):
77 return condPredicateTest
78 return predicateTest
79
80 def memClassName(base, post, add, writeback, \
81 size=4, sign=False, user=False):

--- 45 unchanged lines hidden ---
98 def pickPredicate(blobs):
99 for val in blobs.values():
100 if re.search('(?<!Opt)CondCodes', val):
101 return condPredicateTest
102 return predicateTest
103
104 def memClassName(base, post, add, writeback, \
105 size=4, sign=False, user=False):

--- 45 unchanged lines hidden ---