From 28a86a8415b7a977d21a846333af0a1a7868d070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Wed, 23 Oct 2013 17:13:54 +0200 Subject: [PATCH] Code ported and updated to Python 3. --- tools/lsbgen.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/lsbgen.py b/tools/lsbgen.py index 9f4bbe1..459e6bd 100755 --- a/tools/lsbgen.py +++ b/tools/lsbgen.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- #======================================================================= # @@ -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 @@ -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)) #-------------------------------------------------------------------