From 1db61d660db382b671237215fc65c65b5371c810 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 5 Jul 2021 14:30:50 +0100 Subject: [PATCH] add function to turn permute into an order list --- src/openpower/sv/svp64.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/openpower/sv/svp64.py b/src/openpower/sv/svp64.py index 32880775..e9ba29b1 100644 --- a/src/openpower/sv/svp64.py +++ b/src/openpower/sv/svp64.py @@ -68,6 +68,15 @@ class SVP64REMAP(Record): ("ydimsz" , 6), ("xdimsz" , 6)], name=name) + def order(self, permute): + options = {0b000: [0,1,2], + 0b001: [0,2,1], + 0b010: [1,0,2], + 0b011: [1,2,0], + 0b100: [2,0,1], + 0b101: [2,1,0]} + return options[permute] + def ports(self): return [self.mode, self.skip, self.offset, self.invxyz, self.permute, self.zdimsz, self.ydimsz, self.xdimsz] -- 2.30.2