Skip to content

Commit

Permalink
Code ported and updated to Python 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
secworks committed Oct 23, 2013
1 parent db13776 commit 28a86a8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tools/lsbgen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#=======================================================================
#
Expand Down Expand Up @@ -70,12 +70,12 @@ def main():

# Check that the given size is ok.
if (vector_bits % word_bits != 0):
print "Error: Vector with %d bits can not be evenly divided into %d-bit words." % (vector_bits, word_bits)
print("Error: Vector with %d bits can not be evenly divided into %d-bit words." % (vector_bits, word_bits))
return
else:
print "Creating %d words of size %d"
print("Creating %d words of size %d" )

for i in range(vector_bits / word_bits):
for i in range(int(vector_bits / word_bits)):
b0max = (vector_bits - 1) - i * word_bits
b0min = (vector_bits - 8) - i * word_bits
b1max = (vector_bits - 9) - i * word_bits
Expand All @@ -85,9 +85,9 @@ def main():
b3max = (vector_bits - 25) - i * word_bits
b3min = (vector_bits - 32) - i * word_bits

print "x%d_new = {%s[%d:%d], %s[%d:%d], %s[%d:%d], %s[%d:%d]}" %\
print("x%d_new = {%s[%d:%d], %s[%d:%d], %s[%d:%d], %s[%d:%d]}" %\
(i, vector_name, b3max, b3min, vector_name, b2max, b2min,
vector_name, b1max, b1min, vector_name, b0max, b0min)
vector_name, b1max, b1min, vector_name, b0max, b0min))


#-------------------------------------------------------------------
Expand Down

0 comments on commit 28a86a8

Please sign in to comment.