modectrlunit.v
来自「hmac的verilog代码, 通过控制字选择进行sha1运算或hmac运算」· Verilog 代码 · 共 41 行
V
41 行
///////////////////////////////////////////////////////// module describe// name: modectrlunit// function: record the ctrl word,the addr is 0;ctrlword[0] is the padflg.// writer: zy// data: 2006/03/14// version: 1.0// feature: ////////////////////////////////////////////////////////module modectrlunit(clk,reset,en,wr,addr,datain,ctrlword,maskword);input clk;input reset;input en;input wr;input [3:0] addr;input [4:0] datain;output [4:0] ctrlword;output [2:0] maskword;reg [4:0] ctrlword;//ctrl[0] is pad flag, ctrl[1] is soft reset,ctrl[2] is modsel, ctrl[3] is newhmac, ctrl[4] is ivrstreg [2:0] maskword;always @(posedge clk)begin if (!reset) begin ctrlword<=0; maskword<=0; end else if ((addr==0)&&(en)&&(!wr)) ctrlword<=datain; else if ((addr==15)&&(en)&&(!wr)) maskword<=datain[2:0]; else ctrlword[1]<=0;endendmodule
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?