HLSFactory-Agent is an open-source tool for automatically extracting standalone HLS designs from academic and open-source repositories.
It helps identify HLS kernels, collect the files needed to build them, and package each design into a standalone Vitis HLS-compatible project when possible.
- Finds HLS kernels and top-level functions
- Extracts each design into its own folder
- Copies required source files, headers, and test data
- Adapts non-Vitis HLS code when possible
- Generates a
synth.tclscript for each design - Saves logs, session traces, and HTML transcripts for debugging
The repository also includes scripts for finding HLS-related papers and repositories from conference proceedings and metadata sources.
hlsfactory_agent/ Core agent code
docker_images/ Docker image used to run the agent
exp/run_base/ Example batch run and analysis scripts
hls_source_indexing/ Scripts and data for indexing HLS-related papers
- Python 3.12+
- Docker
- Git
- OpenRouter API key
- Vitis HLS, for validating extracted designs
Clone the repository:
git clone https://github.com/sharc-lab/hlsfactory-agent.git
cd hlsfactory-agentBuild the Docker image:
cd docker_images
./build.shThis creates the Docker image:
hlsfactory-agentCreate a .env file in the repository root with your OpenRouter API key:
OPENROUTER_API_KEY=your_openrouter_keyThe main example workflow is:
python exp/run_base/run.pyThis script clones a predefined list of repositories, runs HLSFactory-Agent inside Docker, and writes outputs to:
exp/run_base/runs/
For each repository, the agent:
- Analyzes the repository structure
- Finds possible HLS designs
- Creates one folder per design
- Copies source files, headers, and test data
- Converts code toward Vitis HLS compatibility when needed
- Generates a
synth.tclscript - Saves logs and session transcripts
You can modify this script to attempt to extract HLS designs from repositories you are intsted in.
Each run produces:
- Extracted standalone design folders
run_data.json- Pi session logs
- HTML session transcripts
Outputs are stored under:
exp/run_base/runs/
After running extraction jobs, analyze the outputs with:
python exp/run_base/analyze_output_designs.pySummary figures are written to:
exp/run_base/figures/
The hls_source_indexing/ directory contains scripts for finding candidate HLS papers and repositories.
The indexing workflow searches venues such as:
FPGA, FCCM, FPL, FPT, HEART, TRETS, DAC, ICCAD, ASP-DAC,
DATE, MLCAD, ICLAD, GLVLSI, HOST, TCAD, ISCA, MICRO,
HPCA, ESWEEK, MLSYS, ASPLOS