minor stylistic tweaks

This commit is contained in:
Zachary Snow 2024-02-25 14:13:23 -05:00
parent a91541b8c2
commit c92065cd10
5 changed files with 21 additions and 31 deletions

View File

@ -7,8 +7,8 @@
### New Features
* `unique`, `unique0`, and `priority` case statements now are prefaced
with `parallel_case` and `full_case` attributes
* `unique`, `unique0`, and `priority` case statements now produce corresponding
`parallel_case` and `full_case` statement attributes
* Added support for attributes in unary, binary, and ternary expressions
* Added support for shadowing interface names with local typenames
* Added support for streaming concatenations within ternary expressions

View File

@ -3,8 +3,9 @@
-
- Conversion for `unique`, `unique0`, and `priority` (verification checks)
-
- This conversion adds full_case and parallel_case synthesis attributes
- for priority and unique modifiers on case statements.
- For `case`, these verification checks are replaced with equivalent
- `full_case` and `parallel_case` attributes. For `if`, they are simply
- dropped.
-}
module Convert.Unique (convert) where

View File

@ -1,19 +1,10 @@
module top;
reg [1:0] select;
logic [3:0] data [2:0];
UniqueCase case0(.select, .data(data[0]));
Unique0Case case1(.select, .data(data[1]));
PriorityCase case2(.select, .data(data[2]));
initial begin end
endmodule
module UniqueCase(
input logic [1:0] select,
output logic [3:0] data
);
always_comb begin
data = 4'b0;
unique case(select)
unique case (select)
2'd0: data = 4'ha;
2'd1: data = 4'h6;
2'd2: data = 4'h3;
@ -27,7 +18,7 @@ module Unique0Case(
);
always_comb begin
data = 4'b0;
unique0 case(select)
unique0 case (select)
2'd0: data = 4'ha;
2'd1: data = 4'h6;
2'd2: data = 4'h3;
@ -41,7 +32,7 @@ module PriorityCase(
);
always_comb begin
data = 4'b0;
priority case(select)
priority case (select)
2'd0: data = 4'ha;
2'd1: data = 4'h6;
2'd2: data = 4'h3;

View File

@ -1,19 +1,10 @@
module top;
reg [1:0] select;
wire [3:0] data [2:0];
UniqueCase case0(.select(select), .data(data[0]));
Unique0Case case1(.select(select), .data(data[1]));
PriorityCase case2(.select(select), .data(data[2]));
initial begin end
endmodule
module UniqueCase(
input [1:0] select,
input wire [1:0] select,
output reg [3:0] data
);
always @* begin
data = 4'b0;
case(select)
case (select)
2'd0: data = 4'ha;
2'd1: data = 4'h6;
2'd2: data = 4'h3;
@ -22,12 +13,12 @@ module UniqueCase(
endmodule
module Unique0Case(
input [1:0] select,
input wire [1:0] select,
output reg [3:0] data
);
always @* begin
data = 4'b0;
case(select)
case (select)
2'd0: data = 4'ha;
2'd1: data = 4'h6;
2'd2: data = 4'h3;
@ -36,12 +27,12 @@ module Unique0Case(
endmodule
module PriorityCase(
input [1:0] select,
input wire [1:0] select,
output reg [3:0] data
);
always @* begin
data = 4'b0;
case(select)
case (select)
2'd0: data = 4'ha;
2'd1: data = 4'h6;
2'd2: data = 4'h3;

View File

@ -0,0 +1,7 @@
module top;
reg [1:0] select;
wire [3:0] data [2:0];
UniqueCase case0(select, data[0]);
Unique0Case case1(select, data[1]);
PriorityCase case2(select, data[2]);
endmodule