nios2_uc_mm_interconnect_0_cmd_demux.sv 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. // (C) 2001-2018 Intel Corporation. All rights reserved.
  2. // Your use of Intel Corporation's design tools, logic functions and other
  3. // software and tools, and its AMPP partner logic functions, and any output
  4. // files from any of the foregoing (including device programming or simulation
  5. // files), and any associated documentation or information are expressly subject
  6. // to the terms and conditions of the Intel Program License Subscription
  7. // Agreement, Intel FPGA IP License Agreement, or other applicable
  8. // license agreement, including, without limitation, that your use is for the
  9. // sole purpose of programming logic devices manufactured by Intel and sold by
  10. // Intel or its authorized distributors. Please refer to the applicable
  11. // agreement for further details.
  12. // $Id: //acds/rel/18.1std/ip/merlin/altera_merlin_demultiplexer/altera_merlin_demultiplexer.sv.terp#1 $
  13. // $Revision: #1 $
  14. // $Date: 2018/07/18 $
  15. // $Author: psgswbuild $
  16. // -------------------------------------
  17. // Merlin Demultiplexer
  18. //
  19. // Asserts valid on the appropriate output
  20. // given a one-hot channel signal.
  21. // -------------------------------------
  22. `timescale 1 ns / 1 ns
  23. // ------------------------------------------
  24. // Generation parameters:
  25. // output_name: nios2_uc_mm_interconnect_0_cmd_demux
  26. // ST_DATA_W: 96
  27. // ST_CHANNEL_W: 7
  28. // NUM_OUTPUTS: 7
  29. // VALID_WIDTH: 1
  30. // ------------------------------------------
  31. //------------------------------------------
  32. // Message Supression Used
  33. // QIS Warnings
  34. // 15610 - Warning: Design contains x input pin(s) that do not drive logic
  35. //------------------------------------------
  36. module nios2_uc_mm_interconnect_0_cmd_demux
  37. (
  38. // -------------------
  39. // Sink
  40. // -------------------
  41. input [1-1 : 0] sink_valid,
  42. input [96-1 : 0] sink_data, // ST_DATA_W=96
  43. input [7-1 : 0] sink_channel, // ST_CHANNEL_W=7
  44. input sink_startofpacket,
  45. input sink_endofpacket,
  46. output sink_ready,
  47. // -------------------
  48. // Sources
  49. // -------------------
  50. output reg src0_valid,
  51. output reg [96-1 : 0] src0_data, // ST_DATA_W=96
  52. output reg [7-1 : 0] src0_channel, // ST_CHANNEL_W=7
  53. output reg src0_startofpacket,
  54. output reg src0_endofpacket,
  55. input src0_ready,
  56. output reg src1_valid,
  57. output reg [96-1 : 0] src1_data, // ST_DATA_W=96
  58. output reg [7-1 : 0] src1_channel, // ST_CHANNEL_W=7
  59. output reg src1_startofpacket,
  60. output reg src1_endofpacket,
  61. input src1_ready,
  62. output reg src2_valid,
  63. output reg [96-1 : 0] src2_data, // ST_DATA_W=96
  64. output reg [7-1 : 0] src2_channel, // ST_CHANNEL_W=7
  65. output reg src2_startofpacket,
  66. output reg src2_endofpacket,
  67. input src2_ready,
  68. output reg src3_valid,
  69. output reg [96-1 : 0] src3_data, // ST_DATA_W=96
  70. output reg [7-1 : 0] src3_channel, // ST_CHANNEL_W=7
  71. output reg src3_startofpacket,
  72. output reg src3_endofpacket,
  73. input src3_ready,
  74. output reg src4_valid,
  75. output reg [96-1 : 0] src4_data, // ST_DATA_W=96
  76. output reg [7-1 : 0] src4_channel, // ST_CHANNEL_W=7
  77. output reg src4_startofpacket,
  78. output reg src4_endofpacket,
  79. input src4_ready,
  80. output reg src5_valid,
  81. output reg [96-1 : 0] src5_data, // ST_DATA_W=96
  82. output reg [7-1 : 0] src5_channel, // ST_CHANNEL_W=7
  83. output reg src5_startofpacket,
  84. output reg src5_endofpacket,
  85. input src5_ready,
  86. output reg src6_valid,
  87. output reg [96-1 : 0] src6_data, // ST_DATA_W=96
  88. output reg [7-1 : 0] src6_channel, // ST_CHANNEL_W=7
  89. output reg src6_startofpacket,
  90. output reg src6_endofpacket,
  91. input src6_ready,
  92. // -------------------
  93. // Clock & Reset
  94. // -------------------
  95. (*altera_attribute = "-name MESSAGE_DISABLE 15610" *) // setting message suppression on clk
  96. input clk,
  97. (*altera_attribute = "-name MESSAGE_DISABLE 15610" *) // setting message suppression on reset
  98. input reset
  99. );
  100. localparam NUM_OUTPUTS = 7;
  101. wire [NUM_OUTPUTS - 1 : 0] ready_vector;
  102. // -------------------
  103. // Demux
  104. // -------------------
  105. always @* begin
  106. src0_data = sink_data;
  107. src0_startofpacket = sink_startofpacket;
  108. src0_endofpacket = sink_endofpacket;
  109. src0_channel = sink_channel >> NUM_OUTPUTS;
  110. src0_valid = sink_channel[0] && sink_valid;
  111. src1_data = sink_data;
  112. src1_startofpacket = sink_startofpacket;
  113. src1_endofpacket = sink_endofpacket;
  114. src1_channel = sink_channel >> NUM_OUTPUTS;
  115. src1_valid = sink_channel[1] && sink_valid;
  116. src2_data = sink_data;
  117. src2_startofpacket = sink_startofpacket;
  118. src2_endofpacket = sink_endofpacket;
  119. src2_channel = sink_channel >> NUM_OUTPUTS;
  120. src2_valid = sink_channel[2] && sink_valid;
  121. src3_data = sink_data;
  122. src3_startofpacket = sink_startofpacket;
  123. src3_endofpacket = sink_endofpacket;
  124. src3_channel = sink_channel >> NUM_OUTPUTS;
  125. src3_valid = sink_channel[3] && sink_valid;
  126. src4_data = sink_data;
  127. src4_startofpacket = sink_startofpacket;
  128. src4_endofpacket = sink_endofpacket;
  129. src4_channel = sink_channel >> NUM_OUTPUTS;
  130. src4_valid = sink_channel[4] && sink_valid;
  131. src5_data = sink_data;
  132. src5_startofpacket = sink_startofpacket;
  133. src5_endofpacket = sink_endofpacket;
  134. src5_channel = sink_channel >> NUM_OUTPUTS;
  135. src5_valid = sink_channel[5] && sink_valid;
  136. src6_data = sink_data;
  137. src6_startofpacket = sink_startofpacket;
  138. src6_endofpacket = sink_endofpacket;
  139. src6_channel = sink_channel >> NUM_OUTPUTS;
  140. src6_valid = sink_channel[6] && sink_valid;
  141. end
  142. // -------------------
  143. // Backpressure
  144. // -------------------
  145. assign ready_vector[0] = src0_ready;
  146. assign ready_vector[1] = src1_ready;
  147. assign ready_vector[2] = src2_ready;
  148. assign ready_vector[3] = src3_ready;
  149. assign ready_vector[4] = src4_ready;
  150. assign ready_vector[5] = src5_ready;
  151. assign ready_vector[6] = src6_ready;
  152. assign sink_ready = |(sink_channel & ready_vector);
  153. endmodule