尧图网站建设 尧图网络
  • 首页
  • 关于我们
  • 服务项目
  • 案例展示
  • 建站流程
  • 资讯中心
  • 联系我们
首页/资讯中心/详情

spatial 一个芯片设计语言的简介 scala dsl 并行支持 -1

spatial 一个芯片设计语言的简介 scala dsl 并行支持  -1
📅 发布时间:2026/6/18 23:24:17

以下是对原网站内容的翻译

https://spatial-lang.readthedocs.io/en/legacy/tutorial/starting.html

以下是您提供的Spatial框架入门指南的中英对照翻译:


​​0. Getting Started | 0. 开始使用​​

​​Prerequisites | 先决条件​​

First, make sure to download and install the following prerequisites:

首先,请确保下载并安装以下先决条件:

  • ​​Scala SBT​​

  • ​​Java JDK​​

While it’s not at all required, it may be easier to learn to use Spatial if you’ve had experience with Scala or a similar functional programming language in the past. Knowledge of Scala will allow you to use meta-programming to assist your Spatial designs.

虽然这不是必需的,但如果您以前有使用 Scala 或类似函数式编程语言的经验,学习使用 Spatial 可能会更容易。Scala 知识将使您能够使用元编程来辅助您的 Spatial 设计。

If you’d like, check out this Scala tutorial.

如果您愿意,可以查看这个 Scala 教程。

Finally, please sign up for the Spatial users google group if you have any questions.

最后,如果您有任何问题,请注册 Spatial 用户的 Google 群组。


​​Installation via Quickstart (Recommended) | 通过快速开始安装(推荐)​​

To get started with Spatial, you simply need to clone the spatial-quickstart repo and set your environment:

要开始使用 Spatial,您只需要克隆 spatial-quickstart代码库并设置您的环境:

 
$ git clone git@github.com:stanford-ppl/spatial-quickstart $ cd spatial-quickstart $ export SPATIAL_HOME=`pwd`
 
 

You can start writing your apps directly in spatial-lang/src/<filename>.scala. To run a quick test, you can run the following:

您可以直接在 spatial-lang/src/<文件名>.scala中开始编写您的应用程序。要运行一个快速测试,您可以执行以下命令:

 
$ bin/spatial Quicktest $ cd gen/Quicktest && bash run.sh 7
 
 

The app called “Quicktest” is in spatial-quicktest/src/Applications.scala. It has one input register, reads and adds 4 to it in the Accel, and then writes this to an output register.

名为 “Quicktest” 的应用程序位于 spatial-quicktest/src/Applications.scala。它有一个输入寄存器,在 Accel 中读取该值并加 4,然后将其写入输出寄存器。


​​Installation From Source | 从源码安装​​

Run the following (bash) commands to clone and update the spatial-lang repository:

运行以下 (bash) 命令来克隆和更新 spatial-lang代码库:

 
$ git clone https://github.com/stanford-ppl/spatial-lang.git $ cd spatial-lang $ git submodule update --init
 
 

This will pull Spatial’s submodules argon, apps, and scala-virtualized.

这将拉取 Spatial 的子模块 argon、apps 和 scala-virtualized。

You may need to export your JAVA_HOMEenvironment variable to point to your Java installation (usually /usr/bin)

您可能需要导出您的 JAVA_HOME环境变量,以指向您的 Java 安装路径(通常是 /usr/bin)。

You are now ready to compile the language. Run the following:

现在您已准备好编译此语言。运行以下命令:

 
$ cd spatial-lang # Navigate to root of spatial-lang repository | 导航到 spatial-lang 代码库的根目录 $ sbt compile
 
 

A good habit would be to pull from these repositories often and run sbt compilein your spatial-langdirectory.

一个好的习惯是经常从这些代码库拉取更新,并在您的 spatial-lang目录中运行 sbt compile。

To run a quick test, you can run the following:

要运行一个快速测试,您可以执行以下命令:

 
$ bin/spatial InOutArg $ cd gen/InOutArg && bash run.sh 7
 
 

The app called “InOutArg” is in spatial-lang/apps/src/UnitTests.scala. It has one input register, reads and adds 4 to it in the Accel, and then writes this to an output register.

名为 “InOutArg” 的应用程序位于 spatial-lang/apps/src/UnitTests.scala。它有一个输入寄存器,在 Accel 中读取该值并加 4,然后将其写入输出寄存器。


