Skip to content

Commit

Permalink
[spatz_controller] additionally check for sb_wrote_enable_i to update…
Browse files Browse the repository at this point in the history
… vl counters
  • Loading branch information
Navaneeth-KunhiPurayil committed Dec 18, 2024
1 parent d8406f6 commit 641e377
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
19 changes: 15 additions & 4 deletions hw/ip/spatz/src/spatz_controller.sv
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,12 @@ module spatz_controller
if (sb_enable_o[SB_VFU_VD_WD]) begin
// Calculate the load-store interface id to use here for chaining
automatic logic intID = (vl_cnt_q[sb_id_i[SB_VFU_VD_WD]] < vl_max_d[sb_id_i[SB_VFU_VD_WD]]) ? 0 : 1;
vl_cnt_d[sb_id_i[SB_VFU_VD_WD]] += VRFWordBWidth;
if (vl_cnt_q[sb_id_i[SB_VFU_VD_WD]] >= (vl_max_d[sb_id_i[SB_VFU_VD_WD]]-VRFWordBWidth)) begin

Check warning on line 307 in hw/ip/spatz/src/spatz_controller.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] hw/ip/spatz/src/spatz_controller.sv#L307

Remove trailing spaces. [Style: trailing-spaces] [no-trailing-spaces]
Raw output
message:"Remove trailing spaces. [Style: trailing-spaces] [no-trailing-spaces]"  location:{path:"hw/ip/spatz/src/spatz_controller.sv"  range:{start:{line:307  column:1}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}  suggestions:{range:{start:{line:307  column:1}  end:{line:308}}  text:"\n"}
// Update vl_cnt if actually written into the VRF
if (sb_wrote_result_i[SB_VFU_VD_WD - SB_VFU_VD_WD])
vl_cnt_d[sb_id_i[SB_VFU_VD_WD]] += VRFWordBWidth;

if (vl_cnt_q[sb_id_i[SB_VFU_VD_WD]] >= (vl_max_d[sb_id_i[SB_VFU_VD_WD]] * (intID + 1) - VRFWordBWidth)) begin
done_result_d[intID][sb_id_i[SB_VFU_VD_WD]] = 1'b1;
end

Expand All @@ -324,8 +328,15 @@ module spatz_controller
if (sb_enable_o[SB_VSLDU_VD_WD]) begin
// Calculate the load-store interface id to use here for chaining
automatic logic intID = (vl_cnt_q[sb_id_i[SB_VSLDU_VD_WD]] < vl_max_d[sb_id_i[SB_VSLDU_VD_WD]]) ? 0 : 1;
vl_cnt_d[sb_id_i[SB_VSLDU_VD_WD]] += VRFWordBWidth;


Check warning on line 331 in hw/ip/spatz/src/spatz_controller.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] hw/ip/spatz/src/spatz_controller.sv#L331

Remove trailing spaces. [Style: trailing-spaces] [no-trailing-spaces]
Raw output
message:"Remove trailing spaces. [Style: trailing-spaces] [no-trailing-spaces]"  location:{path:"hw/ip/spatz/src/spatz_controller.sv"  range:{start:{line:331  column:1}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}  suggestions:{range:{start:{line:331  column:1}  end:{line:332}}  text:"\n"}
// Update vl_cnt if actually written into the VRF
if (sb_wrote_result_i[SB_VSLDU_VD_WD - SB_VFU_VD_WD])
vl_cnt_d[sb_id_i[SB_VSLDU_VD_WD]] += VRFWordBWidth;

Check warning on line 335 in hw/ip/spatz/src/spatz_controller.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] hw/ip/spatz/src/spatz_controller.sv#L335

Remove trailing spaces. [Style: trailing-spaces] [no-trailing-spaces]
Raw output
message:"Remove trailing spaces. [Style: trailing-spaces] [no-trailing-spaces]"  location:{path:"hw/ip/spatz/src/spatz_controller.sv"  range:{start:{line:335  column:1}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}  suggestions:{range:{start:{line:335  column:1}  end:{line:336}}  text:"\n"}
if (vl_cnt_q[sb_id_i[SB_VSLDU_VD_WD]] >= (vl_max_d[sb_id_i[SB_VSLDU_VD_WD]] * (intID + 1) - VRFWordBWidth)) begin
done_result_d[intID][sb_id_i[SB_VSLDU_VD_WD]] = 1'b1;
end

Check warning on line 339 in hw/ip/spatz/src/spatz_controller.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] hw/ip/spatz/src/spatz_controller.sv#L339

