Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yosys-tests
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
yosys-tests
Commits
20804cae
Commit
20804cae
authored
Oct 05, 2019
by
Eddie Hung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update synth_xilinx_dsp/assert_area.py for muladd
parent
095a0103
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
architecture/synth_xilinx_dsp/assert_area.py
+10
-5
No files found.
architecture/synth_xilinx_dsp/assert_area.py
View file @
20804cae
...
@@ -15,8 +15,10 @@ for fn in glob.glob('*.v'):
...
@@ -15,8 +15,10 @@ for fn in glob.glob('*.v'):
A
,
B
=
map
(
int
,
m
.
group
(
2
,
4
))
A
,
B
=
map
(
int
,
m
.
group
(
2
,
4
))
Asigned
,
Bsigned
=
m
.
group
(
3
,
5
)
Asigned
,
Bsigned
=
m
.
group
(
3
,
5
)
if
m
.
group
(
6
):
if
m
.
group
(
6
):
C
=
map
(
int
,
m
.
group
(
7
))
C
=
int
(
m
.
group
(
7
))
Csigned
=
m
.
group
(
8
)
Csigned
=
m
.
group
(
8
)
else
:
C
=
0
Areg
=
'A'
in
m
.
group
(
9
)
Areg
=
'A'
in
m
.
group
(
9
)
Breg
=
'B'
in
m
.
group
(
9
)
Breg
=
'B'
in
m
.
group
(
9
)
Mreg
=
'M'
in
m
.
group
(
9
)
Mreg
=
'M'
in
m
.
group
(
9
)
...
@@ -28,6 +30,9 @@ for fn in glob.glob('*.v'):
...
@@ -28,6 +30,9 @@ for fn in glob.glob('*.v'):
A
+=
1
A
+=
1
B
+=
1
B
+=
1
Asigned
=
Bsigned
=
1
Asigned
=
Bsigned
=
1
if
C
>
0
and
not
Csigned
:
C
+=
1
Csigned
=
1
X
=
1
+
max
(
0
,
A
-
25
+
16
)
//
17
X
=
1
+
max
(
0
,
A
-
25
+
16
)
//
17
Y
=
1
+
max
(
0
,
B
-
18
+
16
)
//
17
Y
=
1
+
max
(
0
,
B
-
18
+
16
)
//
17
count_MAC
=
X
*
Y
count_MAC
=
X
*
Y
...
@@ -38,18 +43,18 @@ for fn in glob.glob('*.v'):
...
@@ -38,18 +43,18 @@ for fn in glob.glob('*.v'):
if
not
macc
and
(
A
>
25
)
^
(
B
>
18
):
if
not
macc
and
(
A
>
25
)
^
(
B
>
18
):
count_DFF
-=
1
# For pure multipliers with just one big dimension,
count_DFF
-=
1
# For pure multipliers with just one big dimension,
# expect last slice to absorb at least one register
# expect last slice to absorb at least one register
if
Preg
and
(
A
>
25
or
B
>
18
):
if
Preg
and
(
A
>
25
or
B
>
18
or
C
>
48
):
count_DFF
+=
A
+
B
count_DFF
+=
max
(
A
+
B
,
C
)
if
macc
:
if
macc
:
count_DFF
+=
5
# In my testcases, accumulator is always
count_DFF
+=
5
# In my testcases, accumulator is always
# 5bits bigger than multiplier result
# 5bits bigger than multiplier result
elif
(
A
>
25
)
^
(
B
>
18
)
:
elif
(
(
A
>
25
)
^
(
B
>
18
))
and
C
<=
48
:
count_DFF
-=
1
# For pure multipliers with just one big dimension,
count_DFF
-=
1
# For pure multipliers with just one big dimension,
# expect last slice to absorb at least one register
# expect last slice to absorb at least one register
# TODO: More assert on number of CARRY and LUTs
# TODO: More assert on number of CARRY and LUTs
count_CARRY
=
''
count_CARRY
=
''
if
macc
or
muladd
:
if
macc
or
muladd
:
if
A
<=
25
and
B
<=
18
:
if
A
<=
25
and
B
<=
18
and
C
<=
48
:
count_CARRY
=
'; select t:XORCY -assert-none; select t:LUT* -assert-none'
;
count_CARRY
=
'; select t:XORCY -assert-none; select t:LUT* -assert-none'
;
elif
A
<=
25
or
B
<=
18
:
elif
A
<=
25
or
B
<=
18
:
count_CARRY
=
'; select t:XORCY -assert-none; select t:LUT* -assert-none'
;
count_CARRY
=
'; select t:XORCY -assert-none; select t:LUT* -assert-none'
;
...
...
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