Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv2v
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
sv2v
Commits
2b9fff78
Commit
2b9fff78
authored
Feb 19, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix indentation inconsistencies
parent
e9d62e01
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
92 deletions
+92
-92
src/Language/SystemVerilog/AST/Type.hs
+29
-29
src/Language/SystemVerilog/Parser/Preprocess.hs
+1
-1
test/basic/paramtype.v
+44
-44
test/basic/struct_array_param.v
+2
-2
test/basic/union.sv
+15
-15
test/resolve/package.svh
+1
-1
No files found.
src/Language/SystemVerilog/AST/Type.hs
View file @
2b9fff78
...
...
@@ -256,42 +256,42 @@ instance Show DriveStrength where
show
(
DriveStrength
s0
s1
)
=
printf
"(%s, %s)"
(
show
s0
)
(
show
s1
)
data
Strength0
=
Supply0
|
Strong0
|
Pull0
|
Weak0
|
Highz0
deriving
(
Eq
,
Ord
)
=
Supply0
|
Strong0
|
Pull0
|
Weak0
|
Highz0
deriving
(
Eq
,
Ord
)
instance
Show
Strength0
where
show
Supply0
=
"supply0"
show
Strong0
=
"strong0"
show
Pull0
=
"pull0"
show
Weak0
=
"weak0"
show
Highz0
=
"highz0"
show
Supply0
=
"supply0"
show
Strong0
=
"strong0"
show
Pull0
=
"pull0"
show
Weak0
=
"weak0"
show
Highz0
=
"highz0"
data
Strength1
=
Supply1
|
Strong1
|
Pull1
|
Weak1
|
Highz1
deriving
(
Eq
,
Ord
)
=
Supply1
|
Strong1
|
Pull1
|
Weak1
|
Highz1
deriving
(
Eq
,
Ord
)
instance
Show
Strength1
where
show
Supply1
=
"supply1"
show
Strong1
=
"strong1"
show
Pull1
=
"pull1"
show
Weak1
=
"weak1"
show
Highz1
=
"highz1"
show
Supply1
=
"supply1"
show
Strong1
=
"strong1"
show
Pull1
=
"pull1"
show
Weak1
=
"weak1"
show
Highz1
=
"highz1"
data
ChargeStrength
=
Small
|
Medium
|
Large
deriving
(
Eq
,
Ord
)
=
Small
|
Medium
|
Large
deriving
(
Eq
,
Ord
)
instance
Show
ChargeStrength
where
show
Small
=
"(small)"
show
Medium
=
"(medium)"
show
Large
=
"(large)"
show
Small
=
"(small)"
show
Medium
=
"(medium)"
show
Large
=
"(large)"
src/Language/SystemVerilog/Parser/Preprocess.hs
View file @
2b9fff78
...
...
@@ -182,7 +182,7 @@ popCondStack directive = do
cs
<-
getCondStack
case
cs
of
[]
->
lexicalError
$
"`"
++
directive
++
" directive outside of an `if/`endif block"
"`"
++
directive
++
" directive outside of an `if/`endif block"
c
:
cs'
->
setCondStack
cs'
>>
return
c
isIdentChar
::
Char
->
Bool
...
...
test/basic/paramtype.v
View file @
2b9fff78
module
top
;
initial
begin
// generated by running a commercial simulator
$
display
(
"m_def 0 00000000000000000000000000000001 1"
)
;
$
display
(
"m_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"m_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"m_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"m_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_def 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_def 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_def 0 00000000000000000000000000000001 1"
)
;
$
display
(
"n_def 01 00000000000000000000000000000010 2"
)
;
$
display
(
"n_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_def 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_def 0 00000000000000000000000000000001 1"
)
;
$
display
(
"n_def 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_tdef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_tdef 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_tdef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_tdef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_tdef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_tdef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_nodef a= 1 01 00000000000000000000000000000010 2"
)
;
$
display
(
"n_nodef b= 0 000 00000000000000000000000000000001 3"
)
;
$
display
(
"n_nodef a= 0 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef b= 1 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_nodef a= 0 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef b= 1 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_nodef a= 1 01 00000000000000000000000000000010 2"
)
;
$
display
(
"n_nodef b= 0 0 00000000000000000000000000000001 1"
)
;
$
display
(
"p 00 00000000000000000000000000000001 2"
)
;
$
display
(
"p 001 00000000000000000000000000000010 3"
)
;
$
display
(
"p 0 00000000000000000000000000000001 1"
)
;
$
display
(
"p 1 00000000000000000000000000000010 1"
)
;
$
display
(
"p 000 00000000000000000000000000000001 3"
)
;
$
display
(
"p 001 00000000000000000000000000000010 3"
)
;
end
initial
begin
// generated by running a commercial simulator
$
display
(
"m_def 0 00000000000000000000000000000001 1"
)
;
$
display
(
"m_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"m_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"m_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"m_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_def 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_def 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_def 0 00000000000000000000000000000001 1"
)
;
$
display
(
"n_def 01 00000000000000000000000000000010 2"
)
;
$
display
(
"n_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_def 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_def 0 00000000000000000000000000000001 1"
)
;
$
display
(
"n_def 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_tdef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_tdef 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_tdef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_tdef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_tdef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_tdef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_nodef a= 1 01 00000000000000000000000000000010 2"
)
;
$
display
(
"n_nodef b= 0 000 00000000000000000000000000000001 3"
)
;
$
display
(
"n_nodef a= 0 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef b= 1 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_nodef a= 0 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef b= 1 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_nodef a= 1 01 00000000000000000000000000000010 2"
)
;
$
display
(
"n_nodef b= 0 0 00000000000000000000000000000001 1"
)
;
$
display
(
"p 00 00000000000000000000000000000001 2"
)
;
$
display
(
"p 001 00000000000000000000000000000010 3"
)
;
$
display
(
"p 0 00000000000000000000000000000001 1"
)
;
$
display
(
"p 1 00000000000000000000000000000010 1"
)
;
$
display
(
"p 000 00000000000000000000000000000001 3"
)
;
$
display
(
"p 001 00000000000000000000000000000010 3"
)
;
end
endmodule
test/basic/struct_array_param.v
View file @
2b9fff78
module
top
;
parameter
foo_1
=
{
3'b010
,
2'b01
,
4'b0000
};
parameter
foo_0
=
{
3'b001
,
2'b00
,
4'b0010
};
parameter
foo_1
=
{
3'b010
,
2'b01
,
4'b0000
};
parameter
foo_0
=
{
3'b001
,
2'b00
,
4'b0010
};
initial
begin
$
display
(
foo_0
)
;
$
display
(
foo_1
)
;
...
...
test/basic/union.sv
View file @
2b9fff78
typedef
union
packed
{
logic
[
4
:
0
]
x
;
logic
[
4
:
0
]
y
;
logic
[
4
:
0
]
x
;
logic
[
4
:
0
]
y
;
}
A
;
typedef
union
packed
{
logic
[
4
:
0
]
x
;
logic
[
0
:
4
]
y
;
logic
[
4
:
0
]
x
;
logic
[
0
:
4
]
y
;
}
B
;
typedef
union
packed
{
logic
[
4
:
0
]
x
;
logic
[
1
:
5
]
y
;
logic
[
4
:
0
]
x
;
logic
[
1
:
5
]
y
;
}
C
;
typedef
union
packed
{
logic
[
4
:
0
]
x
;
struct
packed
{
logic
[
2
:
0
]
a
;
logic
[
1
:
0
]
b
;
}
y
;
struct
packed
{
logic
[
1
:
0
]
a
;
logic
[
0
:
2
]
b
;
}
z
;
logic
[
4
:
0
]
x
;
struct
packed
{
logic
[
2
:
0
]
a
;
logic
[
1
:
0
]
b
;
}
y
;
struct
packed
{
logic
[
1
:
0
]
a
;
logic
[
0
:
2
]
b
;
}
z
;
}
D
;
module
wrap
;
...
...
test/resolve/package.svh
View file @
2b9fff78
`define
FANCY_SEEING_YOU
1337
package
pkg
;
function
automatic
integer
width_calc
;
input
integer
a
;
input
integer
a
;
return
a
+
3
;
endfunction
endpackage
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment