aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2016-08-26 19:35:30 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2016-08-26 19:35:30 -0700
commitc86d2ee8dca8fb1186f036f64b7e3a49bdfc6266 (patch)
tree7a6654e8f19021aa101ed0598bb46a10bcf73f90
parent9f3e3894d7a9d1d1a9f893ba5e36936b9e9bf7a4 (diff)
downloadriscv-opcodes-c86d2ee8dca8fb1186f036f64b7e3a49bdfc6266.zip
riscv-opcodes-c86d2ee8dca8fb1186f036f64b7e3a49bdfc6266.tar.gz
riscv-opcodes-c86d2ee8dca8fb1186f036f64b7e3a49bdfc6266.tar.bz2
Renumber misa; add performance counter CSRs
-rwxr-xr-xparse-opcodes187
1 files changed, 154 insertions, 33 deletions
diff --git a/parse-opcodes b/parse-opcodes
index c0809cc..5300f36 100755
--- a/parse-opcodes
+++ b/parse-opcodes
@@ -56,6 +56,35 @@ csrs = [
(0xC00, 'cycle'),
(0xC01, 'time'),
(0xC02, 'instret'),
+ (0xC03, 'hpmcounter3'),
+ (0xC04, 'hpmcounter4'),
+ (0xC05, 'hpmcounter5'),
+ (0xC06, 'hpmcounter6'),
+ (0xC07, 'hpmcounter7'),
+ (0xC08, 'hpmcounter8'),
+ (0xC09, 'hpmcounter9'),
+ (0xC0A, 'hpmcounter10'),
+ (0xC0B, 'hpmcounter11'),
+ (0xC0C, 'hpmcounter12'),
+ (0xC0D, 'hpmcounter13'),
+ (0xC0E, 'hpmcounter14'),
+ (0xC0F, 'hpmcounter15'),
+ (0xC10, 'hpmcounter16'),
+ (0xC11, 'hpmcounter17'),
+ (0xC12, 'hpmcounter18'),
+ (0xC13, 'hpmcounter19'),
+ (0xC14, 'hpmcounter20'),
+ (0xC15, 'hpmcounter21'),
+ (0xC16, 'hpmcounter22'),
+ (0xC17, 'hpmcounter23'),
+ (0xC18, 'hpmcounter24'),
+ (0xC19, 'hpmcounter25'),
+ (0xC1A, 'hpmcounter26'),
+ (0xC1B, 'hpmcounter27'),
+ (0xC1C, 'hpmcounter28'),
+ (0xC1D, 'hpmcounter29'),
+ (0xC1E, 'hpmcounter30'),
+ (0xC1F, 'hpmcounter31'),
# Standard Supervisor R/W
(0x100, 'sstatus'),
@@ -68,13 +97,9 @@ csrs = [
(0x144, 'sip'),
(0x180, 'sptbr'),
- # Standard Supervisor RO
- (0xD00, 'scycle'),
- (0xD01, 'stime'),
- (0xD02, 'sinstret'),
-
# Standard Machine R/W
(0x300, 'mstatus'),
+ (0x301, 'misa'),
(0x302, 'medeleg'),
(0x303, 'mideleg'),
(0x304, 'mie'),
@@ -84,14 +109,6 @@ csrs = [
(0x342, 'mcause'),
(0x343, 'mbadaddr'),
(0x344, 'mip'),
- (0x310, 'mucounteren'),
- (0x311, 'mscounteren'),
- (0x700, 'mucycle_delta'),
- (0x701, 'mutime_delta'),
- (0x702, 'muinstret_delta'),
- (0x704, 'mscycle_delta'),
- (0x705, 'mstime_delta'),
- (0x706, 'msinstret_delta'),
(0x7a0, 'tselect'),
(0x7a1, 'tdata1'),
(0x7a2, 'tdata2'),
@@ -99,19 +116,74 @@ csrs = [
(0x7b0, 'dcsr'),
(0x7b1, 'dpc'),
(0x7b2, 'dscratch'),
+ (0xB00, 'mcycle'),
+ (0xB02, 'minstret'),
+ (0xB03, 'mhpmcounter3'),
+ (0xB04, 'mhpmcounter4'),
+ (0xB05, 'mhpmcounter5'),
+ (0xB06, 'mhpmcounter6'),
+ (0xB07, 'mhpmcounter7'),
+ (0xB08, 'mhpmcounter8'),
+ (0xB09, 'mhpmcounter9'),
+ (0xB0A, 'mhpmcounter10'),
+ (0xB0B, 'mhpmcounter11'),
+ (0xB0C, 'mhpmcounter12'),
+ (0xB0D, 'mhpmcounter13'),
+ (0xB0E, 'mhpmcounter14'),
+ (0xB0F, 'mhpmcounter15'),
+ (0xB10, 'mhpmcounter16'),
+ (0xB11, 'mhpmcounter17'),
+ (0xB12, 'mhpmcounter18'),
+ (0xB13, 'mhpmcounter19'),
+ (0xB14, 'mhpmcounter20'),
+ (0xB15, 'mhpmcounter21'),
+ (0xB16, 'mhpmcounter22'),
+ (0xB17, 'mhpmcounter23'),
+ (0xB18, 'mhpmcounter24'),
+ (0xB19, 'mhpmcounter25'),
+ (0xB1A, 'mhpmcounter26'),
+ (0xB1B, 'mhpmcounter27'),
+ (0xB1C, 'mhpmcounter28'),
+ (0xB1D, 'mhpmcounter29'),
+ (0xB1E, 'mhpmcounter30'),
+ (0xB1F, 'mhpmcounter31'),
+ (0x320, 'mucounteren'),
+ (0x321, 'mscounteren'),
+ (0x323, 'mhpmevent3'),
+ (0x324, 'mhpmevent4'),
+ (0x325, 'mhpmevent5'),
+ (0x326, 'mhpmevent6'),
+ (0x327, 'mhpmevent7'),
+ (0x328, 'mhpmevent8'),
+ (0x329, 'mhpmevent9'),
+ (0x32A, 'mhpmevent10'),
+ (0x32B, 'mhpmevent11'),
+ (0x32C, 'mhpmevent12'),
+ (0x32D, 'mhpmevent13'),
+ (0x32E, 'mhpmevent14'),
+ (0x32F, 'mhpmevent15'),
+ (0x330, 'mhpmevent16'),
+ (0x331, 'mhpmevent17'),
+ (0x332, 'mhpmevent18'),
+ (0x333, 'mhpmevent19'),
+ (0x334, 'mhpmevent20'),
+ (0x335, 'mhpmevent21'),
+ (0x336, 'mhpmevent22'),
+ (0x337, 'mhpmevent23'),
+ (0x338, 'mhpmevent24'),
+ (0x339, 'mhpmevent25'),
+ (0x33A, 'mhpmevent26'),
+ (0x33B, 'mhpmevent27'),
+ (0x33C, 'mhpmevent28'),
+ (0x33D, 'mhpmevent29'),
+ (0x33E, 'mhpmevent30'),
+ (0x33F, 'mhpmevent31'),
# Standard Machine RO
- (0xF00, 'mcycle'),
- (0xF01, 'mtime'),
- (0xF02, 'minstret'),
- (0xF10, 'misa'),
(0xF11, 'mvendorid'),
(0xF12, 'marchid'),
(0xF13, 'mimpid'),
(0xF14, 'mhartid'),
-
- # Nonstandard Machine R/W
- (0x7C2, 'mreset'),
]
csrs32 = [
@@ -119,19 +191,68 @@ csrs32 = [
(0xC80, 'cycleh'),
(0xC81, 'timeh'),
(0xC82, 'instreth'),
-
- # Standard Machine R/W
- (0x780, 'mucycle_deltah'),
- (0x781, 'mutime_deltah'),
- (0x782, 'muinstret_deltah'),
- (0x784, 'mscycle_deltah'),
- (0x785, 'mstime_deltah'),
- (0x786, 'msinstret_deltah'),
-
- # Standard Machine RO
- (0xF80, 'mcycleh'),
- (0xF81, 'mtimeh'),
- (0xF82, 'minstreth'),
+ (0xC83, 'hpmcounter3h'),
+ (0xC84, 'hpmcounter4h'),
+ (0xC85, 'hpmcounter5h'),
+ (0xC86, 'hpmcounter6h'),
+ (0xC87, 'hpmcounter7h'),
+ (0xC88, 'hpmcounter8h'),
+ (0xC89, 'hpmcounter9h'),
+ (0xC8A, 'hpmcounter10h'),
+ (0xC8B, 'hpmcounter11h'),
+ (0xC8C, 'hpmcounter12h'),
+ (0xC8D, 'hpmcounter13h'),
+ (0xC8E, 'hpmcounter14h'),
+ (0xC8F, 'hpmcounter15h'),
+ (0xC90, 'hpmcounter16h'),
+ (0xC91, 'hpmcounter17h'),
+ (0xC92, 'hpmcounter18h'),
+ (0xC93, 'hpmcounter19h'),
+ (0xC94, 'hpmcounter20h'),
+ (0xC95, 'hpmcounter21h'),
+ (0xC96, 'hpmcounter22h'),
+ (0xC97, 'hpmcounter23h'),
+ (0xC98, 'hpmcounter24h'),
+ (0xC99, 'hpmcounter25h'),
+ (0xC9A, 'hpmcounter26h'),
+ (0xC9B, 'hpmcounter27h'),
+ (0xC9C, 'hpmcounter28h'),
+ (0xC9D, 'hpmcounter29h'),
+ (0xC9E, 'hpmcounter30h'),
+ (0xC9F, 'hpmcounter31h'),
+
+ # Standard Machine RW
+ (0xB80, 'mcycleh'),
+ (0xB82, 'minstreth'),
+ (0xB83, 'mhpmcounter3h'),
+ (0xB84, 'mhpmcounter4h'),
+ (0xB85, 'mhpmcounter5h'),
+ (0xB86, 'mhpmcounter6h'),
+ (0xB87, 'mhpmcounter7h'),
+ (0xB88, 'mhpmcounter8h'),
+ (0xB89, 'mhpmcounter9h'),
+ (0xB8A, 'mhpmcounter10h'),
+ (0xB8B, 'mhpmcounter11h'),
+ (0xB8C, 'mhpmcounter12h'),
+ (0xB8D, 'mhpmcounter13h'),
+ (0xB8E, 'mhpmcounter14h'),
+ (0xB8F, 'mhpmcounter15h'),
+ (0xB90, 'mhpmcounter16h'),
+ (0xB91, 'mhpmcounter17h'),
+ (0xB92, 'mhpmcounter18h'),
+ (0xB93, 'mhpmcounter19h'),
+ (0xB94, 'mhpmcounter20h'),
+ (0xB95, 'mhpmcounter21h'),
+ (0xB96, 'mhpmcounter22h'),
+ (0xB97, 'mhpmcounter23h'),
+ (0xB98, 'mhpmcounter24h'),
+ (0xB99, 'mhpmcounter25h'),
+ (0xB9A, 'mhpmcounter26h'),
+ (0xB9B, 'mhpmcounter27h'),
+ (0xB9C, 'mhpmcounter28h'),
+ (0xB9D, 'mhpmcounter29h'),
+ (0xB9E, 'mhpmcounter30h'),
+ (0xB9F, 'mhpmcounter31h'),
]
opcode_base = 0