mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-06-28 09:37:38 -04:00
update scope tap testing
This commit is contained in:
parent
30571d716c
commit
5c694a997c
3 changed files with 45 additions and 21 deletions
|
@ -260,11 +260,11 @@ config2()
|
||||||
# disabling ZICOND extension
|
# disabling ZICOND extension
|
||||||
CONFIGS="-DEXT_ZICOND_DISABLE" ./ci/blackbox.sh --driver=rtlsim --app=demo
|
CONFIGS="-DEXT_ZICOND_DISABLE" ./ci/blackbox.sh --driver=rtlsim --app=demo
|
||||||
|
|
||||||
# test 128-bit MEM block
|
# test 128-bit memory block
|
||||||
CONFIGS="-DMEM_BLOCK_SIZE=16" ./ci/blackbox.sh --driver=opae --app=mstress
|
CONFIGS="-DMEM_BLOCK_SIZE=16" ./ci/blackbox.sh --driver=opae --app=mstress
|
||||||
CONFIGS="-DMEM_BLOCK_SIZE=16" ./ci/blackbox.sh --driver=xrt --app=mstress
|
CONFIGS="-DMEM_BLOCK_SIZE=16" ./ci/blackbox.sh --driver=xrt --app=mstress
|
||||||
|
|
||||||
# test XLEN-bit MEM block
|
# test XLEN-bit memory block
|
||||||
CONFIGS="-DMEM_BLOCK_SIZE=$XSIZE" ./ci/blackbox.sh --driver=opae --app=mstress
|
CONFIGS="-DMEM_BLOCK_SIZE=$XSIZE" ./ci/blackbox.sh --driver=opae --app=mstress
|
||||||
CONFIGS="-DMEM_BLOCK_SIZE=$XSIZE" ./ci/blackbox.sh --driver=simx --app=mstress
|
CONFIGS="-DMEM_BLOCK_SIZE=$XSIZE" ./ci/blackbox.sh --driver=simx --app=mstress
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ config2()
|
||||||
CONFIGS="-DMEM_BLOCK_SIZE=16" ./ci/blackbox.sh --driver=rtlsim --app=mstress --threads=8
|
CONFIGS="-DMEM_BLOCK_SIZE=16" ./ci/blackbox.sh --driver=rtlsim --app=mstress --threads=8
|
||||||
CONFIGS="-DMEM_BLOCK_SIZE=16" ./ci/blackbox.sh --driver=simx --app=mstress --threads=8
|
CONFIGS="-DMEM_BLOCK_SIZE=16" ./ci/blackbox.sh --driver=simx --app=mstress --threads=8
|
||||||
|
|
||||||
# test single-bank DRAM
|
# test single-bank memory
|
||||||
if [ "$XLEN" == "64" ]; then
|
if [ "$XLEN" == "64" ]; then
|
||||||
CONFIGS="-DPLATFORM_MEMORY_BANKS=1 -DPLATFORM_MEMORY_ADDR_WIDTH=48" ./ci/blackbox.sh --driver=opae --app=mstress
|
CONFIGS="-DPLATFORM_MEMORY_BANKS=1 -DPLATFORM_MEMORY_ADDR_WIDTH=48" ./ci/blackbox.sh --driver=opae --app=mstress
|
||||||
CONFIGS="-DPLATFORM_MEMORY_BANKS=1 -DPLATFORM_MEMORY_ADDR_WIDTH=48" ./ci/blackbox.sh --driver=xrt --app=mstress
|
CONFIGS="-DPLATFORM_MEMORY_BANKS=1 -DPLATFORM_MEMORY_ADDR_WIDTH=48" ./ci/blackbox.sh --driver=xrt --app=mstress
|
||||||
|
@ -281,11 +281,16 @@ config2()
|
||||||
CONFIGS="-DPLATFORM_MEMORY_BANKS=1 -DPLATFORM_MEMORY_ADDR_WIDTH=32" ./ci/blackbox.sh --driver=xrt --app=mstress
|
CONFIGS="-DPLATFORM_MEMORY_BANKS=1 -DPLATFORM_MEMORY_ADDR_WIDTH=32" ./ci/blackbox.sh --driver=xrt --app=mstress
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# test 33-bit DRAM address
|
# test larger memory address
|
||||||
CONFIGS="-DPLATFORM_MEMORY_ADDR_WIDTH=33" ./ci/blackbox.sh --driver=opae --app=mstress
|
if [ "$XLEN" == "64" ]; then
|
||||||
CONFIGS="-DPLATFORM_MEMORY_ADDR_WIDTH=33" ./ci/blackbox.sh --driver=xrt --app=mstress
|
CONFIGS="-DPLATFORM_MEMORY_ADDR_WIDTH=49" ./ci/blackbox.sh --driver=opae --app=mstress
|
||||||
|
CONFIGS="-DPLATFORM_MEMORY_ADDR_WIDTH=49" ./ci/blackbox.sh --driver=xrt --app=mstress
|
||||||
|
else
|
||||||
|
CONFIGS="-DPLATFORM_MEMORY_ADDR_WIDTH=33" ./ci/blackbox.sh --driver=opae --app=mstress
|
||||||
|
CONFIGS="-DPLATFORM_MEMORY_ADDR_WIDTH=33" ./ci/blackbox.sh --driver=xrt --app=mstress
|
||||||
|
fi
|
||||||
|
|
||||||
# test DRAM banks interleaving
|
# test memory banks interleaving
|
||||||
CONFIGS="-DPLATFORM_MEMORY_INTERLEAVE=1" ./ci/blackbox.sh --driver=opae --app=mstress
|
CONFIGS="-DPLATFORM_MEMORY_INTERLEAVE=1" ./ci/blackbox.sh --driver=opae --app=mstress
|
||||||
CONFIGS="-DPLATFORM_MEMORY_INTERLEAVE=0" ./ci/blackbox.sh --driver=opae --app=mstress
|
CONFIGS="-DPLATFORM_MEMORY_INTERLEAVE=0" ./ci/blackbox.sh --driver=opae --app=mstress
|
||||||
|
|
||||||
|
@ -326,8 +331,8 @@ scope()
|
||||||
{
|
{
|
||||||
echo "begin scope tests..."
|
echo "begin scope tests..."
|
||||||
|
|
||||||
./ci/blackbox.sh --driver=opae --scope --app=demo --args="-n1"
|
SCOPE_DEPTH=1024 ./ci/blackbox.sh --driver=opae --app=demo --args="-n1" --scope
|
||||||
./ci/blackbox.sh --driver=xrt --scope --app=demo --args="-n1"
|
SCOPE_DEPTH=1024 ./ci/blackbox.sh --driver=xrt --app=demo --args="-n1" --scope
|
||||||
|
|
||||||
echo "debugging scope done!"
|
echo "debugging scope done!"
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,6 +261,20 @@ int vx_scope_start(scope_callback_t* callback, vx_device_h hdevice, uint64_t sta
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// setup capture size
|
||||||
|
const char* capture_size_env = std::getenv("SCOPE_DEPTH");
|
||||||
|
if (capture_size_env != nullptr) {
|
||||||
|
std::stringstream ss(capture_size_env);
|
||||||
|
uint32_t capture_size;
|
||||||
|
if (ss >> capture_size) {
|
||||||
|
for (auto& tap : json_obj["taps"]) {
|
||||||
|
auto id = tap["id"].get<uint32_t>();
|
||||||
|
uint64_t cmd_depth = (capture_size << 11) | (id << 3) | CMD_SET_DEPTH;
|
||||||
|
CHECK_ERR(g_callback.registerWrite(hdevice, cmd_depth));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// set stop time
|
// set stop time
|
||||||
if (stop_time != uint64_t(-1)) {
|
if (stop_time != uint64_t(-1)) {
|
||||||
std::cout << "[SCOPE] stop time: " << std::dec << stop_time << "s" << std::endl;
|
std::cout << "[SCOPE] stop time: " << std::dec << stop_time << "s" << std::endl;
|
||||||
|
|
|
@ -78,8 +78,9 @@ static uint64_t trace_stop_time = TRACE_STOP_TIME;
|
||||||
|
|
||||||
bool sim_trace_enabled() {
|
bool sim_trace_enabled() {
|
||||||
if (timestamp >= trace_start_time
|
if (timestamp >= trace_start_time
|
||||||
&& timestamp < trace_stop_time)
|
&& timestamp < trace_stop_time) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
return trace_enabled;
|
return trace_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,10 +157,10 @@ public:
|
||||||
|
|
||||||
// launch execution thread
|
// launch execution thread
|
||||||
future_ = std::async(std::launch::async, [&]{
|
future_ = std::async(std::launch::async, [&]{
|
||||||
while (!stop_) {
|
while (!stop_) {
|
||||||
std::lock_guard<std::mutex> guard(mutex_);
|
std::lock_guard<std::mutex> guard(mutex_);
|
||||||
this->tick();
|
this->tick();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -178,7 +179,7 @@ public:
|
||||||
return -1;
|
return -1;
|
||||||
// set uninitialized data to "baadf00d"
|
// set uninitialized data to "baadf00d"
|
||||||
for (uint32_t i = 0; i < len; ++i) {
|
for (uint32_t i = 0; i < len; ++i) {
|
||||||
((uint8_t*)alloc)[i] = (0xbaadf00d >> ((i & 0x3) * 8)) & 0xff;
|
((uint8_t*)alloc)[i] = (0xbaadf00d >> ((i & 0x3) * 8)) & 0xff;
|
||||||
}
|
}
|
||||||
host_buffer_t buffer;
|
host_buffer_t buffer;
|
||||||
buffer.data = (uint64_t*)alloc;
|
buffer.data = (uint64_t*)alloc;
|
||||||
|
@ -207,8 +208,9 @@ public:
|
||||||
std::lock_guard<std::mutex> guard(mutex_);
|
std::lock_guard<std::mutex> guard(mutex_);
|
||||||
|
|
||||||
// simulate CPU-GPU latency
|
// simulate CPU-GPU latency
|
||||||
for (uint32_t i = 0; i < CPU_GPU_LATENCY; ++i)
|
for (uint32_t i = 0; i < CPU_GPU_LATENCY; ++i) {
|
||||||
this->tick();
|
this->tick();
|
||||||
|
}
|
||||||
|
|
||||||
// simulate mmio request
|
// simulate mmio request
|
||||||
device_->vcp2af_sRxPort_c0_mmioRdValid = 1;
|
device_->vcp2af_sRxPort_c0_mmioRdValid = 1;
|
||||||
|
@ -225,8 +227,9 @@ public:
|
||||||
std::lock_guard<std::mutex> guard(mutex_);
|
std::lock_guard<std::mutex> guard(mutex_);
|
||||||
|
|
||||||
// simulate CPU-GPU latency
|
// simulate CPU-GPU latency
|
||||||
for (uint32_t i = 0; i < CPU_GPU_LATENCY; ++i)
|
for (uint32_t i = 0; i < CPU_GPU_LATENCY; ++i) {
|
||||||
this->tick();
|
this->tick();
|
||||||
|
}
|
||||||
|
|
||||||
// simulate mmio request
|
// simulate mmio request
|
||||||
device_->vcp2af_sRxPort_c0_mmioWrValid = 1;
|
device_->vcp2af_sRxPort_c0_mmioWrValid = 1;
|
||||||
|
@ -324,13 +327,14 @@ private:
|
||||||
void sRxPort_bus_eval() {
|
void sRxPort_bus_eval() {
|
||||||
// check mmio request
|
// check mmio request
|
||||||
bool mmio_req_enabled = device_->vcp2af_sRxPort_c0_mmioRdValid
|
bool mmio_req_enabled = device_->vcp2af_sRxPort_c0_mmioRdValid
|
||||||
|| device_->vcp2af_sRxPort_c0_mmioWrValid;
|
|| device_->vcp2af_sRxPort_c0_mmioWrValid;
|
||||||
|
|
||||||
// schedule CCI read responses
|
// schedule CCI read responses
|
||||||
std::list<cci_rd_req_t>::iterator cci_rd_it(cci_reads_.end());
|
std::list<cci_rd_req_t>::iterator cci_rd_it(cci_reads_.end());
|
||||||
for (auto it = cci_reads_.begin(), ie = cci_reads_.end(); it != ie; ++it) {
|
for (auto it = cci_reads_.begin(), ie = cci_reads_.end(); it != ie; ++it) {
|
||||||
if (it->cycles_left > 0)
|
if (it->cycles_left > 0) {
|
||||||
it->cycles_left -= 1;
|
it->cycles_left -= 1;
|
||||||
|
}
|
||||||
if ((cci_rd_it == ie) && (it->cycles_left == 0)) {
|
if ((cci_rd_it == ie) && (it->cycles_left == 0)) {
|
||||||
cci_rd_it = it;
|
cci_rd_it = it;
|
||||||
}
|
}
|
||||||
|
@ -339,8 +343,9 @@ private:
|
||||||
// schedule CCI write responses
|
// schedule CCI write responses
|
||||||
std::list<cci_wr_req_t>::iterator cci_wr_it(cci_writes_.end());
|
std::list<cci_wr_req_t>::iterator cci_wr_it(cci_writes_.end());
|
||||||
for (auto it = cci_writes_.begin(), ie = cci_writes_.end(); it != ie; ++it) {
|
for (auto it = cci_writes_.begin(), ie = cci_writes_.end(); it != ie; ++it) {
|
||||||
if (it->cycles_left > 0)
|
if (it->cycles_left > 0) {
|
||||||
it->cycles_left -= 1;
|
it->cycles_left -= 1;
|
||||||
|
}
|
||||||
if ((cci_wr_it == ie) && (it->cycles_left == 0)) {
|
if ((cci_wr_it == ie) && (it->cycles_left == 0)) {
|
||||||
cci_wr_it = it;
|
cci_wr_it = it;
|
||||||
}
|
}
|
||||||
|
@ -358,7 +363,7 @@ private:
|
||||||
// send CCI read response (ensure mmio disabled)
|
// send CCI read response (ensure mmio disabled)
|
||||||
device_->vcp2af_sRxPort_c0_rspValid = 0;
|
device_->vcp2af_sRxPort_c0_rspValid = 0;
|
||||||
if (!mmio_req_enabled
|
if (!mmio_req_enabled
|
||||||
&& (cci_rd_it != cci_reads_.end())) {
|
&& (cci_rd_it != cci_reads_.end())) {
|
||||||
device_->vcp2af_sRxPort_c0_rspValid = 1;
|
device_->vcp2af_sRxPort_c0_rspValid = 1;
|
||||||
device_->vcp2af_sRxPort_c0_hdr_resp_type = 0;
|
device_->vcp2af_sRxPort_c0_hdr_resp_type = 0;
|
||||||
memcpy(device_->vcp2af_sRxPort_c0_data, cci_rd_it->data.data(), CACHE_BLOCK_SIZE);
|
memcpy(device_->vcp2af_sRxPort_c0_data, cci_rd_it->data.data(), CACHE_BLOCK_SIZE);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue