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
d4511871
Commit
d4511871
authored
Aug 13, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
typeof $clog2
parent
d9e890c8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
0 deletions
+7
-0
src/Convert/TypeOf.hs
+2
-0
test/basic/typeof.sv
+2
-0
test/basic/typeof.v
+3
-0
No files found.
src/Convert/TypeOf.hs
View file @
d4511871
...
@@ -95,6 +95,8 @@ typeof (Call (Ident "$unsigned") (Args [e] [])) =
...
@@ -95,6 +95,8 @@ typeof (Call (Ident "$unsigned") (Args [e] [])) =
typeof
e
typeof
e
typeof
(
Call
(
Ident
"$signed"
)
(
Args
[
e
]
[]
))
=
typeof
(
Call
(
Ident
"$signed"
)
(
Args
[
e
]
[]
))
=
typeof
e
typeof
e
typeof
(
Call
(
Ident
"$clog2"
)
(
Args
[
_
]
[]
))
=
return
$
IntegerAtom
TInteger
Unspecified
typeof
(
Call
(
Ident
x
)
_
)
=
typeof
(
Call
(
Ident
x
)
_
)
=
typeof
$
Ident
x
typeof
$
Ident
x
typeof
(
orig
@
(
Bit
e
_
))
=
do
typeof
(
orig
@
(
Bit
e
_
))
=
do
...
...
test/basic/typeof.sv
View file @
d4511871
...
@@ -31,6 +31,7 @@ module top;
...
@@ -31,6 +31,7 @@ module top;
type
(
{
x
,
y
}
)
b
=
{
x
,
y
};
type
(
{
x
,
y
}
)
b
=
{
x
,
y
};
type
(
FLAG
?
x
:
y
)
c
=
FLAG
?
x
:
y
;
type
(
FLAG
?
x
:
y
)
c
=
FLAG
?
x
:
y
;
type
(
!
FLAG
?
x
:
y
)
d
=
!
FLAG
?
x
:
y
;
type
(
!
FLAG
?
x
:
y
)
d
=
!
FLAG
?
x
:
y
;
type
($
clog2
(
x
))
e
=
$
clog2
(
x
)
;
$
display
(
"%b %d %d"
,
x
,
$
left
(
x
)
,
$
right
(
x
))
;
$
display
(
"%b %d %d"
,
x
,
$
left
(
x
)
,
$
right
(
x
))
;
$
display
(
"%b %d %d"
,
y
,
$
left
(
y
)
,
$
right
(
y
))
;
$
display
(
"%b %d %d"
,
y
,
$
left
(
y
)
,
$
right
(
y
))
;
$
display
(
"%b %d %d"
,
z
,
$
left
(
z
)
,
$
right
(
z
))
;
$
display
(
"%b %d %d"
,
z
,
$
left
(
z
)
,
$
right
(
z
))
;
...
@@ -38,6 +39,7 @@ module top;
...
@@ -38,6 +39,7 @@ module top;
$
display
(
"%b %d %d"
,
b
,
$
left
(
b
)
,
$
right
(
b
))
;
$
display
(
"%b %d %d"
,
b
,
$
left
(
b
)
,
$
right
(
b
))
;
$
display
(
"%b %d %d"
,
c
,
$
left
(
c
)
,
$
right
(
c
))
;
$
display
(
"%b %d %d"
,
c
,
$
left
(
c
)
,
$
right
(
c
))
;
$
display
(
"%b %d %d"
,
d
,
$
left
(
d
)
,
$
right
(
d
))
;
$
display
(
"%b %d %d"
,
d
,
$
left
(
d
)
,
$
right
(
d
))
;
$
display
(
"%b %d %d"
,
e
,
$
left
(
e
)
,
$
right
(
e
))
;
end
end
parameter
W
=
4
;
parameter
W
=
4
;
...
...
test/basic/typeof.v
View file @
d4511871
...
@@ -33,6 +33,7 @@ module top;
...
@@ -33,6 +33,7 @@ module top;
reg
[
31
:
0
]
a
;
reg
[
31
:
0
]
a
;
reg
[
7
:
0
]
b
;
reg
[
7
:
0
]
b
;
reg
[
3
:
0
]
c
,
d
;
reg
[
3
:
0
]
c
,
d
;
integer
e
;
x
=
4'b1011
;
x
=
4'b1011
;
y
=
x
^
3'b111
;
y
=
x
^
3'b111
;
z
=
x
^
5'b11111
;
z
=
x
^
5'b11111
;
...
@@ -40,6 +41,7 @@ module top;
...
@@ -40,6 +41,7 @@ module top;
b
=
{
x
,
y
};
b
=
{
x
,
y
};
c
=
FLAG
?
x
:
y
;
c
=
FLAG
?
x
:
y
;
d
=
!
FLAG
?
x
:
y
;
d
=
!
FLAG
?
x
:
y
;
e
=
$
clog2
(
x
)
;
$
display
(
"%b %d %d"
,
x
,
4
,
1
)
;
$
display
(
"%b %d %d"
,
x
,
4
,
1
)
;
$
display
(
"%b %d %d"
,
y
,
3
,
0
)
;
$
display
(
"%b %d %d"
,
y
,
3
,
0
)
;
$
display
(
"%b %d %d"
,
z
,
4
,
0
)
;
$
display
(
"%b %d %d"
,
z
,
4
,
0
)
;
...
@@ -47,6 +49,7 @@ module top;
...
@@ -47,6 +49,7 @@ module top;
$
display
(
"%b %d %d"
,
b
,
7
,
0
)
;
$
display
(
"%b %d %d"
,
b
,
7
,
0
)
;
$
display
(
"%b %d %d"
,
c
,
3
,
0
)
;
$
display
(
"%b %d %d"
,
c
,
3
,
0
)
;
$
display
(
"%b %d %d"
,
d
,
3
,
0
)
;
$
display
(
"%b %d %d"
,
d
,
3
,
0
)
;
$
display
(
"%b %d %d"
,
e
,
31
,
0
)
;
end
end
parameter
W
=
4
;
parameter
W
=
4
;
...
...
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