From: Luke Kenneth Casson Leighton Date: Fri, 9 Oct 2020 16:58:01 +0000 (+0100) Subject: update sv opcodes table X-Git-Tag: convert-csv-opcode-to-binary~2029 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a78be37f48115a3cea9d1a592c6c008aee7d5f3b;p=libreriscv.git update sv opcodes table --- diff --git a/openpower/opcode_regs_deduped.mdwn b/openpower/opcode_regs_deduped.mdwn index 4e7cfafdc..d398c2ebc 100644 --- a/openpower/opcode_regs_deduped.mdwn +++ b/openpower/opcode_regs_deduped.mdwn @@ -3,26 +3,26 @@ [[!table data=""" unit | in | out | CR in | CR out| name | LDST | 1 | R | 0 | 0| LDST-1R-1W | -LDST | 2 | 0 | 0 | 0| LDST-2R-0W | +LDST | 2 | 0 | 0 | 0| LDST-2R | LDST | 2 | R | 0 | 0| LDST-2R-1W | -LDST | 3 | 0 | 0 | 0| LDST-3R-0W | -LDST | 3 | 0 | 0 | 1| LDST-3R-0W-CRo | -OTHER | 0 | 0 | 0 | 0| 0R-0W | -OTHER | 0 | 0 | 1 | 0| 0R-0W-CRi | -OTHER | 0 | 0 | 1 | 1| 0R-0W-CRio | -OTHER | 0 | R | 0 | 0| 0R-1W | -OTHER | 0 | R | 1 | 0| 0R-1W-CRi | -OTHER | 1 | 0 | 0 | 0| 1R-0W | -OTHER | 1 | 0 | 0 | 1| 1R-0W-CRo | -OTHER | 1 | 0 | 1 | 1| 1R-0W-CRio | +LDST | 3 | 0 | 0 | 0| LDST-3R | +LDST | 3 | 0 | 0 | 1| LDST-3R-CRo---C-R-o | +OTHER | 0 | 0 | 0 | 0| | +OTHER | 0 | 0 | 1 | 0| CRi | +OTHER | 0 | 0 | 1 | 1| CRio | +OTHER | 0 | R | 0 | 0| 1W | +OTHER | 0 | R | 1 | 0| 1W-CRi | +OTHER | 1 | 0 | 0 | 0| 1R | +OTHER | 1 | 0 | 0 | 1| 1R-CRo---C-R-o | +OTHER | 1 | 0 | 1 | 1| 1R-CRio | OTHER | 1 | R | 0 | 0| 1R-1W | -OTHER | 1 | R | 0 | 1| 1R-1W-CRo | +OTHER | 1 | R | 0 | 1| 1R-1W-CRo---C-R-o | OTHER | 1 | R | 1 | 1| 1R-1W-CRio | -OTHER | 2 | 0 | 0 | 0| 2R-0W | -OTHER | 2 | 0 | 0 | 1| 2R-0W-CRo | -OTHER | 2 | 0 | 1 | 1| 2R-0W-CRio | +OTHER | 2 | 0 | 0 | 0| 2R | +OTHER | 2 | 0 | 0 | 1| 2R-CRo---C-R-o | +OTHER | 2 | 0 | 1 | 1| 2R-CRio | OTHER | 2 | R | 0 | 0| 2R-1W | -OTHER | 2 | R | 0 | 1| 2R-1W-CRo | +OTHER | 2 | R | 0 | 1| 2R-1W-CRo---C-R-o | OTHER | 2 | R | 1 | 0| 2R-1W-CRi | OTHER | 2 | R | 1 | 1| 2R-1W-CRio | OTHER | 3 | R | 1 | 1| 3R-1W-CRio | @@ -45,7 +45,7 @@ minor_58.csv | 1 | ldu | DS-Form| minor_58.csv | 2 | lwa | DS-Form| """]] -## LDST-2R-0W +## LDST-2R [[!table data=""" CSV | opcode | asm | form| @@ -88,7 +88,7 @@ minor_31.csv | 0b1101010101 | lbzcix | X-Form| minor_31.csv | 0b1101110101 | ldcix | X-Form| """]] -## LDST-3R-0W +## LDST-3R [[!table data=""" CSV | opcode | asm | form| @@ -110,7 +110,7 @@ minor_31.csv | 0b1111010101 | stbcix | X-Form| minor_31.csv | 0b1111110101 | stdcix | X-Form| """]] -## LDST-3R-0W-CRo +## LDST-3R-CRo---C-R-o [[!table data=""" CSV | opcode | asm | form| @@ -119,7 +119,7 @@ minor_31.csv | 0b0011110111 | stbux | X-Form| minor_31.csv | 0b1010110110 | stbcx | X-Form| """]] -## 0R-0W +## [[!table data=""" CSV | opcode | asm | form| @@ -141,7 +141,7 @@ minor_31.csv | 0b1001010110 | sync | X-Form| minor_31.csv | 0b1111010110 | icbi | X-Form| """]] -## 0R-0W-CRi +## CRi [[!table data=""" CSV | opcode | asm | form| @@ -151,7 +151,7 @@ minor_19.csv | 0b1000010000 | bcctr | XL-Form| minor_19.csv | 0b1000110000 | bctar | XL-Form| """]] -## 0R-0W-CRio +## CRio [[!table data=""" CSV | opcode | asm | form| @@ -174,7 +174,7 @@ minor_63l.csv | 0b011000010 | 2/6=mtfsb0 | -Form| minor_63l.csv | 0b011000100 | 4/6=mtfsfi | -Form| """]] -## 0R-1W +## 1W [[!table data=""" CSV | opcode | asm | form| @@ -183,7 +183,7 @@ minor_31.csv | 0b0001010011 | mfmsr | X-Form| minor_31.csv | 0b0101010011 | mfspr | XFX-Form| """]] -## 0R-1W-CRi +## 1W-CRi [[!table data=""" CSV | opcode | asm | form| @@ -191,7 +191,7 @@ minor_31.csv | 0b0000010011 | mfcr/mfocrf | XFX-Form| minor_31.csv | 0b0010000000 | setb | VX-Form| """]] -## 1R-0W +## 1R [[!table data=""" CSV | opcode | asm | form| @@ -204,7 +204,7 @@ minor_31.csv | 0b0100110010 | tlbie | X-Form| minor_31.csv | 0b0111010011 | mtspr | XFX-Form| """]] -## 1R-0W-CRo +## 1R-CRo---C-R-o [[!table data=""" CSV | opcode | asm | form| @@ -212,7 +212,7 @@ major.csv | 10 | cmpli | D-Form| major.csv | 11 | cmpi | D-Form| """]] -## 1R-0W-CRio +## 1R-CRio [[!table data=""" CSV | opcode | asm | form| @@ -242,7 +242,7 @@ minor_31.csv | 0b0111111010 | popcntd | X-Form| minor_31.csv | 0b1001101000 | nego | XO-Form| """]] -## 1R-1W-CRo +## 1R-1W-CRo---C-R-o [[!table data=""" CSV | opcode | asm | form| @@ -312,7 +312,7 @@ minor_63l.csv | 0b111111001 | 25/15=fctidz | -Form| minor_63l.csv | 0b111111101 | 29/15=fctiduz | -Form| """]] -## 2R-0W +## 2R [[!table data=""" CSV | opcode | asm | form| @@ -321,7 +321,7 @@ minor_31.csv | 0b0001000100 | td | X-Form| minor_31.csv | 0b1111110110 | dcbz | X-Form| """]] -## 2R-0W-CRo +## 2R-CRo---C-R-o [[!table data=""" CSV | opcode | asm | form| @@ -330,7 +330,7 @@ minor_31.csv | 0b0000100000 | cmpl | X-Form| minor_31.csv | 0b0011100000 | cmpeqb | X-Form| """]] -## 2R-0W-CRio +## 2R-CRio [[!table data=""" CSV | opcode | asm | form| @@ -351,7 +351,7 @@ minor_31.csv | 0b1100001001 | modsd | X-Form| minor_31.csv | 0b1100001011 | modsw | X-Form| """]] -## 2R-1W-CRo +## 2R-1W-CRo---C-R-o [[!table data=""" CSV | opcode | asm | form| diff --git a/openpower/sv_analysis.py b/openpower/sv_analysis.py index ac03ac741..7e7eef3c7 100644 --- a/openpower/sv_analysis.py +++ b/openpower/sv_analysis.py @@ -96,20 +96,21 @@ def tformat(d): return ' | '.join(d) + "|" def keyname(row): + res = [] + if row['unit'] != 'OTHER': + res.append(row['unit']) + if row['in'] != '0': + res.append('%sR' % row['in']) if row['out'] == 'R': - out = '1' - else: - out = '0' - res = '%sR-%sW' % (row['in'], out) + res.append('1W') if row['CR in'] == '1' and row['CR out'] == '1': - res += "-CRio" + res.append("CRio") elif row['CR in'] == '1': - res += "-CRi" + res.append("CRi") elif row['CR out'] == '1': + res.append("CRo") res += "-CRo" - if row['unit'] != 'OTHER': - return '%s-' % row['unit'] + res - return res + return '-'.join(res) def process_csvs():