altera_customins_master_translator.v 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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_customins_master_translator/altera_customins_master_translator.v#1 $
  13. // $Revision: #1 $
  14. // $Date: 2018/07/18 $
  15. // $Author: psgswbuild $
  16. // ------------------------------------------
  17. // Custom instruction master translator
  18. // ------------------------------------------
  19. `timescale 1 ns / 1 ns
  20. module altera_customins_master_translator
  21. #(
  22. parameter SHARED_COMB_AND_MULTI = 0
  23. )
  24. (
  25. // ------------------------------------------
  26. // Hybrid slave
  27. // ------------------------------------------
  28. input wire [31:0] ci_slave_dataa, // ci_slave.dataa
  29. input wire [31:0] ci_slave_datab, // .datab
  30. output wire [31:0] ci_slave_result, // .result
  31. input wire [7:0] ci_slave_n, // .n
  32. input wire ci_slave_readra, // .readra
  33. input wire ci_slave_readrb, // .readrb
  34. input wire ci_slave_writerc, // .writerc
  35. input wire [4:0] ci_slave_a, // .a
  36. input wire [4:0] ci_slave_b, // .b
  37. input wire [4:0] ci_slave_c, // .c
  38. input wire [31:0] ci_slave_ipending, // .ipending
  39. input wire ci_slave_estatus, // .estatus
  40. input wire ci_slave_multi_clk, // .clk
  41. input wire ci_slave_multi_reset, // .reset
  42. input wire ci_slave_multi_reset_req,// .reset_req
  43. input wire ci_slave_multi_clken, // .clk_en
  44. input wire ci_slave_multi_start, // .start
  45. output wire ci_slave_multi_done, // .done
  46. input wire [31:0] ci_slave_multi_dataa, // .multi_dataa
  47. input wire [31:0] ci_slave_multi_datab, // .multi_datab
  48. output wire [31:0] ci_slave_multi_result, // .multi_result
  49. input wire [7:0] ci_slave_multi_n, // .multi_n
  50. input wire ci_slave_multi_readra, // .multi_readra
  51. input wire ci_slave_multi_readrb, // .multi_readrb
  52. input wire ci_slave_multi_writerc, // .multi_writerc
  53. input wire [4:0] ci_slave_multi_a, // .multi_a
  54. input wire [4:0] ci_slave_multi_b, // .multi_b
  55. input wire [4:0] ci_slave_multi_c, // .multi_c
  56. // ------------------------------------------
  57. // Comb master
  58. // ------------------------------------------
  59. output wire [31:0] comb_ci_master_dataa, // comb_ci_master.dataa
  60. output wire [31:0] comb_ci_master_datab, // .datab
  61. input wire [31:0] comb_ci_master_result, // .result
  62. output wire [7:0] comb_ci_master_n, // .n
  63. output wire comb_ci_master_readra, // .readra
  64. output wire comb_ci_master_readrb, // .readrb
  65. output wire comb_ci_master_writerc, // .writerc
  66. output wire [4:0] comb_ci_master_a, // .a
  67. output wire [4:0] comb_ci_master_b, // .b
  68. output wire [4:0] comb_ci_master_c, // .c
  69. output wire [31:0] comb_ci_master_ipending, // .ipending
  70. output wire comb_ci_master_estatus, // .estatus
  71. // ------------------------------------------
  72. // Multi master
  73. // ------------------------------------------
  74. output wire multi_ci_master_clk, // multi_ci_master.clk
  75. output wire multi_ci_master_reset, // .reset
  76. output wire multi_ci_master_reset_req, // .reset_req
  77. output wire multi_ci_master_clken, // .clk_en
  78. output wire multi_ci_master_start, // .start
  79. input wire multi_ci_master_done, // .done
  80. output wire [31:0] multi_ci_master_dataa, // .dataa
  81. output wire [31:0] multi_ci_master_datab, // .datab
  82. input wire [31:0] multi_ci_master_result, // .result
  83. output wire [7:0] multi_ci_master_n, // .n
  84. output wire multi_ci_master_readra, // .readra
  85. output wire multi_ci_master_readrb, // .readrb
  86. output wire multi_ci_master_writerc, // .writerc
  87. output wire [4:0] multi_ci_master_a, // .a
  88. output wire [4:0] multi_ci_master_b, // .b
  89. output wire [4:0] multi_ci_master_c // .c
  90. );
  91. assign comb_ci_master_dataa = ci_slave_dataa;
  92. assign comb_ci_master_datab = ci_slave_datab;
  93. assign comb_ci_master_n = ci_slave_n;
  94. assign comb_ci_master_a = ci_slave_a;
  95. assign comb_ci_master_b = ci_slave_b;
  96. assign comb_ci_master_c = ci_slave_c;
  97. assign comb_ci_master_readra = ci_slave_readra;
  98. assign comb_ci_master_readrb = ci_slave_readrb;
  99. assign comb_ci_master_writerc = ci_slave_writerc;
  100. assign comb_ci_master_ipending = ci_slave_ipending;
  101. assign comb_ci_master_estatus = ci_slave_estatus;
  102. assign multi_ci_master_clk = ci_slave_multi_clk;
  103. assign multi_ci_master_reset = ci_slave_multi_reset;
  104. assign multi_ci_master_reset_req = ci_slave_multi_reset_req;
  105. assign multi_ci_master_clken = ci_slave_multi_clken;
  106. assign multi_ci_master_start = ci_slave_multi_start;
  107. assign ci_slave_multi_done = multi_ci_master_done;
  108. generate if (SHARED_COMB_AND_MULTI == 0) begin
  109. assign multi_ci_master_dataa = ci_slave_multi_dataa;
  110. assign multi_ci_master_datab = ci_slave_multi_datab;
  111. assign multi_ci_master_n = ci_slave_multi_n;
  112. assign multi_ci_master_a = ci_slave_multi_a;
  113. assign multi_ci_master_b = ci_slave_multi_b;
  114. assign multi_ci_master_c = ci_slave_multi_c;
  115. assign multi_ci_master_readra = ci_slave_multi_readra;
  116. assign multi_ci_master_readrb = ci_slave_multi_readrb;
  117. assign multi_ci_master_writerc = ci_slave_multi_writerc;
  118. assign ci_slave_result = comb_ci_master_result;
  119. assign ci_slave_multi_result = multi_ci_master_result;
  120. end else begin
  121. assign multi_ci_master_dataa = ci_slave_dataa;
  122. assign multi_ci_master_datab = ci_slave_datab;
  123. assign multi_ci_master_n = ci_slave_n;
  124. assign multi_ci_master_a = ci_slave_a;
  125. assign multi_ci_master_b = ci_slave_b;
  126. assign multi_ci_master_c = ci_slave_c;
  127. assign multi_ci_master_readra = ci_slave_readra;
  128. assign multi_ci_master_readrb = ci_slave_readrb;
  129. assign multi_ci_master_writerc = ci_slave_writerc;
  130. assign ci_slave_result = ci_slave_multi_done ? multi_ci_master_result :
  131. comb_ci_master_result;
  132. end
  133. endgenerate
  134. endmodule