Skip to content

Commit

Permalink
update links and getting started
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfel1 committed Mar 7, 2018
1 parent d6720c4 commit 430c10e
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 35 deletions.
8 changes: 4 additions & 4 deletions docs/site/tutorial/convolution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Let's start by creating the data structures above the Accel that we will set up
filters and compute the gold check. We will expose the rows of the images as command-line arguments.::

import spatial.dsl._
import org.virtualized._
import virtualized._

object DiffAndSobel extends SpatialApp {

Expand Down Expand Up @@ -359,7 +359,7 @@ definitions extend SpatialApp, and then have the next file create an `object` th


// File1.scala
import org.virtualized._
import virtualized._
import spatial.dsl._

object AccelFile extends FunctionsFile {
Expand All @@ -374,7 +374,7 @@ definitions extend SpatialApp, and then have the next file create an `object` th
--------------------------------

// File2.scala
import org.virtualized._
import virtualized._
import spatial.dsl._

trait FunctionsFile extends SpatialApp{
Expand All @@ -392,7 +392,7 @@ Below is the final code for a single-file, functionized version of the two convo
tutorial. See the @HelloWorld page for a refresher on how to compile and test.::

import spatial.dsl._
import org.virtualized._
import virtualized._

object DiffAndSobel extends SpatialApp {

Expand Down
6 changes: 3 additions & 3 deletions docs/site/tutorial/dotproduct.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ the length of these vectors as a command-line argument. We will also write the c
the correct result::
import spatial.dsl._
import org.virtualized._
import virtualized._

object DotProduct extends SpatialApp {

Expand Down Expand Up @@ -246,10 +246,10 @@ Final Code
----------

Finally, below is the complete app that includes all of the performance-oriented features outlined in this page of the tutorial.
Refer back to the `targets <../targets.rst>`_ section for a refresher on how to test your app.::
Refer back to the `targets <../targets.html>`_ section for a refresher on how to test your app.::

import spatial.dsl._
import org.virtualized._
import virtualized._

object DotProduct extends SpatialApp {

Expand Down
4 changes: 2 additions & 2 deletions docs/site/tutorial/gemm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Let's start by creating the data structures above the Accel that we will set up
gold check. We will expose the dimensions of the matrices as command-line arguments. ::
import spatial.dsl._
import org.virtualized._
import virtualized._

object GEMM extends SpatialApp {

Expand Down Expand Up @@ -299,7 +299,7 @@ Final Code
Below is the complete GEMM app. See the @HelloWorld page for a refresher on how to compile and test an app::

import spatial.dsl._
import org.virtualized._
import virtualized._

object GEMM extends SpatialApp {

Expand Down
12 changes: 6 additions & 6 deletions docs/site/tutorial/helloworld.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ All Spatial programs have a few basic components. The following code example sho
an application that is called `HelloSpatial`::

import spatial.dsl._
import org.virtualized._
import virtualized._

object HelloSpatial extends SpatialApp {

Expand All @@ -86,7 +86,7 @@ While this template is empty, you can use this same flow freely as you build you
Currently, you should edit and place apps inside of your `spatial-lang/apps/src/` directory. Copy-paste the above
template into a new file in this directory and you are ready to compile.

For information on how to compile your app to a specific target, see the `targets <../targets.rst>`_ page.
For information on how to compile your app to a specific target, see the `targets <../targets.html>`_ page.
We recommend beginnig with either the Scala or VCS backends.


Expand Down Expand Up @@ -177,12 +177,12 @@ ignored in RTL, since there is no straightforward print for FPGAs::
println("2D pass? " + cksum_2D)
println("scatter pass? " + cksum_scattered)

Congratulations! You have completed the DRAM section of the tutorial. Refer back to the `targets <../targets.rst>`_ section for a refresher on how to test your app.
Congratulations! You have completed the DRAM section of the tutorial. Refer back to the `targets <../targets.html>`_ section for a refresher on how to test your app.

Below is a copy-pastable version of the code outlined above::

import spatial.dsl._
import org.virtualized._
import virtualized._

object HelloSpatial extends SpatialApp {

Expand Down Expand Up @@ -300,7 +300,7 @@ Now we can move outside the Accel and read the arg values::
val cksum = (result1 == {args(0).to[Int] + args(1).to[Int]}) && (result2 == args(0).to[Int]) // The {} brackets are Scala's way of scoping operations
println("ArgTest pass? " + cksum)

Congratulations! You have completed the ArgIn/Out section of the tutorial. Refer back to the `targets <../targets.rst>`_ section for a refresher on how to test your app.
Congratulations! You have completed the ArgIn/Out section of the tutorial. Refer back to the `targets <../targets.html>`_ section for a refresher on how to test your app.


Final Code
Expand All @@ -309,7 +309,7 @@ Final Code
Below is a copy-pastable version of the code outlined above::

import spatial.dsl._
import org.virtualized._
import virtualized._

object HelloSpatial extends SpatialApp {

Expand Down
4 changes: 2 additions & 2 deletions docs/site/tutorial/nw.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ between the two, and print out the result back into files called ``alignedA.txt`
if our alignments are "correct," we will aim to have less than 10% of the entries be in error.::

import spatial.dsl._
import org.virtualized._
import virtualized._

object NW extends SpatialApp {

Expand Down Expand Up @@ -274,7 +274,7 @@ Final Code
Here is the final code for this version of NW::

import spatial.dsl._
import org.virtualized._
import virtualized._

object NW extends SpatialApp {
@struct case class nw_tuple(score: Int16, ptr: Int16)
Expand Down
49 changes: 48 additions & 1 deletion docs/site/tutorial/starting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ If you'd like, check out this `Scala tutorial <https://www.tutorialspoint.com/sc
Finally, please sign up for the `Spatial users google group <https://groups.google.com/forum/#!forum/spatial-lang-users>`_ if you have any questions.



.. Installation (From Binary)
.. --------------------------
Expand All @@ -34,7 +35,53 @@ Finally, please sign up for the `Spatial users google group <https://groups.goog
Installation (From Source)
Installation From Maven (Recommended)
--------------------------

.. highlight:: bash

NOTE: This does not work right now. ETA: March 8, 2018

To get started with Spatial, you do not need to clone or build any DSL software yourself.
You simply need to create a new SBT project as follows::

mkdir -p spatial-lang/src/main && cd spatial-lang

.. highlight:: scala

In ``spatial-lang/``, create a file called ``build.sbt``::

organization := "org"

version := "1.0-SNAPSHOT"

name := "spatial-app"

scalaVersion := "2.12.1"
val paradiseVersion = "2.1.0"

scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-language:reflectiveCalls")

libraryDependencies ++= Seq("edu.stanford.cs.dawn" %% "spatial" % "0.1-SNAPSHOT")

resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots"),
Resolver.sonatypeRepo("releases"),
// "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository/",
)
addCompilerPlugin("org.scalamacros" % "paradise" % paradiseVersion cross CrossVersion.full)

scalaSource in Compile := baseDirectory.value / "src"

.. highlight:: bash

Finally, start writing your apps is ``spatial-lang/src/main/<filename>.scala``. Refer to
`targets <../targets.html>`_ to learn how to compile the app. The command is::

$ sbt "runMain <app name> <args>"


Installation From Source
--------------------------

.. highlight:: bash
Expand Down
8 changes: 4 additions & 4 deletions docs/source/tutorial/convolution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Let's start by creating the data structures above the Accel that we will set up
filters and compute the gold check. We will expose the rows of the images as command-line arguments.::

import spatial.dsl._
import org.virtualized._
import virtualized._

object DiffAndSobel extends SpatialApp {

Expand Down Expand Up @@ -352,7 +352,7 @@ inside of a separate file entirely, then you simply need to make the `trait` tha
definitions extend SpatialApp, and then have the next file create an `object` that extends the first trait::


import org.virtualized._
import virtualized._
import spatial.dsl._

object AccelFile extends FunctionsFile {
Expand All @@ -366,7 +366,7 @@ definitions extend SpatialApp, and then have the next file create an `object` th

--------------------------------

import org.virtualized._
import virtualized._
import spatial.dsl._

trait FunctionsFile extends SpatialApp{
Expand All @@ -384,7 +384,7 @@ Below is the final code for a single-file, functionized version of the two convo
tutorial. See the :doc:`HelloWorld <helloworld>` page for a refresher on how to compile and test.::

import spatial.dsl._
import org.virtualized._
import virtualized._

object DiffAndSobel extends SpatialApp {

Expand Down
4 changes: 2 additions & 2 deletions docs/source/tutorial/dotproduct.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ the length of these vectors as a command-line argument. We will also write the c
the correct result::
import spatial.dsl._
import org.virtualized._
import virtualized._

object DotProduct extends SpatialApp {

Expand Down Expand Up @@ -249,7 +249,7 @@ Finally, below is the complete app that includes all of the performance-oriented
Refer back to the `targets <../targets.rst>`_ section for a refresher on how to test your app.::

import spatial.dsl._
import org.virtualized._
import virtualized._

object DotProduct extends SpatialApp {

Expand Down
4 changes: 2 additions & 2 deletions docs/source/tutorial/gemm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Let's start by creating the data structures above the Accel that we will set up
gold check. We will expose the dimensions of the matrices as command-line arguments. ::
import spatial.dsl._
import org.virtualized._
import virtualized._

object GEMM extends SpatialApp {

Expand Down Expand Up @@ -299,7 +299,7 @@ Final Code
Below is the complete GEMM app. See the :doc:`HelloWorld <helloworld>` page for a refresher on how to compile and test an app::

import spatial.dsl._
import org.virtualized._
import virtualized._

object GEMM extends SpatialApp {

Expand Down
12 changes: 6 additions & 6 deletions docs/source/tutorial/helloworld.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ All Spatial programs have a few basic components. The following code example sho
an application that is called `HelloSpatial`::

import spatial.dsl._
import org.virtualized._
import virtualized._

object HelloSpatial extends SpatialApp {

Expand All @@ -85,7 +85,7 @@ While this template is empty, you can use this same flow freely as you build you
Currently, you should edit and place apps inside of your `spatial-lang/apps/src/` directory. Copy-paste the above
template into a new file in this directory and you are ready to compile.

For information on how to compile your app to a specific target, see the `targets <../targets.rst>`_ page.
For information on how to compile your app to a specific target, see the `targets <../targets.html>`_ page.
We recommend beginnig with either the Scala or VCS backends.


Expand Down Expand Up @@ -176,12 +176,12 @@ ignored in RTL, since there is no straightforward print for FPGAs::
println("2D pass? " + cksum_2D)
println("scatter pass? " + cksum_scattered)

Congratulations! You have completed the DRAM section of the tutorial. Refer back to the `targets <../targets.rst>`_ section for a refresher on how to test your app.
Congratulations! You have completed the DRAM section of the tutorial. Refer back to the `targets <../targets.html>`_ section for a refresher on how to test your app.

Below is a copy-pastable version of the code outlined above::

import spatial.dsl._
import org.virtualized._
import virtualized._

object HelloSpatial extends SpatialApp {

Expand Down Expand Up @@ -299,7 +299,7 @@ Now we can move outside the Accel and read the arg values::
val cksum = (result1 == {args(0).to[Int] + args(1).to[Int]}) && (result2 == args(0).to[Int]) // The {} brackets are Scala's way of scoping operations
println("ArgTest pass? " + cksum)

Congratulations! You have completed the ArgIn/Out section of the tutorial. Refer back to the `targets <../targets.rst>`_ section for a refresher on how to test your app.
Congratulations! You have completed the ArgIn/Out section of the tutorial. Refer back to the `targets <../targets.html>`_ section for a refresher on how to test your app.


Final Code
Expand All @@ -308,7 +308,7 @@ Final Code
Below is a copy-pastable version of the code outlined above::

import spatial.dsl._
import org.virtualized._
import virtualized._

object HelloSpatial extends SpatialApp {

Expand Down
4 changes: 2 additions & 2 deletions docs/source/tutorial/nw.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ between the two, and print out the result back into files called ``alignedA.txt`
if our alignments are "correct," we will aim to have less than 10% of the entries be in error.::

import spatial.dsl._
import org.virtualized._
import virtualized._

object NW extends SpatialApp {

Expand Down Expand Up @@ -266,7 +266,7 @@ Final Code
Here is the final code for this version of NW::

import spatial.dsl._
import org.virtualized._
import virtualized._

object NW extends SpatialApp {
@struct case class nw_tuple(score: Int16, ptr: Int16)
Expand Down

0 comments on commit 430c10e

Please sign in to comment.