SampleStrobeGenRstDemux.v 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. `timescale 1ns / 1ps
  2. //////////////////////////////////////////////////////////////////////////////////
  3. // Company:
  4. // Engineer:
  5. //
  6. // Create Date: 10:02:35 04/20/2020
  7. // Design Name:
  8. // Module Name: mult_module
  9. // Project Name:
  10. // Target Devices:
  11. // Tool versions:
  12. // Description:
  13. //
  14. // Dependencies:
  15. //
  16. // Revision:
  17. // Revision 0.01 - File Created
  18. // Additional Comments:
  19. //
  20. //////////////////////////////////////////////////////////////////////////////////
  21. module SampleStrobeGenRstDemux
  22. #(
  23. parameter CmdRegWidth = 24,
  24. parameter PGenNum = 7,
  25. parameter TrigPortsNum = 6
  26. )
  27. (
  28. input Rst_i,
  29. input [CmdRegWidth-28:0] MuxCtrl_i,
  30. input GenRst_i,
  31. output [PGenNum-1:0] RstDemuxOut_o
  32. );
  33. //================================================================================
  34. // LOCALPARAM
  35. //================================================================================
  36. // REG/WIRE
  37. reg [PGenNum-1:0] demuxOut;
  38. //================================================================================
  39. // ASSIGNMENTS
  40. assign RstDemuxOut_o = demuxOut;
  41. //================================================================================
  42. // CODING
  43. always @(*) begin
  44. if (!Rst_i) begin
  45. case(MuxCtrl_i)
  46. 5'd0: begin
  47. demuxOut = {6'b000000,GenRst_i};
  48. end
  49. 5'd1: begin
  50. demuxOut = {5'b00000,GenRst_i,1'b0};
  51. end
  52. 5'd2: begin
  53. demuxOut = {5'b0000,GenRst_i,2'b00};
  54. end
  55. 5'd3: begin
  56. demuxOut = {3'b000,GenRst_i,3'b000};
  57. end
  58. 5'd4: begin
  59. demuxOut = {2'b00,GenRst_i,5'b0000};
  60. end
  61. 5'd5: begin
  62. demuxOut = {1'b0,GenRst_i,5'b00000};
  63. end
  64. 5'd6: begin
  65. demuxOut = {GenRst_i,6'b000000};
  66. end
  67. default :begin
  68. demuxOut = 7'b0000000;
  69. end
  70. endcase
  71. end else begin
  72. demuxOut = 0;
  73. end
  74. end
  75. endmodule