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
...
@@ -256,42 +256,42 @@ instance Show DriveStrength where
show
(
DriveStrength
s0
s1
)
=
printf
"(%s, %s)"
(
show
s0
)
(
show
s1
)
show
(
DriveStrength
s0
s1
)
=
printf
"(%s, %s)"
(
show
s0
)
(
show
s1
)
data
Strength0
data
Strength0
=
Supply0
=
Supply0
|
Strong0
|
Strong0
|
Pull0
|
Pull0
|
Weak0
|
Weak0
|
Highz0
|
Highz0
deriving
(
Eq
,
Ord
)
deriving
(
Eq
,
Ord
)
instance
Show
Strength0
where
instance
Show
Strength0
where
show
Supply0
=
"supply0"
show
Supply0
=
"supply0"
show
Strong0
=
"strong0"
show
Strong0
=
"strong0"
show
Pull0
=
"pull0"
show
Pull0
=
"pull0"
show
Weak0
=
"weak0"
show
Weak0
=
"weak0"
show
Highz0
=
"highz0"
show
Highz0
=
"highz0"
data
Strength1
data
Strength1
=
Supply1
=
Supply1
|
Strong1
|
Strong1
|
Pull1
|
Pull1
|
Weak1
|
Weak1
|
Highz1
|
Highz1
deriving
(
Eq
,
Ord
)
deriving
(
Eq
,
Ord
)
instance
Show
Strength1
where
instance
Show
Strength1
where
show
Supply1
=
"supply1"
show
Supply1
=
"supply1"
show
Strong1
=
"strong1"
show
Strong1
=
"strong1"
show
Pull1
=
"pull1"
show
Pull1
=
"pull1"
show
Weak1
=
"weak1"
show
Weak1
=
"weak1"
show
Highz1
=
"highz1"
show
Highz1
=
"highz1"
data
ChargeStrength
data
ChargeStrength
=
Small
=
Small
|
Medium
|
Medium
|
Large
|
Large
deriving
(
Eq
,
Ord
)
deriving
(
Eq
,
Ord
)
instance
Show
ChargeStrength
where
instance
Show
ChargeStrength
where
show
Small
=
"(small)"
show
Small
=
"(small)"
show
Medium
=
"(medium)"
show
Medium
=
"(medium)"
show
Large
=
"(large)"
show
Large
=
"(large)"
src/Language/SystemVerilog/Parser/Preprocess.hs
View file @
2b9fff78
...
@@ -182,7 +182,7 @@ popCondStack directive = do
...
@@ -182,7 +182,7 @@ popCondStack directive = do
cs
<-
getCondStack
cs
<-
getCondStack
case
cs
of
case
cs
of
[]
->
lexicalError
$
[]
->
lexicalError
$
"`"
++
directive
++
" directive outside of an `if/`endif block"
"`"
++
directive
++
" directive outside of an `if/`endif block"
c
:
cs'
->
setCondStack
cs'
>>
return
c
c
:
cs'
->
setCondStack
cs'
>>
return
c
isIdentChar
::
Char
->
Bool
isIdentChar
::
Char
->
Bool
...
...
test/basic/paramtype.v
View file @
2b9fff78
module
top
;
module
top
;
initial
begin
initial
begin
// generated by running a commercial simulator
// generated by running a commercial simulator
$
display
(
"m_def 0 00000000000000000000000000000001 1"
)
;
$
display
(
"m_def 0 00000000000000000000000000000001 1"
)
;
$
display
(
"m_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"m_def 00 00000000000000000000000000000001 2"
)
;
$
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
(
"m_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"m_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_nodef 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_nodef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_nodef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_def 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_def 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_def 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_def 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_def 0 00000000000000000000000000000001 1"
)
;
$
display
(
"n_def 0 00000000000000000000000000000001 1"
)
;
$
display
(
"n_def 01 00000000000000000000000000000010 2"
)
;
$
display
(
"n_def 01 00000000000000000000000000000010 2"
)
;
$
display
(
"n_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_def 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_def 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_def 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_def 0 00000000000000000000000000000001 1"
)
;
$
display
(
"n_def 0 00000000000000000000000000000001 1"
)
;
$
display
(
"n_def 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_def 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_tdef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_tdef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_tdef 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_tdef 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_tdef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_tdef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_tdef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_tdef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_tdef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_tdef 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_tdef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_tdef 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_nodef a= 1 01 00000000000000000000000000000010 2"
)
;
$
display
(
"n_nodef a= 1 01 00000000000000000000000000000010 2"
)
;
$
display
(
"n_nodef b= 0 000 00000000000000000000000000000001 3"
)
;
$
display
(
"n_nodef b= 0 000 00000000000000000000000000000001 3"
)
;
$
display
(
"n_nodef a= 0 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef a= 0 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef b= 1 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_nodef b= 1 1 00000000000000000000000000000010 1"
)
;
$
display
(
"n_nodef a= 0 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef a= 0 00 00000000000000000000000000000001 2"
)
;
$
display
(
"n_nodef b= 1 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_nodef b= 1 001 00000000000000000000000000000010 3"
)
;
$
display
(
"n_nodef a= 1 01 00000000000000000000000000000010 2"
)
;
$
display
(
"n_nodef a= 1 01 00000000000000000000000000000010 2"
)
;
$
display
(
"n_nodef b= 0 0 00000000000000000000000000000001 1"
)
;
$
display
(
"n_nodef b= 0 0 00000000000000000000000000000001 1"
)
;
$
display
(
"p 00 00000000000000000000000000000001 2"
)
;
$
display
(
"p 00 00000000000000000000000000000001 2"
)
;
$
display
(
"p 001 00000000000000000000000000000010 3"
)
;
$
display
(
"p 001 00000000000000000000000000000010 3"
)
;
$
display
(
"p 0 00000000000000000000000000000001 1"
)
;
$
display
(
"p 0 00000000000000000000000000000001 1"
)
;
$
display
(
"p 1 00000000000000000000000000000010 1"
)
;
$
display
(
"p 1 00000000000000000000000000000010 1"
)
;
$
display
(
"p 000 00000000000000000000000000000001 3"
)
;
$
display
(
"p 000 00000000000000000000000000000001 3"
)
;
$
display
(
"p 001 00000000000000000000000000000010 3"
)
;
$
display
(
"p 001 00000000000000000000000000000010 3"
)
;
end
end
endmodule
endmodule
test/basic/struct_array_param.v
View file @
2b9fff78
module
top
;
module
top
;
parameter
foo_1
=
{
3'b010
,
2'b01
,
4'b0000
};
parameter
foo_1
=
{
3'b010
,
2'b01
,
4'b0000
};
parameter
foo_0
=
{
3'b001
,
2'b00
,
4'b0010
};
parameter
foo_0
=
{
3'b001
,
2'b00
,
4'b0010
};
initial
begin
initial
begin
$
display
(
foo_0
)
;
$
display
(
foo_0
)
;
$
display
(
foo_1
)
;
$
display
(
foo_1
)
;
...
...
test/basic/union.sv
View file @
2b9fff78
typedef
union
packed
{
typedef
union
packed
{
logic
[
4
:
0
]
x
;
logic
[
4
:
0
]
x
;
logic
[
4
:
0
]
y
;
logic
[
4
:
0
]
y
;
}
A
;
}
A
;
typedef
union
packed
{
typedef
union
packed
{
logic
[
4
:
0
]
x
;
logic
[
4
:
0
]
x
;
logic
[
0
:
4
]
y
;
logic
[
0
:
4
]
y
;
}
B
;
}
B
;
typedef
union
packed
{
typedef
union
packed
{
logic
[
4
:
0
]
x
;
logic
[
4
:
0
]
x
;
logic
[
1
:
5
]
y
;
logic
[
1
:
5
]
y
;
}
C
;
}
C
;
typedef
union
packed
{
typedef
union
packed
{
logic
[
4
:
0
]
x
;
logic
[
4
:
0
]
x
;
struct
packed
{
struct
packed
{
logic
[
2
:
0
]
a
;
logic
[
2
:
0
]
a
;
logic
[
1
:
0
]
b
;
logic
[
1
:
0
]
b
;
}
y
;
}
y
;
struct
packed
{
struct
packed
{
logic
[
1
:
0
]
a
;
logic
[
1
:
0
]
a
;
logic
[
0
:
2
]
b
;
logic
[
0
:
2
]
b
;
}
z
;
}
z
;
}
D
;
}
D
;
module
wrap
;
module
wrap
;
...
...
test/resolve/package.svh
View file @
2b9fff78
`define
FANCY_SEEING_YOU
1337
`define
FANCY_SEEING_YOU
1337
package
pkg
;
package
pkg
;
function
automatic
integer
width_calc
;
function
automatic
integer
width_calc
;
input
integer
a
;
input
integer
a
;
return
a
+
3
;
return
a
+
3
;
endfunction
endfunction
endpackage
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