From 38b97697cfc41e6b638c4d5f5a2f98d7ced43d39 Mon Sep 17 00:00:00 2001 From: Andreas Olofsson Date: Mon, 26 Aug 2024 09:19:35 -0400 Subject: [PATCH 1/4] Experimental router --- umi/sumi/rtl/umi_router.v | 64 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 umi/sumi/rtl/umi_router.v diff --git a/umi/sumi/rtl/umi_router.v b/umi/sumi/rtl/umi_router.v new file mode 100644 index 0000000..a461a5f --- /dev/null +++ b/umi/sumi/rtl/umi_router.v @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright 2024 Zero ASIC Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ---- + * + * Documentation: + * + * - Select signal selects output port + * - Inputs broadcasted to all outputs + * - Ready signal aggregated from otuputs + * + * Testing: + * + ******************************************************************************/ + +module umi_router + #( + parameter M = 4, // number of outputs ports + parameter DW = 128, // umi data width + parameter CW = 32, // umi command width + parameter AW = 64 // umi adress width + ) + (// Incoming UMI + input umi_in_valid, + input [CW-1:0] umi_in_cmd, + input [AW-1:0] umi_in_dstaddr, + input [AW-1:0] umi_in_srcaddr, + input [DW-1:0] umi_in_data, + output umi_in_ready, + // Outgoing UMI + input [M-1:0] umi_select, // output selector + output [M-1:0] umi_out_valid, + output [M*CW-1:0] umi_out_cmd, + output [M*AW-1:0] umi_out_dstaddr, + output [M*AW-1:0] umi_out_srcaddr, + output [M*DW-1:0] umi_out_data, + input [M-1:0] umi_out_ready + ); + + // Valid signal + assign umi_out_valid[M-1:0] = umi_in_valid ? umi_select[M-1:0] : 'b0; + + // Ready signal + assign umi_in_ready = &(~umi_out_valid[M-1:0] | umi_out_ready[M-1:0]); + + // Broadcast packet + assign umi_out_cmd[M*CW-1:0] = {M{umi_in_cmd[CW-1:0]}}; + assign umi_out_dstaddr[M*AW-1:0] = {M{umi_in_dstadddr[AW-1:0]}}; + assign umi_out_srcaddr[M*AW-1:0] = {M{umi_in_srcadddr[AW-1:0]}}; + assign umi_out_data[M*DW-1:0] = {M{umi_in_data[DW-1:0]}}; + +endmodule From 0a8bf60ca228ae5c65148442d2af92b844c30f17 Mon Sep 17 00:00:00 2001 From: Andreas Olofsson Date: Mon, 26 Aug 2024 16:07:39 -0400 Subject: [PATCH 2/4] Logic cleanup - Selecting ready based on select signal rather than valid --- umi/sumi/rtl/umi_router.v | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/umi/sumi/rtl/umi_router.v b/umi/sumi/rtl/umi_router.v index a461a5f..b3a77bb 100644 --- a/umi/sumi/rtl/umi_router.v +++ b/umi/sumi/rtl/umi_router.v @@ -33,6 +33,7 @@ module umi_router parameter AW = 64 // umi adress width ) (// Incoming UMI + input [M-1:0] umi_in_select, // output selector input umi_in_valid, input [CW-1:0] umi_in_cmd, input [AW-1:0] umi_in_dstaddr, @@ -40,7 +41,6 @@ module umi_router input [DW-1:0] umi_in_data, output umi_in_ready, // Outgoing UMI - input [M-1:0] umi_select, // output selector output [M-1:0] umi_out_valid, output [M*CW-1:0] umi_out_cmd, output [M*AW-1:0] umi_out_dstaddr, @@ -50,15 +50,15 @@ module umi_router ); // Valid signal - assign umi_out_valid[M-1:0] = umi_in_valid ? umi_select[M-1:0] : 'b0; + assign umi_out_valid[M-1:0] = umi_in_valid ? umi_in_select[M-1:0] : 'b0; // Ready signal - assign umi_in_ready = &(~umi_out_valid[M-1:0] | umi_out_ready[M-1:0]); + assign umi_in_ready = &(~umi_in_select[M-1:0] | umi_out_ready[M-1:0]); // Broadcast packet - assign umi_out_cmd[M*CW-1:0] = {M{umi_in_cmd[CW-1:0]}}; - assign umi_out_dstaddr[M*AW-1:0] = {M{umi_in_dstadddr[AW-1:0]}}; - assign umi_out_srcaddr[M*AW-1:0] = {M{umi_in_srcadddr[AW-1:0]}}; - assign umi_out_data[M*DW-1:0] = {M{umi_in_data[DW-1:0]}}; + assign umi_out_cmd[M*CW-1:0] = {M{umi_in_cmd[CW-1:0]}}; + assign umi_out_dstaddr[M*AW-1:0] = {M{umi_in_dstaddr[AW-1:0]}}; + assign umi_out_srcaddr[M*AW-1:0] = {M{umi_in_srcaddr[AW-1:0]}}; + assign umi_out_data[M*DW-1:0] = {M{umi_in_data[DW-1:0]}}; endmodule From 160d67a608bf417b4f701af0a5b3fe12dab26113 Mon Sep 17 00:00:00 2001 From: Andreas Olofsson Date: Mon, 26 Aug 2024 16:09:40 -0400 Subject: [PATCH 3/4] Renaming, better name --- umi/sumi/rtl/{umi_router.v => umi_demux.v} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename umi/sumi/rtl/{umi_router.v => umi_demux.v} (100%) diff --git a/umi/sumi/rtl/umi_router.v b/umi/sumi/rtl/umi_demux.v similarity index 100% rename from umi/sumi/rtl/umi_router.v rename to umi/sumi/rtl/umi_demux.v From b69da60da5b353338b20b6e00bc26f3767ce074c Mon Sep 17 00:00:00 2001 From: Andreas Olofsson Date: Tue, 27 Aug 2024 08:33:54 -0400 Subject: [PATCH 4/4] Fixing module name --- umi/sumi/rtl/umi_demux.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/umi/sumi/rtl/umi_demux.v b/umi/sumi/rtl/umi_demux.v index b3a77bb..56f431f 100644 --- a/umi/sumi/rtl/umi_demux.v +++ b/umi/sumi/rtl/umi_demux.v @@ -25,7 +25,7 @@ * ******************************************************************************/ -module umi_router +module umi_demux #( parameter M = 4, // number of outputs ports parameter DW = 128, // umi data width