📄 priority.v
字号:
//////////////////////////////////////////////////////////////////////////// Block Name : priority.v// Author : Jason Kassoff// Date : 01/28/01// Last Revision : 01/28/01 (by Jason Kassoff)//// Block Description :// This block models the priority selector circuit.// It sets the output for the highest priority bit slice// that has both match line and occupied line set.//// Controls:// Inputs: pri_match_s2, pri_occ_s2// Outputs: pri_addr_s2////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////module priority ( pri_match_s2, pri_addr_v2, pri_found_match_v2, phi1, phi2 );////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Port Declarations////////////////////////////////////////////////////////////////////////////input [19:0] pri_match_s2;output [19:0] pri_addr_v2;output pri_found_match_v2;input phi1;input phi2;/////////////////////////////////////////////////////////////////////////////// Internal Variable Declarations/////////////////////////////////////////////////////////////////////////////reg [19:0] pri_addr_v2;reg pri_found_match_v2;reg pri_found_match_q2;// select the first masked match bit and set corresponding address bitalways @(phi2 or pri_match_s2)begin if (phi2) begin casex (pri_match_s2) 20'b1xxxxxxxxxxxxxxxxxxx: pri_addr_v2 = 20'h80000; 20'b01xxxxxxxxxxxxxxxxxx: pri_addr_v2 = 20'h40000; 20'b001xxxxxxxxxxxxxxxxx: pri_addr_v2 = 20'h20000; 20'b0001xxxxxxxxxxxxxxxx: pri_addr_v2 = 20'h10000; 20'b00001xxxxxxxxxxxxxxx: pri_addr_v2 = 20'h08000; 20'b000001xxxxxxxxxxxxxx: pri_addr_v2 = 20'h04000; 20'b0000001xxxxxxxxxxxxx: pri_addr_v2 = 20'h02000; 20'b00000001xxxxxxxxxxxx: pri_addr_v2 = 20'h01000; 20'b000000001xxxxxxxxxxx: pri_addr_v2 = 20'h00800; 20'b0000000001xxxxxxxxxx: pri_addr_v2 = 20'h00400; 20'b00000000001xxxxxxxxx: pri_addr_v2 = 20'h00200; 20'b000000000001xxxxxxxx: pri_addr_v2 = 20'h00100; 20'b0000000000001xxxxxxx: pri_addr_v2 = 20'h00080; 20'b00000000000001xxxxxx: pri_addr_v2 = 20'h00040; 20'b000000000000001xxxxx: pri_addr_v2 = 20'h00020; 20'b0000000000000001xxxx: pri_addr_v2 = 20'h00010; 20'b00000000000000001xxx: pri_addr_v2 = 20'h00008; 20'b000000000000000001xx: pri_addr_v2 = 20'h00004; 20'b0000000000000000001x: pri_addr_v2 = 20'h00002; 20'b00000000000000000001: pri_addr_v2 = 20'h00001; default: begin pri_addr_v2 = 20'h00001; pri_found_match_q2 = 1'b0; end endcase end else begin pri_addr_v2 = 20'h00000; pri_found_match_q2 = 1'b1; endendalways @(posedge phi1 or posedge phi2)begin if (phi1) pri_found_match_v2 = 1'b1; if (phi2) pri_found_match_v2 = pri_found_match_q2;endendmodule // priority
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -