diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2013-07-31 16:13:54 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2013-07-31 16:13:54 -0700 |
commit | 063b0e181e8c25cc6493aa233d9f64f63bc3b629 (patch) | |
tree | 41812f283b9291a2625b2db6d7e1199519fc157b /parse-opcodes | |
parent | 157d7aafa998a05f76d33d542388e1e789bf0557 (diff) |
HW ignores upper bits of fence, but SW supplies 0
Diffstat (limited to 'parse-opcodes')
-rwxr-xr-x | parse-opcodes | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/parse-opcodes b/parse-opcodes index d918d40..fceefdb 100755 --- a/parse-opcodes +++ b/parse-opcodes @@ -526,29 +526,33 @@ for line in sys.stdin: for token in tokens[1:]: if len(token.split('=')) == 2: - tmp = token.split('=') - val = int(tmp[1],0) - if len(tmp[0].split('..')) == 2: - tmp = tmp[0].split('..') + tokens = token.split('=') + if len(tokens[0].split('..')) == 2: + tmp = tokens[0].split('..') hi = int(tmp[0]) lo = int(tmp[1]) if hi <= lo: sys.exit("%s: bad range %d..%d" % (name,hi,lo)) else: - hi = lo = int(tmp[0]) - if val >= (1 << (hi-lo+1)): - sys.exit("%s: bad value %d for range %d..%d" % (name,val,hi,lo)) - mymatch = mymatch | (val << lo) - mymask = mymask | ((1<<(hi+1))-(1<<lo)) + hi = lo = int(tokens[0]) + + if tokens[1] != 'ignore': + val = int(tokens[1], 0) + if val >= (1 << (hi-lo+1)): + sys.exit("%s: bad value %d for range %d..%d" % (name,val,hi,lo)) + mymatch = mymatch | (val << lo) + mymask = mymask | ((1<<(hi+1))-(1<<lo)) + if cover & ((1<<(hi+1))-(1<<lo)): sys.exit("%s: overspecified" % name) cover = cover | ((1<<(hi+1))-(1<<lo)) + elif token in arglut: if cover & ((1<<(arglut[token][0]+1))-(1<<arglut[token][1])): sys.exit("%s: overspecified" % name) cover = cover | ((1<<(arglut[token][0]+1))-(1<<arglut[token][1])) - arguments[name].append(token) + else: sys.exit("%s: unknown token %s" % (name,token)) |