Skip to content

Commit

Permalink
padding to 32
Browse files Browse the repository at this point in the history
  • Loading branch information
Yangff committed Jul 24, 2021
1 parent a3a7308 commit f2b7fc3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions script/reglib.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def genHeader(self):
padId = padId + 1
s.extend(ident(i.genHeader(), 2, '\t'))
currentBit = i.msb + 1
if currentBit != 32:
s.append(f'\t\tuint32_t pad{padId} : {32 - currentBit};')

s.extend([
"\t};",
Expand Down Expand Up @@ -290,6 +292,12 @@ def FieldBit(name, bit, len=1):
context.r.addField(name, (~(((2**len)-1)<<bit) & 0xFFFFFFFF))
else:
print("You are not in any register")

def FieldRename(lsb, name):
if context.r:
for f in context.r.fields:
if f.lsb == lsb:
f.name = name

def HasField(addr):
if context.r:
Expand Down

0 comments on commit f2b7fc3

Please sign in to comment.