mirror of
https://github.com/YosysHQ/yosys
synced 2026-02-01 06:48:01 +00:00
add $priority cell
This commit is contained in:
parent
967b47d984
commit
e166dd4475
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