Skip to content

Commit

Permalink
[hw/ip/spatz] fix: also buffer instr id from FPU
Browse files Browse the repository at this point in the history
  • Loading branch information
Navaneeth-KunhiPurayil committed Dec 18, 2024
1 parent 1f915bd commit d8406f6
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 6 deletions.
16 changes: 10 additions & 6 deletions hw/ip/spatz/src/spatz.sv
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ module spatz import spatz_pkg::*; import rvv_pkg::*; import fpnew_pkg::*; #(
logic vrf_buf_ready;

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

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

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

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.sv"  range:{start:{line:102  column:23}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}
logic vrf_buf_valid;

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

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

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

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.sv"  range:{start:{line:104  column:1}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}
// Buffer structure to track data information for writes from FPU to VRF
typedef struct packed {
vrf_data_t wdata;
vrf_addr_t waddr;
vrf_be_t wbe;
spatz_id_t wid;
} vrf_buf_t;

vrf_buf_t vrf_buf_data;
Expand Down Expand Up @@ -237,7 +239,7 @@ module spatz import spatz_pkg::*; import rvv_pkg::*; import fpnew_pkg::*; #(
// Scoreboard read enable and write enable input signals
logic [NrReadPorts-1:0] sb_re;
logic [NrWritePorts-1:0] sb_we, sb_we_buf;
spatz_id_t [NrReadPorts+NrWritePorts-1:0] sb_id;
spatz_id_t [NrReadPorts+NrWritePorts-1:0] sb_id, sb_buf_id;

spatz_controller #(
.NrMemPorts (NrMemPorts ),
Expand Down Expand Up @@ -278,22 +280,24 @@ module spatz import spatz_pkg::*; import rvv_pkg::*; import fpnew_pkg::*; #(
.vsldu_rsp_valid_i(vsldu_rsp_valid ),
.vsldu_rsp_i (vsldu_rsp ),
// Scoreboard check
.sb_id_i (sb_id ),
.sb_wrote_result_i(vrf_wvalid ),
.sb_enable_i ({sb_we_buf, sb_re} ),
.sb_enable_o ({vrf_we, vrf_re})
.sb_id_i (sb_buf_id ),
.sb_wrote_result_i(vrf_wvalid ),
.sb_enable_i ({sb_we_buf, sb_re}),
.sb_enable_o ({vrf_we, vrf_re} )
);

always_comb begin
sb_we_buf = sb_we;
vrf_wdata_buf = vrf_wdata;
vrf_waddr_buf = vrf_waddr;
vrf_wbe_buf = vrf_wbe;
sb_buf_id = sb_id;
if (vrf_buf_valid) begin
sb_we_buf [VFU_VD_WD] = 1'b1;
vrf_wdata_buf[VFU_VD_WD] = vrf_buf_data.wdata;

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

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

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

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.sv"  range:{start:{line:297  column:53}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}  suggestions:{range:{start:{line:297  column:53}  end:{line:298}}  text:"      vrf_wdata_buf[VFU_VD_WD] = vrf_buf_data.wdata;\n"}
vrf_waddr_buf[VFU_VD_WD] = vrf_buf_data.waddr;
vrf_wbe_buf [VFU_VD_WD] = vrf_buf_data.wbe;
sb_buf_id [SB_VFU_VD_WD] = vrf_buf_data.wid;
end
end

Expand Down Expand Up @@ -342,7 +346,7 @@ module spatz import spatz_pkg::*; import rvv_pkg::*; import fpnew_pkg::*; #(

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

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

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

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.sv"  range:{start:{line:346  column:1}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}  suggestions:{range:{start:{line:346  column:1}  end:{line:347}}  text:"\n"}
.valid_i (vrf_buf_en ),
.ready_o (vrf_buf_ready ),
.data_i ({vrf_wdata[VFU_VD_WD], vrf_waddr[VFU_VD_WD], vrf_wbe[VFU_VD_WD]}),
.data_i ({vrf_wdata[VFU_VD_WD], vrf_waddr[VFU_VD_WD], vrf_wbe[VFU_VD_WD], sb_id[SB_VFU_VD_WD]}),

