From 054c4a6a9c8ab9f00cc5bfa82bf7b2efc7567e7b Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Tue, 2 Aug 2022 21:21:44 +0100 Subject: [PATCH] Fix reversed pseudocode for ctz/clz --- doc/hazard3.pdf | 22 +++++++++++----------- doc/sections/instruction_pseudocode.adoc | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/hazard3.pdf b/doc/hazard3.pdf index fe96a1f..e255253 100644 --- a/doc/hazard3.pdf +++ b/doc/hazard3.pdf @@ -5,7 +5,7 @@ /Creator (Asciidoctor PDF 2.0.7, based on Prawn 2.4.0) /Producer (Asciidoctor PDF 2.0.7, based on Prawn 2.4.0) /ModDate (D:20220728011309+01'00') -/CreationDate (D:20220731174438+01'00') +/CreationDate (D:20220802212055+01'00') >> endobj 2 0 obj @@ -33262,7 +33262,7 @@ endobj [175 0 R /XYZ 0 242.99 null] endobj 181 0 obj -<< /Length 6899 +<< /Length 6909 >> stream q @@ -33587,7 +33587,7 @@ ET BT 59.24 255.825 Td /F3.0 11 Tf - Tj + Tj ET 0.0 0.0 0.0 SCN @@ -33725,7 +33725,7 @@ endobj [182 0 R /XYZ 0 170.95 null] endobj 187 0 obj -<< /Length 7873 +<< /Length 7863 >> stream q @@ -33990,7 +33990,7 @@ ET BT 59.24 404.005 Td /F3.0 11 Tf - Tj + Tj ET 0.0 0.0 0.0 SCN @@ -74050,12 +74050,12 @@ xref 0000496192 00000 n 0000496238 00000 n 0000496284 00000 n -0000503237 00000 n -0000503594 00000 n -0000503640 00000 n -0000503686 00000 n -0000503732 00000 n -0000503778 00000 n +0000503247 00000 n +0000503604 00000 n +0000503650 00000 n +0000503696 00000 n +0000503742 00000 n +0000503788 00000 n 0000511705 00000 n 0000512062 00000 n 0000512108 00000 n diff --git a/doc/sections/instruction_pseudocode.adoc b/doc/sections/instruction_pseudocode.adoc index 5e40239..28caeca 100644 --- a/doc/sections/instruction_pseudocode.adoc +++ b/doc/sections/instruction_pseudocode.adoc @@ -719,7 +719,7 @@ rd = 32; // Default = 32 if no set bits reg found = 1'b0; // Local variable for (i = 0; i < 32; i = i + 1) begin - if (rs1[i] && !found) begin + if (rs1[31 - i] && !found) begin found = 1'b1; rd = i; end @@ -755,7 +755,7 @@ rd = 32; // Default = 32 if no set bits reg found = 1'b0; // Local variable for (i = 0; i < 32; i = i + 1) begin - if (rs1[31 - i] && !found) begin + if (rs1[i] && !found) begin found = 1'b1; rd = i; end