Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sst/elements/vanadis/decoder/vriscv64decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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));
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/sst/elements/vanadis/os/include/process.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include <math.h>
#include <sys/mman.h>
//#include <iostream>
//#include <fstream>

#include <cstdint>
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/sst/elements/vanadis/os/include/virtMemMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
8 changes: 4 additions & 4 deletions src/sst/elements/vanadis/os/vnodeos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "utils.h"
#include "sst/elements/mmu/utils.h"

#include <iostream>

using namespace SST::Vanadis;

VanadisNodeOSComponent::VanadisNodeOSComponent(SST::ComponentId_t id, SST::Params& params)
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
17 changes: 14 additions & 3 deletions src/sst/elements/vanadis/tests/basic_vanadis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/sst/elements/vanadis/vanadis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <sst/core/output.h>
#include <vector>

#include <iostream>

using namespace SST::Vanadis;
using namespace std;

Expand Down Expand Up @@ -834,7 +836,6 @@ void VanadisCore::printRob(int rob_num, VanadisCircularQueue<VanadisInstruction*
int
VanadisCore::performRetire(int rob_num, VanadisCircularQueue<VanadisInstruction*>* rob, const uint64_t cycle)
{

#ifdef VANADIS_BUILD_DEBUG
if ( output->getVerboseLevel() >= 8 ) {
printRob( rob_num, rob );
Expand Down
Loading