FPGA: Add save to HBM (work in progress)

This commit is contained in:
2023-09-07 22:15:20 +02:00
parent 347bfd3f2c
commit 38df621cf6
6 changed files with 294 additions and 3 deletions
+24 -1
View File
@@ -216,11 +216,13 @@ void HLSSimulatedDevice::HLSMainThread() {
STREAM_512 converted_1;
STREAM_512 converted_2;
STREAM_512 converted_3;
hls::stream<ap_uint<ADDR_STREAM_WIDTH> > addr0;
hls::stream<ap_uint<ADDR_STREAM_WIDTH> > addr1;
hls::stream<ap_uint<ADDR_STREAM_WIDTH> > addr2;
hls::stream<ap_uint<ADDR_STREAM_WIDTH> > addr3;
hls::stream<ap_uint<ADDR_STREAM_WIDTH> > addr4;
hls::stream<ap_uint<UDP_METADATA_STREAM_WIDTH> > udp_metadata;
ap_uint<1> idle_data_collection;
@@ -306,10 +308,25 @@ void HLSSimulatedDevice::HLSMainThread() {
// Timer procedure - count how many times write_data is not accepting input (to help track down latency issues)
hls_cores.emplace_back([&] { timer_host(converted_1, converted_2, counter_host); });
STREAM_512 save_to_hbm_completion;
ap_uint<8> save_to_hbm_err_reg;
uint64_t save_to_hbm_packets_processed;
ap_uint<1> save_to_hbm_idle;
hls_cores.emplace_back([&] { save_to_hbm(converted_2, addr3, converted_3, addr4,
(hbm256_t *) (hbm_memory[12].data()),
(hbm256_t *) (hbm_memory[13].data()),
(hbm256_t *) (hbm_memory[14].data()),
(hbm256_t *) (hbm_memory[15].data()),
save_to_hbm_completion,
save_to_hbm_packets_processed,
save_to_hbm_idle,
save_to_hbm_err_reg,
16); });
// 3. Prepare data to write to host memory
hls_cores.emplace_back([&] {
host_writer(converted_2, addr3, datamover_out.GetDataStream(),
host_writer(converted_3, addr4, datamover_out.GetDataStream(),
datamover_out.GetCtrlStream(), work_request_stream, completion_stream,
packets_processed, host_writer_idle, err_reg); });
@@ -328,6 +345,9 @@ void HLSSimulatedDevice::HLSMainThread() {
if (!addr3.empty())
throw std::runtime_error("Addr3 queue not empty");
if (!addr4.empty())
throw std::runtime_error("Addr4 queue not empty");
if (!raw1.empty())
throw std::runtime_error("Raw1 queue not empty");
@@ -349,6 +369,9 @@ void HLSSimulatedDevice::HLSMainThread() {
if (!converted_2.empty())
throw std::runtime_error("Converted_2 queue not empty");
if (!converted_3.empty())
throw std::runtime_error("Converted_3 queue not empty");
if (!datamover_in.GetDataStream().empty())
throw std::runtime_error("Datamover queue is not empty");