​​That’s it! Up next... | 就是这样!接下来...​​

That’s it! Up next, you will learn how to use the language by working through a series of examples. The concepts you will learn in these tutorials are listed below. Feel free to skip around the apps as you find convenient:

就是这样!接下来,您将通过一系列示例学习如何使用该语言。您将在这些教程中学到的概念如下所列。请根据您的方便随意跳转学习不同的应用程序:

  • Hello, World! (你好,世界!)

  • Application skeleton (import statements, application creation, accel scope, host scope) (应用程序骨架(import 语句、应用程序创建、accel 作用域、host 作用域))

  • ArgIn

  • ArgOut

  • HostIO

  • DRAM

  • SRAM

  • Reg

  • Typing system (类型系统)

  • Data transfer between host and accel (setArg, setMem, getArg, getMem, load, store, gather, scatter) (主机与加速器之间的数据传输)

  • Basic debugging hooks (基本调试钩子)

  • Compiling an app (编译应用程序)

  • Dot Product (点积)

  • Tiling (分块/平铺)

  • Reduce and Fold (Reduce 和 Fold 操作)

  • Sequential execution and Coarse-grain pipelining (顺序执行和粗粒度流水线)

  • Parallelization (并行化)

  • Basic buffering and banking (基本缓冲和存储体配置)

  • General Matrix Multiply (GEMM) (通用矩阵乘法)

  • MemReduce and MemFold

  • Debugging with instrumentation (使用插桩进行调试)

  • Advanced banking (高级存储体配置)

  • Advanced buffering (高级缓冲)

  • Differentiator & Sobel Filter (微分器和 Sobel 滤波器)

  • LineBuffer

  • ShiftRegister

  • LUT (查找表)

  • Spatial Functions and Multifile Projects (Spatial 函数和多文件项目)

  • Needleman-Wunsch

  • FSM (有限状态机)

  • Branching (分支)

  • FIFO

  • Systolic Arrays (脉动阵列)

  • File IO and text management (文件 IO 和文本管理)

  • Asserts, Breakpoints, and Sleep (断言、断点和休眠)

 

相关新闻

  • NVIDIA GPU调研: 访存通路设计
  • 图论杂题。
  • 第02周 java预习

最新新闻

  • 济南正规奢侈品包包回收门店地址,添价收名牌包回收实测评级 - 薛定谔的梨花猫
  • 西安AI智能体开发公司:企业级定制智能体的技术实践与多端部署
  • AI 回答太长想保存成 PDF 或长图,怎样保留标题、表格和代码块? - 【DS随心转】
  • 抖音去水印免费工具推荐:免费软件小程序都能用 - 工具软件使用方法推荐
  • 02梦断代码阅读笔记之一
  • 2026深圳黄金回收门店实力大排名,透明回收、报价公道商家一览 - 奢侈品回收测评

日新闻

  • 5分钟掌握Python进化算法:Geatpy高性能优化工具完全指南
  • Microchip 24AA044 EEPROM选型与应用全指南:从参数解析到实战编程
  • 华为的鸿蒙到底有多牛?为什么称作遥遥领先?

周新闻

  • 3步解锁iOS设备:applera1n激活锁绕过完全指南
  • 39 2026 人工智能证书终极盘点,普通人选 AI 证书可以从这些方向入手
  • Redis 暴露公网有多危险?从端口检查到补救步骤

月新闻

  • 【总结】入门篇:50句话让你记住架构核心概念
  • WeChatMsg技术方案解析:实现Mac微信数据自主管理的完整解决方案
  • WeChatMsg:革新性微信数据备份方案,打造你的专属数字记忆库

关于尧图

  • 公司简介
  • 团队介绍
  • 企业文化
  • 荣誉资质

服务项目

  • 定制开发
  • 电商建站
  • UI 设计
  • 运维服务

快速链接

  • 案例展示
  • 建站流程
  • 常见问题
  • 资讯中心

联系方式

  • 📍北京市朝阳区互联网产业园 A 座 10 层
  • 📞400-888-8888
  • ✉️contact@rkmt.cn
  • 🕐周一至周日 9:00-21:00

© 2024 北京尧图网络科技有限公司 版权所有 | 京 ICP 备 XXXXXXXX 号