nios2_uc_mm_interconnect_0_rsp_demux.sv 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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_rsp_demux
  26. // ST_DATA_W: 94
  27. // ST_CHANNEL_W: 4
  28. // NUM_OUTPUTS: 2
  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_rsp_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. // -------------------
  63. // Clock & Reset
  64. // -------------------
  65. (*altera_attribute = "-name MESSAGE_DISABLE 15610" *) // setting message suppression on clk
  66. input clk,
  67. (*altera_attribute = "-name MESSAGE_DISABLE 15610" *) // setting message suppression on reset
  68. input reset
  69. );
  70. localparam NUM_OUTPUTS = 2;
  71. wire [NUM_OUTPUTS - 1 : 0] ready_vector;
  72. // -------------------
  73. // Demux
  74. // -------------------
  75. always @* begin
  76. src0_data = sink_data;
  77. src0_startofpacket = sink_startofpacket;
  78. src0_endofpacket = sink_endofpacket;
  79. src0_channel = sink_channel >> NUM_OUTPUTS;
  80. src0_valid = sink_channel[0] && sink_valid;
  81. src1_data = sink_data;
  82. src1_startofpacket = sink_startofpacket;
  83. src1_endofpacket = sink_endofpacket;
  84. src1_channel = sink_channel >> NUM_OUTPUTS;
  85. src1_valid = sink_channel[1] && sink_valid;
  86. end
  87. // -------------------
  88. // Backpressure
  89. // -------------------
  90. assign ready_vector[0] = src0_ready;
  91. assign ready_vector[1] = src1_ready;
  92. assign sink_ready = |(sink_channel & {{2{1'b0}},{ready_vector[NUM_OUTPUTS - 1 : 0]}});
  93. endmodule