|
| 1 | +package edu.berkeley.cs.ucie.digital |
| 2 | +package sideband |
| 3 | + |
| 4 | +import chisel3._ |
| 5 | +import chisel3.util._ |
| 6 | + |
| 7 | +import interfaces._ |
| 8 | + |
| 9 | +class D2DSidebandChannelIO( |
| 10 | + val sbParams: SidebandParams, |
| 11 | + val fdiParams: FdiParams, |
| 12 | +) extends Bundle { |
| 13 | + // connect to another sideband node in the layer above (protocol layer) |
| 14 | + val to_upper_layer = new Bundle { |
| 15 | + val tx = new Bundle { |
| 16 | + val bits = Output(UInt(fdiParams.sbWidth.W)) |
| 17 | + val valid = Output(Bool()) |
| 18 | + val credit = Input(Bool()) |
| 19 | + } |
| 20 | + val rx = new Bundle { |
| 21 | + val bits = Input(UInt(fdiParams.sbWidth.W)) |
| 22 | + val valid = Input(Bool()) |
| 23 | + val credit = Output(Bool()) |
| 24 | + } |
| 25 | + } |
| 26 | + // connect to another sideband node in the layer below (physical layer) |
| 27 | + val to_lower_layer = new Bundle { |
| 28 | + val tx = new Bundle { |
| 29 | + val bits = Output(UInt(fdiParams.sbWidth.W)) |
| 30 | + val valid = Output(Bool()) |
| 31 | + val credit = Input(Bool()) |
| 32 | + } |
| 33 | + val rx = new Bundle { |
| 34 | + val bits = Input(UInt(fdiParams.sbWidth.W)) |
| 35 | + val valid = Input(Bool()) |
| 36 | + val credit = Output(Bool()) |
| 37 | + } |
| 38 | + } |
| 39 | + // d2d layer drive these |
| 40 | + val inner = Flipped(new SidebandSwitcherbundle(sbParams)) |
| 41 | +} |
| 42 | + |
| 43 | +class PHYSidebandChannelIO( |
| 44 | + val sbParams: SidebandParams, |
| 45 | + val fdiParams: FdiParams, |
| 46 | +) extends Bundle { |
| 47 | + // connect to another sideband node in the layer above (d2d layer) |
| 48 | + val to_upper_layer = new Bundle { |
| 49 | + val tx = new Bundle { |
| 50 | + val bits = Output(UInt(fdiParams.sbWidth.W)) |
| 51 | + val valid = Output(Bool()) |
| 52 | + val credit = Input(Bool()) |
| 53 | + } |
| 54 | + val rx = new Bundle { |
| 55 | + val bits = Input(UInt(fdiParams.sbWidth.W)) |
| 56 | + val valid = Input(Bool()) |
| 57 | + val credit = Output(Bool()) |
| 58 | + } |
| 59 | + } |
| 60 | + // connect to another sideband node in the layer below (link layer) |
| 61 | + val to_lower_layer = new Bundle { |
| 62 | + val tx = new Bundle { |
| 63 | + val bits = Output(UInt(fdiParams.sbWidth.W)) |
| 64 | + val clock = Output(Bool()) |
| 65 | + } |
| 66 | + val rx = new Bundle { |
| 67 | + val bits = Input(UInt(fdiParams.sbWidth.W)) |
| 68 | + val clock = Input(Bool()) |
| 69 | + } |
| 70 | + } |
| 71 | + // phy layer drive these |
| 72 | + val inner = Flipped(new SidebandSwitcherbundle(sbParams)) |
| 73 | +} |
| 74 | + |
| 75 | +// IO for the RDI and FDI sideband |
| 76 | +class SidebandNodeIO(val sbParams: SidebandParams, val fdiParams: FdiParams) |
| 77 | + extends Bundle { |
| 78 | + // layers drive these |
| 79 | + val inner = new Bundle { |
| 80 | + val layer_to_node = Flipped(Decoupled(UInt(sbParams.sbNodeMsgWidth.W))) |
| 81 | + /* This signal overrides the tx.ready and takes up the priority reserved |
| 82 | + * queue slot */ |
| 83 | + // Should only be asserted high for access completion packets |
| 84 | + val node_to_layer = Decoupled(UInt(sbParams.sbNodeMsgWidth.W)) |
| 85 | + } |
| 86 | + // connect these to another sideband node |
| 87 | + val outer = new Bundle { |
| 88 | + val tx = new Bundle { |
| 89 | + val bits = Output(UInt(fdiParams.sbWidth.W)) |
| 90 | + val valid = Output(Bool()) |
| 91 | + val credit = Input(Bool()) |
| 92 | + } |
| 93 | + val rx = new Bundle { |
| 94 | + val bits = Input(UInt(fdiParams.sbWidth.W)) |
| 95 | + val valid = Input(Bool()) |
| 96 | + val credit = Output(Bool()) |
| 97 | + } |
| 98 | + } |
| 99 | +} |
| 100 | + |
| 101 | +class SidebandNodeOuterIO( |
| 102 | + val sbParams: SidebandParams, |
| 103 | + val fdiParams: FdiParams, |
| 104 | +) extends Bundle { |
| 105 | + val tx = new Bundle { |
| 106 | + val bits = Output(UInt(fdiParams.sbWidth.W)) |
| 107 | + val valid = Output(Bool()) |
| 108 | + val credit = Input(Bool()) |
| 109 | + } |
| 110 | + val rx = new Bundle { |
| 111 | + val bits = Input(UInt(fdiParams.sbWidth.W)) |
| 112 | + val valid = Input(Bool()) |
| 113 | + val credit = Output(Bool()) |
| 114 | + } |
| 115 | +} |
| 116 | + |
| 117 | +class SidebandLinkNodeOuterIO( |
| 118 | + val sbParams: SidebandParams, |
| 119 | + val fdiParams: FdiParams, |
| 120 | +) extends Bundle { |
| 121 | + val tx = new Bundle { |
| 122 | + val bits = Output(UInt(fdiParams.sbWidth.W)) |
| 123 | + val clock = Output(Bool()) |
| 124 | + } |
| 125 | + val rx = new Bundle { |
| 126 | + val bits = Input(UInt(fdiParams.sbWidth.W)) |
| 127 | + val clock = Input(Bool()) |
| 128 | + } |
| 129 | +} |
| 130 | + |
| 131 | +// IO for the remote sideband |
| 132 | +class SidebandLinkIO(val sbParams: SidebandParams, val fdiParams: FdiParams) |
| 133 | + extends Bundle { |
| 134 | + // layers drive these |
| 135 | + val inner = new Bundle { |
| 136 | + val layer_to_node = Flipped(Decoupled(UInt(sbParams.sbNodeMsgWidth.W))) |
| 137 | + /* This signal overrides the tx.ready and takes up the priority reserved |
| 138 | + * queue slot */ |
| 139 | + // Should only be asserted high for access completion packets |
| 140 | + val node_to_layer = Decoupled(UInt(sbParams.sbNodeMsgWidth.W)) |
| 141 | + } |
| 142 | + // connect these to another sideband node |
| 143 | + val outer = new Bundle { |
| 144 | + val tx = new Bundle { |
| 145 | + val bits = Output(UInt(fdiParams.sbWidth.W)) |
| 146 | + val clock = Output(Bool()) |
| 147 | + } |
| 148 | + val rx = new Bundle { |
| 149 | + val bits = Input(UInt(fdiParams.sbWidth.W)) |
| 150 | + val clock = Input(Bool()) |
| 151 | + } |
| 152 | + } |
| 153 | +} |
| 154 | + |
| 155 | +class SidebandSwitcherIO(val sbParams: SidebandParams) extends Bundle { |
| 156 | + // layer drive these |
| 157 | + val inner = Flipped(new SidebandSwitcherbundle(sbParams)) |
| 158 | + // Sideband node drive these |
| 159 | + val outer = new SidebandSwitcherbundle(sbParams) |
| 160 | +} |
| 161 | + |
| 162 | +class SidebandSwitcherbundle(val sbParams: SidebandParams) extends Bundle { |
| 163 | + val node_to_layer_above = Flipped(Decoupled(UInt(sbParams.sbNodeMsgWidth.W))) |
| 164 | + val layer_to_node_above = Decoupled(UInt(sbParams.sbNodeMsgWidth.W)) |
| 165 | + val node_to_layer_below = Flipped(Decoupled(UInt(sbParams.sbNodeMsgWidth.W))) |
| 166 | + val layer_to_node_below = Decoupled(UInt(sbParams.sbNodeMsgWidth.W)) |
| 167 | +} |
0 commit comments