当前位置:网站首页>SOC_SD_CLK
SOC_SD_CLK
2022-06-30 06:38:00 【捌肆幺幺】
1.接口
input in_TestMode;
input hclk;
input hrst_n;
input [7:0] in_clk_divider; //分频计数
input in_sd_clk_enable; //时钟使能
input hw_stop_clk; //受到DMA和读写控制
output fifo_sd_clk;
output reg out_sd_clk_o;
2.内部信号
reg [7:0] div_counter; //分频计数器
wire divider_0_val;
wire out_sd_clk_tp;
wire clk_ena_stop;
3.功能代码
- 是否分频:in_clk_divider 为0时不分频
assign divider_0_val = (in_clk_divider == 8'b0 );
- 时钟开关
assign clk_ena_stop = (!in_sd_clk_enable || hw_stop_clk);
- 不需要分频的时候,out_sd_clk 置零可以降低功耗
[email protected](posedge hclk or negedge hrst_n) begin
if(!hrst_n)
out_sd_clk <= 1'b0;
else if (clk_ena_stop || divider_0_val)
out_sd_clk <= 1'b0;
else if (div_counter == in_clk_divider-1)
out_sd_clk <= ~out_sd_clk;
end
[email protected](posedge hclk or negedge hrst_n) begin
if(!hrst_n)
div_counter <= 8'b0;
else if ( clk_ena_stop || div_0_val)
div_counter <= 8'b0;
else begin
if(div_counter == in_clk_divider-1)
div_counter <= 8'b0;
else
div_counter <= div_counter + 1;
end
end
- MUX选择电路构成下来电路

MX2X2 U1
(
.Y(fifo_sd_clk),
.A(out_sd_clk), //0
.B(hclk ), //1
.S0 (divider_0_val)
);
TLATNTSCAX4 U2
(
.ECK(out_sd_clk_tp), //out
.SE(1 'b0), //1
.E( !clk_ena_stop), //s
.CK(fifo_sd_clk ) //0
);
MX2X2 U3
(
.Y(out_sd_clk_dft),
.A(out_sd_clk_tp ), //0
.B(hclk ), //1
.S(in_TestMode)
);
边栏推荐
- A small template (an abstract class, a complete process is written in a method, the uncertain part is written in the abstract method, and then the subclass inherits the abstract class, and the subclas
- Static routing job
- Fastapi learning Day2
- Deep learning --- the weight of the three good students' scores (3)
- Rhcsa day 1
- 相关数据库问题提问。
- 46. full arrangement -dfs double hundred code
- 力扣------替换空格
- Control method of UAV formation
- 程序猿入门攻略(十一)——结构体
猜你喜欢

1.4 - 定点数与浮点数

Introduction to neural networks

相关数据库问题提问。

First experience of Galaxy Kirin

New project folder based on PIO plug-in in vscode -- Interpretation

1.2 (supplementary)

Loading class `com. mysql. jdbc. Driver‘. This is deprecated. The new driver class is `com. mysql. cj. jdb

Gazebo model modification

基础刷题(一)

Gazebo installation, uninstall and upgrade
随机推荐
2020-10-06
Spin official tutorial
Ini parsing learning documents
Detailed description of methods in the interface
神经网络入门
华泰炒股安全吗?我想网上开户。
1.9 - Cache
1.2(补充)
Software tools_ Shortcut_ Operation summary
Collections tool class (V)
银河麒麟初体验
1.3 - 码制
Initial love with mqtt
[wechat applet: single or multiple styles, background color, rounded corners]
Gazebo model modification
To: k210 realizes face recognition (code interpretation attached)
ETL为什么经常变成ELT甚至LET?
Jgaurora A8 configuration file
Set in set (III)
Graphic octet, really top