nios2_uc_nios2_cpu_debug_slave_sysclk.v 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. //Legal Notice: (C)2020 Altera Corporation. All rights reserved. Your
  2. //use of Altera Corporation's design tools, logic functions and other
  3. //software and tools, and its AMPP partner logic functions, and any
  4. //output files any of the foregoing (including device programming or
  5. //simulation files), and any associated documentation or information are
  6. //expressly subject to the terms and conditions of the Altera Program
  7. //License Subscription Agreement or other applicable license agreement,
  8. //including, without limitation, that your use is for the sole purpose
  9. //of programming logic devices manufactured by Altera and sold by Altera
  10. //or its authorized distributors. Please refer to the applicable
  11. //agreement for further details.
  12. // synthesis translate_off
  13. `timescale 1ns / 1ps
  14. // synthesis translate_on
  15. // turn off superfluous verilog processor warnings
  16. // altera message_level Level1
  17. // altera message_off 10034 10035 10036 10037 10230 10240 10030
  18. module nios2_uc_nios2_cpu_debug_slave_sysclk (
  19. // inputs:
  20. clk,
  21. ir_in,
  22. sr,
  23. vs_udr,
  24. vs_uir,
  25. // outputs:
  26. jdo,
  27. take_action_break_a,
  28. take_action_break_b,
  29. take_action_break_c,
  30. take_action_ocimem_a,
  31. take_action_ocimem_b,
  32. take_action_tracectrl,
  33. take_no_action_break_a,
  34. take_no_action_break_b,
  35. take_no_action_break_c,
  36. take_no_action_ocimem_a
  37. )
  38. ;
  39. output [ 37: 0] jdo;
  40. output take_action_break_a;
  41. output take_action_break_b;
  42. output take_action_break_c;
  43. output take_action_ocimem_a;
  44. output take_action_ocimem_b;
  45. output take_action_tracectrl;
  46. output take_no_action_break_a;
  47. output take_no_action_break_b;
  48. output take_no_action_break_c;
  49. output take_no_action_ocimem_a;
  50. input clk;
  51. input [ 1: 0] ir_in;
  52. input [ 37: 0] sr;
  53. input vs_udr;
  54. input vs_uir;
  55. reg enable_action_strobe /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"D101,D103\"" */;
  56. reg [ 1: 0] ir /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"D101,R101\"" */;
  57. reg [ 37: 0] jdo /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"D101,R101\"" */;
  58. reg jxuir /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"D101,D103\"" */;
  59. reg sync2_udr /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"D101,D103\"" */;
  60. reg sync2_uir /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"D101,D103\"" */;
  61. wire sync_udr;
  62. wire sync_uir;
  63. wire take_action_break_a;
  64. wire take_action_break_b;
  65. wire take_action_break_c;
  66. wire take_action_ocimem_a;
  67. wire take_action_ocimem_b;
  68. wire take_action_tracectrl;
  69. wire take_no_action_break_a;
  70. wire take_no_action_break_b;
  71. wire take_no_action_break_c;
  72. wire take_no_action_ocimem_a;
  73. wire unxunused_resetxx3;
  74. wire unxunused_resetxx4;
  75. reg update_jdo_strobe /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"D101,D103\"" */;
  76. assign unxunused_resetxx3 = 1'b1;
  77. altera_std_synchronizer the_altera_std_synchronizer3
  78. (
  79. .clk (clk),
  80. .din (vs_udr),
  81. .dout (sync_udr),
  82. .reset_n (unxunused_resetxx3)
  83. );
  84. defparam the_altera_std_synchronizer3.depth = 2;
  85. assign unxunused_resetxx4 = 1'b1;
  86. altera_std_synchronizer the_altera_std_synchronizer4
  87. (
  88. .clk (clk),
  89. .din (vs_uir),
  90. .dout (sync_uir),
  91. .reset_n (unxunused_resetxx4)
  92. );
  93. defparam the_altera_std_synchronizer4.depth = 2;
  94. always @(posedge clk)
  95. begin
  96. sync2_udr <= sync_udr;
  97. update_jdo_strobe <= sync_udr & ~sync2_udr;
  98. enable_action_strobe <= update_jdo_strobe;
  99. sync2_uir <= sync_uir;
  100. jxuir <= sync_uir & ~sync2_uir;
  101. end
  102. assign take_action_ocimem_a = enable_action_strobe && (ir == 2'b00) &&
  103. ~jdo[35] && jdo[34];
  104. assign take_no_action_ocimem_a = enable_action_strobe && (ir == 2'b00) &&
  105. ~jdo[35] && ~jdo[34];
  106. assign take_action_ocimem_b = enable_action_strobe && (ir == 2'b00) &&
  107. jdo[35];
  108. assign take_action_break_a = enable_action_strobe && (ir == 2'b10) &&
  109. ~jdo[36] &&
  110. jdo[37];
  111. assign take_no_action_break_a = enable_action_strobe && (ir == 2'b10) &&
  112. ~jdo[36] &&
  113. ~jdo[37];
  114. assign take_action_break_b = enable_action_strobe && (ir == 2'b10) &&
  115. jdo[36] && ~jdo[35] &&
  116. jdo[37];
  117. assign take_no_action_break_b = enable_action_strobe && (ir == 2'b10) &&
  118. jdo[36] && ~jdo[35] &&
  119. ~jdo[37];
  120. assign take_action_break_c = enable_action_strobe && (ir == 2'b10) &&
  121. jdo[36] && jdo[35] &&
  122. jdo[37];
  123. assign take_no_action_break_c = enable_action_strobe && (ir == 2'b10) &&
  124. jdo[36] && jdo[35] &&
  125. ~jdo[37];
  126. assign take_action_tracectrl = enable_action_strobe && (ir == 2'b11) &&
  127. jdo[15];
  128. always @(posedge clk)
  129. begin
  130. if (jxuir)
  131. ir <= ir_in;
  132. if (update_jdo_strobe)
  133. jdo <= sr;
  134. end
  135. endmodule