From: Luke Kenneth Casson Leighton Date: Sat, 28 Nov 2020 09:23:56 +0000 (+0000) Subject: just record immediate exists not which type X-Git-Tag: convert-csv-opcode-to-binary~1641 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=afb5ad2f7db060ee5c223b1aecd9c012749c6b9d;p=libreriscv.git just record immediate exists not which type --- diff --git a/openpower/opcode_regs_deduped.mdwn b/openpower/opcode_regs_deduped.mdwn index a1f701458..85e192c55 100644 --- a/openpower/opcode_regs_deduped.mdwn +++ b/openpower/opcode_regs_deduped.mdwn @@ -2,45 +2,34 @@ [[!table data=""" LDST-1R-1W-imm | I | -LDST-1R-1W-imm | I | -LDST-1R-2W-imm | I | LDST-1R-2W-imm | I | LDST-2R-imm | S | -LDST-2R-imm | S | -LDST-2R-1W-imm | S | +LDST-2R-1W | - | LDST-2R-1W-imm | S | -LDST-2R-1W-imm | S | -LDST-2R-2W-imm | - | -LDST-3R-imm | - | +LDST-2R-2W | - | +LDST-3R | - | LDST-3R-CRo | - | -LDST-3R-1W-imm | - | -imm | - | +LDST-3R-1W | - | + | - | imm | - | CRi | - | CRi | - | CRio | - | -1W-imm | - | +1W | - | 1W-CRi | - | +1R | - | 1R-imm | - | -1R-imm | - | -1R-CRo | - | 1R-CRo | - | 1R-CRio | - | +1R-1W | R | 1R-1W-imm | - | -1R-1W-imm | - | -1R-1W-imm | - | -1R-1W-CRo | R | -1R-1W-CRo | R | -1R-1W-CRo | R | -1R-1W-CRo | R | 1R-1W-CRo | R | 1R-1W-CRo | R | 1R-1W-CRio | R | -2R-imm | - | +2R | - | 2R-CRo | R | 2R-CRio | R | -2R-1W-imm | - | -2R-1W-CRo | R | +2R-1W | R | 2R-1W-CRo | R | 2R-1W-CRo | R | 2R-1W-CRi | R | @@ -52,48 +41,37 @@ CRio | - | [[!table data=""" unit | in | outcnt | CR in | CR out | imm| name | -LDST | 1 | 1 | 0 | 0 | DS| LDST-1R-1W-imm | -LDST | 1 | 1 | 0 | 0 | SI| LDST-1R-1W-imm | -LDST | 1 | 2 | 0 | 0 | DS| LDST-1R-2W-imm | -LDST | 1 | 2 | 0 | 0 | SI| LDST-1R-2W-imm | -LDST | 2 | 0 | 0 | 0 | DS| LDST-2R-imm | -LDST | 2 | 0 | 0 | 0 | SI| LDST-2R-imm | -LDST | 2 | 1 | 0 | 0 | | LDST-2R-1W-imm | -LDST | 2 | 1 | 0 | 0 | DS| LDST-2R-1W-imm | -LDST | 2 | 1 | 0 | 0 | SI| LDST-2R-1W-imm | -LDST | 2 | 2 | 0 | 0 | | LDST-2R-2W-imm | -LDST | 3 | 0 | 0 | 0 | | LDST-3R-imm | +LDST | 1 | 1 | 0 | 0 | 1| LDST-1R-1W-imm | +LDST | 1 | 2 | 0 | 0 | 1| LDST-1R-2W-imm | +LDST | 2 | 0 | 0 | 0 | 1| LDST-2R-imm | +LDST | 2 | 1 | 0 | 0 | | LDST-2R-1W | +LDST | 2 | 1 | 0 | 0 | 1| LDST-2R-1W-imm | +LDST | 2 | 2 | 0 | 0 | | LDST-2R-2W | +LDST | 3 | 0 | 0 | 0 | | LDST-3R | LDST | 3 | 0 | 0 | 1 | | LDST-3R-CRo | -LDST | 3 | 1 | 0 | 0 | | LDST-3R-1W-imm | -OTHER | 0 | 0 | 0 | 0 | | imm | -OTHER | 0 | 0 | 0 | 0 | LI| imm | +LDST | 3 | 1 | 0 | 0 | | LDST-3R-1W | +OTHER | 0 | 0 | 0 | 0 | | | +OTHER | 0 | 0 | 0 | 0 | 1| imm | OTHER | 0 | 0 | 1 | 0 | | CRi | -OTHER | 0 | 0 | 1 | 0 | BD| CRi | +OTHER | 0 | 0 | 1 | 0 | 1| CRi | OTHER | 0 | 0 | 1 | 1 | | CRio | -OTHER | 0 | 1 | 0 | 0 | | 1W-imm | +OTHER | 0 | 1 | 0 | 0 | | 1W | OTHER | 0 | 1 | 1 | 0 | | 1W-CRi | -OTHER | 1 | 0 | 0 | 0 | | 1R-imm | -OTHER | 1 | 0 | 0 | 0 | SI| 1R-imm | -OTHER | 1 | 0 | 0 | 1 | SI| 1R-CRo | -OTHER | 1 | 0 | 0 | 1 | UI| 1R-CRo | +OTHER | 1 | 0 | 0 | 0 | | 1R | +OTHER | 1 | 0 | 0 | 0 | 1| 1R-imm | +OTHER | 1 | 0 | 0 | 1 | 1| 1R-CRo | OTHER | 1 | 0 | 1 | 1 | | 1R-CRio | -OTHER | 1 | 1 | 0 | 0 | | 1R-1W-imm | -OTHER | 1 | 1 | 0 | 0 | SI| 1R-1W-imm | -OTHER | 1 | 1 | 0 | 0 | UI| 1R-1W-imm | +OTHER | 1 | 1 | 0 | 0 | | 1R-1W | +OTHER | 1 | 1 | 0 | 0 | 1| 1R-1W-imm | OTHER | 1 | 1 | 0 | 1 | | 1R-1W-CRo | -OTHER | 1 | 1 | 0 | 1 | M1| 1R-1W-CRo | -OTHER | 1 | 1 | 0 | 1 | SH| 1R-1W-CRo | -OTHER | 1 | 1 | 0 | 1 | SH32| 1R-1W-CRo | -OTHER | 1 | 1 | 0 | 1 | SI| 1R-1W-CRo | -OTHER | 1 | 1 | 0 | 1 | UI| 1R-1W-CRo | +OTHER | 1 | 1 | 0 | 1 | 1| 1R-1W-CRo | OTHER | 1 | 1 | 1 | 1 | | 1R-1W-CRio | -OTHER | 2 | 0 | 0 | 0 | | 2R-imm | +OTHER | 2 | 0 | 0 | 0 | | 2R | OTHER | 2 | 0 | 0 | 1 | | 2R-CRo | OTHER | 2 | 0 | 1 | 1 | | 2R-CRio | -OTHER | 2 | 1 | 0 | 0 | | 2R-1W-imm | +OTHER | 2 | 1 | 0 | 0 | | 2R-1W | OTHER | 2 | 1 | 0 | 1 | | 2R-1W-CRo | -OTHER | 2 | 1 | 0 | 1 | SH| 2R-1W-CRo | -OTHER | 2 | 1 | 0 | 1 | SH32| 2R-1W-CRo | +OTHER | 2 | 1 | 0 | 1 | 1| 2R-1W-CRo | OTHER | 2 | 1 | 1 | 0 | | 2R-1W-CRi | OTHER | 2 | 1 | 1 | 1 | | 2R-1W-CRio | OTHER | 3 | 1 | 1 | 1 | | 3R-1W-CRio | @@ -101,27 +79,14 @@ OTHER | 3 | 1 | 1 | 1 | | 3R-1W-CRio | ## LDST-1R-1W-imm -[[!table data=""" -CSV | opcode | asm | form| -minor_58.csv | 0 | ld | DS-Form| -minor_58.csv | 2 | lwa | DS-Form| -"""]] - -## LDST-1R-1W-imm - [[!table data=""" CSV | opcode | asm | form| major.csv | 32 | lwz | D-Form| major.csv | 34 | lbz | D-Form| major.csv | 40 | lhz | D-Form| major.csv | 42 | lha | D-Form| -"""]] - -## LDST-1R-2W-imm - -[[!table data=""" -CSV | opcode | asm | form| -minor_58.csv | 1 | ldu | DS-Form| +minor_58.csv | 0 | ld | DS-Form| +minor_58.csv | 2 | lwa | DS-Form| """]] ## LDST-1R-2W-imm @@ -132,13 +97,7 @@ major.csv | 33 | lwzu | D-Form| major.csv | 35 | lbzu | D-Form| major.csv | 41 | lhzu | D-Form| major.csv | 43 | lhau | D-Form| -"""]] - -## LDST-2R-imm - -[[!table data=""" -CSV | opcode | asm | form| -minor_62.csv | 0 | std | DS-Form| +minor_58.csv | 1 | ldu | DS-Form| """]] ## LDST-2R-imm @@ -148,9 +107,10 @@ CSV | opcode | asm | form| major.csv | 36 | stw | D-Form| major.csv | 38 | stb | D-Form| major.csv | 44 | sth | D-Form| +minor_62.csv | 0 | std | DS-Form| """]] -## LDST-2R-1W-imm +## LDST-2R-1W [[!table data=""" CSV | opcode | asm | form| @@ -175,21 +135,15 @@ minor_31.csv | 0b1101110101 | ldcix | X-Form| ## LDST-2R-1W-imm -[[!table data=""" -CSV | opcode | asm | form| -minor_62.csv | 1 | stdu | DS-Form| -"""]] - -## LDST-2R-1W-imm - [[!table data=""" CSV | opcode | asm | form| major.csv | 37 | stwu | D-Form| major.csv | 39 | stbu | D-Form| major.csv | 45 | sthu | D-Form| +minor_62.csv | 1 | stdu | DS-Form| """]] -## LDST-2R-2W-imm +## LDST-2R-2W [[!table data=""" CSV | opcode | asm | form| @@ -201,7 +155,7 @@ minor_31.csv | 0b0101110101 | lwaux | X-Form| minor_31.csv | 0b0101110111 | lhaux | X-Form| """]] -## LDST-3R-imm +## LDST-3R [[!table data=""" CSV | opcode | asm | form| @@ -228,7 +182,7 @@ minor_31.csv | 0b0011010111 | stbx | X-Form| minor_31.csv | 0b1010110110 | stbcx | X-Form| """]] -## LDST-3R-1W-imm +## LDST-3R-1W [[!table data=""" CSV | opcode | asm | form| @@ -238,7 +192,7 @@ minor_31.csv | 0b0011110111 | stbux | X-Form| minor_31.csv | 0b0110110111 | sthux | X-Form| """]] -## imm +## [[!table data=""" CSV | opcode | asm | form| @@ -303,7 +257,7 @@ minor_63l.csv | 0b011000010 | 2/6=mtfsb0 | -Form| minor_63l.csv | 0b011000100 | 4/6=mtfsfi | -Form| """]] -## 1W-imm +## 1W [[!table data=""" CSV | opcode | asm | form| @@ -320,7 +274,7 @@ minor_31.csv | 0b0000010011 | mfcr/mfocrf | XFX-Form| minor_31.csv | 0b0010000000 | setb | VX-Form| """]] -## 1R-imm +## 1R [[!table data=""" CSV | opcode | asm | form| @@ -341,16 +295,10 @@ major.csv | 3 | twi | D-Form| ## 1R-CRo -[[!table data=""" -CSV | opcode | asm | form| -major.csv | 11 | cmpi | D-Form| -"""]] - -## 1R-CRo - [[!table data=""" CSV | opcode | asm | form| major.csv | 10 | cmpli | D-Form| +major.csv | 11 | cmpi | D-Form| """]] ## 1R-CRio @@ -363,7 +311,7 @@ minor_63l.csv | 0b000000101 | 5/0=ftsqrt | -Form| minor_63l.csv | 0b011110110 | 22/7=mtfsf | -Form| """]] -## 1R-1W-imm +## 1R-1W [[!table data=""" CSV | opcode | asm | form| @@ -383,17 +331,11 @@ CSV | opcode | asm | form| major.csv | 12 | addic | D-Form| major.csv | 14 | addi | D-Form| major.csv | 15 | addis | D-Form| -major.csv | 8 | subfic | D-Form| -"""]] - -## 1R-1W-imm - -[[!table data=""" -CSV | opcode | asm | form| major.csv | 24 | ori | D-Form| major.csv | 25 | oris | D-Form| major.csv | 26 | xori | D-Form| major.csv | 27 | xoris | D-Form| +major.csv | 8 | subfic | D-Form| """]] ## 1R-1W-CRo @@ -417,52 +359,28 @@ minor_31.csv | 0b1111011010 | extsw | X-Form| [[!table data=""" CSV | opcode | asm | form| -minor_31.csv | 0b0011101000 | subfme | XO-Form| -minor_31.csv | 0b0011101010 | addme | XO-Form| -minor_31.csv | 0b1011101000 | subfmeo | XO-Form| -minor_31.csv | 0b1011101010 | addmeo | XO-Form| -"""]] - -## 1R-1W-CRo - -[[!table data=""" -CSV | opcode | asm | form| +major.csv | 13 | addic. | D-Form| +major.csv | 21 | rlwinm | M-Form| +major.csv | 28 | andi. | B-Form| +major.csv | 29 | andis. | B-Form| +major.csv | 7 | mulli | D-Form| minor_30.csv | 0b0000 | rldicl | MDS-Form| minor_30.csv | 0b0001 | rldicl | MDS-Form| minor_30.csv | 0b0010 | rldicr | MD-Form| minor_30.csv | 0b0011 | rldicr | MD-Form| minor_30.csv | 0b0100 | rldic | MD-Form| minor_30.csv | 0b0101 | rldic | MD-Form| +minor_31.csv | 0b0011101000 | subfme | XO-Form| +minor_31.csv | 0b0011101010 | addme | XO-Form| +minor_31.csv | 0b1011101000 | subfmeo | XO-Form| +minor_31.csv | 0b1011101010 | addmeo | XO-Form| +minor_31.csv | 0b1100111000 | srawi | X-Form| minor_31.csv | 0b1100111010 | sradi | XS-Form| minor_31.csv | 0b1100111011 | sradi | XS-Form| minor_31.csv | 0b1101111010 | extswsli | XS-Form| minor_31.csv | 0b1101111011 | extswsli | XS-Form| """]] -## 1R-1W-CRo - -[[!table data=""" -CSV | opcode | asm | form| -major.csv | 21 | rlwinm | M-Form| -minor_31.csv | 0b1100111000 | srawi | X-Form| -"""]] - -## 1R-1W-CRo - -[[!table data=""" -CSV | opcode | asm | form| -major.csv | 13 | addic. | D-Form| -major.csv | 7 | mulli | D-Form| -"""]] - -## 1R-1W-CRo - -[[!table data=""" -CSV | opcode | asm | form| -major.csv | 28 | andi. | B-Form| -major.csv | 29 | andis. | B-Form| -"""]] - ## 1R-1W-CRio [[!table data=""" @@ -496,7 +414,7 @@ minor_63l.csv | 0b111111001 | 25/15=fctidz | -Form| minor_63l.csv | 0b111111101 | 29/15=fctiduz | -Form| """]] -## 2R-imm +## 2R [[!table data=""" CSV | opcode | asm | form| @@ -524,7 +442,7 @@ minor_63l.csv | 0b000000001 | 1/0=fcmpo | -Form| minor_63l.csv | 0b000000100 | 4/0=ftdiv | -Form| """]] -## 2R-1W-imm +## 2R-1W [[!table data=""" CSV | opcode | asm | form| @@ -603,17 +521,11 @@ minor_31.csv | 0b1111101011 | divwo | XO-Form| [[!table data=""" CSV | opcode | asm | form| +major.csv | 20 | rlwimi | M-Form| minor_30.csv | 0b0110 | rldimi | MD-Form| minor_30.csv | 0b0111 | rldimi | MD-Form| """]] -## 2R-1W-CRo - -[[!table data=""" -CSV | opcode | asm | form| -major.csv | 20 | rlwimi | M-Form| -"""]] - ## 2R-1W-CRi [[!table data=""" diff --git a/openpower/sv_analysis.py b/openpower/sv_analysis.py index 40e055140..783af9b41 100644 --- a/openpower/sv_analysis.py +++ b/openpower/sv_analysis.py @@ -108,7 +108,7 @@ def create_key(row): # constants if row['in2'].startswith('CONST_'): - res['imm'] = row['in2'].split("_")[1] + res['imm'] = "1" # row['in2'].split("_")[1] else: res['imm'] = '' @@ -138,7 +138,7 @@ def keyname(row): res.append("CRi") elif row['CR out'] == '1': res.append("CRo") - elif 'imm' in row: + elif 'imm' in row and row['imm']: res.append("imm") return '-'.join(res)