gem5 v24.0.0.0
Loading...
Searching...
No Matches
misc.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013 ARM Limited
3 * Copyright (c) 2014-2015 Sven Karlsson
4 * Copyright (c) 2019 Yifei Liu
5 * Copyright (c) 2020 Barkhausen Institut
6 * Copyright (c) 2021 StreamComputing Corp
7 * All rights reserved
8 *
9 * The license below extends only to copyright in the software and shall
10 * not be construed as granting a license to any other intellectual
11 * property including but not limited to intellectual property relating
12 * to a hardware implementation of the functionality of the software
13 * licensed hereunder. You may use the software subject to the license
14 * terms below provided that you ensure that this notice is replicated
15 * unmodified and in its entirety in all distributions of the software,
16 * modified or unmodified, in source code or in binary form.
17 *
18 * Copyright (c) 2016 RISC-V Foundation
19 * Copyright (c) 2016 The University of Virginia
20 * Copyright (c) 2024 University of Rostock
21 * All rights reserved.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions are
25 * met: redistributions of source code must retain the above copyright
26 * notice, this list of conditions and the following disclaimer;
27 * redistributions in binary form must reproduce the above copyright
28 * notice, this list of conditions and the following disclaimer in the
29 * documentation and/or other materials provided with the distribution;
30 * neither the name of the copyright holders nor the names of its
31 * contributors may be used to endorse or promote products derived from
32 * this software without specific prior written permission.
33 *
34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
37 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
38 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
39 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
41 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
42 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 */
46
47#ifndef __ARCH_RISCV_REGS_MISC_HH__
48#define __ARCH_RISCV_REGS_MISC_HH__
49
50#include <string>
51#include <unordered_map>
52
55#include "arch/riscv/types.hh"
56#include "base/bitunion.hh"
57#include "base/types.hh"
58#include "cpu/reg_class.hh"
59#include "debug/MiscRegs.hh"
60#include "enums/RiscvType.hh"
61
62namespace gem5
63{
64
65namespace RiscvISA
66{
67
69{
147
157 MISCREG_PMPCFG1, // pmpcfg1 is rv32 only
159 MISCREG_PMPCFG3, // pmpcfg3 is rv32 only
176
186
194
202
203 // These registers are not in the standard, hence does not exist in the
204 // CSRData map. These are mainly used to provide a minimal implementation
205 // for non-maskable-interrupt in our simple cpu.
206 // non-maskable-interrupt-vector-base-address: NMI version of xTVEC
208 // non-maskable-interrupt-enable: NMI version of xIE
210 // non-maskable-interrupt-pending: NMI version of xIP
212
213 // the following MicsRegIndex are RV32 only
215
248
250
254 // This CSR shared the same space with MISCREG_FFLAGS
263
266
268 NUM_MISCREGS, debug::MiscRegs);
269
271{
272 CSR_USTATUS = 0x000,
273 CSR_UIE = 0x004,
274 CSR_UTVEC = 0x005,
276 CSR_UEPC = 0x041,
277 CSR_UCAUSE = 0x042,
278 CSR_UTVAL = 0x043,
279 CSR_UIP = 0x044,
280 CSR_FFLAGS = 0x001,
281 CSR_FRM = 0x002,
282 CSR_FCSR = 0x003,
283 CSR_CYCLE = 0xC00,
284 CSR_TIME = 0xC01,
285 CSR_INSTRET = 0xC02,
315
316 // rv32 only csr register begin
317 CSR_CYCLEH = 0xC80,
318 CSR_TIMEH = 0xC81,
349 // rv32 only csr register end
350
351 CSR_SSTATUS = 0x100,
352 CSR_SEDELEG = 0x102,
353 CSR_SIDELEG = 0x103,
354 CSR_SIE = 0x104,
355 CSR_STVEC = 0x105,
358 CSR_SEPC = 0x141,
359 CSR_SCAUSE = 0x142,
360 CSR_STVAL = 0x143,
361 CSR_SIP = 0x144,
362 CSR_SATP = 0x180,
363
365 CSR_MARCHID = 0xF12,
366 CSR_MIMPID = 0xF13,
367 CSR_MHARTID = 0xF14,
368 CSR_MSTATUS = 0x300,
369 CSR_MISA = 0x301,
370 CSR_MEDELEG = 0x302,
371 CSR_MIDELEG = 0x303,
372 CSR_MIE = 0x304,
373 CSR_MTVEC = 0x305,
375 CSR_MSTATUSH = 0x310, // rv32 only
377 CSR_MEPC = 0x341,
378 CSR_MCAUSE = 0x342,
379 CSR_MTVAL = 0x343,
380 CSR_MIP = 0x344,
381 CSR_PMPCFG0 = 0x3A0,
382 CSR_PMPCFG1 = 0x3A1, // pmpcfg1 rv32 only
383 CSR_PMPCFG2 = 0x3A2,
384 CSR_PMPCFG3 = 0x3A3,// pmpcfg3 rv32 only
401 CSR_MCYCLE = 0xB00,
432
433 // rv32 only csr register begin
434 CSR_MCYCLEH = 0xB80,
465 // rv32 only csr register end
466
496
497 CSR_TSELECT = 0x7A0,
498 CSR_TDATA1 = 0x7A1,
499 CSR_TDATA2 = 0x7A2,
500 CSR_TDATA3 = 0x7A3,
501 CSR_DCSR = 0x7B0,
502 CSR_DPC = 0x7B1,
504
505 CSR_VSTART = 0x008,
506 CSR_VXSAT = 0x009,
507 CSR_VXRM = 0x00A,
508 CSR_VCSR = 0x00F,
509 CSR_VL = 0xC20,
510 CSR_VTYPE = 0xC21,
511 CSR_VLENB = 0xC22
513
515{
516 const std::string name;
517 const int physIndex;
518 const uint64_t rvTypes;
519 const uint64_t isaExts;
520};
521
522template <typename... T>
523constexpr uint64_t rvTypeFlags(T... args) {
524 return ((1 << args) | ...);
525}
526
527template <typename... T>
528constexpr uint64_t isaExtsFlags(T... isa_exts) {
529 return ((1ULL << (isa_exts - 'a')) | ...);
530}
531
532constexpr uint64_t isaExtsFlags() {
533 return 0ULL;
534}
535
536const std::unordered_map<int, CSRMetadata> CSRData = {
538 {"ustatus", MISCREG_USTATUS, rvTypeFlags(RV64, RV32),
539 isaExtsFlags('n')}},
540 {CSR_UIE,
541 {"uie", MISCREG_UIE, rvTypeFlags(RV64, RV32), isaExtsFlags('n')}},
542 {CSR_UTVEC,
543 {"utvec", MISCREG_UTVEC, rvTypeFlags(RV64, RV32), isaExtsFlags('n')}},
545 {"uscratch", MISCREG_USCRATCH, rvTypeFlags(RV64, RV32),
546 isaExtsFlags('n')}},
547 {CSR_UEPC,
548 {"uepc", MISCREG_UEPC, rvTypeFlags(RV64, RV32), isaExtsFlags('n')}},
549 {CSR_UCAUSE,
550 {"ucause", MISCREG_UCAUSE, rvTypeFlags(RV64, RV32),
551 isaExtsFlags('n')}},
552 {CSR_UTVAL,
553 {"utval", MISCREG_UTVAL, rvTypeFlags(RV64, RV32), isaExtsFlags('n')}},
554 {CSR_UIP,
555 {"uip", MISCREG_UIP, rvTypeFlags(RV64, RV32), isaExtsFlags('n')}},
556 {CSR_FFLAGS,
557 {"fflags", MISCREG_FFLAGS, rvTypeFlags(RV64, RV32),
558 isaExtsFlags('f')}},
559 {CSR_FRM,
560 {"frm", MISCREG_FRM, rvTypeFlags(RV64, RV32), isaExtsFlags('f')}},
561 {CSR_FCSR,
562 {"fcsr", MISCREG_FCSR, rvTypeFlags(RV64, RV32), isaExtsFlags('f')}},
563 {CSR_CYCLE,
565 {CSR_TIME,
570 {"hpmcounter03", MISCREG_HPMCOUNTER03, rvTypeFlags(RV64, RV32),
571 isaExtsFlags()}},
573 {"hpmcounter04", MISCREG_HPMCOUNTER04, rvTypeFlags(RV64, RV32),
574 isaExtsFlags()}},
576 {"hpmcounter05", MISCREG_HPMCOUNTER05, rvTypeFlags(RV64, RV32),
577 isaExtsFlags()}},
579 {"hpmcounter06", MISCREG_HPMCOUNTER06, rvTypeFlags(RV64, RV32),
580 isaExtsFlags()}},
582 {"hpmcounter07", MISCREG_HPMCOUNTER07, rvTypeFlags(RV64, RV32),
583 isaExtsFlags()}},
585 {"hpmcounter08", MISCREG_HPMCOUNTER08, rvTypeFlags(RV64, RV32),
586 isaExtsFlags()}},
588 {"hpmcounter09", MISCREG_HPMCOUNTER09, rvTypeFlags(RV64, RV32),
589 isaExtsFlags()}},
591 {"hpmcounter10", MISCREG_HPMCOUNTER10, rvTypeFlags(RV64, RV32),
592 isaExtsFlags()}},
594 {"hpmcounter11", MISCREG_HPMCOUNTER11, rvTypeFlags(RV64, RV32),
595 isaExtsFlags()}},
597 {"hpmcounter12", MISCREG_HPMCOUNTER12, rvTypeFlags(RV64, RV32),
598 isaExtsFlags()}},
600 {"hpmcounter13", MISCREG_HPMCOUNTER13, rvTypeFlags(RV64, RV32),
601 isaExtsFlags()}},
603 {"hpmcounter14", MISCREG_HPMCOUNTER14, rvTypeFlags(RV64, RV32),
604 isaExtsFlags()}},
606 {"hpmcounter15", MISCREG_HPMCOUNTER15, rvTypeFlags(RV64, RV32),
607 isaExtsFlags()}},
609 {"hpmcounter16", MISCREG_HPMCOUNTER16, rvTypeFlags(RV64, RV32),
610 isaExtsFlags()}},
612 {"hpmcounter17", MISCREG_HPMCOUNTER17, rvTypeFlags(RV64, RV32),
613 isaExtsFlags()}},
615 {"hpmcounter18", MISCREG_HPMCOUNTER18, rvTypeFlags(RV64, RV32),
616 isaExtsFlags()}},
618 {"hpmcounter19", MISCREG_HPMCOUNTER19, rvTypeFlags(RV64, RV32),
619 isaExtsFlags()}},
621 {"hpmcounter20", MISCREG_HPMCOUNTER20, rvTypeFlags(RV64, RV32),
622 isaExtsFlags()}},
624 {"hpmcounter21", MISCREG_HPMCOUNTER21, rvTypeFlags(RV64, RV32),
625 isaExtsFlags()}},
627 {"hpmcounter22", MISCREG_HPMCOUNTER22, rvTypeFlags(RV64, RV32),
628 isaExtsFlags()}},
630 {"hpmcounter23", MISCREG_HPMCOUNTER23, rvTypeFlags(RV64, RV32),
631 isaExtsFlags()}},
633 {"hpmcounter24", MISCREG_HPMCOUNTER24, rvTypeFlags(RV64, RV32),
634 isaExtsFlags()}},
636 {"hpmcounter25", MISCREG_HPMCOUNTER25, rvTypeFlags(RV64, RV32),
637 isaExtsFlags()}},
639 {"hpmcounter26", MISCREG_HPMCOUNTER26, rvTypeFlags(RV64, RV32),
640 isaExtsFlags()}},
642 {"hpmcounter27", MISCREG_HPMCOUNTER27, rvTypeFlags(RV64, RV32),
643 isaExtsFlags()}},
645 {"hpmcounter28", MISCREG_HPMCOUNTER28, rvTypeFlags(RV64, RV32),
646 isaExtsFlags()}},
648 {"hpmcounter29", MISCREG_HPMCOUNTER29, rvTypeFlags(RV64, RV32),
649 isaExtsFlags()}},
651 {"hpmcounter30", MISCREG_HPMCOUNTER30, rvTypeFlags(RV64, RV32),
652 isaExtsFlags()}},
654 {"hpmcounter31", MISCREG_HPMCOUNTER31, rvTypeFlags(RV64, RV32),
655 isaExtsFlags()}},
656 {CSR_CYCLEH,
658 {CSR_TIMEH,
661 {"instreth", MISCREG_INSTRETH, rvTypeFlags(RV32), isaExtsFlags()}},
663 {"hpmcounter03h", MISCREG_HPMCOUNTER03H, rvTypeFlags(RV32),
664 isaExtsFlags()}},
666 {"hpmcounter04h", MISCREG_HPMCOUNTER04H, rvTypeFlags(RV32),
667 isaExtsFlags()}},
669 {"hpmcounter05h", MISCREG_HPMCOUNTER05H, rvTypeFlags(RV32),
670 isaExtsFlags()}},
672 {"hpmcounter06h", MISCREG_HPMCOUNTER06H, rvTypeFlags(RV32),
673 isaExtsFlags()}},
675 {"hpmcounter07h", MISCREG_HPMCOUNTER07H, rvTypeFlags(RV32),
676 isaExtsFlags()}},
678 {"hpmcounter08h", MISCREG_HPMCOUNTER08H, rvTypeFlags(RV32),
679 isaExtsFlags()}},
681 {"hpmcounter09h", MISCREG_HPMCOUNTER09H, rvTypeFlags(RV32),
682 isaExtsFlags()}},
684 {"hpmcounter10h", MISCREG_HPMCOUNTER10H, rvTypeFlags(RV32),
685 isaExtsFlags()}},
687 {"hpmcounter11h", MISCREG_HPMCOUNTER11H, rvTypeFlags(RV32),
688 isaExtsFlags()}},
690 {"hpmcounter12h", MISCREG_HPMCOUNTER12H, rvTypeFlags(RV32),
691 isaExtsFlags()}},
693 {"hpmcounter13h", MISCREG_HPMCOUNTER13H, rvTypeFlags(RV32),
694 isaExtsFlags()}},
696 {"hpmcounter14h", MISCREG_HPMCOUNTER14H, rvTypeFlags(RV32),
697 isaExtsFlags()}},
699 {"hpmcounter15h", MISCREG_HPMCOUNTER15H, rvTypeFlags(RV32),
700 isaExtsFlags()}},
702 {"hpmcounter16h", MISCREG_HPMCOUNTER16H, rvTypeFlags(RV32),
703 isaExtsFlags()}},
705 {"hpmcounter17h", MISCREG_HPMCOUNTER17H, rvTypeFlags(RV32),
706 isaExtsFlags()}},
708 {"hpmcounter18h", MISCREG_HPMCOUNTER18H, rvTypeFlags(RV32),
709 isaExtsFlags()}},
711 {"hpmcounter19h", MISCREG_HPMCOUNTER19H, rvTypeFlags(RV32),
712 isaExtsFlags()}},
714 {"hpmcounter20h", MISCREG_HPMCOUNTER20H, rvTypeFlags(RV32),
715 isaExtsFlags()}},
717 {"hpmcounter21h", MISCREG_HPMCOUNTER21H, rvTypeFlags(RV32),
718 isaExtsFlags()}},
720 {"hpmcounter22h", MISCREG_HPMCOUNTER22H, rvTypeFlags(RV32),
721 isaExtsFlags()}},
723 {"hpmcounter23h", MISCREG_HPMCOUNTER23H, rvTypeFlags(RV32),
724 isaExtsFlags()}},
726 {"hpmcounter24h", MISCREG_HPMCOUNTER24H, rvTypeFlags(RV32),
727 isaExtsFlags()}},
729 {"hpmcounter25h", MISCREG_HPMCOUNTER25H, rvTypeFlags(RV32),
730 isaExtsFlags()}},
732 {"hpmcounter26h", MISCREG_HPMCOUNTER26H, rvTypeFlags(RV32),
733 isaExtsFlags()}},
735 {"hpmcounter27h", MISCREG_HPMCOUNTER27H, rvTypeFlags(RV32),
736 isaExtsFlags()}},
738 {"hpmcounter28h", MISCREG_HPMCOUNTER28H, rvTypeFlags(RV32),
739 isaExtsFlags()}},
741 {"hpmcounter29h", MISCREG_HPMCOUNTER29H, rvTypeFlags(RV32),
742 isaExtsFlags()}},
744 {"hpmcounter30h", MISCREG_HPMCOUNTER30H, rvTypeFlags(RV32),
745 isaExtsFlags()}},
747 {"hpmcounter31h", MISCREG_HPMCOUNTER31H, rvTypeFlags(RV32),
748 isaExtsFlags()}},
749
751 {"sstatus", MISCREG_SSTATUS, rvTypeFlags(RV64, RV32),
752 isaExtsFlags('s')}},
754 {"sedeleg", MISCREG_SEDELEG, rvTypeFlags(RV64, RV32),
755 isaExtsFlags('s')}},
757 {"sideleg", MISCREG_SIDELEG, rvTypeFlags(RV64, RV32),
758 isaExtsFlags('s')}},
759 {CSR_SIE,
760 {"sie", MISCREG_SIE, rvTypeFlags(RV64, RV32), isaExtsFlags('s')}},
761 {CSR_STVEC,
762 {"stvec", MISCREG_STVEC, rvTypeFlags(RV64, RV32), isaExtsFlags('s')}},
764 {"scounteren", MISCREG_SCOUNTEREN, rvTypeFlags(RV64, RV32),
765 isaExtsFlags('s')}},
767 {"sscratch", MISCREG_SSCRATCH, rvTypeFlags(RV64, RV32),
768 isaExtsFlags('s')}},
769 {CSR_SEPC,
770 {"sepc", MISCREG_SEPC, rvTypeFlags(RV64, RV32), isaExtsFlags('s')}},
771 {CSR_SCAUSE,
772 {"scause", MISCREG_SCAUSE, rvTypeFlags(RV64, RV32),
773 isaExtsFlags('s')}},
774 {CSR_STVAL,
775 {"stval", MISCREG_STVAL, rvTypeFlags(RV64, RV32), isaExtsFlags('s')}},
776 {CSR_SIP,
777 {"sip", MISCREG_SIP, rvTypeFlags(RV64, RV32), isaExtsFlags('s')}},
778 {CSR_SATP,
779 {"satp", MISCREG_SATP, rvTypeFlags(RV64, RV32), isaExtsFlags('s')}},
780
782 {"mvendorid", MISCREG_VENDORID, rvTypeFlags(RV64, RV32),
783 isaExtsFlags()}},
785 {"marchid", MISCREG_ARCHID, rvTypeFlags(RV64, RV32), isaExtsFlags()}},
786 {CSR_MIMPID,
789 {"mhartid", MISCREG_HARTID, rvTypeFlags(RV64, RV32), isaExtsFlags()}},
792 {CSR_MISA,
798 {CSR_MIE,
800 {CSR_MTVEC,
803 {"mcounteren", MISCREG_MCOUNTEREN, rvTypeFlags(RV64, RV32),
804 isaExtsFlags()}},
806 {"mstatush", MISCREG_MSTATUSH, rvTypeFlags(RV32), isaExtsFlags()}},
808 {"mscratch", MISCREG_MSCRATCH, rvTypeFlags(RV64, RV32),
809 isaExtsFlags()}},
810 {CSR_MEPC,
812 {CSR_MCAUSE,
814 {CSR_MTVAL,
816 {CSR_MIP,
820 // pmpcfg1 rv32 only
822 {"pmpcfg1", MISCREG_PMPCFG1, rvTypeFlags(RV32), isaExtsFlags()}},
825 // pmpcfg3 rv32 only
827 {"pmpcfg3", MISCREG_PMPCFG3, rvTypeFlags(RV32), isaExtsFlags()}},
829 {"pmpaddr0", MISCREG_PMPADDR00, rvTypeFlags(RV64, RV32),
830 isaExtsFlags()}},
832 {"pmpaddr1", MISCREG_PMPADDR01, rvTypeFlags(RV64, RV32),
833 isaExtsFlags()}},
835 {"pmpaddr2", MISCREG_PMPADDR02, rvTypeFlags(RV64, RV32),
836 isaExtsFlags()}},
838 {"pmpaddr3", MISCREG_PMPADDR03, rvTypeFlags(RV64, RV32),
839 isaExtsFlags()}},
841 {"pmpaddr4", MISCREG_PMPADDR04, rvTypeFlags(RV64, RV32),
842 isaExtsFlags()}},
844 {"pmpaddr5", MISCREG_PMPADDR05, rvTypeFlags(RV64, RV32),
845 isaExtsFlags()}},
847 {"pmpaddr6", MISCREG_PMPADDR06, rvTypeFlags(RV64, RV32),
848 isaExtsFlags()}},
850 {"pmpaddr7", MISCREG_PMPADDR07, rvTypeFlags(RV64, RV32),
851 isaExtsFlags()}},
853 {"pmpaddr8", MISCREG_PMPADDR08, rvTypeFlags(RV64, RV32),
854 isaExtsFlags()}},
856 {"pmpaddr9", MISCREG_PMPADDR09, rvTypeFlags(RV64, RV32),
857 isaExtsFlags()}},
859 {"pmpaddr10", MISCREG_PMPADDR10, rvTypeFlags(RV64, RV32),
860 isaExtsFlags()}},
862 {"pmpaddr11", MISCREG_PMPADDR11, rvTypeFlags(RV64, RV32),
863 isaExtsFlags()}},
865 {"pmpaddr12", MISCREG_PMPADDR12, rvTypeFlags(RV64, RV32),
866 isaExtsFlags()}},
868 {"pmpaddr13", MISCREG_PMPADDR13, rvTypeFlags(RV64, RV32),
869 isaExtsFlags()}},
871 {"pmpaddr14", MISCREG_PMPADDR14, rvTypeFlags(RV64, RV32),
872 isaExtsFlags()}},
874 {"pmpaddr15", MISCREG_PMPADDR15, rvTypeFlags(RV64, RV32),
875 isaExtsFlags()}},
876 {CSR_MCYCLE,
879 {"minstret", MISCREG_INSTRET, rvTypeFlags(RV64, RV32),
880 isaExtsFlags()}},
882 {"mhpmcounter03", MISCREG_HPMCOUNTER03, rvTypeFlags(RV64, RV32),
883 isaExtsFlags()}},
885 {"mhpmcounter04", MISCREG_HPMCOUNTER04, rvTypeFlags(RV64, RV32),
886 isaExtsFlags()}},
888 {"mhpmcounter05", MISCREG_HPMCOUNTER05, rvTypeFlags(RV64, RV32),
889 isaExtsFlags()}},
891 {"mhpmcounter06", MISCREG_HPMCOUNTER06, rvTypeFlags(RV64, RV32),
892 isaExtsFlags()}},
894 {"mhpmcounter07", MISCREG_HPMCOUNTER07, rvTypeFlags(RV64, RV32),
895 isaExtsFlags()}},
897 {"mhpmcounter08", MISCREG_HPMCOUNTER08, rvTypeFlags(RV64, RV32),
898 isaExtsFlags()}},
900 {"mhpmcounter09", MISCREG_HPMCOUNTER09, rvTypeFlags(RV64, RV32),
901 isaExtsFlags()}},
903 {"mhpmcounter10", MISCREG_HPMCOUNTER10, rvTypeFlags(RV64, RV32),
904 isaExtsFlags()}},
906 {"mhpmcounter11", MISCREG_HPMCOUNTER11, rvTypeFlags(RV64, RV32),
907 isaExtsFlags()}},
909 {"mhpmcounter12", MISCREG_HPMCOUNTER12, rvTypeFlags(RV64, RV32),
910 isaExtsFlags()}},
912 {"mhpmcounter13", MISCREG_HPMCOUNTER13, rvTypeFlags(RV64, RV32),
913 isaExtsFlags()}},
915 {"mhpmcounter14", MISCREG_HPMCOUNTER14, rvTypeFlags(RV64, RV32),
916 isaExtsFlags()}},
918 {"mhpmcounter15", MISCREG_HPMCOUNTER15, rvTypeFlags(RV64, RV32),
919 isaExtsFlags()}},
921 {"mhpmcounter16", MISCREG_HPMCOUNTER16, rvTypeFlags(RV64, RV32),
922 isaExtsFlags()}},
924 {"mhpmcounter17", MISCREG_HPMCOUNTER17, rvTypeFlags(RV64, RV32),
925 isaExtsFlags()}},
927 {"mhpmcounter18", MISCREG_HPMCOUNTER18, rvTypeFlags(RV64, RV32),
928 isaExtsFlags()}},
930 {"mhpmcounter19", MISCREG_HPMCOUNTER19, rvTypeFlags(RV64, RV32),
931 isaExtsFlags()}},
933 {"mhpmcounter20", MISCREG_HPMCOUNTER20, rvTypeFlags(RV64, RV32),
934 isaExtsFlags()}},
936 {"mhpmcounter21", MISCREG_HPMCOUNTER21, rvTypeFlags(RV64, RV32),
937 isaExtsFlags()}},
939 {"mhpmcounter22", MISCREG_HPMCOUNTER22, rvTypeFlags(RV64, RV32),
940 isaExtsFlags()}},
942 {"mhpmcounter23", MISCREG_HPMCOUNTER23, rvTypeFlags(RV64, RV32),
943 isaExtsFlags()}},
945 {"mhpmcounter24", MISCREG_HPMCOUNTER24, rvTypeFlags(RV64, RV32),
946 isaExtsFlags()}},
948 {"mhpmcounter25", MISCREG_HPMCOUNTER25, rvTypeFlags(RV64, RV32),
949 isaExtsFlags()}},
951 {"mhpmcounter26", MISCREG_HPMCOUNTER26, rvTypeFlags(RV64, RV32),
952 isaExtsFlags()}},
954 {"mhpmcounter27", MISCREG_HPMCOUNTER27, rvTypeFlags(RV64, RV32),
955 isaExtsFlags()}},
957 {"mhpmcounter28", MISCREG_HPMCOUNTER28, rvTypeFlags(RV64, RV32),
958 isaExtsFlags()}},
960 {"mhpmcounter29", MISCREG_HPMCOUNTER29, rvTypeFlags(RV64, RV32),
961 isaExtsFlags()}},
963 {"mhpmcounter30", MISCREG_HPMCOUNTER30, rvTypeFlags(RV64, RV32),
964 isaExtsFlags()}},
966 {"mhpmcounter31", MISCREG_HPMCOUNTER31, rvTypeFlags(RV64, RV32),
967 isaExtsFlags()}},
968
970 {"mcycleh", MISCREG_CYCLEH, rvTypeFlags(RV32), isaExtsFlags()}},
972 {"minstreth", MISCREG_INSTRETH, rvTypeFlags(RV32), isaExtsFlags()}},
974 {"mhpmcounter03h", MISCREG_HPMCOUNTER03H, rvTypeFlags(RV32),
975 isaExtsFlags()}},
977 {"mhpmcounter04h", MISCREG_HPMCOUNTER04H, rvTypeFlags(RV32),
978 isaExtsFlags()}},
980 {"mhpmcounter05h", MISCREG_HPMCOUNTER05H, rvTypeFlags(RV32),
981 isaExtsFlags()}},
983 {"mhpmcounter06h", MISCREG_HPMCOUNTER06H, rvTypeFlags(RV32),
984 isaExtsFlags()}},
986 {"mhpmcounter07h", MISCREG_HPMCOUNTER07H, rvTypeFlags(RV32),
987 isaExtsFlags()}},
989 {"mhpmcounter08h", MISCREG_HPMCOUNTER08H, rvTypeFlags(RV32),
990 isaExtsFlags()}},
992 {"mhpmcounter09h", MISCREG_HPMCOUNTER09H, rvTypeFlags(RV32),
993 isaExtsFlags()}},
995 {"mhpmcounter10h", MISCREG_HPMCOUNTER10H, rvTypeFlags(RV32),
996 isaExtsFlags()}},
998 {"mhpmcounter11h", MISCREG_HPMCOUNTER11H, rvTypeFlags(RV32),
999 isaExtsFlags()}},
1001 {"mhpmcounter12h", MISCREG_HPMCOUNTER12H, rvTypeFlags(RV32),
1002 isaExtsFlags()}},
1004 {"mhpmcounter13h", MISCREG_HPMCOUNTER13H, rvTypeFlags(RV32),
1005 isaExtsFlags()}},
1007 {"mhpmcounter14h", MISCREG_HPMCOUNTER14H, rvTypeFlags(RV32),
1008 isaExtsFlags()}},
1010 {"mhpmcounter15h", MISCREG_HPMCOUNTER15H, rvTypeFlags(RV32),
1011 isaExtsFlags()}},
1013 {"mhpmcounter16h", MISCREG_HPMCOUNTER16H, rvTypeFlags(RV32),
1014 isaExtsFlags()}},
1016 {"mhpmcounter17h", MISCREG_HPMCOUNTER17H, rvTypeFlags(RV32),
1017 isaExtsFlags()}},
1019 {"mhpmcounter18h", MISCREG_HPMCOUNTER18H, rvTypeFlags(RV32),
1020 isaExtsFlags()}},
1022 {"mhpmcounter19h", MISCREG_HPMCOUNTER19H, rvTypeFlags(RV32),
1023 isaExtsFlags()}},
1025 {"mhpmcounter20h", MISCREG_HPMCOUNTER20H, rvTypeFlags(RV32),
1026 isaExtsFlags()}},
1028 {"mhpmcounter21h", MISCREG_HPMCOUNTER21H, rvTypeFlags(RV32),
1029 isaExtsFlags()}},
1031 {"mhpmcounter22h", MISCREG_HPMCOUNTER22H, rvTypeFlags(RV32),
1032 isaExtsFlags()}},
1034 {"mhpmcounter23h", MISCREG_HPMCOUNTER23H, rvTypeFlags(RV32),
1035 isaExtsFlags()}},
1037 {"mhpmcounter24h", MISCREG_HPMCOUNTER24H, rvTypeFlags(RV32),
1038 isaExtsFlags()}},
1040 {"mhpmcounter25h", MISCREG_HPMCOUNTER25H, rvTypeFlags(RV32),
1041 isaExtsFlags()}},
1043 {"mhpmcounter26h", MISCREG_HPMCOUNTER26H, rvTypeFlags(RV32),
1044 isaExtsFlags()}},
1046 {"mhpmcounter27h", MISCREG_HPMCOUNTER27H, rvTypeFlags(RV32),
1047 isaExtsFlags()}},
1049 {"mhpmcounter28h", MISCREG_HPMCOUNTER28H, rvTypeFlags(RV32),
1050 isaExtsFlags()}},
1052 {"mhpmcounter29h", MISCREG_HPMCOUNTER29H, rvTypeFlags(RV32),
1053 isaExtsFlags()}},
1055 {"mhpmcounter30h", MISCREG_HPMCOUNTER30H, rvTypeFlags(RV32),
1056 isaExtsFlags()}},
1058 {"mhpmcounter31h", MISCREG_HPMCOUNTER31H, rvTypeFlags(RV32),
1059 isaExtsFlags()}},
1060
1062 {"mhpmevent03", MISCREG_HPMEVENT03, rvTypeFlags(RV64, RV32),
1063 isaExtsFlags()}},
1065 {"mhpmevent04", MISCREG_HPMEVENT04, rvTypeFlags(RV64, RV32),
1066 isaExtsFlags()}},
1068 {"mhpmevent05", MISCREG_HPMEVENT05, rvTypeFlags(RV64, RV32),
1069 isaExtsFlags()}},
1071 {"mhpmevent06", MISCREG_HPMEVENT06, rvTypeFlags(RV64, RV32),
1072 isaExtsFlags()}},
1074 {"mhpmevent07", MISCREG_HPMEVENT07, rvTypeFlags(RV64, RV32),
1075 isaExtsFlags()}},
1077 {"mhpmevent08", MISCREG_HPMEVENT08, rvTypeFlags(RV64, RV32),
1078 isaExtsFlags()}},
1080 {"mhpmevent09", MISCREG_HPMEVENT09, rvTypeFlags(RV64, RV32),
1081 isaExtsFlags()}},
1083 {"mhpmevent10", MISCREG_HPMEVENT10, rvTypeFlags(RV64, RV32),
1084 isaExtsFlags()}},
1086 {"mhpmevent11", MISCREG_HPMEVENT11, rvTypeFlags(RV64, RV32),
1087 isaExtsFlags()}},
1089 {"mhpmevent12", MISCREG_HPMEVENT12, rvTypeFlags(RV64, RV32),
1090 isaExtsFlags()}},
1092 {"mhpmevent13", MISCREG_HPMEVENT13, rvTypeFlags(RV64, RV32),
1093 isaExtsFlags()}},
1095 {"mhpmevent14", MISCREG_HPMEVENT14, rvTypeFlags(RV64, RV32),
1096 isaExtsFlags()}},
1098 {"mhpmevent15", MISCREG_HPMEVENT15, rvTypeFlags(RV64, RV32),
1099 isaExtsFlags()}},
1101 {"mhpmevent16", MISCREG_HPMEVENT16, rvTypeFlags(RV64, RV32),
1102 isaExtsFlags()}},
1104 {"mhpmevent17", MISCREG_HPMEVENT17, rvTypeFlags(RV64, RV32),
1105 isaExtsFlags()}},
1107 {"mhpmevent18", MISCREG_HPMEVENT18, rvTypeFlags(RV64, RV32),
1108 isaExtsFlags()}},
1110 {"mhpmevent19", MISCREG_HPMEVENT19, rvTypeFlags(RV64, RV32),
1111 isaExtsFlags()}},
1113 {"mhpmevent20", MISCREG_HPMEVENT20, rvTypeFlags(RV64, RV32),
1114 isaExtsFlags()}},
1116 {"mhpmevent21", MISCREG_HPMEVENT21, rvTypeFlags(RV64, RV32),
1117 isaExtsFlags()}},
1119 {"mhpmevent22", MISCREG_HPMEVENT22, rvTypeFlags(RV64, RV32),
1120 isaExtsFlags()}},
1122 {"mhpmevent23", MISCREG_HPMEVENT23, rvTypeFlags(RV64, RV32),
1123 isaExtsFlags()}},
1125 {"mhpmevent24", MISCREG_HPMEVENT24, rvTypeFlags(RV64, RV32),
1126 isaExtsFlags()}},
1128 {"mhpmevent25", MISCREG_HPMEVENT25, rvTypeFlags(RV64, RV32),
1129 isaExtsFlags()}},
1131 {"mhpmevent26", MISCREG_HPMEVENT26, rvTypeFlags(RV64, RV32),
1132 isaExtsFlags()}},
1134 {"mhpmevent27", MISCREG_HPMEVENT27, rvTypeFlags(RV64, RV32),
1135 isaExtsFlags()}},
1137 {"mhpmevent28", MISCREG_HPMEVENT28, rvTypeFlags(RV64, RV32),
1138 isaExtsFlags()}},
1140 {"mhpmevent29", MISCREG_HPMEVENT29, rvTypeFlags(RV64, RV32),
1141 isaExtsFlags()}},
1143 {"mhpmevent30", MISCREG_HPMEVENT30, rvTypeFlags(RV64, RV32),
1144 isaExtsFlags()}},
1146 {"mhpmevent31", MISCREG_HPMEVENT31, rvTypeFlags(RV64, RV32),
1147 isaExtsFlags()}},
1148
1149 {CSR_TSELECT,
1150 {"tselect", MISCREG_TSELECT, rvTypeFlags(RV64, RV32), isaExtsFlags()}},
1151 {CSR_TDATA1,
1152 {"tdata1", MISCREG_TDATA1, rvTypeFlags(RV64, RV32), isaExtsFlags()}},
1153 {CSR_TDATA2,
1154 {"tdata2", MISCREG_TDATA2, rvTypeFlags(RV64, RV32), isaExtsFlags()}},
1155 {CSR_TDATA3,
1156 {"tdata3", MISCREG_TDATA3, rvTypeFlags(RV64, RV32), isaExtsFlags()}},
1157 {CSR_DCSR,
1159 {CSR_DPC,
1161 {CSR_DSCRATCH,
1162 {"dscratch", MISCREG_DSCRATCH, rvTypeFlags(RV64, RV32),
1163 isaExtsFlags()}},
1164
1165 {CSR_VSTART,
1166 {"vstart", MISCREG_VSTART, rvTypeFlags(RV64, RV32),
1167 isaExtsFlags('v')}},
1168 {CSR_VXSAT,
1169 {"vxsat", MISCREG_VXSAT, rvTypeFlags(RV64, RV32), isaExtsFlags('v')}},
1170 {CSR_VXRM,
1171 {"vxrm", MISCREG_VXRM, rvTypeFlags(RV64, RV32), isaExtsFlags('v')}},
1172 {CSR_VCSR,
1173 {"vcsr", MISCREG_VCSR, rvTypeFlags(RV64, RV32), isaExtsFlags('v')}},
1174 {CSR_VL,
1175 {"vl", MISCREG_VL, rvTypeFlags(RV64, RV32), isaExtsFlags('v')}},
1176 {CSR_VTYPE,
1177 {"vtype", MISCREG_VTYPE, rvTypeFlags(RV64, RV32), isaExtsFlags('v')}},
1178 {CSR_VLENB,
1179 {"VLENB", MISCREG_VLENB, rvTypeFlags(RV64, RV32), isaExtsFlags('v')}}
1180};
1181
1190 Bitfield<63> rv64_sd;
1191 Bitfield<35, 34> sxl;
1192 Bitfield<33, 32> uxl;
1193 Bitfield<31> rv32_sd;
1194 Bitfield<22> tsr;
1195 Bitfield<21> tw;
1196 Bitfield<20> tvm;
1197 Bitfield<19> mxr;
1198 Bitfield<18> sum;
1199 Bitfield<17> mprv;
1200 Bitfield<16, 15> xs;
1201 Bitfield<14, 13> fs;
1202 Bitfield<12, 11> mpp;
1203 Bitfield<10, 9> vs;
1204 Bitfield<8> spp;
1205 Bitfield<7> mpie;
1206 Bitfield<5> spie;
1207 Bitfield<4> upie;
1208 Bitfield<3> mie;
1209 Bitfield<1> sie;
1210 Bitfield<0> uie;
1212
1213
1218BitUnion64(MISA)
1219 Bitfield<63, 62> rv64_mxl;
1220 Bitfield<31, 30> rv32_mxl;
1221 Bitfield<23> rvx;
1222 Bitfield<21> rvv;
1223 Bitfield<20> rvu;
1224 Bitfield<19> rvt;
1225 Bitfield<18> rvs;
1226 Bitfield<16> rvq;
1227 Bitfield<15> rvp;
1228 Bitfield<13> rvn;
1229 Bitfield<12> rvm;
1230 Bitfield<11> rvl;
1231 Bitfield<10> rvk;
1232 Bitfield<9> rvj;
1233 Bitfield<8> rvi;
1234 Bitfield<7> rvh;
1235 Bitfield<6> rvg;
1236 Bitfield<5> rvf;
1237 Bitfield<4> rve;
1238 Bitfield<3> rvd;
1239 Bitfield<2> rvc;
1240 Bitfield<1> rvb;
1241 Bitfield<0> rva;
1243
1251 Bitfield<63,16> local;
1252 Bitfield<11> mei;
1253 Bitfield<9> sei;
1254 Bitfield<8> uei;
1255 Bitfield<7> mti;
1256 Bitfield<5> sti;
1257 Bitfield<4> uti;
1258 Bitfield<3> msi;
1259 Bitfield<1> ssi;
1260 Bitfield<0> usi;
1262
1263const off_t MXL_OFFSETS[enums::Num_RiscvType] = {
1264 [RV32] = (sizeof(uint32_t) * 8 - 2),
1265 [RV64] = (sizeof(uint64_t) * 8 - 2),
1266};
1267const off_t MBE_OFFSET[enums::Num_RiscvType] = {
1268 [RV32] = 5,
1269 [RV64] = 37,
1270};
1271const off_t SBE_OFFSET[enums::Num_RiscvType] = {
1272 [RV32] = 4,
1273 [RV64] = 36,
1274};
1275const off_t SXL_OFFSET = 34;
1276const off_t UXL_OFFSET = 32;
1277const off_t FS_OFFSET = 13;
1278const off_t VS_OFFSET = 9;
1279const off_t FRM_OFFSET = 5;
1280
1281const RegVal ISA_MXL_MASKS[enums::Num_RiscvType] = {
1282 [RV32] = 3ULL << MXL_OFFSETS[RV32],
1283 [RV64] = 3ULL << MXL_OFFSETS[RV64],
1284};
1286const RegVal ISA_EXT_C_MASK = 1UL << ('c' - 'a');
1287const RegVal MISA_MASKS[enums::Num_RiscvType] = {
1290};
1291
1292
1293const RegVal STATUS_SD_MASKS[enums::Num_RiscvType] = {
1294 [RV32] = 1ULL << ((sizeof(uint32_t) * 8) - 1),
1295 [RV64] = 1ULL << ((sizeof(uint64_t) * 8) - 1),
1296};
1297const RegVal STATUS_MBE_MASK[enums::Num_RiscvType] = {
1298 [RV32] = 1ULL << MBE_OFFSET[RV32],
1299 [RV64] = 1ULL << MBE_OFFSET[RV64],
1300};
1301const RegVal STATUS_SBE_MASK[enums::Num_RiscvType] = {
1302 [RV32] = 1ULL << SBE_OFFSET[RV32],
1303 [RV64] = 1ULL << SBE_OFFSET[RV64],
1304};
1307const RegVal STATUS_TSR_MASK = 1ULL << 22;
1308const RegVal STATUS_TW_MASK = 1ULL << 21;
1309const RegVal STATUS_TVM_MASK = 1ULL << 20;
1310const RegVal STATUS_MXR_MASK = 1ULL << 19;
1311const RegVal STATUS_SUM_MASK = 1ULL << 18;
1312const RegVal STATUS_MPRV_MASK = 1ULL << 17;
1313const RegVal STATUS_XS_MASK = 3ULL << 15;
1315const RegVal STATUS_MPP_MASK = 3ULL << 11;
1317const RegVal STATUS_SPP_MASK = 1ULL << 8;
1318const RegVal STATUS_MPIE_MASK = 1ULL << 7;
1319const RegVal STATUS_SPIE_MASK = 1ULL << 5;
1320const RegVal STATUS_UPIE_MASK = 1ULL << 4;
1321const RegVal STATUS_MIE_MASK = 1ULL << 3;
1322const RegVal STATUS_SIE_MASK = 1ULL << 1;
1323const RegVal STATUS_UIE_MASK = 1ULL << 0;
1324const RegVal
1325MSTATUS_MASKS[enums::Num_RiscvType][enums::Num_PrivilegeModeSet] = {
1326 [RV32] = {
1327 [enums::M] = STATUS_SD_MASKS[RV32] |
1330 [enums::MU] = STATUS_SD_MASKS[RV32] | STATUS_TW_MASK |
1334 [enums::MNU] = STATUS_SD_MASKS[RV32] | STATUS_TW_MASK |
1340 [enums::MSU] = STATUS_SD_MASKS[RV32] | STATUS_TSR_MASK |
1347 [enums::MNSU] = STATUS_SD_MASKS[RV32] | STATUS_TSR_MASK |
1355 },
1356 [RV64] = {
1357 [enums::M] = STATUS_SD_MASKS[RV64] | STATUS_MBE_MASK[RV64] |
1360 [enums::MU] = STATUS_SD_MASKS[RV64] | STATUS_MBE_MASK[RV64] |
1364 [enums::MNU] = STATUS_SD_MASKS[RV64] | STATUS_MBE_MASK[RV64] |
1370 [enums::MSU] = STATUS_SD_MASKS[RV64] |
1379 [enums::MNSU] = STATUS_SD_MASKS[RV64] |
1388 },
1389};
1390// rv32 only
1391const RegVal MSTATUSH_MASKS[enums::Num_PrivilegeModeSet] = {
1392 [enums::M] = STATUS_MBE_MASK[RV32],
1393 [enums::MU] = STATUS_MBE_MASK[RV32],
1394 [enums::MNU] = STATUS_MBE_MASK[RV32],
1395 [enums::MSU] = STATUS_MBE_MASK[RV32] | STATUS_SBE_MASK[RV32],
1396 [enums::MNSU] = STATUS_MBE_MASK[RV32] | STATUS_SBE_MASK[RV32],
1397};
1398const RegVal
1399SSTATUS_MASKS[enums::Num_RiscvType][enums::Num_PrivilegeModeSet] = {
1400 [RV32] = {
1401 [enums::M] = 0ULL,
1402 [enums::MU] = 0ULL,
1403 [enums::MNU] = 0ULL,
1404 [enums::MSU] = STATUS_SD_MASKS[RV32] | STATUS_MXR_MASK |
1408 [enums::MNSU] = STATUS_SD_MASKS[RV32] | STATUS_MXR_MASK |
1413 },
1414 [RV64] = {
1415 [enums::M] = 0ULL,
1416 [enums::MU] = 0ULL,
1417 [enums::MNU] = 0ULL,
1418 [enums::MSU] = STATUS_SD_MASKS[RV64] | STATUS_UXL_MASK |
1422 [enums::MNSU] = STATUS_SD_MASKS[RV64] | STATUS_UXL_MASK |
1427 },
1428};
1429const RegVal
1430USTATUS_MASKS[enums::Num_RiscvType][enums::Num_PrivilegeModeSet] = {
1431 [RV32] = {
1432 [enums::M] = 0ULL,
1433 [enums::MU] = 0ULL,
1434 [enums::MNU] = STATUS_SD_MASKS[RV32] |
1437 [enums::MSU] = 0ULL,
1438 [enums::MNSU] = STATUS_SD_MASKS[RV32] | STATUS_MXR_MASK |
1442 },
1443 [RV64] = {
1444 [enums::M] = 0ULL,
1445 [enums::MU] = 0ULL,
1446 [enums::MNU] = STATUS_SD_MASKS[RV64] |
1449 [enums::MSU] = 0ULL,
1450 [enums::MNSU] = STATUS_SD_MASKS[RV64] | STATUS_MXR_MASK |
1454 },
1455};
1456
1457const RegVal LOCAL_MASK = mask(63,16);
1458const RegVal MEI_MASK = 1ULL << 11;
1459const RegVal SEI_MASK = 1ULL << 9;
1460const RegVal UEI_MASK = 1ULL << 8;
1461const RegVal MTI_MASK = 1ULL << 7;
1462const RegVal STI_MASK = 1ULL << 5;
1463const RegVal UTI_MASK = 1ULL << 4;
1464const RegVal MSI_MASK = 1ULL << 3;
1465const RegVal SSI_MASK = 1ULL << 1;
1466const RegVal USI_MASK = 1ULL << 0;
1467const RegVal MI_MASK[enums::Num_PrivilegeModeSet] = {
1468 [enums::M] = LOCAL_MASK | MEI_MASK| MTI_MASK | MSI_MASK,
1469 [enums::MU] = LOCAL_MASK | MEI_MASK| MTI_MASK | MSI_MASK,
1470 [enums::MNU] = LOCAL_MASK | MEI_MASK | UEI_MASK | MTI_MASK | UTI_MASK |
1472 [enums::MSU] = LOCAL_MASK | MEI_MASK | SEI_MASK | MTI_MASK | STI_MASK |
1474 [enums::MNSU] = LOCAL_MASK | MEI_MASK | SEI_MASK | UEI_MASK |
1477};
1478const RegVal SI_MASK[enums::Num_PrivilegeModeSet] = {
1479 [enums::M] = 0ULL,
1480 [enums::MU] = 0ULL,
1481 [enums::MNU] = UEI_MASK | UTI_MASK | USI_MASK,
1482 [enums::MSU] = SEI_MASK | STI_MASK | SSI_MASK,
1483 [enums::MNSU] = SEI_MASK | UEI_MASK |
1484 STI_MASK | UTI_MASK |
1486};
1487const RegVal UI_MASK[enums::Num_PrivilegeModeSet] = {
1488 [enums::M] = 0ULL,
1489 [enums::MU] = 0ULL,
1490 [enums::MNU] = UEI_MASK | UTI_MASK | USI_MASK,
1491 [enums::MSU] = 0ULL,
1492 [enums::MNSU] = UEI_MASK | UTI_MASK | USI_MASK,
1493};
1494const RegVal FFLAGS_MASK = (1 << FRM_OFFSET) - 1;
1495const RegVal FRM_MASK = 0x7;
1496
1497const RegVal CAUSE_INTERRUPT_MASKS[enums::Num_RiscvType] = {
1498 [RV32] = (1ULL << 31),
1499 [RV64] = (1ULL << 63),
1500};
1501
1502const std::unordered_map<int, RegVal>
1503CSRMasks[enums::Num_RiscvType][enums::Num_PrivilegeModeSet] = {
1504 [RV32] = {
1505 [enums::M] = {
1506 {CSR_USTATUS, USTATUS_MASKS[RV32][enums::M]},
1507 {CSR_UIE, UI_MASK[enums::M]},
1508 {CSR_UIP, UI_MASK[enums::M]},
1510 {CSR_FRM, FRM_MASK},
1512 {CSR_SSTATUS, SSTATUS_MASKS[RV32][enums::M]},
1513 {CSR_SIE, SI_MASK[enums::M]},
1514 {CSR_SIP, SI_MASK[enums::M]},
1515 {CSR_MSTATUS, MSTATUS_MASKS[RV32][enums::M]},
1517 {CSR_MIE, MI_MASK[enums::M]},
1518 {CSR_MSTATUSH, MSTATUSH_MASKS[enums::M]},
1519 {CSR_MIP, MI_MASK[enums::M]},
1520 },
1521 [enums::MU] = {
1522 {CSR_USTATUS, USTATUS_MASKS[RV32][enums::MU]},
1523 {CSR_UIE, UI_MASK[enums::MU]},
1524 {CSR_UIP, UI_MASK[enums::MU]},
1526 {CSR_FRM, FRM_MASK},
1528 {CSR_SSTATUS, SSTATUS_MASKS[RV32][enums::MU]},
1529 {CSR_SIE, SI_MASK[enums::MU]},
1530 {CSR_SIP, SI_MASK[enums::MU]},
1531 {CSR_MSTATUS, MSTATUS_MASKS[RV32][enums::MU]},
1533 {CSR_MIE, MI_MASK[enums::MU]},
1534 {CSR_MSTATUSH, MSTATUSH_MASKS[enums::MU]},
1535 {CSR_MIP, MI_MASK[enums::MU]},
1536 },
1537 [enums::MNU] = {
1538 {CSR_USTATUS, USTATUS_MASKS[RV32][enums::MNU]},
1539 {CSR_UIE, UI_MASK[enums::MNU]},
1540 {CSR_UIP, UI_MASK[enums::MNU]},
1542 {CSR_FRM, FRM_MASK},
1544 {CSR_SSTATUS, SSTATUS_MASKS[RV32][enums::MNU]},
1545 {CSR_SIE, SI_MASK[enums::MNU]},
1546 {CSR_SIP, SI_MASK[enums::MNU]},
1547 {CSR_MSTATUS, MSTATUS_MASKS[RV32][enums::MNU]},
1549 {CSR_MIE, MI_MASK[enums::MNU]},
1550 {CSR_MSTATUSH, MSTATUSH_MASKS[enums::MNU]},
1551 {CSR_MIP, MI_MASK[enums::MNU]},
1552 },
1553 [enums::MSU] = {
1554 {CSR_USTATUS, USTATUS_MASKS[RV32][enums::MSU]},
1555 {CSR_UIE, UI_MASK[enums::MSU]},
1556 {CSR_UIP, UI_MASK[enums::MSU]},
1558 {CSR_FRM, FRM_MASK},
1560 {CSR_SSTATUS, SSTATUS_MASKS[RV32][enums::MSU]},
1561 {CSR_SIE, SI_MASK[enums::MSU]},
1562 {CSR_SIP, SI_MASK[enums::MSU]},
1563 {CSR_MSTATUS, MSTATUS_MASKS[RV32][enums::MSU]},
1565 {CSR_MIE, MI_MASK[enums::MSU]},
1566 {CSR_MSTATUSH, MSTATUSH_MASKS[enums::MSU]},
1567 {CSR_MIP, MI_MASK[enums::MSU]},
1568 },
1569 [enums::MNSU] = {
1570 {CSR_USTATUS, USTATUS_MASKS[RV32][enums::MNSU]},
1571 {CSR_UIE, UI_MASK[enums::MNSU]},
1572 {CSR_UIP, UI_MASK[enums::MNSU]},
1574 {CSR_FRM, FRM_MASK},
1576 {CSR_SSTATUS, SSTATUS_MASKS[RV32][enums::MNSU]},
1577 {CSR_SIE, SI_MASK[enums::MNSU]},
1578 {CSR_SIP, SI_MASK[enums::MNSU]},
1579 {CSR_MSTATUS, MSTATUS_MASKS[RV32][enums::MNSU]},
1581 {CSR_MIE, MI_MASK[enums::MNSU]},
1582 {CSR_MSTATUSH, MSTATUSH_MASKS[enums::MNSU]},
1583 {CSR_MIP, MI_MASK[enums::MNSU]},
1584 },
1585 },
1586 [RV64] = {
1587 [enums::M] = {
1588 {CSR_USTATUS, USTATUS_MASKS[RV64][enums::M]},
1589 {CSR_UIE, UI_MASK[enums::M]},
1590 {CSR_UIP, UI_MASK[enums::M]},
1592 {CSR_FRM, FRM_MASK},
1594 {CSR_SSTATUS, SSTATUS_MASKS[RV64][enums::M]},
1595 {CSR_SIE, SI_MASK[enums::M]},
1596 {CSR_SIP, SI_MASK[enums::M]},
1597 {CSR_MSTATUS, MSTATUS_MASKS[RV64][enums::M]},
1599 {CSR_MIE, MI_MASK[enums::M]},
1600 {CSR_MIP, MI_MASK[enums::M]},
1601 },
1602 [enums::MU] = {
1603 {CSR_USTATUS, USTATUS_MASKS[RV64][enums::MU]},
1604 {CSR_UIE, UI_MASK[enums::MU]},
1605 {CSR_UIP, UI_MASK[enums::MU]},
1607 {CSR_FRM, FRM_MASK},
1609 {CSR_SSTATUS, SSTATUS_MASKS[RV64][enums::MU]},
1610 {CSR_SIE, SI_MASK[enums::MU]},
1611 {CSR_SIP, SI_MASK[enums::MU]},
1612 {CSR_MSTATUS, MSTATUS_MASKS[RV64][enums::MU]},
1614 {CSR_MIE, MI_MASK[enums::MU]},
1615 {CSR_MIP, MI_MASK[enums::MU]},
1616 },
1617 [enums::MNU] = {
1618 {CSR_USTATUS, USTATUS_MASKS[RV64][enums::MNU]},
1619 {CSR_UIE, UI_MASK[enums::MNU]},
1620 {CSR_UIP, UI_MASK[enums::MNU]},
1622 {CSR_FRM, FRM_MASK},
1624 {CSR_SSTATUS, SSTATUS_MASKS[RV64][enums::MNU]},
1625 {CSR_SIE, SI_MASK[enums::MNU]},
1626 {CSR_SIP, SI_MASK[enums::MNU]},
1627 {CSR_MSTATUS, MSTATUS_MASKS[RV64][enums::MNU]},
1629 {CSR_MIE, MI_MASK[enums::MNU]},
1630 {CSR_MIP, MI_MASK[enums::MNU]},
1631 },
1632 [enums::MSU] = {
1633 {CSR_USTATUS, USTATUS_MASKS[RV64][enums::MSU]},
1634 {CSR_UIE, UI_MASK[enums::MSU]},
1635 {CSR_UIP, UI_MASK[enums::MSU]},
1637 {CSR_FRM, FRM_MASK},
1639 {CSR_SSTATUS, SSTATUS_MASKS[RV64][enums::MSU]},
1640 {CSR_SIE, SI_MASK[enums::MSU]},
1641 {CSR_SIP, SI_MASK[enums::MSU]},
1642 {CSR_MSTATUS, MSTATUS_MASKS[RV64][enums::MSU]},
1644 {CSR_MIE, MI_MASK[enums::MSU]},
1645 {CSR_MIP, MI_MASK[enums::MSU]},
1646 },
1647 [enums::MNSU] = {
1648 {CSR_USTATUS, USTATUS_MASKS[RV64][enums::MNSU]},
1649 {CSR_UIE, UI_MASK[enums::MNSU]},
1650 {CSR_UIP, UI_MASK[enums::MNSU]},
1652 {CSR_FRM, FRM_MASK},
1654 {CSR_SSTATUS, SSTATUS_MASKS[RV64][enums::MNSU]},
1655 {CSR_SIE, SI_MASK[enums::MNSU]},
1656 {CSR_SIP, SI_MASK[enums::MNSU]},
1657 {CSR_MSTATUS, MSTATUS_MASKS[RV64][enums::MNSU]},
1659 {CSR_MIE, MI_MASK[enums::MNSU]},
1660 {CSR_MIP, MI_MASK[enums::MNSU]},
1661 },
1662 },
1663};
1664
1665} // namespace RiscvISA
1666} // namespace gem5
1667
1668#endif // __ARCH_RISCV_REGS_MISC_HH__
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
#define BitUnion64(name)
Use this to define conveniently sized values overlayed with bitfields.
Definition bitunion.hh:494
#define EndBitUnion(name)
This closes off the class and union started by the above macro.
Definition bitunion.hh:428
constexpr RegClass miscRegClass
Definition misc.hh:2937
const RegVal STATUS_TSR_MASK
Definition misc.hh:1307
const RegVal UI_MASK[enums::Num_PrivilegeModeSet]
Definition misc.hh:1487
const RegVal MSTATUSH_MASKS[enums::Num_PrivilegeModeSet]
Definition misc.hh:1391
Bitfield< 3 > rvd
Definition misc.hh:1238
const RegVal SI_MASK[enums::Num_PrivilegeModeSet]
Definition misc.hh:1478
Bitfield< 3 > msi
Definition misc.hh:1258
Bitfield< 0 > uie
Definition misc.hh:1210
Bitfield< 12, 11 > mpp
Definition misc.hh:1202
Bitfield< 21 > tw
Definition misc.hh:1195
constexpr uint64_t isaExtsFlags()
Definition misc.hh:532
@ CSR_MHPMEVENT19
Definition misc.hh:483
@ CSR_HPMCOUNTER18
Definition misc.hh:301
@ CSR_HPMCOUNTER05H
Definition misc.hh:322
@ CSR_HPMCOUNTER11
Definition misc.hh:294
@ CSR_HPMCOUNTER03H
Definition misc.hh:320
@ CSR_HPMCOUNTER05
Definition misc.hh:288
@ CSR_MHPMCOUNTER25H
Definition misc.hh:458
@ CSR_MHPMEVENT27
Definition misc.hh:491
@ CSR_MHPMCOUNTER07H
Definition misc.hh:440
@ CSR_HPMCOUNTER23
Definition misc.hh:306
@ CSR_MHPMCOUNTER03H
Definition misc.hh:436
@ CSR_MHPMEVENT17
Definition misc.hh:481
@ CSR_HPMCOUNTER20H
Definition misc.hh:337
@ CSR_HPMCOUNTER17
Definition misc.hh:300
@ CSR_MHPMEVENT21
Definition misc.hh:485
@ CSR_MHPMCOUNTER07
Definition misc.hh:407
@ CSR_HPMCOUNTER16
Definition misc.hh:299
@ CSR_HPMCOUNTER15
Definition misc.hh:298
@ CSR_HPMCOUNTER06H
Definition misc.hh:323
@ CSR_HPMCOUNTER07
Definition misc.hh:290
@ CSR_HPMCOUNTER27
Definition misc.hh:310
@ CSR_HPMCOUNTER08
Definition misc.hh:291
@ CSR_MHPMCOUNTER21H
Definition misc.hh:454
@ CSR_HPMCOUNTER21
Definition misc.hh:304
@ CSR_HPMCOUNTER24
Definition misc.hh:307
@ CSR_MHPMCOUNTER29H
Definition misc.hh:462
@ CSR_MHPMCOUNTER12H
Definition misc.hh:445
@ CSR_MHPMEVENT22
Definition misc.hh:486
@ CSR_MHPMCOUNTER16
Definition misc.hh:416
@ CSR_MHPMEVENT06
Definition misc.hh:470
@ CSR_MHPMCOUNTER23
Definition misc.hh:423
@ CSR_MHPMEVENT05
Definition misc.hh:469
@ CSR_MHPMCOUNTER22
Definition misc.hh:422
@ CSR_MHPMCOUNTER10H
Definition misc.hh:443
@ CSR_MHPMEVENT13
Definition misc.hh:477
@ CSR_HPMCOUNTER29
Definition misc.hh:312
@ CSR_MHPMCOUNTER06
Definition misc.hh:406
@ CSR_HPMCOUNTER04
Definition misc.hh:287
@ CSR_MHPMCOUNTER05H
Definition misc.hh:438
@ CSR_HPMCOUNTER25
Definition misc.hh:308
@ CSR_MHPMEVENT20
Definition misc.hh:484
@ CSR_HPMCOUNTER10H
Definition misc.hh:327
@ CSR_HPMCOUNTER26
Definition misc.hh:309
@ CSR_HPMCOUNTER11H
Definition misc.hh:328
@ CSR_MHPMEVENT31
Definition misc.hh:495
@ CSR_HPMCOUNTER28
Definition misc.hh:311
@ CSR_MHPMCOUNTER29
Definition misc.hh:429
@ CSR_MHPMCOUNTER15
Definition misc.hh:415
@ CSR_MHPMEVENT14
Definition misc.hh:478
@ CSR_HPMCOUNTER10
Definition misc.hh:293
@ CSR_MHPMCOUNTER28
Definition misc.hh:428
@ CSR_MHPMCOUNTER09H
Definition misc.hh:442
@ CSR_HPMCOUNTER19H
Definition misc.hh:336
@ CSR_MHPMCOUNTER13H
Definition misc.hh:446
@ CSR_MHPMCOUNTER27
Definition misc.hh:427
@ CSR_MHPMCOUNTER16H
Definition misc.hh:449
@ CSR_MHPMCOUNTER03
Definition misc.hh:403
@ CSR_HPMCOUNTER04H
Definition misc.hh:321
@ CSR_MHPMEVENT07
Definition misc.hh:471
@ CSR_MHPMCOUNTER11
Definition misc.hh:411
@ CSR_MHPMCOUNTER26H
Definition misc.hh:459
@ CSR_HPMCOUNTER07H
Definition misc.hh:324
@ CSR_MHPMCOUNTER17H
Definition misc.hh:450
@ CSR_MHPMEVENT03
Definition misc.hh:467
@ CSR_HPMCOUNTER30
Definition misc.hh:313
@ CSR_HPMCOUNTER28H
Definition misc.hh:345
@ CSR_HPMCOUNTER25H
Definition misc.hh:342
@ CSR_HPMCOUNTER17H
Definition misc.hh:334
@ CSR_HPMCOUNTER29H
Definition misc.hh:346
@ CSR_MHPMEVENT08
Definition misc.hh:472
@ CSR_MHPMEVENT25
Definition misc.hh:489
@ CSR_MHPMCOUNTER22H
Definition misc.hh:455
@ CSR_HPMCOUNTER31H
Definition misc.hh:348
@ CSR_MHPMCOUNTER19
Definition misc.hh:419
@ CSR_MHPMCOUNTER05
Definition misc.hh:405
@ CSR_MHPMCOUNTER15H
Definition misc.hh:448
@ CSR_MHPMEVENT30
Definition misc.hh:494
@ CSR_MHPMCOUNTER10
Definition misc.hh:410
@ CSR_HPMCOUNTER16H
Definition misc.hh:333
@ CSR_HPMCOUNTER30H
Definition misc.hh:347
@ CSR_HPMCOUNTER22
Definition misc.hh:305
@ CSR_MHPMEVENT16
Definition misc.hh:480
@ CSR_MHPMCOUNTER24H
Definition misc.hh:457
@ CSR_MHPMEVENT12
Definition misc.hh:476
@ CSR_HPMCOUNTER23H
Definition misc.hh:340
@ CSR_HPMCOUNTER20
Definition misc.hh:303
@ CSR_HPMCOUNTER14H
Definition misc.hh:331
@ CSR_HPMCOUNTER08H
Definition misc.hh:325
@ CSR_MHPMEVENT09
Definition misc.hh:473
@ CSR_HPMCOUNTER26H
Definition misc.hh:343
@ CSR_MHPMEVENT04
Definition misc.hh:468
@ CSR_MHPMCOUNTER18H
Definition misc.hh:451
@ CSR_MHPMEVENT29
Definition misc.hh:493
@ CSR_MHPMCOUNTER06H
Definition misc.hh:439
@ CSR_HPMCOUNTER27H
Definition misc.hh:344
@ CSR_HPMCOUNTER18H
Definition misc.hh:335
@ CSR_MHPMCOUNTER25
Definition misc.hh:425
@ CSR_MHPMCOUNTER23H
Definition misc.hh:456
@ CSR_MHPMEVENT15
Definition misc.hh:479
@ CSR_MHPMEVENT11
Definition misc.hh:475
@ CSR_HPMCOUNTER09H
Definition misc.hh:326
@ CSR_MHPMCOUNTER13
Definition misc.hh:413
@ CSR_HPMCOUNTER15H
Definition misc.hh:332
@ CSR_MHPMEVENT10
Definition misc.hh:474
@ CSR_MHPMCOUNTER11H
Definition misc.hh:444
@ CSR_MHPMEVENT18
Definition misc.hh:482
@ CSR_HPMCOUNTER06
Definition misc.hh:289
@ CSR_MHPMEVENT23
Definition misc.hh:487
@ CSR_MHPMEVENT26
Definition misc.hh:490
@ CSR_MHPMCOUNTER09
Definition misc.hh:409
@ CSR_MHPMCOUNTER24
Definition misc.hh:424
@ CSR_MHPMCOUNTER26
Definition misc.hh:426
@ CSR_HPMCOUNTER21H
Definition misc.hh:338
@ CSR_MHPMCOUNTER04H
Definition misc.hh:437
@ CSR_MHPMCOUNTER30H
Definition misc.hh:463
@ CSR_HPMCOUNTER22H
Definition misc.hh:339
@ CSR_MHPMCOUNTER17
Definition misc.hh:417
@ CSR_MHPMCOUNTER14H
Definition misc.hh:447
@ CSR_MHPMCOUNTER31H
Definition misc.hh:464
@ CSR_HPMCOUNTER13
Definition misc.hh:296
@ CSR_MHPMCOUNTER20
Definition misc.hh:420
@ CSR_MHPMCOUNTER20H
Definition misc.hh:453
@ CSR_HPMCOUNTER12
Definition misc.hh:295
@ CSR_MHPMCOUNTER21
Definition misc.hh:421
@ CSR_MHPMEVENT28
Definition misc.hh:492
@ CSR_HPMCOUNTER14
Definition misc.hh:297
@ CSR_MHPMCOUNTER31
Definition misc.hh:431
@ CSR_HPMCOUNTER31
Definition misc.hh:314
@ CSR_HPMCOUNTER13H
Definition misc.hh:330
@ CSR_MHPMCOUNTER28H
Definition misc.hh:461
@ CSR_MHPMCOUNTER14
Definition misc.hh:414
@ CSR_MHPMCOUNTER19H
Definition misc.hh:452
@ CSR_HPMCOUNTER12H
Definition misc.hh:329
@ CSR_HPMCOUNTER09
Definition misc.hh:292
@ CSR_HPMCOUNTER19
Definition misc.hh:302
@ CSR_HPMCOUNTER03
Definition misc.hh:286
@ CSR_MHPMCOUNTER18
Definition misc.hh:418
@ CSR_MHPMCOUNTER27H
Definition misc.hh:460
@ CSR_MHPMCOUNTER08H
Definition misc.hh:441
@ CSR_MHPMCOUNTER12
Definition misc.hh:412
@ CSR_MHPMCOUNTER30
Definition misc.hh:430
@ CSR_MHPMCOUNTER04
Definition misc.hh:404
@ CSR_MHPMEVENT24
Definition misc.hh:488
@ CSR_HPMCOUNTER24H
Definition misc.hh:341
@ CSR_MHPMCOUNTER08
Definition misc.hh:408
Bitfield< 1 > ssi
Definition misc.hh:1259
Bitfield< 35, 34 > sxl
Definition misc.hh:1191
constexpr enums::RiscvType RV32
Definition pcstate.hh:56
const RegVal FRM_MASK
Definition misc.hh:1495
Bitfield< 8 > rvi
Definition misc.hh:1233
Bitfield< 21 > rvv
Definition misc.hh:1222
const RegVal STATUS_MBE_MASK[enums::Num_RiscvType]
Definition misc.hh:1297
const RegVal CAUSE_INTERRUPT_MASKS[enums::Num_RiscvType]
Definition misc.hh:1497
Bitfield< 6 > rvg
Definition misc.hh:1235
Bitfield< 0 > usi
Definition misc.hh:1260
Bitfield< 20 > rvu
Definition misc.hh:1223
Bitfield< 18 > sum
Definition misc.hh:1198
Bitfield< 8 > spp
Definition misc.hh:1204
Bitfield< 11 > mei
Definition misc.hh:1252
const RegVal STATUS_SBE_MASK[enums::Num_RiscvType]
Definition misc.hh:1301
Bitfield< 7 > rvh
Definition misc.hh:1234
Bitfield< 4 > uti
Definition misc.hh:1257
const RegVal MEI_MASK
Definition misc.hh:1458
Bitfield< 8 > uei
Definition misc.hh:1254
Bitfield< 4 > upie
Definition misc.hh:1207
Bitfield< 17 > mprv
Definition misc.hh:1199
const RegVal SEI_MASK
Definition misc.hh:1459
Bitfield< 23 > rvx
Definition misc.hh:1221
const RegVal SSI_MASK
Definition misc.hh:1465
const off_t UXL_OFFSET
Definition misc.hh:1276
Bitfield< 5 > sti
Definition misc.hh:1256
Bitfield< 1 > sie
Definition misc.hh:1209
const RegVal UTI_MASK
Definition misc.hh:1463
Bitfield< 18 > rvs
Definition misc.hh:1225
const off_t SXL_OFFSET
Definition misc.hh:1275
const RegVal STATUS_MIE_MASK
Definition misc.hh:1321
Bitfield< 31 > rv32_sd
Definition misc.hh:1193
const RegVal STATUS_SIE_MASK
Definition misc.hh:1322
const off_t FS_OFFSET
Definition misc.hh:1277
const RegVal STATUS_TW_MASK
Definition misc.hh:1308
const RegVal STATUS_MPIE_MASK
Definition misc.hh:1318
Bitfield< 14, 13 > fs
Definition misc.hh:1201
Bitfield< 12 > rvm
Definition misc.hh:1229
const RegVal SSTATUS_MASKS[enums::Num_RiscvType][enums::Num_PrivilegeModeSet]
Definition misc.hh:1399
const RegVal STATUS_VS_MASK
Definition misc.hh:1316
const off_t VS_OFFSET
Definition misc.hh:1278
const RegVal MTI_MASK
Definition misc.hh:1461
const off_t MBE_OFFSET[enums::Num_RiscvType]
Definition misc.hh:1267
Bitfield< 20 > tvm
Definition misc.hh:1196
const RegVal STATUS_XS_MASK
Definition misc.hh:1313
const RegVal STATUS_SXL_MASK
Definition misc.hh:1305
const RegVal FFLAGS_MASK
Definition misc.hh:1494
Bitfield< 7 > mti
Definition misc.hh:1255
Bitfield< 0 > rva
Definition misc.hh:1241
Bitfield< 16 > rvq
Definition misc.hh:1226
const RegVal STATUS_MPRV_MASK
Definition misc.hh:1312
Bitfield< 33, 32 > uxl
Definition misc.hh:1192
Bitfield< 15 > rvp
Definition misc.hh:1227
const RegVal MSI_MASK
Definition misc.hh:1464
Bitfield< 5 > spie
Definition misc.hh:1206
Bitfield< 3 > mie
Definition misc.hh:1208
Bitfield< 7 > mpie
Definition misc.hh:1205
const RegVal STATUS_UXL_MASK
Definition misc.hh:1306
const RegVal USI_MASK
Definition misc.hh:1466
const RegVal STATUS_MXR_MASK
Definition misc.hh:1310
const RegVal USTATUS_MASKS[enums::Num_RiscvType][enums::Num_PrivilegeModeSet]
Definition misc.hh:1430
const std::unordered_map< int, CSRMetadata > CSRData
Definition misc.hh:536
Bitfield< 22 > tsr
Definition misc.hh:1194
const std::unordered_map< int, RegVal > CSRMasks[enums::Num_RiscvType][enums::Num_PrivilegeModeSet]
Definition misc.hh:1503
const RegVal LOCAL_MASK
Definition misc.hh:1457
const RegVal UEI_MASK
Definition misc.hh:1460
const RegVal STATUS_FS_MASK
Definition misc.hh:1314
const RegVal STATUS_SPP_MASK
Definition misc.hh:1317
const RegVal ISA_EXT_MASK
Definition misc.hh:1285
const RegVal STATUS_SD_MASKS[enums::Num_RiscvType]
Definition misc.hh:1293
const RegVal STATUS_SPIE_MASK
Definition misc.hh:1319
const RegVal STATUS_MPP_MASK
Definition misc.hh:1315
const RegVal STATUS_UIE_MASK
Definition misc.hh:1323
Bitfield< 13 > rvn
Definition misc.hh:1228
Bitfield< 4 > rve
Definition misc.hh:1237
constexpr enums::RiscvType RV64
Definition pcstate.hh:57
const RegVal ISA_EXT_C_MASK
Definition misc.hh:1286
Bitfield< 1 > rvb
Definition misc.hh:1240
@ MISCREG_PMPADDR11
Definition misc.hh:171
@ MISCREG_HPMCOUNTER16H
Definition misc.hh:232
@ MISCREG_USTATUS
Definition misc.hh:257
@ MISCREG_HPMCOUNTER09
Definition misc.hh:88
@ MISCREG_HPMEVENT31
Definition misc.hh:139
@ MISCREG_IMPID
Definition misc.hh:74
@ MISCREG_HPMEVENT07
Definition misc.hh:115
@ MISCREG_HPMCOUNTER16
Definition misc.hh:95
@ MISCREG_HPMCOUNTER13H
Definition misc.hh:229
@ MISCREG_HPMCOUNTER19
Definition misc.hh:98
@ MISCREG_PMPADDR12
Definition misc.hh:172
@ MISCREG_HPMCOUNTER07
Definition misc.hh:86
@ MISCREG_HPMEVENT29
Definition misc.hh:137
@ MISCREG_HPMCOUNTER26
Definition misc.hh:105
@ MISCREG_PMPADDR05
Definition misc.hh:165
@ MISCREG_HPMCOUNTER13
Definition misc.hh:92
@ MISCREG_PMPADDR10
Definition misc.hh:170
@ MISCREG_SIDELEG
Definition misc.hh:178
@ MISCREG_PMPADDR14
Definition misc.hh:174
@ MISCREG_PMPCFG3
Definition misc.hh:159
@ NUM_PHYS_MISCREGS
Definition misc.hh:249
@ MISCREG_HPMCOUNTER22H
Definition misc.hh:238
@ MISCREG_PMPADDR09
Definition misc.hh:169
@ MISCREG_HPMEVENT06
Definition misc.hh:114
@ MISCREG_TSELECT
Definition misc.hh:140
@ MISCREG_MSCRATCH
Definition misc.hh:152
@ MISCREG_HPMCOUNTER04H
Definition misc.hh:220
@ MISCREG_HPMEVENT21
Definition misc.hh:129
@ MISCREG_HPMCOUNTER12H
Definition misc.hh:228
@ MISCREG_STATUS
Definition misc.hh:76
@ MISCREG_HPMEVENT12
Definition misc.hh:120
@ MISCREG_HPMCOUNTER25
Definition misc.hh:104
@ MISCREG_PMPADDR04
Definition misc.hh:164
@ MISCREG_INSTRETH
Definition misc.hh:218
@ MISCREG_MCOUNTEREN
Definition misc.hh:151
@ MISCREG_PMPADDR00
Definition misc.hh:160
@ MISCREG_HPMCOUNTER22
Definition misc.hh:101
@ MISCREG_HPMEVENT17
Definition misc.hh:125
@ MISCREG_HPMEVENT20
Definition misc.hh:128
@ MISCREG_HPMCOUNTER03H
Definition misc.hh:219
@ MISCREG_HPMCOUNTER15H
Definition misc.hh:231
@ MISCREG_MEDELEG
Definition misc.hh:148
@ MISCREG_USCRATCH
Definition misc.hh:188
@ MISCREG_HPMEVENT25
Definition misc.hh:133
@ MISCREG_HPMCOUNTER31H
Definition misc.hh:247
@ MISCREG_HPMCOUNTER11
Definition misc.hh:90
@ MISCREG_HPMCOUNTER17H
Definition misc.hh:233
@ MISCREG_HPMEVENT03
Definition misc.hh:111
@ MISCREG_PMPCFG1
Definition misc.hh:157
@ MISCREG_SSTATUS
Definition misc.hh:260
@ MISCREG_HPMEVENT13
Definition misc.hh:121
@ MISCREG_PMPADDR13
Definition misc.hh:173
@ MISCREG_FFLAGS_EXE
Definition misc.hh:255
@ MISCREG_HPMCOUNTER12
Definition misc.hh:91
@ MISCREG_HPMCOUNTER29H
Definition misc.hh:245
@ MISCREG_HPMEVENT04
Definition misc.hh:112
@ MISCREG_HPMEVENT08
Definition misc.hh:116
@ MISCREG_HPMEVENT19
Definition misc.hh:127
@ MISCREG_DSCRATCH
Definition misc.hh:146
@ MISCREG_HPMEVENT30
Definition misc.hh:138
@ MISCREG_SEDELEG
Definition misc.hh:177
@ MISCREG_PMPADDR06
Definition misc.hh:166
@ MISCREG_HPMCOUNTER21
Definition misc.hh:100
@ MISCREG_HPMCOUNTER21H
Definition misc.hh:237
@ MISCREG_PMPADDR03
Definition misc.hh:163
@ MISCREG_SCOUNTEREN
Definition misc.hh:180
@ MISCREG_HPMCOUNTER18H
Definition misc.hh:234
@ MISCREG_HPMCOUNTER06
Definition misc.hh:85
@ MISCREG_HPMCOUNTER20H
Definition misc.hh:236
@ MISCREG_HPMCOUNTER28
Definition misc.hh:107
@ MISCREG_PMPADDR02
Definition misc.hh:162
@ MISCREG_MIDELEG
Definition misc.hh:149
@ MISCREG_HPMCOUNTER30
Definition misc.hh:109
@ MISCREG_HPMCOUNTER14
Definition misc.hh:93
@ MISCREG_MSTATUSH
Definition misc.hh:214
@ MISCREG_HPMEVENT10
Definition misc.hh:118
@ MISCREG_HPMEVENT26
Definition misc.hh:134
@ MISCREG_HPMEVENT18
Definition misc.hh:126
@ MISCREG_HPMEVENT23
Definition misc.hh:131
@ MISCREG_INSTRET
Definition misc.hh:81
@ MISCREG_HARTID
Definition misc.hh:75
@ MISCREG_HPMCOUNTER05H
Definition misc.hh:221
@ MISCREG_HPMCOUNTER20
Definition misc.hh:99
@ MISCREG_HPMEVENT09
Definition misc.hh:117
@ MISCREG_HPMCOUNTER04
Definition misc.hh:83
@ MISCREG_HPMCOUNTER25H
Definition misc.hh:241
@ MISCREG_HPMCOUNTER27H
Definition misc.hh:243
@ MISCREG_HPMCOUNTER06H
Definition misc.hh:222
@ MISCREG_PMPADDR07
Definition misc.hh:167
@ MISCREG_HPMCOUNTER08H
Definition misc.hh:224
@ MISCREG_HPMEVENT16
Definition misc.hh:124
@ MISCREG_HPMCOUNTER18
Definition misc.hh:97
@ MISCREG_SSCRATCH
Definition misc.hh:181
@ MISCREG_HPMCOUNTER19H
Definition misc.hh:235
@ MISCREG_HPMEVENT14
Definition misc.hh:122
@ MISCREG_HPMCOUNTER10H
Definition misc.hh:226
@ MISCREG_HPMCOUNTER05
Definition misc.hh:84
@ MISCREG_HPMCOUNTER30H
Definition misc.hh:246
@ MISCREG_HPMCOUNTER17
Definition misc.hh:96
@ MISCREG_HPMCOUNTER09H
Definition misc.hh:225
@ MISCREG_HPMCOUNTER27
Definition misc.hh:106
@ MISCREG_HPMCOUNTER24
Definition misc.hh:103
@ MISCREG_HPMCOUNTER28H
Definition misc.hh:244
@ MISCREG_HPMCOUNTER14H
Definition misc.hh:230
@ MISCREG_HPMCOUNTER23
Definition misc.hh:102
@ MISCREG_CYCLE
Definition misc.hh:79
@ MISCREG_HPMCOUNTER07H
Definition misc.hh:223
@ MISCREG_HPMCOUNTER15
Definition misc.hh:94
@ MISCREG_HPMEVENT24
Definition misc.hh:132
@ MISCREG_HPMCOUNTER10
Definition misc.hh:89
@ MISCREG_HPMCOUNTER29
Definition misc.hh:108
@ MISCREG_VENDORID
Definition misc.hh:72
@ MISCREG_PMPADDR01
Definition misc.hh:161
@ MISCREG_HPMEVENT27
Definition misc.hh:135
@ MISCREG_HPMEVENT15
Definition misc.hh:123
@ MISCREG_HPMEVENT05
Definition misc.hh:113
@ MISCREG_ARCHID
Definition misc.hh:73
@ MISCREG_HPMCOUNTER24H
Definition misc.hh:240
@ MISCREG_MSTATUS
Definition misc.hh:251
@ MISCREG_HPMEVENT11
Definition misc.hh:119
@ MISCREG_HPMCOUNTER31
Definition misc.hh:110
@ MISCREG_HPMCOUNTER23H
Definition misc.hh:239
@ MISCREG_HPMCOUNTER11H
Definition misc.hh:227
@ MISCREG_PMPADDR08
Definition misc.hh:168
@ MISCREG_HPMCOUNTER03
Definition misc.hh:82
@ MISCREG_PMPADDR15
Definition misc.hh:175
@ MISCREG_HPMEVENT28
Definition misc.hh:136
@ MISCREG_HPMEVENT22
Definition misc.hh:130
@ MISCREG_PMPCFG0
Definition misc.hh:156
@ MISCREG_HPMCOUNTER08
Definition misc.hh:87
@ MISCREG_HPMCOUNTER26H
Definition misc.hh:242
@ MISCREG_PMPCFG2
Definition misc.hh:158
const RegVal MISA_MASKS[enums::Num_RiscvType]
Definition misc.hh:1287
Bitfield< 10 > rvk
Definition misc.hh:1231
Bitfield< 19 > rvt
Definition misc.hh:1224
const off_t FRM_OFFSET
Definition misc.hh:1279
Bitfield< 9, 5 > vs
Bitfield< 16, 15 > xs
Definition misc.hh:1200
const RegVal ISA_MXL_MASKS[enums::Num_RiscvType]
Definition misc.hh:1281
const RegVal STI_MASK
Definition misc.hh:1462
const RegVal MI_MASK[enums::Num_PrivilegeModeSet]
Definition misc.hh:1467
const RegVal STATUS_SUM_MASK
Definition misc.hh:1311
Bitfield< 5 > rvf
Definition misc.hh:1236
Bitfield< 9 > rvj
Definition misc.hh:1232
Bitfield< 31, 30 > rv32_mxl
Definition misc.hh:1220
Bitfield< 2 > rvc
Definition misc.hh:1239
Bitfield< 11 > rvl
Definition misc.hh:1230
const off_t SBE_OFFSET[enums::Num_RiscvType]
Definition misc.hh:1271
Bitfield< 19 > mxr
Definition misc.hh:1197
const RegVal STATUS_UPIE_MASK
Definition misc.hh:1320
constexpr uint64_t rvTypeFlags(T... args)
Definition misc.hh:523
Bitfield< 9 > sei
Definition misc.hh:1253
const RegVal STATUS_TVM_MASK
Definition misc.hh:1309
const RegVal MSTATUS_MASKS[enums::Num_RiscvType][enums::Num_PrivilegeModeSet]
Definition misc.hh:1325
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
constexpr char MiscRegClassName[]
Definition reg_class.hh:82
uint64_t RegVal
Definition types.hh:173
@ MiscRegClass
Control (misc) register.
Definition reg_class.hh:70
const uint64_t rvTypes
Definition misc.hh:518
const uint64_t isaExts
Definition misc.hh:519
const std::string name
Definition misc.hh:516
Vector Registers layout specification.

Generated on Tue Jun 18 2024 16:24:04 for gem5 by doxygen 1.11.0