-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verilog: add tests for combiations of declarations
This adds tests for combinations of wire/reg/input/output/inout for the same identifier.
- Loading branch information
Showing
24 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
KNOWNBUG | ||
enum_name_collision.sv | ||
|
||
^EXIT=2$ | ||
^SIGNAL=0$ | ||
-- | ||
-- | ||
The name collision should be errored. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module main; | ||
|
||
typedef enum { some_identifier } some_type; | ||
|
||
// name collision | ||
wire some_identifier; | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CORE | ||
inout_and_reg.v | ||
|
||
^file .* line 4: symbol `some_var' is declared both as input and as register$ | ||
^EXIT=2$ | ||
^SIGNAL=0$ | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module main; | ||
// some_var must not be both an input and a reg | ||
inout [31:0] some_var; | ||
reg [31:0] some_var; | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
KNOWNBUG | ||
input_and_ansi_input.v | ||
|
||
^EXIT=2$ | ||
^SIGNAL=0$ | ||
-- | ||
-- | ||
The redeclaration must be errored. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module main(input [31:0] some_var); | ||
// some_var must not be redeclared | ||
input [31:0] some_var; | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
KNOWNBUG | ||
input_and_output.v | ||
|
||
^EXIT=2$ | ||
^SIGNAL=0$ | ||
-- | ||
-- | ||
This should be errored, as some_var must not be both input and output. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module main(x); | ||
// cannot declare both as input and output | ||
input [31:0] x; | ||
output [31:0] x; | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CORE | ||
input_and_reg.v | ||
|
||
^file .* line 4: symbol `some_var' is declared both as input and as register$ | ||
^EXIT=2$ | ||
^SIGNAL=0$ | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module main; | ||
// some_var must not be both an input and a reg | ||
input [31:0] some_var; | ||
reg [31:0] some_var; | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CORE | ||
parameter_name_collision.v | ||
|
||
^file .* line 4: definition of symbol `p' conflicts with earlier definition at line 3$ | ||
^EXIT=2$ | ||
^SIGNAL=0$ | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module main; | ||
|
||
parameter p = 123; | ||
parameter p = 123; | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CORE | ||
wire_and_output.v | ||
--module M1 | ||
^no properties$ | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module M1(some_port); | ||
output [31:0] some_port; | ||
wire [31:0] some_port; | ||
endmodule | ||
|
||
module M2(some_port); | ||
// order flipped | ||
wire [31:0] some_port; | ||
output [31:0] some_port; | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
KNOWNBUG | ||
wire_and_reg.v | ||
|
||
^EXIT=2$ | ||
^SIGNAL=0$ | ||
-- | ||
-- | ||
This should be errored, as some_var must not be both wire and reg. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module main; | ||
// some_var must not be both wire and reg | ||
wire [31:0] some_var; | ||
reg [31:0] some_var; | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
KNOWNBUG | ||
input_and_reg.v | ||
|
||
^EXIT=2$ | ||
^SIGNAL=0$ | ||
-- | ||
-- | ||
The redeclaration must be errored. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module main; | ||
// some_var must not be redeclared | ||
wire [31:0] some_var; | ||
wire [31:0] some_var; | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
KNOWNBUG | ||
task_name_collision.v | ||
|
||
^definition of symbol `some_task' conflicts with earlier definition at line$ | ||
^EXIT=2$ | ||
^SIGNAL=0$ | ||
-- | ||
-- | ||
The line number is missing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module main; | ||
|
||
reg [31:0] data; | ||
|
||
task some_task; | ||
data = 123; | ||
endtask | ||
|
||
task some_task; | ||
data = 456; | ||
endtask | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
KNOWNBUG | ||
typedef_name_collision1.sv | ||
|
||
^EXIT=2$ | ||
^SIGNAL=0$ | ||
-- | ||
-- | ||
The name collision should be errored. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module main; | ||
|
||
typedef bit some_identifier; | ||
|
||
// name collision | ||
typedef bit some_identifier; | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CORE | ||
typedef_name_collision2.sv | ||
|
||
^file .* line 6: definition of symbol `some_identifier' conflicts with earlier definition at line 3$ | ||
^EXIT=2$ | ||
^SIGNAL=0$ | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module main; | ||
|
||
wire some_identifier; | ||
|
||
// name collision | ||
typedef bit some_identifier; | ||
|
||
endmodule |