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
5dbed420
Commit
5dbed420
authored
Aug 01, 2019
by
Eddie Hung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update xilinx_dsp tests
parent
13f65024
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
9 deletions
+30
-9
architecture/synth_xilinx_dsp/assert_area.py
+26
-5
architecture/synth_xilinx_dsp/run-test.sh
+4
-4
No files found.
architecture/synth_xilinx_dsp/assert_area.py
View file @
5dbed420
...
...
@@ -4,15 +4,35 @@ import glob
import
re
import
os
re_mux
=
re
.
compile
(
r'mul_(\d+)(s?)_(\d+)(s?)_
A?B?P?
_A?B?P?\.v'
)
re_mux
=
re
.
compile
(
r'mul_(\d+)(s?)_(\d+)(s?)_
(A?B?P?)
_A?B?P?\.v'
)
for
fn
in
glob
.
glob
(
'*.v'
):
m
=
re_mux
.
match
(
fn
)
if
not
m
:
continue
A
,
B
=
map
(
int
,
m
.
group
(
1
,
3
))
if
not
m
.
group
(
2
):
A
+=
1
if
not
m
.
group
(
4
):
B
+=
1
Asigned
,
Bsigned
=
m
.
group
(
2
,
4
)
Areg
=
'A'
in
m
.
group
(
5
)
Breg
=
'B'
in
m
.
group
(
5
)
Preg
=
'P'
in
m
.
group
(
5
)
if
not
(
Asigned
and
Bsigned
):
A
+=
1
B
+=
1
Asigned
=
Bsigned
=
1
if
A
<
B
:
A
,
B
=
B
,
A
Asigned
,
Bsigned
=
Bsigned
,
Asigned
X
=
(
A
+
23
)
//
24
if
X
>
1
and
A
%
24
==
1
:
X
-=
1
# No headroom needed on last multiplier
Y
=
(
B
+
16
)
//
17
if
Y
>
1
and
B
%
17
==
1
:
Y
-=
1
# No headroom needed on last multiplier
count_MAC
=
X
*
Y
count_DFF
=
0
if
Preg
:
count_DFF
+=
A
+
B
# TODO: Assert on number of CARRY4s too
bn
,
_
=
os
.
path
.
splitext
(
fn
)
...
...
@@ -20,7 +40,8 @@ for fn in glob.glob('*.v'):
print
(
'''
`ifndef _AUTOTB
module __test ;
wire [4095:0] assert_area = "cd
%
s; select t:DSP48E1 -assert-count 1; select t:* t:DSP48E1
%%
d -assert-none";
wire [4095:0] assert_area = "cd {0}; select t:DSP48E1 -assert-count {1}; select t:FD* -assert-max {2}";
// {3} {4} {5} {6} X={7} Y={8}
endmodule
`endif
'''
%
os
.
path
.
splitext
(
fn
)[
0
]
,
file
=
f
)
'''
.
format
(
os
.
path
.
splitext
(
fn
)[
0
],
count_MAC
,
count_DFF
,
A
,
B
,
Asigned
,
Bsigned
,
X
,
Y
)
,
file
=
f
)
architecture/synth_xilinx_dsp/run-test.sh
View file @
5dbed420
...
...
@@ -19,12 +19,12 @@ if ! which iverilog > /dev/null ; then
fi
#wget https://raw.githubusercontent.com/YosysHQ/yosys-bench/master/verilog/benchmarks_small/mul/generate.py -O generate_mul.py -o /dev/null
cp ~/yosys/yosys-bench/verilog/benchmarks_small/mul/
generate.py generate
_mul.py
python3
generate_mul.py
cp ~/yosys/yosys-bench/verilog/benchmarks_small/mul/
common.py common
_mul.py
PYTHONPATH
=
".:
$PYTHONPATH
"
python3 ../
generate_mul.py
python3 ../assert_area.py
${
MAKE
:-
make
}
-f
../../../../tools/autotest.mk
$seed
*
.v
EXTRA_FLAGS
=
"
\
${
MAKE
:-
make
}
-f
../../../../tools/autotest.mk
$seed
*
__
.v
EXTRA_FLAGS
=
"
\
-p 'design -copy-to __test __test;
\
synth_xilinx
-abc9
;
\
synth_xilinx;
\
design -copy-from __test *;
\
select -assert-any __test;
\
script -scriptwire __test/w:assert_area'
\
...
...
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