当前位置: 首页 > news >正文

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

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

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 (断言、断点和休眠)

 

http://www.wxhsa.cn/company.asp?id=3687

相关文章:

  • NOIP备考
  • NVIDIA GPGPU 访存通路设计调研
  • 用 Java 和 Tesseract 实现验证码图像识别
  • AGC003D
  • Java 实现验证码图像识别与处理流程详解
  • 图论杂题。
  • 暑假训练小结
  • 初识python:一些基础的知识(函数)
  • Java并发编程(3)
  • 斐波那契子序列
  • [豪の学习笔记] 软考中级备考 基础复习#10
  • 题解:CF2137D Replace with Occurrences
  • 题解:CF2137C Maximum Even Sum
  • 第02周 java预习
  • 编码规范
  • 深入解析:【译】Visual Studio 八月更新已发布 —— 更智能的人工智能、更出色的调试功能以及更多控制权
  • 命令模式在 TPL Dataflow 反馈回路管道中的应用及问题解决
  • Ubuntu 24.04 服务器调整MySQL 8.0.42 三节点集群(一主两从架构)安装部署配置教程
  • 使用almalinux基础镜像创建nginx镜像
  • docke容器版Nessus登录+破解+激活+特征库更新
  • 我把Cursor当磁盘清理工具用,非常棒! - ukyo-
  • vue项目
  • 第九篇:数据库服务克隆应用
  • Anti-Proxy Attendance 题解
  • 【2024-2025第二学期】助教工作总结
  • 开始每小时记录日程
  • 5【鸿蒙/OpenHarmony/NDK】使用Node-API进行异步任务开发
  • 控制器指令
  • 题解:AT_abc421_c [ABC421C] Alternated
  • MySQL数据库:SQL数据类型