Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inline start csr & start streamer-gemm together #356

Merged
merged 3 commits into from
Sep 30, 2024
Merged
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
6 changes: 3 additions & 3 deletions target/snitch_cluster/sw/apps/snax-gemmx/src/snax-gemmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ int main() {
delta_local_d32, bypassSIMD, transposed_A, transposed_B,
channel_en_C);

// Set CSR to start Streamer for conv2d
set_gemmx_streamer_start();

// Set GEMMX configuration CSR
uint32_t subtraction_setting =
gen_subtraction_config(subtraction_a, subtraction_b);
Expand All @@ -97,6 +94,9 @@ int main() {
shared_multiplier5, shared_multiplier6, shared_multiplier7, M * N,
bypassSIMD);

// Set CSR to start Streamer for conv2d
set_gemmx_streamer_start();

// Set CSR to start GEMM
set_gemmx_start();

Expand Down
5 changes: 3 additions & 2 deletions target/snitch_cluster/sw/snax/gemmx/include/snax-gemmx-lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <stdbool.h>
#include "snrt.h"
#include "stdint.h"
#include "streamer_csr_addr_map.h"

#pragma once

Expand Down Expand Up @@ -76,7 +77,7 @@ void set_gemmx_streamer_csr(
int32_t transpose_B, int32_t channel_en_C);

// Set CSR to start STREAMER
void set_gemmx_streamer_start();
inline void set_gemmx_streamer_start() { csrw_ss(STREAMER_START_CSR, 1); }

// Set GEMM configuration CSR
void set_gemmx_csr(int tempLoop0, int tempLoop1, int tempLoop2,
Expand All @@ -89,7 +90,7 @@ void set_gemmx_csr(int tempLoop0, int tempLoop1, int tempLoop2,
uint32_t temporal_loop_bound, uint32_t bypassSIMD);

// Set CSR to start GEMM
void set_gemmx_start();
inline void set_gemmx_start() { csrw_ss(GEMMX_START, 1); }

// Poll until Streamer and GEMM accelerator finish
void wait_gemmx_and_streamer();
Expand Down
6 changes: 0 additions & 6 deletions target/snitch_cluster/sw/snax/gemmx/src/snax-gemmx-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ void set_gemmx_streamer_csr(
#endif
}

// Set CSR to start STREAMER
void set_gemmx_streamer_start() { csrw_ss(STREAMER_START_CSR, 1); }

// Set GEMM configuration CSR
void set_gemmx_csr(int tempLoop0, int tempLoop1, int tempLoop2,
int subtractions, uint32_t csr0, uint32_t csr1,
Expand Down Expand Up @@ -209,9 +206,6 @@ void set_gemmx_csr(int tempLoop0, int tempLoop1, int tempLoop2,
csrw_ss(BYPASS_SIMD, bypassSIMD);
}

// Set CSR to start GEMM
void set_gemmx_start() { csrw_ss(GEMMX_START, 1); }

// Stall until Streamer and GEMM accelerator finish
void wait_gemmx_and_streamer() {
csrw_ss(STREAMER_START_CSR, 0);
Expand Down
Loading