Docs | Quick Start | Tutorials
XLS implements a High Level Synthesis toolchain that produces synthesizable designs (Verilog and SystemVerilog) from flexible, high-level descriptions of functionality. It is Apache 2 licensed.
XLS (Accelerated HW Synthesis) aims to be the Software Development Kit (SDK) for the End of Moore's Law (EoML) era. In this "age of specialization", software and hardware engineers must do more co-design across their domain boundaries -- collaborate on shared artifacts, understand each other's cost models, and share tooling/methodology. XLS attempts to leverage automation, software engineers, and machine cycles to accelerate this overall process.
XLS enables the rapid development of hardware IP that also runs as efficient host software via "software style" methodology. An XLS design runs at native speeds for use in host software or a simulator, but that design can also generate hardware block output -- the XLS tools' correctness ensures (and provides tools to help formally verify) that they are functionally identical.
XLS supports both (optionally pipelined) functions with pure-wire I/O interfaces
and
concurrent processes
(or proc
s). Procs are stateful, allowing induction over time, and include more
general communication interfaces.
XLS is experimental, undergoing rapid development, and not an officially supported Google product. Expect bugs and sharp edges. Please help by trying it out, running through some tutorials, reporting bugs.
We are early stage and this has some practical effects:
For a more setup-free and environment-independent way of trying out XLS, see our colab notebooks:
bit.ly/learn-xls: a "learn XLS in Y minutes" style walkthrough in DSLX, our Rust-inspired domain specific language (DSL).
bit.ly/xls-playground: an XLS evaluation environment that can run the following interactively:
The following downloads the latest github repo release binaries for an x64 Linux machine:
# Determine the url of the latest release tarball. LATEST_XLS_RELEASE_TARBALL_URL=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/google/xls/releases | \ grep -m 1 -o 'https://.*/releases/download/.*\.tar\.gz') # Download the tarball and unpack it, observe the version numbers for each of the included tools. curl -O -L ${LATEST_XLS_RELEASE_TARBALL_URL} tar -xzvvf xls-*.tar.gz cd xls-*/ ./interpreter_main --version ./ir_converter_main --version ./opt_main --version ./codegen_main --version ./proto_to_dslx_main --version
Aside from the binary releases (available for x64 Linux as described above), and the available colab notebooks, XLS must be built from source using the Bazel build system.
The following instructions are for the Ubuntu 22.04 (Jammy Jellyfish) Linux distribution.
On an average 8-core VM:
Please see the two corresponding command lines below -- we start by assuming Bazel has been installed:
~$ git clone https://github.com/google/xls.git ~$ cd xls ~/xls$ # Follow the bazel install instructions to install bazel 7 ~/xls$ # https://bazel.build/install/ubuntu ~/xls$ # Note we're going to tell Ubuntu that `/usr/bin/env python` is actually python3 ~/xls$ # here, since that has not been the case by default on past Ubuntus. ~/xls$ # This is important. Without this step, you may experience cryptic error messages: ~/xls$ sudo apt install python3-distutils python3-dev libtinfo5 python-is-python3 ~/xls$ # Now build/test in optimized build mode. ~/xls$ # If you don't plan on using the C++ front-end, which is not strictly ~/xls$ # needed (i.e. DSLX front-end only), use this command line: ~/xls$ bazel test -c opt -- //xls/... -//xls/contrib/xlscc/... ~/xls$ # To build everything, including the C++ front-end: ~/xls$ bazel test -c opt -- //xls/...
Reference build/test environment setups are also provided via Dockerfile
s, if
you have difficulty setting up the (limited set of) dependencies shown above in
your environment:
~$ git clone https://github.com/google/xls.git ~$ cd xls ~/xls$ docker build . -f Dockerfile-ubuntu-22.04 # Performs optimized build-and-test.
Many programmers are used to using programs like ccache
to improve caching for
a build, but Bazel actually ships with very-high quality caching layers.
In particular, incremental builds are more safe.
However, there are circumstances where Bazel might decide to recompile files
where the results could have been cached locally - or where it might be safe to
reuse certain intermediate results, even after a bazel clean
. To improve this,
you can tell Bazel to use a shared "disk cache", storing files persistently
elsewhere on disk; just create a directory somewhere (e.g.,
~/.bazel_disk_cache/
), and then run:
echo "build --disk_cache=$(realpath ~/.bazel_disk_cache)" >> ~/.bazelrc echo "test --disk_cache=$(realpath ~/.bazel_disk_cache)" >> ~/.bazelrc
!!! WARNING Bazel does not automate garbage collection of this directory, so it will grow over time without bounds. You will need to clean it up periodically, either manually or with an automated script.
Alternatively, you can add a remote cache that takes care of garbage collection for you. This can be hosted on a personal server or even on the local machine. We've personally had good results with localhost instances of bazel-remote.
Navigating a new code base can be daunting; the following description provides a high-level view of the important directories and their intended organization / purpose, and correspond to the components in this XLS stack diagram:
<div align='center'> <img src='https://google.github.io/xls/images/xls_stack_diagram.png' alt='XLS Stack Diagram'> </div>dependency_support
:
Configuration files that load, build, and expose Bazel targets for external
dependencies of XLS.
docs
: Generated documentation
served via GitHub pages:
https://google.github.io/xls/
docs_src
: Markdown file
sources, rendered to docs
via
mkdocs.
xls
: Project-named
subdirectory within the repository, in common Bazel-project style.
build
: Build macros
that create XLS artifacts; e.g. convert DSL to IR, create test targets for
DSL code, etc.codegen
: Verilog
AST (VAST) support to generate Verilog/SystemVerilog operations and FSMs.
VAST is built up by components we call generators (e.g.
PipelineGenerator, SequentialGenerator for FSMs) in the translation from XLS
IR.common
: "base"
functionality that layers on top of standard library usage. Generally we use
Abseil versions of base constructs wherever possible.contrib/xlscc
:
Experimental C++ syntax support that targets XLS IR (alternative path to
DSLX) developed by a sister team at Google, sharing the same open source /
testing flow as the rest of the XLS project. May be of particular interest
for teams with existing C++ HLS code bases.data_structures
:
Generic data structures used in XLS that augment standard libraries; e.g.
BDDs, union find, min cut, etc.delay_model
:
Functionality to characterize, describe, and interpolate data delay for
XLS IR operations on a target backend process. Already-characterized
descriptions are placed in xls/delay_model/models
and can be referred to via
command line flags.dslx
: A DSL (called
"DSLX") that mimics Rust, while being an immutable expression-language
dataflow DSL with hardware-oriented features; e.g. arbitrary bitwidths,
entirely fixed size objects, fully analyzeable call graph. XLS team has found
dataflow DSLs are a good fit to describe hardware as compared to languages
designed assume von Neumann style computation.fuzzer
: A
whole-stack multiprocess fuzzer that generates programs at the DSL level and
cross-compares different execution engines (DSL interpreter, IR interpreter,
IR JIT, code-generated-Verilog simulator). Designed so that it can easily be
run on different nodes in a cluster simultaneously and accumulate shared
findings.examples
: Example
computations that are tested and executable through the XLS stack.experimental
:
Artifacts captured from experimental explorations.interpreter
:
Interpreter for XLS IR - useful for debugging and exploration. For cases
needing throughput, consider using the JIT (below).ir
:
XLS IR definition, text parser/formatter, and facilities for abstract
evaluation.jit
:
LLVM-based JIT for XLS IR. Enables native-speed execution of DSLX and XLS IR
programs.modules
:
Hardware building block DSLX "libraries" (outside the DSLX standard library)
that may be easily reused or instantiated in a broader design.netlist
: Libraries
that parse/analyze/interpret netlist-level descriptions, as are
generally given in simple structural Verilog with an associated cell library.passes
: Passes that
run on the XLS IR as part of optimization, before scheduling / code
generation.scheduling
:
Scheduling algorithms, determine when operations execute (e.g. which
pipeline stage) in a clocked design.simulation
:
Code that wraps Verilog simulators and generates Verilog testbenches for XLS
computations. iverilog is
currently used to simulate as it supports non-synthesizable testbench
constructs.solvers
:
Converters from XLS IR into SMT solver input, such that formal proofs can be
run on XLS computations; e.g. Logical Equalence Checks between XLS IR and a
netlist description. Z3 is used as the
solver engine.synthesis
:
Interface that wraps backend synthesis flows, such that tools can be
retargeted e.g. between ASIC and FPGA flows.tests
:
Integration tests that span various top-level components of the XLS project.tools
:
Many tools that work with the XLS
system and its libraries in a decomposed way via command line interfaces.uncore_rtl
:
Helper RTL that interfaces XLS-generated blocks with device top-level for e.g.
FPGA experiments.visualization
:
Visualization tools to inspect the XLS compiler/system interactively. See
IR visualization.Discussions about XLS - development, debugging, usage, etc:
The following are contributors to the XLS project, see our contributing documentation and good first issues if you're interested in contributing, or reach out via GitHub discussions!
一键生成PPT和Word,让学习生活更轻松
讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。
深度推理能力全新升级,全面对标OpenAI o1
科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。
一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型
Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。
字节跳动发布的AI编程神器IDE
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。
AI助力,做PPT更简单!
咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。
选题、配图、成文,一站式创作,让内容运营更高效
讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。
专业的AI公文写作平台,公文写作神器
AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。
OpenAI Agents SDK,助力开发者便捷使用 OpenAI 相关功能。
openai-agents-python 是 OpenAI 推出的一款强大 Python SDK,它为开发者提供了与 OpenAI 模型交互的高效工具,支持工具调用、结果处理、追踪等功能,涵盖多种应用场景,如研究助手、财务研究等,能显著提升开发效率,让开发者更轻松地利用 OpenAI 的技术优势。
高分辨率纹理 3D 资产生成
Hunyuan3D-2 是腾讯开发的用于 3D 资产生成的强大工具,支持从文本描述、单张图片或多视角图片生成 3D 模型,具备快速形状生成能力,可生成带纹理的高质量 3D 模型,适用于多个领域,为 3D 创作提供了高效解决方 案。
一个具备存储、管理和客户端操作等多种功能的分布式文件系统相关项目。
3FS 是一个功能强大的分布式文件系统项目,涵盖了存储引擎、元数据管理、客户端工具等多个模块。它支持多种文件操作,如创建文件和目录、设置布局等,同时具备高效的事件循环、节点选择和协程池管理等特性。适用于需要大规模数据存储和管理的场景,能够提高系统的性能和可靠性,是分布式存储领域的优质解决方案。
最新AI工具、AI资讯
独家AI资源、AI项目落地
微信扫一扫关注公众号