updates scc

This commit is contained in:
Eyck Jentzsch 2025-01-06 12:40:29 +01:00
parent 9fcd203f87
commit 5490f0203f
2 changed files with 14 additions and 11 deletions

2
scc

@ -1 +1 @@
Subproject commit d6f2a80b1b8aa49506fd6e37e21c38149bcc3ba6 Subproject commit e5439d3a32faaec0c1ac750c337597b48f855831

View File

@ -7,6 +7,7 @@
#include <unordered_map> #include <unordered_map>
using namespace sc_core; using namespace sc_core;
using tlm_gp_shared_ptr_vec = std::vector<tlm::scc::tlm_gp_shared_ptr>;
factory::add<testbench> tb; factory::add<testbench> tb;
@ -83,11 +84,12 @@ template <typename STATE> unsigned run_scenario(STATE& state) {
tlm::scc::tlm_gp_shared_ptr trans = tlm::scc::tlm_gp_shared_ptr trans =
prepare_trans<testbench::bus_cfg>(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 1); prepare_trans<testbench::bus_cfg>(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 1);
trans->set_command(tlm::TLM_READ_COMMAND); trans->set_command(tlm::TLM_READ_COMMAND);
SCCDEBUG(__FUNCTION__) << "run1, iteration " << i << " TX: " << *trans; SCCDEBUG("run1") << "iteration " << i << " TX: " << *trans;
dut.intor_pe.transport(*trans, false); dut.intor_pe.transport(*trans, false);
state.read_tx[axi::get_axi_id(*trans)].first.emplace_back(trans); state.read_tx[axi::get_axi_id(*trans)].first.emplace_back(trans);
StartAddr += state.BurstSizeBytes; StartAddr += state.BurstSizeBytes;
} }
SCCDEBUG("run1") << "finished " << state.NumberOfIterations << " iterations";
}); });
auto run2 = sc_spawn([&dut, &state]() { auto run2 = sc_spawn([&dut, &state]() {
unsigned int StartAddr{0x2000}; unsigned int StartAddr{0x2000};
@ -96,11 +98,12 @@ template <typename STATE> unsigned run_scenario(STATE& state) {
prepare_trans<testbench::bus_cfg>(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 2); prepare_trans<testbench::bus_cfg>(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 2);
trans->set_command(tlm::TLM_WRITE_COMMAND); trans->set_command(tlm::TLM_WRITE_COMMAND);
randomize(*trans); randomize(*trans);
SCCDEBUG(__FUNCTION__) << "run2, iteration " << i << " TX: " << *trans; SCCDEBUG("run2") << "iteration " << i << " TX: " << *trans;
dut.intor_pe.transport(*trans, false); dut.intor_pe.transport(*trans, false);
state.write_tx[axi::get_axi_id(*trans)].first.emplace_back(trans); state.write_tx[axi::get_axi_id(*trans)].first.emplace_back(trans);
StartAddr += state.BurstSizeBytes; StartAddr += state.BurstSizeBytes;
} }
SCCDEBUG("run2") << "finished " << state.NumberOfIterations << " iterations";
}); });
auto run3 = sc_spawn([&dut, &state]() { auto run3 = sc_spawn([&dut, &state]() {
unsigned int StartAddr{0x1000}; unsigned int StartAddr{0x1000};
@ -108,11 +111,12 @@ template <typename STATE> unsigned run_scenario(STATE& state) {
tlm::scc::tlm_gp_shared_ptr trans = tlm::scc::tlm_gp_shared_ptr trans =
prepare_trans<testbench::bus_cfg>(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 3); prepare_trans<testbench::bus_cfg>(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 3);
trans->set_command(tlm::TLM_READ_COMMAND); trans->set_command(tlm::TLM_READ_COMMAND);
SCCDEBUG(__FUNCTION__) << "run3, iteration " << i << " TX: " << *trans; SCCDEBUG("run3") << "iteration " << i << " TX: " << *trans;
dut.intor_pe.transport(*trans, false); dut.intor_pe.transport(*trans, false);
state.read_tx[axi::get_axi_id(*trans)].first.emplace_back(trans); state.read_tx[axi::get_axi_id(*trans)].first.emplace_back(trans);
StartAddr += state.BurstSizeBytes; StartAddr += state.BurstSizeBytes;
} }
SCCDEBUG("run3") << "finished " << state.NumberOfIterations << " iterations";
}); });
auto run4 = sc_spawn([&dut, &state]() { auto run4 = sc_spawn([&dut, &state]() {
unsigned int StartAddr{0x3000}; unsigned int StartAddr{0x3000};
@ -121,11 +125,12 @@ template <typename STATE> unsigned run_scenario(STATE& state) {
prepare_trans<testbench::bus_cfg>(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 4); prepare_trans<testbench::bus_cfg>(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 4);
trans->set_command(tlm::TLM_WRITE_COMMAND); trans->set_command(tlm::TLM_WRITE_COMMAND);
randomize(*trans); randomize(*trans);
SCCDEBUG(__FUNCTION__) << "run4, iteration " << i << " TX: " << *trans; SCCDEBUG("run4") << "iteration " << i << " TX: " << *trans;
dut.intor_pe.transport(*trans, false); dut.intor_pe.transport(*trans, false);
state.write_tx[axi::get_axi_id(*trans)].first.emplace_back(trans); state.write_tx[axi::get_axi_id(*trans)].first.emplace_back(trans);
StartAddr += state.BurstSizeBytes; StartAddr += state.BurstSizeBytes;
} }
SCCDEBUG("run4") << "finished " << state.NumberOfIterations << " iterations";
}); });
unsigned cycles{0}; unsigned cycles{0};
@ -142,9 +147,8 @@ void axi4_burst_alignment(bool pipelined_wrreq, bool write_bp) {
unsigned int BurstLengthByte{16}; unsigned int BurstLengthByte{16};
unsigned int BurstSizeBytes{8}; unsigned int BurstSizeBytes{8};
unsigned int NumberOfIterations{8}; unsigned int NumberOfIterations{8};
std::unordered_map<unsigned, std::pair<std::vector<tlm::scc::tlm_gp_shared_ptr>, std::vector<tlm::scc::tlm_gp_shared_ptr>>> read_tx; std::unordered_map<unsigned, std::pair<tlm_gp_shared_ptr_vec, tlm_gp_shared_ptr_vec>> read_tx;
std::unordered_map<unsigned, std::pair<std::vector<tlm::scc::tlm_gp_shared_ptr>, std::vector<tlm::scc::tlm_gp_shared_ptr>>> std::unordered_map<unsigned, std::pair<tlm_gp_shared_ptr_vec, tlm_gp_shared_ptr_vec>> write_tx;
write_tx;
unsigned resp_cnt{0}; unsigned resp_cnt{0};
} state; } state;
@ -184,9 +188,8 @@ void axi4_narrow_burst(bool pipelined_wrreq, bool write_bp) {
unsigned int BurstLengthByte{16}; unsigned int BurstLengthByte{16};
unsigned int BurstSizeBytes{4}; unsigned int BurstSizeBytes{4};
unsigned int NumberOfIterations{8}; unsigned int NumberOfIterations{8};
std::unordered_map<unsigned, std::pair<std::vector<tlm::scc::tlm_gp_shared_ptr>, std::vector<tlm::scc::tlm_gp_shared_ptr>>> read_tx; std::unordered_map<unsigned, std::pair<tlm_gp_shared_ptr_vec, tlm_gp_shared_ptr_vec>> read_tx;
std::unordered_map<unsigned, std::pair<std::vector<tlm::scc::tlm_gp_shared_ptr>, std::vector<tlm::scc::tlm_gp_shared_ptr>>> std::unordered_map<unsigned, std::pair<tlm_gp_shared_ptr_vec, tlm_gp_shared_ptr_vec>> write_tx;
write_tx;
unsigned resp_cnt{0}; unsigned resp_cnt{0};
} state; } state;