diff --git a/src/sst/elements/vanadis/decoder/vriscv64decoder.h b/src/sst/elements/vanadis/decoder/vriscv64decoder.h index 5ca8dcde69..6c225014da 100644 --- a/src/sst/elements/vanadis/decoder/vriscv64decoder.h +++ b/src/sst/elements/vanadis/decoder/vriscv64decoder.h @@ -361,7 +361,6 @@ class VanadisRISCV64Decoder : public VanadisDecoder bool decode_fault = true; - // if the last two bits that are set are 11, then we are performing at least 32bit instruction formats, // otherwise we are performing decodes on the C-extension (16b) formats if ( (ins & 0x3) == 0x3 ) { @@ -3458,6 +3457,7 @@ class VanadisRISCV64Decoder : public VanadisDecoder "[decode] -> decode fault detected at 0x%" PRI_ADDR " / thr: %" PRIu32 ", set to fatal on detect\n", ins_address, hw_thr); } + bundle->addInstruction(new VanadisInstructionDecodeFault(ins_address, hw_thr, options)); } } diff --git a/src/sst/elements/vanadis/os/include/process.h b/src/sst/elements/vanadis/os/include/process.h index b5ca675f6d..283ee5b5d2 100644 --- a/src/sst/elements/vanadis/os/include/process.h +++ b/src/sst/elements/vanadis/os/include/process.h @@ -18,7 +18,6 @@ #include #include -//#include //#include #include @@ -183,7 +182,7 @@ class ProcessInfo { assert( 1 == fscanf(fp,"hw_thread_: %" SCNu32 "\n",&hw_thread_) ); output->verbose(CALL_INFO, 0, VANADIS_DBG_CHECKPOINT,"hw_thread_: %" PRIu32 "\n",hw_thread_); - assert( 1 == fscanf(fp,"thread_id_address: %" SCNx64 "\n",&thread_id_address_) ); + assert( 1 == fscanf(fp,"thread_id_address_: %" SCNx64 "\n",&thread_id_address_) ); output->verbose(CALL_INFO, 0, VANADIS_DBG_CHECKPOINT,"thread_id_address: %#" PRIx64 "\n",thread_id_address_); virtual_memory_map_ = new VirtMemMap(output,fp,phys_mem_mgr,elf_info); diff --git a/src/sst/elements/vanadis/os/include/virtMemMap.cc b/src/sst/elements/vanadis/os/include/virtMemMap.cc index e289aa06c6..d49c41fd73 100644 --- a/src/sst/elements/vanadis/os/include/virtMemMap.cc +++ b/src/sst/elements/vanadis/os/include/virtMemMap.cc @@ -249,7 +249,7 @@ MemoryRegion::MemoryRegion( SST::Output* output, FILE* fp, PhysMemManager* mem_m for ( auto i = 0; i < size; i++ ) { int vpn,ppn,ref_cnt; - assert( 3 == fscanf(fp,"vpn: %d, ppn: %d, refCnt: %d\n", &vpn, &ppn, &ref_cnt ) ); + assert( 3 == fscanf(fp,"vpn: %d, ppn: %d, ref_cnt: %d\n", &vpn, &ppn, &ref_cnt ) ); output->verbose(CALL_INFO, 0, VANADIS_DBG_SNAPSHOT,"vpn: %d, ppn: %d, refCnt: %d\n", vpn, ppn, ref_cnt ); virt_to_phys_page_map_[vpn] = new OS::Page( mem_manager, ppn, ref_cnt ); } diff --git a/src/sst/elements/vanadis/os/vnodeos.cc b/src/sst/elements/vanadis/os/vnodeos.cc index 7f94af6e04..a3f81f6200 100644 --- a/src/sst/elements/vanadis/os/vnodeos.cc +++ b/src/sst/elements/vanadis/os/vnodeos.cc @@ -33,6 +33,8 @@ #include "utils.h" #include "sst/elements/mmu/utils.h" +#include + using namespace SST::Vanadis; VanadisNodeOSComponent::VanadisNodeOSComponent(SST::ComponentId_t id, SST::Params& params) @@ -343,7 +345,6 @@ int VanadisNodeOSComponent::checkpointLoad( std::string dir ) std::stringstream filename; filename << checkpoint_dir_ << "/" << getName(); output_->verbose(CALL_INFO, 0, VANADIS_DBG_CHECKPOINT,"Checkpoint component `%s` %s\n",getName().c_str(), filename.str().c_str()); - auto fp = fopen(filename.str().c_str(),"r"); assert(fp); @@ -409,13 +410,13 @@ int VanadisNodeOSComponent::checkpointLoad( std::string dir ) output_->verbose(CALL_INFO, 0, VANADIS_DBG_CHECKPOINT,"core: %" PRIu32 "\n",core); assert( core == i ); - assert( 1 == fscanf(fp,"hw_thread_map_.size(): %zd\n",&size) ); + assert( 1 == fscanf(fp,"m_hwThreadMap.size(): %zd\n",&size) ); output_->verbose(CALL_INFO, 0, VANADIS_DBG_CHECKPOINT,"hw_thread_map_.size(): %zu\n",size); for ( auto j = 0; j < size; j++ ) { uint32_t hw_thread; // hw_thread: 0 - assert( 1 == fscanf(fp, "hw_thread: %" SCNu32 "\n",&hw_thread) ); + assert( 1 == fscanf(fp, "hwThread: %" SCNu32 "\n",&hw_thread) ); output_->verbose(CALL_INFO, 0, VANADIS_DBG_CHECKPOINT,"hw_thread: %" PRIu32 "\n",hw_thread); assert( hw_thread == j ); uint32_t pid,tid; @@ -433,7 +434,6 @@ int VanadisNodeOSComponent::checkpointLoad( std::string dir ) char str [80]; assert( 1 == fscanf(fp,"filename: %s\n",str)); output_->verbose(CALL_INFO, 0, VANADIS_DBG_CHECKPOINT,"filename: %s\n",str); - auto & page_map = elf_page_cache_[ elf_map_[str] ]; size_t size2; diff --git a/src/sst/elements/vanadis/tests/basic_vanadis.py b/src/sst/elements/vanadis/tests/basic_vanadis.py index ecd1c7d0af..4455d8f69e 100644 --- a/src/sst/elements/vanadis/tests/basic_vanadis.py +++ b/src/sst/elements/vanadis/tests/basic_vanadis.py @@ -60,6 +60,8 @@ parser.add_argument("--library", help="Which vanadis library to use, 'vanadis' or 'vanadisdbg'. Default is vanadis.") parser.add_argument("--halt-at-address", help="An optional instruction address at which to end simulation. 0 indicates none (default).") parser.add_argument("--tlb-iface", help="Whether to put TLBs in the core's memory interface (1) or place them between the interface and L1 (0, default).") +parser.add_argument("--cpt", help="vanadis checkpoint. save or load or nothing") +parser.add_argument("--cptdir", help="vanadis checkpoint directory") args = parser.parse_args() @@ -109,8 +111,13 @@ l1_debug=0 dbgAddr="0" stopDbg="0" -checkpointDir = "" +checkpointDir = "" if args.cptdir == None else args.cptdir checkpoint = "" +if args.cpt == "save": + checkpoint = "save" +elif args.cpt == "load": + checkpoint = "load" + pythonDebug=False #exe = "hello-world-cpp" @@ -269,11 +276,15 @@ "initBacking": 1, "addr_range_start": 0, "addr_range_end": 0xffffffff, - "debug_level" : mh_debug_level, - "debug" : mh_debug, + "debug_level" : 10, #mh_debug_level, + "debug" : 1, #mh_debug, "checkpointDir" : checkpointDir, "checkpoint" : checkpoint } +if checkpoint == "save": + memCtrlParams["backing_out_file"] = checkpointDir + "/" + "memory.out" +elif checkpoint == "load": + memCtrlParams["backing_in_file"] = checkpointDir + "/" + "memory.out" memParams = { "mem_size" : "4GiB", diff --git a/src/sst/elements/vanadis/vanadis.cc b/src/sst/elements/vanadis/vanadis.cc index 994cdf458d..d704fba3a1 100644 --- a/src/sst/elements/vanadis/vanadis.cc +++ b/src/sst/elements/vanadis/vanadis.cc @@ -26,6 +26,8 @@ #include #include +#include + using namespace SST::Vanadis; using namespace std; @@ -834,7 +836,6 @@ void VanadisCore::printRob(int rob_num, VanadisCircularQueue* rob, const uint64_t cycle) { - #ifdef VANADIS_BUILD_DEBUG if ( output->getVerboseLevel() >= 8 ) { printRob( rob_num, rob );