Skip to content

Commit 3fb8fa0

Browse files
author
amonemi
committed
ssa works in mesh-3d
1 parent 8d7f1cf commit 3fb8fa0

File tree

3 files changed

+26
-46
lines changed

3 files changed

+26
-46
lines changed

mpsoc/rtl/src_noc/fattree_route.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ module fattree_addr_decoder #(
710710
endmodule
711711

712712
/**************
713-
* regular_topo_ssa_check_destport_conflict
713+
* fattree_ssa_check_destport_conflict
714714
* check if the incomming flit goes to SS port
715715
* ************/
716716
module fattree_ssa_check_destport #(

mpsoc/rtl/src_noc/mesh_torus.sv

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ module regular_topo_dspt_clear_gen #(
212212
endmodule
213213

214214

215-
module regular_topo_mask_non_assignable_destport #(
215+
module regular_topo_mask_non_assignable_destport #(
216216
parameter TOPOLOGY="MESH",
217217
parameter ROUTE_NAME="DOR",
218218
parameter SW_LOC=0,
@@ -741,36 +741,26 @@ module ring_torus_distance_gen (
741741
endmodule
742742

743743

744-
module regular_topo_ssa_check_destport #(
745-
parameter ROUTE_TYPE="DETERMINISTIC",
744+
module two_dim_ssa_check_destport #(
746745
parameter SW_LOC = 0,
747-
parameter P=5,
748-
parameter DEBUG_EN = 0,
749-
parameter DSTPw = P-1,
750746
parameter SS_PORT=0
751747
)(
752748
destport_encoded, //exsited packet dest port
753749
destport_in_encoded, // incomming packet dest port
754750
ss_port_hdr_flit,
755-
ss_port_nonhdr_flit
751+
ss_port_nonhdr_flit
756752
`ifdef SIMULATION
757753
,clk,
758754
ivc_num_getting_sw_grant,
759755
hdr_flg
760756
`endif
761757
);
762-
758+
import pronoc_pkg::*;
763759
input [DSTPw-1 : 0] destport_encoded, destport_in_encoded;
764760
output ss_port_hdr_flit, ss_port_nonhdr_flit;
765761
`ifdef SIMULATION
766762
input clk, ivc_num_getting_sw_grant,hdr_flg;
767763
`endif
768-
//MESH, TORUS Topology p=5
769-
localparam
770-
LOCAL = 0,
771-
EAST = 1,
772-
WEST = 3;
773-
774764
/*************************
775765
* destination port is coded
776766
* destination-port_in
@@ -815,22 +805,19 @@ endgenerate
815805
endmodule
816806

817807

818-
module line_ring_ssa_check_destport #(
819-
parameter ROUTE_TYPE="DETERMINISTIC",
808+
module one_dim_ssa_check_destport #(
820809
parameter SW_LOC = 0,
821-
parameter P=3,
822-
parameter DEBUG_EN = 0,
823-
parameter DSTPw = P-1,
824810
parameter SS_PORT=0
825811
)(
826812
destport_encoded, //exsited packet dest port
827813
destport_in_encoded, // incomming packet dest port
828814
ss_port_hdr_flit,
829815
ss_port_nonhdr_flit
830816
);
817+
import pronoc_pkg::*;
831818
input [DSTPw-1 : 0] destport_encoded, destport_in_encoded;
832819
output ss_port_hdr_flit, ss_port_nonhdr_flit;
833-
wire [P-1 : 0] dest_port_num,assigned_dest_port_num;
820+
wire [MAX_P-1 : 0] dest_port_num,assigned_dest_port_num;
834821

835822
line_ring_decode_dstport cnv1(
836823
.dstport_one_hot(dest_port_num),

mpsoc/rtl/src_noc/ss_allocator.sv

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ module ssa_per_vc #(
282282

283283
ssa_check_destport #(
284284
.SW_LOC(SW_LOC),
285-
.P(P),
286285
.SS_PORT(SS_PORT)
287286
) check_destport (
288287
.destport_encoded(destport_encoded),
@@ -335,7 +334,6 @@ endmodule
335334

336335
module ssa_check_destport #(
337336
parameter SW_LOC = 0,
338-
parameter P=5,
339337
parameter SS_PORT=0
340338
) (
341339
destport_encoded, //non header flit dest port
@@ -370,13 +368,9 @@ module ssa_check_destport #(
370368
.ss_port_hdr_flit(ss_port_hdr_flit),
371369
.ss_port_nonhdr_flit(ss_port_nonhdr_flit)
372370
);
373-
end else if (IS_MESH | IS_TORUS ) begin : mesh
374-
regular_topo_ssa_check_destport #(
375-
.ROUTE_TYPE(ROUTE_TYPE),
371+
end else if (IS_MESH | IS_TORUS ) begin : D2_
372+
two_dim_ssa_check_destport #(
376373
.SW_LOC(SW_LOC),
377-
.P(P),
378-
.DEBUG_EN(DEBUG_EN),
379-
.DSTPw(DSTPw),
380374
.SS_PORT(SS_PORT)
381375
) destport_check (
382376
.destport_encoded(destport_encoded),
@@ -392,21 +386,13 @@ module ssa_check_destport #(
392386
end else if (IS_FMESH) begin :fmesh
393387
localparam
394388
ELw = log2(T3),
395-
Pw = log2(P);
389+
Pw = log2(MAX_P);
396390

397391
wire [Pw-1 : 0] endp_p_in;
398392
wire [MAX_P-1 : 0] destport_one_hot_in;
399-
400-
fmesh_endp_addr_decode endp_addr_decode (
401-
.e_addr(dest_e_addr_in),
402-
.ex(),
403-
.ey(),
404-
.ep(endp_p_in),
405-
.valid()
406-
);
407-
393+
assign endp_p_in = dest_e_addr_in[DAw-1 : DAw-ELw];
408394
destp_generator #(
409-
.P(P),
395+
.P(MAX_P),
410396
.SW_LOC(SW_LOC)
411397
) decoder (
412398
.destport_one_hot (destport_one_hot_in),
@@ -419,20 +405,27 @@ module ssa_check_destport #(
419405
);
420406
assign ss_port_nonhdr_flit = destport_one_hot [SS_PORT];
421407
assign ss_port_hdr_flit = destport_one_hot_in [SS_PORT];
422-
end else begin : line
423-
line_ring_ssa_check_destport #(
424-
.ROUTE_TYPE(ROUTE_TYPE),
408+
end else if(IS_LINE | IS_RING) begin : D1_
409+
one_dim_ssa_check_destport #(
425410
.SW_LOC(SW_LOC),
426-
.P(P),
427-
.DEBUG_EN(DEBUG_EN),
428-
.DSTPw(DSTPw),
429411
.SS_PORT(SS_PORT)
430412
) destport_check (
431413
.destport_encoded(destport_encoded),
432414
.destport_in_encoded(destport_in_encoded),
433415
.ss_port_hdr_flit(ss_port_hdr_flit),
434416
.ss_port_nonhdr_flit(ss_port_nonhdr_flit)
435417
);
418+
end else begin : other
419+
logic [MAX_P-1 : 0] destport_one_hot_in;
420+
always @(*) begin
421+
destport_one_hot_in = '0;
422+
//for deterministic routing destination port is decimal encoded
423+
if(IS_DETERMINISTIC) destport_one_hot_in[destport_in_encoded] = 1'b1;
424+
//for non-deterministic routing destination port is one-hot encoded
425+
else destport_one_hot_in [DSTPw-1 : 0] = destport_in_encoded;
426+
end
427+
assign ss_port_nonhdr_flit = destport_one_hot [SS_PORT];
428+
assign ss_port_hdr_flit = destport_one_hot_in [SS_PORT];
436429
end
437430
endgenerate
438431
endmodule

0 commit comments

Comments
 (0)