Skip to content

Commit

Permalink
Working state
Browse files Browse the repository at this point in the history
  • Loading branch information
otoomey committed Mar 8, 2024
1 parent 9d50da5 commit f0a7871
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 17 deletions.
41 changes: 27 additions & 14 deletions hw/snitch_cluster/src/snitch_vfpr.sv
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module snitch_vfpr import snitch_pkg::*; #(
parameter int unsigned DataWidth = 0,
parameter int unsigned AddrWidth = 0,
parameter int unsigned TCDMMemAddrWidth = 0,
parameter int unsigned RspBufferDepth = 3,
parameter type tcdm_req_t = logic,
parameter type tcdm_rsp_t = logic,
parameter type tcdm_user_t = logic,
Expand Down Expand Up @@ -63,6 +64,16 @@ module snitch_vfpr import snitch_pkg::*; #(
);

for (genvar i = 0; i < 3; i++) begin

Check warning on line 66 in hw/snitch_cluster/src/snitch_vfpr.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] hw/snitch_cluster/src/snitch_vfpr.sv#L66

All generate block statements must have a label [Style: generate-statements] [generate-label]
Raw output
message:"All generate block statements must have a label [Style: generate-statements] [generate-label]" location:{path:"./hw/snitch_cluster/src/snitch_vfpr.sv" range:{start:{line:66 column:36}}} severity:WARNING source:{name:"verible-verilog-lint" url:"https://github.com/chipsalliance/verible"}
logic cong_out_valid, cong_out_ready;
logic [1:0] rsp_congestion;
stream_stall i_full_stall (
.valid_i(rvalid_fork[i]),
.ready_o(rready_fork[i]),
.stall(rsp_congestion == (RspBufferDepth - 1)),
.valid_o(cong_out_valid),
.ready_i(cong_out_ready)
);

logic ic_in_valid, ic_in_ready;
logic track_in_valid, track_in_ready;

Check warning on line 79 in hw/snitch_cluster/src/snitch_vfpr.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] hw/snitch_cluster/src/snitch_vfpr.sv#L79

Remove trailing spaces. [Style: trailing-spaces] [no-trailing-spaces]
Raw output
message:"Remove trailing spaces. [Style: trailing-spaces] [no-trailing-spaces]" location:{path:"./hw/snitch_cluster/src/snitch_vfpr.sv" range:{start:{line:79 column:1}}} severity:WARNING source:{name:"verible-verilog-lint" url:"https://github.com/chipsalliance/verible"} suggestions:{range:{start:{line:79 column:1} end:{line:80}} text:"\n"}
Expand All @@ -71,8 +82,8 @@ module snitch_vfpr import snitch_pkg::*; #(
) i_tcdm_bypass (
.clk_i,
.rst_ni(~rst_i),
.valid_i(rvalid_fork[i]),
.ready_o(rready_fork[i]),
.valid_i(cong_out_valid),
.ready_o(cong_out_ready),
.valid_o({ic_in_valid, track_in_valid}),
.ready_i({ic_in_ready, track_in_ready})
);
Expand Down Expand Up @@ -113,22 +124,24 @@ module snitch_vfpr import snitch_pkg::*; #(
// buffer the interconnect output - necessary because
// the ic expects output to be always ready
logic ic_out_valid, ic_out_ready;
fall_through_register #(
.T(data_t)
stream_fifo #(
.FALL_THROUGH ( 1'b0 ),
.DEPTH ( RspBufferDepth ),
.T ( data_t )
) i_rsp_buffer (
.clk_i,
.rst_ni(~rst_i),
.clr_i('0),
.testmode_i('0),
.valid_i(vfpr_rsp[i].p_valid),
.ready_o(/* unused */),
.data_i(vfpr_rsp[i].p.data),
.valid_o(ic_out_valid),
.ready_i(ic_out_ready),
.data_o(rdata_o[i])
.rst_ni (~rst_i),
.flush_i (1'b0),
.testmode_i(1'b0),
.usage_o (rsp_congestion),
.data_i (vfpr_rsp[i].p.data),
.valid_i (vfpr_rsp[i].p_valid),
.ready_o (/* open */),
.data_o (rdata_o[i]),
.valid_o (ic_out_valid),
.ready_i (ic_out_ready)
);


stream_merge #(
.N_INP(2)
) i_rsp_join (
Expand Down
19 changes: 16 additions & 3 deletions target/snitch_cluster/sw/apps/tutorial/src/axpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@

// Define your kernel
void axpy(uint32_t l, double a, double *x, double *y, double *z) {
for (uint32_t i = 0; i < l ; i++) {
z[i] = a * x[i] + y[i];
}
// for (uint32_t i = 0; i < l ; i++) {
// z[i] = a * x[i] + y[i];
// }
// asm volatile(
// "frep.o %[n_frep], %[unroll], 8, 13 \n"
// "fmadd.d f16, f0, %[acc], f8 \n" // rd = rs1 x rs2 + rs3
// : [ acc ] "+f"(a)
// : [ n_frep ] "r"(32), [ unroll ] "i"(1)
// : "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23"
// );
asm volatile(
"frep.o %[n_frep], %[unroll], 0, 0 \n"
"fmadd.d f16, f0, %[acc], f8 \n"
: [ acc ] "+f"(a)
: [ n_frep ] "r"(31), [ unroll ] "i"(1)
: "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23");
snrt_fpu_fence();
}

Expand Down

0 comments on commit f0a7871

Please sign in to comment.