nios2_uc_mm_interconnect_0_cmd_demux.sv 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. // (C) 2001-2019 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/19.1std/ip/merlin/altera_merlin_demultiplexer/altera_merlin_demultiplexer.sv.terp#1 $
  13. // $Revision: #1 $
  14. // $Date: 2018/11/07 $
  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: 94
  27. // ST_CHANNEL_W: 4
  28. // NUM_OUTPUTS: 4
  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 [94-1 : 0] sink_data, // ST_DATA_W=94
  43. input [4-1 : 0] sink_channel, // ST_CHANNEL_W=4
  44. input sink_startofpacket,
  45. input sink_endofpacket,
  46. output sink_ready,
  47. // -------------------
  48. // Sources
  49. // -------------------
  50. output reg src0_valid,
  51. output reg [94-1 : 0] src0_data, // ST_DATA_W=94
  52. output reg [4-1 : 0] src0_channel, // ST_CHANNEL_W=4
  53. output reg src0_startofpacket,
  54. output reg src0_endofpacket,
  55. input src0_ready,
  56. output reg src1_valid,
  57. output reg [94-1 : 0] src1_data, // ST_DATA_W=94
  58. output reg [4-1 : 0] src1_channel, // ST_CHANNEL_W=4
  59. output reg src1_startofpacket,
  60. output reg src1_endofpacket,
  61. input src1_ready,
  62. output reg src2_valid,
  63. output reg [94-1 : 0] src2_data, // ST_DATA_W=94
  64. output reg [4-1 : 0] src2_channel, // ST_CHANNEL_W=4
  65. output reg src2_startofpacket,
  66. output reg src2_endofpacket,
  67. input src2_ready,
  68. output reg src3_valid,
  69. output reg [94-1 : 0] src3_data, // ST_DATA_W=94
  70. output reg [4-1 : 0] src3_channel, // ST_CHANNEL_W=4
  71. output reg src3_startofpacket,
  72. output reg src3_endofpacket,
  73. input src3_ready,
  74. // -------------------
  75. // Clock & Reset
  76. // -------------------
  77. (*altera_attribute = "-name MESSAGE_DISABLE 15610" *) // setting message suppression on clk
  78. input clk,
  79. (*altera_attribute = "-name MESSAGE_DISABLE 15610" *) // setting message suppression on reset
  80. input reset
  81. );
  82. localparam NUM_OUTPUTS = 4;
  83. wire [NUM_OUTPUTS - 1 : 0] ready_vector;
  84. // -------------------
  85. // Demux
  86. // -------------------
  87. always @* begin
  88. src0_data = sink_data;
  89. src0_startofpacket = sink_startofpacket;
  90. src0_endofpacket = sink_endofpacket;
  91. src0_channel = sink_channel >> NUM_OUTPUTS;
  92. src0_valid = sink_channel[0] && sink_valid;
  93. src1_data = sink_data;
  94. src1_startofpacket = sink_startofpacket;
  95. src1_endofpacket = sink_endofpacket;
  96. src1_channel = sink_channel >> NUM_OUTPUTS;
  97. src1_valid = sink_channel[1] && sink_valid;
  98. src2_data = sink_data;
  99. src2_startofpacket = sink_startofpacket;
  100. src2_endofpacket = sink_endofpacket;
  101. src2_channel = sink_channel >> NUM_OUTPUTS;
  102. src2_valid = sink_channel[2] && sink_valid;
  103. src3_data = sink_data;
  104. src3_startofpacket = sink_startofpacket;
  105. src3_endofpacket = sink_endofpacket;
  106. src3_channel = sink_channel >> NUM_OUTPUTS;
  107. src3_valid = sink_channel[3] && sink_valid;
  108. end
  109. // -------------------
  110. // Backpressure
  111. // -------------------
  112. assign ready_vector[0] = src0_ready;
  113. assign ready_vector[1] = src1_ready;
  114. assign ready_vector[2] = src2_ready;
  115. assign ready_vector[3] = src3_ready;
  116. assign sink_ready = |(sink_channel & ready_vector);
  117. endmodule