3030#undef STATE
3131#define STATE state
3232
33- processor_t ::processor_t (const isa_parser_t *isa, const cfg_t *cfg,
33+ processor_t ::processor_t (const char * isa_str, const char * priv_str,
34+ const cfg_t *cfg,
3435 simif_t * sim, uint32_t id, bool halt_on_reset,
3536 FILE* log_file, std::ostream& sout_)
36- : debug(false ), halt_request(HR_NONE), isa(isa ), cfg(cfg), sim(sim), id(id), xlen(0 ),
37+ : debug(false ), halt_request(HR_NONE), isa(isa_str, priv_str ), cfg(cfg), sim(sim), id(id), xlen(0 ),
3738 histogram_enabled (false ), log_commits_enabled(false ),
3839 log_file(log_file), sout_(sout_.rdbuf()), halt_on_reset(halt_on_reset),
3940 in_wfi(false ), check_triggers_icount(false ),
40- impl_table(256 , false ), extension_enable_table(isa-> get_extension_table ()),
41+ impl_table(256 , false ), extension_enable_table(isa. get_extension_table()),
4142 last_pc(1 ), executions(1 ), TM(cfg->trigger_count)
4243{
4344 VU.p = this ;
4445 TM.proc = this ;
4546
4647#ifndef HAVE_INT128
47- if (isa-> has_any_vector ()) {
48+ if (isa. has_any_vector ()) {
4849 fprintf (stderr, " V extension is not supported on platforms without __int128 type\n " );
4950 abort ();
5051 }
5152
52- if (isa-> extension_enabled (EXT_ZACAS) && isa-> get_max_xlen () == 64 ) {
53+ if (isa. extension_enabled (EXT_ZACAS) && isa. get_max_xlen () == 64 ) {
5354 fprintf (stderr, " Zacas extension is not supported on 64-bit platforms without __int128 type\n " );
5455 abort ();
5556 }
5657#endif
5758
58- VU.VLEN = isa-> get_vlen ();
59- VU.ELEN = isa-> get_elen ();
60- VU.vlenb = isa-> get_vlen () / 8 ;
59+ VU.VLEN = isa. get_vlen ();
60+ VU.ELEN = isa. get_elen ();
61+ VU.vlenb = isa. get_vlen () / 8 ;
6162 VU.vstart_alu = 0 ;
6263
6364 register_base_instructions ();
6465 mmu = new mmu_t (sim, cfg->endianness , this );
6566
66- disassembler = new disassembler_t (isa);
67- for (auto e : isa-> get_extensions ())
67+ disassembler = new disassembler_t (& isa);
68+ for (auto e : isa. get_extensions ())
6869 register_extension (find_extension (e.c_str ())());
6970
7071 set_pmp_granularity (cfg->pmpgranularity );
7172 set_pmp_num (cfg->pmpregions );
7273
73- if (isa-> get_max_xlen () == 32 )
74+ if (isa. get_max_xlen () == 32 )
7475 set_mmu_capability (IMPL_MMU_SV32);
75- else if (isa-> get_max_xlen () == 64 )
76+ else if (isa. get_max_xlen () == 64 )
7677 set_mmu_capability (IMPL_MMU_SV57);
7778
7879 set_impl (IMPL_MMU_ASID, true );
@@ -575,8 +576,8 @@ void processor_t::enable_log_commits()
575576
576577void processor_t::reset ()
577578{
578- xlen = isa-> get_max_xlen ();
579- state.reset (this , isa-> get_max_isa ());
579+ xlen = isa. get_max_xlen ();
580+ state.reset (this , isa. get_max_isa ());
580581 state.dcsr ->halt = halt_on_reset;
581582 halt_on_reset = false ;
582583 if (any_vector_extensions ())
@@ -724,7 +725,7 @@ void processor_t::take_interrupt(reg_t pending_interrupts)
724725 abort ();
725726
726727 if (check_triggers_icount) TM.detect_icount_match ();
727- throw trap_t (((reg_t )1 << (isa-> get_max_xlen () - 1 )) | ctz (enabled_interrupts));
728+ throw trap_t (((reg_t )1 << (isa. get_max_xlen () - 1 )) | ctz (enabled_interrupts));
728729 }
729730}
730731
@@ -796,7 +797,7 @@ void processor_t::debug_output_log(std::stringstream *s)
796797
797798void processor_t::take_trap (trap_t & t, reg_t epc)
798799{
799- unsigned max_xlen = isa-> get_max_xlen ();
800+ unsigned max_xlen = isa. get_max_xlen ();
800801
801802 if (debug) {
802803 std::stringstream s; // first put everything in a string, later send it to output
@@ -974,7 +975,7 @@ void processor_t::disasm(insn_t insn)
974975 << " : Executed " << executions << " times" << std::endl;
975976 }
976977
977- unsigned max_xlen = isa-> get_max_xlen ();
978+ unsigned max_xlen = isa. get_max_xlen ();
978979
979980 s << " core " << std::dec << std::setfill (' ' ) << std::setw (3 ) << id
980981 << std::hex << " : 0x" << std::setfill (' 0' ) << std::setw (max_xlen / 4 )
@@ -993,7 +994,7 @@ void processor_t::disasm(insn_t insn)
993994
994995int processor_t::paddr_bits ()
995996{
996- unsigned max_xlen = isa-> get_max_xlen ();
997+ unsigned max_xlen = isa. get_max_xlen ();
997998 assert (xlen == max_xlen);
998999 return max_xlen == 64 ? 50 : 34 ;
9991000}
@@ -1120,7 +1121,7 @@ void processor_t::register_base_instructions()
11201121 // add overlapping instructions first, in order
11211122 #define DECLARE_OVERLAP_INSN (name, ext ) \
11221123 name##_overlapping = true ; \
1123- if (isa-> extension_enabled (ext)) \
1124+ if (isa. extension_enabled (ext)) \
11241125 register_base_insn ((insn_desc_t ) { \
11251126 name##_match, \
11261127 name##_mask, \
0 commit comments