.valid_o (vrf_buf_valid ),
.ready_i (vrf_wvalid[VFU_VD_WD] ),
Expand Down
2 changes: 2 additions & 0 deletions sw/spatzBenchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ add_spatz_test_oneParam(dp-faxpy dp-faxpy/main.c 256)
add_spatz_test_oneParam(dp-faxpy dp-faxpy/main.c 1024)

add_spatz_test_oneParam(dp-fdotp dp-fdotp/main.c 128)
add_spatz_test_oneParam(dp-fdotp dp-fdotp/main.c 256)
add_spatz_test_oneParam(dp-fdotp dp-fdotp/main.c 384)
add_spatz_test_oneParam(dp-fdotp dp-fdotp/main.c 512)
add_spatz_test_oneParam(dp-fdotp dp-fdotp/main.c 4096)
add_spatz_test_oneParam(dp-fdotp dp-fdotp/main.c 8192)
add_spatz_test_oneParam(dp-fdotp dp-fdotp/main.c 16384)
Expand Down
23 changes: 23 additions & 0 deletions sw/spatzBenchmarks/dp-fdotp/data/data_256.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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"

dotp_layer dotp_l = {
.M = 256,
.dtype = FP64,
};


static double dotp_A_dram [256] __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, -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 dotp_B_dram [256] __attribute__((section(".data"))) = {0.4780347016744464, 0.9340946495293597, -1.149354106366614, -0.07195237845460918, 0.09414818556627164, -0.23035924547300898, -1.8998197674219859, 0.9478581977287968, -0.5774972459244567, 0.6273242190434466, 0.08511336387296158, -0.1733949212480647, 1.2335858050609876, 1.3917635799868133, -0.9181737147627111, 0.8067649829193638, -0.20314173587596263, 0.19522143581405244, 0.24917168366560993, -0.46610241187034174, -0.9029006394421663, -0.4005606761098726, -1.3514084083199862, -0.9017993731080081, -1.6874596492942056, 0.8505308967944145, 0.6772607869261693, 0.07380298739515019, 1.9920454844101763, -0.33044907219753716, -0.39032216747009113, 1.498700405481595, 1.797754234791071, 0.23182973839731683, -0.4778501888006765, 0.29946965798993297, 0.8488782882116401, 0.3315215039285197, 0.12891223912089034, -1.2238040021173409, -0.6243273110799229, 0.002119877636176426, -1.0103642468106544, -1.1195878651441893, -1.2632446956429335, 1.452604901391212, 0.6929251584566181, 0.3435160724199721, 0.23274595474814475, -1.2546554715250677, 0.8387576576827396, -0.6354031061312012, -1.2173643223619721, 1.231436269706581, -0.12220432019599553, -1.5066610314377438, -0.131168025357405, -0.03123667988254042, 0.5124772757514626, 0.8173767150222387, -0.2772483620390129, -0.8170580592759659, 0.11041826907812055, 0.024119499618272, -0.9954168307888536, -0.7025528681323762, 0.41098923499226014, 0.7739177723108309, -1.2762292342683303, -0.1434065696905791, 0.199025684270468, -1.5400573604406471, 1.548288167937, 0.9288465316923816, 0.08390244767011035, 0.3572785103117973, 0.17859923880951847, -0.6768899292657692, 0.8504258697467754, 0.9425485271043043, 1.8547476587140206, -0.03019556689050345, -0.2256181742270194, 0.19368409881631005, 0.5058710736668895, 0.1038460098414191, -1.4076687315200758, 1.029960808199997, 2.177326020841736, 0.4365480813048655, -0.42153332375097163, -0.9320608828189856, 1.8110431275164358, -1.4858191479600487, 0.7389689210845545, 0.6644577289945207, 0.09402273928088646, -1.4671607394596426, -1.219750082862799, -1.3274229125145334, 0.6099936154303692, -0.11014269025953972, -1.3293671463788634, 0.7101787049919178, -0.01670896018294231, 0.43343311885236446, -0.014621424093204098, 0.6955788134794414, 0.5722528182048355, -1.481720319316519, -0.15323533618009222, 1.090316288383937, -0.9430074874135619, -0.1734020738525506, 0.9803566659279874, 0.0627858851186502, 1.0423699879551078, 1.5545069571528942, 1.5849730687530486, 0.7199388940089966, 2.6380786365181796, -0.27680484002022715, 0.1962794539558957, 0.8731470189472956, 0.010205327986369436, -0.8838416943783096, 0.8068577169597195, 0.29925023340409146, 0.8239191817788585, 1.0202696745617659, 1.3346481596559676, 0.36384746366328413, 0.7611949933670529, -0.8829189545685341, 0.26915516555170543, -0.09599439254200862, -0.6554716217755595, 0.6816100143946399, -0.29262366803238393, 0.9362614654567366, 0.1418089057088939, -0.4836971414215709, -1.242898069994524, 0.2730005353024221, 0.11501735450468505, 1.0157942265133257, 1.6129488803273395, -0.19175241722939693, 0.6164470190315824, -0.20570447804044192, 0.42155963063098567, -0.5707540620409073, 0.6536593231539053, -0.29432626362033404, -0.47610390457226875, -1.3121219556703199, -0.9264218514606051, 0.14788650580579352, 0.0069296369726892315, 0.3306231644074124, 0.8545701717376761, -0.4324600332331524, -0.024493143878920487, 1.980986216379721, -0.2658724362020457, 0.011103897250099562, 1.0111021595209633, -1.1665892611773085, -0.7991803895400539, 0.18661178764402744, 0.8742346952912949, 0.22713168745929768, -0.5133236613036435, -0.5447919995948828, -1.4490806809539707, -0.5830552203885363, -0.007188030468140175, -0.296150919949663, -0.7591698936771379, 1.1809578134345797, -0.14668266051521825, 0.5946658094550371, -0.4752871063125886, 1.1838674589073483, -0.48408003859590065, -0.34832623473704294, -0.031424129829246916, 0.6027021077218985, -0.1269124796513161, -0.132580840204314, 0.8622146933847438, -0.6652501624993471, -0.018728729244763993, 0.056387506785403815, -0.48921141096064424, -0.7306000207552646, -0.6274502774485388, -0.6020537188199624, 1.313122245567395, -0.14388808008330586, 1.3163800108985646, -0.12593952342837475, 1.25609380794485, 1.1658575421017066, -1.7009294128404835, -0.3443663683433915, -0.9552666410033216, -2.123695546730074, -0.9533932980859413, 1.5109902204218253, -0.062040923189698165, -1.7641855643145632, 1.4985053270616493, -0.4079372826543253, 1.429769590030981, -0.2897447883816845, 0.7736151342348289, 0.6104204582278638, -0.5422032040096507, -1.149255707834347, 1.7075504892947724, 1.4528943457305363, 1.5535736491676595, 0.8145713078829363, -0.12165398416725498, -0.13585017018841927, 0.8520383693040029, 0.7245001435289563, 1.3299880805922875, -0.1805351705743782, -0.22203877342660364, -0.5230311319816758, 0.045765518028111664, 2.1112388578012884, 1.9700777629678679, 0.1456185008563352, 0.6952680695280342, 1.289500316820128, -0.3238211924056418, -0.8891278822176073, -0.42661916146469137, 0.6485611566020152, -1.128094765763347, -1.5840451502971633, 0.6965634921004461, -0.33600719481813285, -0.3359458033736853, -1.3453794288815801, 0.782406872557914, 0.16436581820924961, -0.6098672123657596, -0.5846446870404606, 1.7665907233368394, 2.253287365111219, 2.1818716851528808, -0.5497385523974774};


static double dotp_result __attribute__((section(".data"))) = {29.279729947183064};


Loading

0 comments on commit d8406f6

Please sign in to comment.