mirror of
https://github.com/YosysHQ/yosys
synced 2026-02-18 14:44:23 +00:00
add $priority cell
This commit is contained in:
parent
c7b839ef5a
commit
b72eaf5de5
9 changed files with 136 additions and 2 deletions
|
|
@ -3250,3 +3250,19 @@ parameter WIDTH = 0;
|
|||
inout [WIDTH-1:0] Y;
|
||||
|
||||
endmodule
|
||||
|
||||
// --------------------------------------------------------
|
||||
//-
|
||||
//- $priority (A, Y)
|
||||
//* group unary
|
||||
//-
|
||||
//- Priority operator. An output bit is set if the input bit at the same index is set and no lower index input bit is set.
|
||||
//-
|
||||
module \$priority (A, Y);
|
||||
parameter WIDTH = 8;
|
||||
input [WIDTH-1:0] A;
|
||||
output [WIDTH-1:0] Y;
|
||||
|
||||
assign Y = A & (~A + 1);
|
||||
|
||||
endmodule
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue