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
c53d348b
Commit
c53d348b
authored
Sep 06, 2019
by
Eddie Hung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt for macc
parent
1774b366
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
architecture/synth_xilinx_dsp/assert_area.py
+8
-4
architecture/synth_xilinx_dsp/generate_macc.py
+2
-2
No files found.
architecture/synth_xilinx_dsp/assert_area.py
View file @
c53d348b
...
...
@@ -10,12 +10,13 @@ for fn in glob.glob('*.v'):
m
=
re_mux
.
match
(
fn
)
if
not
m
:
continue
macc
=
m
.
group
(
1
)
==
'macc'
A
,
B
=
map
(
int
,
m
.
group
(
2
,
4
))
Asigned
,
Bsigned
=
m
.
group
(
3
,
5
)
Areg
=
'A'
in
m
.
group
(
6
)
Breg
=
'B'
in
m
.
group
(
6
)
Mreg
=
'M'
in
m
.
group
(
6
)
Preg
=
'P'
in
m
.
group
(
6
)
Preg
=
'P'
in
m
.
group
(
6
)
or
macc
if
A
<
B
:
A
,
B
=
B
,
A
Asigned
,
Bsigned
=
Bsigned
,
Asigned
...
...
@@ -29,12 +30,15 @@ for fn in glob.glob('*.v'):
count_DFF
=
0
if
Mreg
and
(
A
>
25
or
B
>
18
):
count_DFF
+=
A
+
B
count_DFF
+=
A
+
B
-
1
if
Preg
and
(
A
>
25
or
B
>
18
):
count_DFF
+=
A
+
B
count_DFF
+=
A
+
B
-
1
if
macc
:
count_DFF
+=
5
# In my testcases, accumulator is always
# 5bits bigger than multiplier result
# TODO: More assert on number of CARRY and LUTs
count_CARRY
=
''
if
A
<=
25
or
B
<=
18
:
if
not
macc
and
(
A
<=
25
or
B
<=
18
)
:
count_CARRY
=
'; select t:XORCY -assert-none; select t:LUT* -assert-none'
;
bn
,
_
=
os
.
path
.
splitext
(
fn
)
...
...
architecture/synth_xilinx_dsp/generate_macc.py
View file @
c53d348b
...
...
@@ -2,8 +2,8 @@
from
common_macc
import
gen_macc
ARange
=
[
'17'
,
'17s'
,
'18'
,
'18s'
,
'19'
,
'19s'
,
'24'
,
'24s'
]
BRange
=
[
'17'
,
'17s'
]
ARange
=
[
'17'
,
'17s'
,
'18'
,
'18s'
,
'19'
,
'19s'
,
'24'
,
'24s'
,
'25'
,
'25s'
,
'36'
,
'36s'
,
'49'
,
'49s'
,
'50'
,
'50s'
,
'75'
,
'75s'
]
BRange
=
[
'17'
,
'17s'
,
'18'
,
'18s'
,
'19'
,
'19s'
,
'27'
,
'27s'
,
'34'
,
'34s'
,
'35'
,
'35s'
,
'36'
,
'36s'
]
if
__name__
==
"__main__"
:
gen_macc
(
ARange
,
BRange
,
reg
=
"ABM"
)
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