Remove trailing spaces. [Style: trailing-spaces] [no-trailing-spaces]
Raw output
message:"Remove trailing spaces. [Style: trailing-spaces] [no-trailing-spaces]"  location:{path:"hw/ip/spatz/src/spatz_controller.sv"  range:{start:{line:339  column:1}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}  suggestions:{range:{start:{line:339  column:1}  end:{line:340}}  text:"\n"}
wrote_result_narrowing_d[sb_id_i[SB_VSLDU_VD_WD]] = sb_wrote_result_i[SB_VSLDU_VD_WD - SB_VFU_VD_WD] ^ narrow_wide_q[sb_id_i[SB_VSLDU_VD_WD]];
wrote_result_d[intID][sb_id_i[SB_VSLDU_VD_WD]] = sb_wrote_result_i[SB_VSLDU_VD_WD - SB_VFU_VD_WD] && (!narrow_wide_q[sb_id_i[SB_VSLDU_VD_WD]] || wrote_result_narrowing_q[sb_id_i[SB_VSLDU_VD_WD]]);
end
Expand Down
1 change: 1 addition & 0 deletions sw/spatzBenchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ add_spatz_test_threeParam(sdotp-bp-fmatmul sdotp-bp-fmatmul/main.c 64 128 64 )
add_spatz_test_threeParam(sdotp-bp-fmatmul sdotp-bp-fmatmul/main.c 128 128 128)
add_spatz_test_threeParam(sdotp-bp-fmatmul sdotp-bp-fmatmul/main.c 128 256 128)

add_spatz_test_oneParam(dp-faxpy dp-faxpy/main.c 128)
add_spatz_test_oneParam(dp-faxpy dp-faxpy/main.c 256)
add_spatz_test_oneParam(dp-faxpy dp-faxpy/main.c 1024)

Expand Down
26 changes: 26 additions & 0 deletions sw/spatzBenchmarks/dp-faxpy/data/data_128.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2023 ETH Zurich and University of Bologna.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

// This file was generated automatically.

#include "layer.h"

const axpy_layer axpy_l = {
.M = 128,
.dtype = FP64,
};


static double axpy_X_dram [128] __attribute__((section(".data"))) = {0.2995562877502637, 0.24237779080894106, 0.28320739441795323, -0.23294220898382634, 0.6711532211923003, 0.7817673742546976, -1.7903080050220619, -1.748402801489203, 0.17347640142361004, 0.26684314514213736, 0.4285173645433462, 0.2318702888580676, -1.0214571469180447, -0.8272632292381021, 1.7342104609172728, -1.4920727283504345, 0.4212009947066779, 1.504572275678796, 1.2715909667771088, 0.618669993885617, -0.03720300727052493, 1.0352472972512925, -0.010085521702337353, 0.08948016046560357, 0.08403017765893717, 0.3900034836035703, -0.5798414554742108, 0.875893884648022, 0.39238484373268534, 1.108461181451433, 0.8651734647119074, 0.855215961472287, 0.6551143052731048, 0.6284835523998145, -1.2405276437359183, -0.32069813902911876, 1.9312142505772192, 0.14532018661151294, -0.6426551784819938, 0.8636024370428342, -0.28692658848988356, 0.6076122224111371, 0.6058412077786697, 1.3109621860249783, -0.226715890674857, -0.21202045663845112, 0.5717787885763634, 0.6217140784054469, 0.16048920142982762, -0.9214988800859956, -1.108152357089335, -0.18737793842779638, 0.4428268084752764, -0.23210767943346114, -0.03265155768725795, -2.4472388194699217, 1.4654350727468453, 0.9460834933616517, -1.1149258145774585, 1.1145903864961688, 0.03089355171661811, -1.3457475275202437, 1.1755166198951001, -2.6327923840518515, -0.3402723143550538, 0.9906934705391687, -0.8522497497179303, 2.1413916159323136, -1.3971667891606305, -0.3466771947976861, 0.8272179859465014, -0.8144713393247613, 0.87049067708538, 0.42876533202174155, -1.0822943886075476, 0.08978802838707413, -0.5701157444892732, -0.43797201089529525, 0.9723184024569489, 2.5161385989502594, 1.417476842717687, 0.9893999456810375, 1.3602887543809026, -0.09352909908052096, 1.7962695897011005, -2.7218123037264546, 0.6793039385517347, -0.4281911334985128, 0.10439951327040194, 0.6829997901277192, -0.6505400281702892, -0.5982505878283358, 1.104934291883692, 0.07340003052572891, -0.26503771215326066, 1.53173972311803, -0.4234650258705706, -1.2932401334189778, -0.33809498992556575, -1.7333080707300015, -0.8419343543824934, -0.5396385130105458, -1.5231894436921225, 0.5315326394037233, -1.2034415205611886, -0.42457720716015085, 0.07730565131249138, 1.8754720735908623, -0.4534667104093323, -0.7925668941744968, 0.9535707528995508, 1.1519037944728634, -0.13315541187567187, 0.08438003070731266, -0.09100868239112153, -1.260561108016399, 0.8441868298852333, -0.09287318729238316, -0.6985651606872716, 0.21403879685760624, -0.1558016358619296, 0.23432766680511513, 0.6822389778186558, 1.092646154841347, -2.0855244747434423, -0.43826430885192064, 2.4477905540112914, -1.2867459190214319};


static double axpy_Y_dram [128] __attribute__((section(".data"))) = {-0.7331361007165538, 0.02971415623949211, -0.44976485629065605, 0.5125347764599241, 0.9635794871121548, -0.6281530761889705, -0.26829634814791053, 0.7101594539703159, 0.07767737996636266, -0.14202016911094215, -1.922962357248398, 1.981160746670956, 0.6291940423652077, -0.8662414779896375, 0.30459236840252873, 2.1301275306235565, -0.031142489440454883, -1.0110560351499196, -0.7547012361469367, -0.1504751849288266, -1.0343187759704584, 0.4319095829234074, -0.21825697811845282, -1.059395117948861, -0.9331956574757799, 0.7418633974455897, -0.6416015466878071, -1.1449408682286504, -0.2216721956818539, -1.420713573549913, -0.476969896992711, 0.9096040699613742, -0.7038921871424687, 1.5214450634475556, -0.6507369068478477, 0.7751228541207369, 0.22993705977460382, 1.0133904557056803, -0.9822868898637884, 2.425005496346911, -0.03315290272508095, 2.059923212244384, -0.9175734236430358, -0.13843588731523931, -2.200242275592898, -1.1737601958122919, 2.3141540243381327, 1.8193583560461684, -0.02606758800262461, -0.15813365028362542, -0.4990858233389999, 1.3612493070253837, -0.18967721053619913, -0.3885493746810846, -0.78645738020847, -1.769258018600366, 0.2863012087770702, -0.2101644250728928, -0.922379116692611, 0.4542988582917103, -1.168731602563987, 0.9219834856645437, -1.5306804207222386, 0.023687715374861383, 0.24904992357977876, -0.5595901539006848, 0.8956621506501764, 0.04378461171949896, 1.6459648576014418, 0.41662757007673235, 0.6518019493570052, 0.38131542509896527, -0.23150035949424588, 1.2160699112636764, 0.08806271189112921, 0.6308029102131235, -0.34934190685175504, -0.698883217299044, -1.5400984867493595, -0.5138258202566868, -0.8326722177147288, 0.3555538090114088, -1.7180388726188185, 0.013161284807438048, 0.17891679769777372, 0.675401077688519, 0.7094535110109988, 1.8141622548156382, 0.46742788122395995, -0.8301903074578377, 0.5800148267422183, 0.0506475437751616, -0.6755331480708628, -0.5170525025832357, -1.0310269968302381, 1.0266955308406385, -0.5373877604116372, -0.6849286438665895, 1.0066107886868416, -0.31691218246652836, 2.1807319429357963, 0.3954366945921875, 1.54663939130953, -0.1729693166437901, 0.002840677025019378, -1.3705193782077094, -1.2542332261046765, -0.17928341987650082, 0.30056229131177675, -1.2411619166267582, -0.7604763355807861, -0.9971481442759493, -0.349041502695088, 1.4026313276860414, 1.4061442335836205, -0.1791036479495098, 1.0127676186224994, 0.6204230823178866, 1.6317833840380092, -0.7482913095490172, 0.013824710906791784, -0.3287020311202719, 0.2805330310458293, -0.3815781043999949, 1.0504938948460687, 0.22899320285046032, 1.5547745398580755, 1.3818135139012033};


static double axpy_alpha_dram __attribute__((section(".data"))) = {0.035489516074808714};


static const double axpy_GR_dram[128] = {-0.7225049930271308, 0.038316026742582644, -0.4397139629139554, 0.5042677701896912, 0.9873983901443186, -0.6004085303935974, -0.3318335128709997, 0.6481094846416242, 0.08383397350328584, -0.13255003502196774, -1.9077544833511022, 1.989389711014655, 0.5929430225299315, -0.8956006496617812, 0.3661386584323537, 2.07717459154598, -0.016194269968086816, -0.9576594931865055, -0.709573088090919, -0.1285188862358212, -1.035639092695017, 0.46865000852060945, -0.21861490840303074, -1.0562195103556404, -0.9302134671349841, 0.75570443234617, -0.6621798393426996, -1.1138558181296077, -0.20774664746269145, -1.381374822632491, -0.4462653094093198, 0.9399552705734779, -0.6806424974746417, 1.5437496405832016, -0.6947626326014581, 0.7637414323605017, 0.29847491896436373, 1.0185477988044238, -1.0050944111510842, 2.455654328918587, -0.043335788499582695, 2.081487075978894, -0.8960724123607933, -0.09191047374083948, -2.208288312839418, -1.1812846992163504, 2.3344461768465483, 1.8414226878256734, -0.02037190390864753, -0.1908371996013556, -0.538413614229259, 1.354599354667486, -0.17396150139845956, -0.3967867639014249, -0.7876161681898795, -1.8561093400228397, 0.33830879034790784, -0.17658837972712327, -0.9619472943112769, 0.4938551317300933, -1.167635205363732, 0.8742235571539799, -1.4889619047442666, -0.06974881226058074, 0.23697382380966273, -0.524430922052777, 0.8654162194578102, 0.11978156389558942, 1.5963800843783367, 0.40432416419919026, 0.6811595153666244, 0.35241023140952815, -0.20060706661685318, 1.2312865854067827, 0.04965260778896639, 0.633989443889892, -0.3695750387303086, -0.7144266320200289, -1.5055913771755312, -0.42452927900279486, -0.7823666505194303, 0.39066713428807087, -1.669762883003836, 0.009841982342157522, 0.242665536176161, 0.5788052761828069, 0.7335616790579115, 1.7989659587002522, 0.4711329694283721, -0.8059509754270091, 0.5569274759551622, 0.029415919921664112, -0.6363195647574492, -0.5144475710200014, -1.0404330569761318, 1.0810562323666588, -0.5524163292543901, -0.7308251103701501, 0.994611961107066, -0.37842644710529644, 2.150852100132005, 0.37628518491011387, 1.4925821350626394, -0.15410548049338615, -0.03986888016402917, -1.385587417826217, -1.2514896859497482, -0.11272382357294308, 0.2844689772033141, -1.2692897321579253, -0.72663457101729, -0.9562676360453715, -0.3537671238252974, 1.4056259341422215, 1.4029143794869536, -0.22384035165573649, 1.0427274006918532, 0.6171270578445548, 1.6069916445384969, -0.7406951762273065, 0.00829538624638834, -0.32038585562241934, 0.3047453622159855, -0.342800621123675, 0.9764796404752543, 0.21343941461644514, 1.641645442072424, 1.3361475239238978};


0 comments on commit 641e377

Please sign in to comment.