URL
https://opencores.org/ocsvn/yifive/yifive/trunk
Subversion Repositories yifive
[/] [yifive/] [trunk/] [caravel_yifive/] [verilog/] [rtl/] [syntacore/] [scr1/] [src/] [core/] [scr1_clk_ctrl.sv] - Rev 11
Compare with Previous | Blame | View Log
/// Copyright by Syntacore LLC © 2016-2020. See LICENSE for details/// @file <scr1_clk_ctrl.sv>/// @brief SCR1 clock control///`include "scr1_arch_description.svh"`ifdef SCR1_CLKCTRL_ENmodule scr1_clk_ctrl (input logic clk, // Clock control module clockinput logic rst_n, // Clock control module resetinput logic test_mode, // DFT Test Modeinput logic test_rst_n, // DFT Test resetinput logic pipe2clkctl_sleep_req_i, // CLK disable request from pipeinput logic pipe2clkctl_wake_req_i, // CLK enable request from pipeoutput logic clkctl2pipe_clk_alw_on_o, // Not gated pipe CLKoutput logic clkctl2pipe_clk_o, // Gated pipeoutput logic clkctl2pipe_clk_en_o, // CLK enabled flagoutput logic clkctl2pipe_clk_dbgc_o // CLK for pipe debug subsystem);logic ctrl_rst_n;assign clkctl2pipe_clk_alw_on_o = clk;assign clkctl2pipe_clk_dbgc_o = clk;assign ctrl_rst_n = (test_mode) ? test_rst_n : rst_n;always_ff @(posedge clk, negedge ctrl_rst_n) beginif (~ctrl_rst_n) beginclkctl2pipe_clk_en_o <= 1'b1;end else beginif (clkctl2pipe_clk_en_o) beginif (pipe2clkctl_sleep_req_i & ~pipe2clkctl_wake_req_i) beginclkctl2pipe_clk_en_o <= 1'b0;endend else begin // ~clkctl2pipe_clk_en_oif (pipe2clkctl_wake_req_i) beginclkctl2pipe_clk_en_o <= 1'b1;endend // pipelineendendscr1_cg i_scr1_cg_pipe (.clk (clk ),.clk_en (clkctl2pipe_clk_en_o),.test_mode (test_mode ),.clk_out (clkctl2pipe_clk_o ));endmodule : scr1_clk_ctrl`endif // SCR1_CLKCTRL_EN
