This repository contains examples from the paper Metaprogramming with Combinators. All measurements were performed under Ubuntu 16.04 using Vivado 2018.3. You may need to install the packages libgmp-dev
and libncurses-dev
using apt
in order to compile all examples.
Running the synthesis tools produces a number of output files. LUT and FF resource usage can be found in the file post_route_util.rpt
. To compute WNS
(post_route_timing_summary.rpt
and use the equation
-
C$\lambda$ash:
- Change to the directory
incrementer/clash
. - Type
make
to generate VHDL files. - For serial results,
cd
tosyn/serial
and typemake
. - For parallel results,
cd
tosyn/parallel-bubble-squeeze
and typemake
. - Reports are produced in two directories:
outputs_u8_8
andoutputs_u16
.
- Change to the directory
-
Kansas Lava:
- Change to he directory
incrementer/kansas-lava
. - Type
make
to generate the code generator,bin/incrementer
. - Invoke
bin/incrementer
to generate VHDL files. - For serial results,
cd
tosyn/serial
and typemake
. - For parallel results,
cd
tosyn/parallel-bubble-squeeze
and typemake
. - Reports are produced in 4 directories:
outputs_u8_8
,outputs_u8_8_rtl
(RTL version),outputs_u16
, andoutputs_u16_rtl
(RTL version).
- Change to he directory
-
MWC:
- Change to the directory
incrementer/vhdl-codegen
. - Type
make
to generate VHDL files. - For serial results,
cd
tosyn/serial
and typemake
. - For parallel results,
cd
tosyn/parallel-bubble-squeeze
and typemake
. - Reports are produced in two directories:
outputs_uq8_8
andoutputs_uq16
.
- Change to the directory
Comparisons are located in the directory ip-comparisons
. For each IP core there are two directories: ip
, which contains the Xilinx IP, and vhdl-codegen
, which contains the MWC implementation.
-
Xilinx IP:
cd
to theip
subdirectory.- Type
make
. - Outputs are in the
outputs
directory.
-
MWC
cd
to thevhdl-codegen
subdirectory.- Type
make
to generate VHDL files in thertl
subdirectory. cd
to thesyn
directory and typemake
.
LOC counts were performed using cloc
(available via apt
or at https://github.com/AlDanial/cloc).
Each approach's pipeline implementation is container in a file Pipeline.hs
in the incrementer/loc
directory.
The vivadostats
script uses the Vivado tools to estimate the maximum frequency at which a VHDL module can be run. It can be installed into a virtualenv by running the following commands in the top-level directory (where this README is found):
virtualenv -p python3 venv
. venv/bin/activate
pip install -e tools/vivadostats
The tool can then be invoked as vivadostats
as long as the virtualenv venv
is active. A typical invocation would be:
vivadostats -d rtl/incrementer.vhd --top main --clock-period 2 -o stats
This would determine main
in rtl/incrementer.vhd
and output CSV files containing statistics to the directory stats
. Three CSV files would be generated by this particular invocation:
File | Contents |
---|---|
incrementer_clock.csv | Attempted clock periods with corresponding WNS, WHS, and WPWS |
incrementer_timing.csv | Timing information for final run |
incrementer_util.csv | Utilization for final run |
This material is based upon work supported by the National Science Foundation under Grant No. CCF-1717088. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.