From ed20e7c6c77543756e1ebc7bc1e6ae7d10911f0a Mon Sep 17 00:00:00 2001
From: azidar
Date: Sat, 16 Jan 2016 12:42:15 -0800
Subject: Added notes for Richard to work on
---
src/main/scala/firrtl/IR.scala | 15 ++++++++-------
src/main/scala/firrtl/Utils.scala | 4 ++++
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/main/scala/firrtl/IR.scala b/src/main/scala/firrtl/IR.scala
index 3dbf3dae..e7356abc 100644
--- a/src/main/scala/firrtl/IR.scala
+++ b/src/main/scala/firrtl/IR.scala
@@ -68,9 +68,10 @@ case class UIntValue(value: BigInt, width: Width) extends Exp
case class SIntValue(value: BigInt, width: Width) extends Exp
case class Ref(name: String, tpe: Type) extends Exp
case class Subfield(exp: Exp, name: String, tpe: Type) extends Exp
-case class Index(exp: Exp, value: BigInt, tpe: Type) extends Exp
+case class Index(exp: Exp, value: BigInt, tpe: Type) extends Exp //SubIndex, add SubAccess
case class DoPrimop(op: Primop, args: Seq[Exp], consts: Seq[BigInt], tpe: Type) extends Exp
+// THIS GOES BYE BYE
trait AccessorDir extends AST
case object Infer extends AccessorDir
case object Read extends AccessorDir
@@ -79,19 +80,19 @@ case object RdWr extends AccessorDir
trait Stmt extends AST
case class DefWire(info: Info, name: String, tpe: Type) extends Stmt
-case class DefReg(info: Info, name: String, tpe: Type, clock: Exp, reset: Exp) extends Stmt
-case class DefMemory(info: Info, name: String, seq: Boolean, tpe: Type, clock: Exp) extends Stmt
+case class DefReg(info: Info, name: String, tpe: Type, clock: Exp, reset: Exp) extends Stmt //Added init value
+case class DefMemory(info: Info, name: String, seq: Boolean, tpe: Type, clock: Exp) extends Stmt //very different
case class DefInst(info: Info, name: String, module: Exp) extends Stmt
case class DefNode(info: Info, name: String, value: Exp) extends Stmt
case class DefPoison(info: Info, name: String, tpe: Type) extends Stmt
-case class DefAccessor(info: Info, name: String, dir: AccessorDir, source: Exp, index: Exp) extends Stmt
-case class OnReset(info: Info, lhs: Exp, rhs: Exp) extends Stmt
+case class DefAccessor(info: Info, name: String, dir: AccessorDir, source: Exp, index: Exp) extends Stmt //BYE BYE
+case class OnReset(info: Info, lhs: Exp, rhs: Exp) extends Stmt //BYE BYE
case class Connect(info: Info, lhs: Exp, rhs: Exp) extends Stmt
case class BulkConnect(info: Info, lhs: Exp, rhs: Exp) extends Stmt
case class When(info: Info, pred: Exp, conseq: Stmt, alt: Stmt) extends Stmt
-case class Assert(info: Info, pred: Exp) extends Stmt
+case class Assert(info: Info, pred: Exp) extends Stmt //Now Stop, with clk and enable and int, add Print
case class Block(stmts: Seq[Stmt]) extends Stmt
-case object EmptyStmt extends Stmt
+case object EmptyStmt extends Stmt //Now Empty
trait Width extends AST
case class IntWidth(width: BigInt) extends Width
diff --git a/src/main/scala/firrtl/Utils.scala b/src/main/scala/firrtl/Utils.scala
index d767f027..fc2efba8 100644
--- a/src/main/scala/firrtl/Utils.scala
+++ b/src/main/scala/firrtl/Utils.scala
@@ -5,6 +5,10 @@
* - Find way to have generic map function instead of mapE and mapS under Stmt implicits
*/
+/* TODO Richard
+ * - add new IR nodes to all Util functions
+ */
+
package firrtl
import scala.collection.mutable.StringBuilder
--
cgit v1.2.3
From 4dc5995cae85ccbcb11d0648143bb8d26a16f135 Mon Sep 17 00:00:00 2001
From: azidar
Date: Sat, 16 Jan 2016 12:42:15 -0800
Subject: Added notes for Richard to work on
---
src/main/scala/firrtl/IR.scala | 15 ++++++++-------
src/main/scala/firrtl/Utils.scala | 4 ++++
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/main/scala/firrtl/IR.scala b/src/main/scala/firrtl/IR.scala
index 3dbf3dae..e7356abc 100644
--- a/src/main/scala/firrtl/IR.scala
+++ b/src/main/scala/firrtl/IR.scala
@@ -68,9 +68,10 @@ case class UIntValue(value: BigInt, width: Width) extends Exp
case class SIntValue(value: BigInt, width: Width) extends Exp
case class Ref(name: String, tpe: Type) extends Exp
case class Subfield(exp: Exp, name: String, tpe: Type) extends Exp
-case class Index(exp: Exp, value: BigInt, tpe: Type) extends Exp
+case class Index(exp: Exp, value: BigInt, tpe: Type) extends Exp //SubIndex, add SubAccess
case class DoPrimop(op: Primop, args: Seq[Exp], consts: Seq[BigInt], tpe: Type) extends Exp
+// THIS GOES BYE BYE
trait AccessorDir extends AST
case object Infer extends AccessorDir
case object Read extends AccessorDir
@@ -79,19 +80,19 @@ case object RdWr extends AccessorDir
trait Stmt extends AST
case class DefWire(info: Info, name: String, tpe: Type) extends Stmt
-case class DefReg(info: Info, name: String, tpe: Type, clock: Exp, reset: Exp) extends Stmt
-case class DefMemory(info: Info, name: String, seq: Boolean, tpe: Type, clock: Exp) extends Stmt
+case class DefReg(info: Info, name: String, tpe: Type, clock: Exp, reset: Exp) extends Stmt //Added init value
+case class DefMemory(info: Info, name: String, seq: Boolean, tpe: Type, clock: Exp) extends Stmt //very different
case class DefInst(info: Info, name: String, module: Exp) extends Stmt
case class DefNode(info: Info, name: String, value: Exp) extends Stmt
case class DefPoison(info: Info, name: String, tpe: Type) extends Stmt
-case class DefAccessor(info: Info, name: String, dir: AccessorDir, source: Exp, index: Exp) extends Stmt
-case class OnReset(info: Info, lhs: Exp, rhs: Exp) extends Stmt
+case class DefAccessor(info: Info, name: String, dir: AccessorDir, source: Exp, index: Exp) extends Stmt //BYE BYE
+case class OnReset(info: Info, lhs: Exp, rhs: Exp) extends Stmt //BYE BYE
case class Connect(info: Info, lhs: Exp, rhs: Exp) extends Stmt
case class BulkConnect(info: Info, lhs: Exp, rhs: Exp) extends Stmt
case class When(info: Info, pred: Exp, conseq: Stmt, alt: Stmt) extends Stmt
-case class Assert(info: Info, pred: Exp) extends Stmt
+case class Assert(info: Info, pred: Exp) extends Stmt //Now Stop, with clk and enable and int, add Print
case class Block(stmts: Seq[Stmt]) extends Stmt
-case object EmptyStmt extends Stmt
+case object EmptyStmt extends Stmt //Now Empty
trait Width extends AST
case class IntWidth(width: BigInt) extends Width
diff --git a/src/main/scala/firrtl/Utils.scala b/src/main/scala/firrtl/Utils.scala
index d767f027..fc2efba8 100644
--- a/src/main/scala/firrtl/Utils.scala
+++ b/src/main/scala/firrtl/Utils.scala
@@ -5,6 +5,10 @@
* - Find way to have generic map function instead of mapE and mapS under Stmt implicits
*/
+/* TODO Richard
+ * - add new IR nodes to all Util functions
+ */
+
package firrtl
import scala.collection.mutable.StringBuilder
--
cgit v1.2.3
From f8d2ac8452e562590ad080265815cb9f3ea26bfc Mon Sep 17 00:00:00 2001
From: ducky
Date: Sat, 16 Jan 2016 14:09:31 -0800
Subject: Update README with better Linux and Scala instructions
---
README.md | 70 ++++++++++++++++++++++++++++++++++++---------------------------
1 file changed, 40 insertions(+), 30 deletions(-)
diff --git a/README.md b/README.md
index 98a7868f..01648fa9 100644
--- a/README.md
+++ b/README.md
@@ -3,50 +3,60 @@
This repository contains the compiler for .fir files.
It is currently being developed in stanza, with the end-goal to translate into scala for ease of other people to use.
- This decision was made for multiple reasons:
- 1. Previous development had already been done in stanza
- 2. Most of the passes are relatively language independent
- 3. Stanza is easier to develop in than scala bc less-strict type system
- 4. As a favor, its useful to develop in stanza to give Patrick some language tips :)
- The hardest part to port will likely be the parser, but we hope to use an existing scala-based general-purpose parser for the port.
+ This decision was made for multiple reasons:
+ 1. Previous development had already been done in stanza
+ 2. Most of the passes are relatively language independent
+ 3. Stanza is easier to develop in than scala bc less-strict type system
+ 4. As a favor, its useful to develop in stanza to give Patrick some language tips :)
+ The hardest part to port will likely be the parser, but we hope to use an existing scala-based general-purpose parser for the port.
#### Installation Instructions
*Disclaimer*: This project is going through development stages so there is no guarantee anything works.
-##### For Linux:
- 1. Clone the repository:
+##### For Linux:
+ 1. Clone the repository:
`git clone https://github.com/ucb-bar/firrtl`
- 1. Install lit (you need to have pip installed first):
+ 1. Install lit (you need to have pip installed first):
`pip install lit`
- 1. Build firrtl:
+ 1. Inflate stanza (this will fail before it builds firrtl):
`make build`
+ 1. Remove first empty line in `utils/bin/stanza`, so the first line now becomes `#!/bin/bash`.
+ 1. Actually build firrtl:
+ `make build`
+ 1. Run `make set-linux`, which links the FileCheck binary to the Linux version.
+ The original binary is compiled for Mac and will not work.
+ * **Note**: This compiled binary may not run on all platforms. You may need to build
+ Clang/LLVM from source to extract the compiled FileCheck utility.
1. Add `firrtl/utils/bin` to your `PATH`, so that the compiled firrtl will be
available anywhere. This also makes FileCheck available for the tests.
- 1. Rename `FileCheck_linux` in `firrtl/utils/bin` to `FileCheck`. The original
- `FileCheck` is a compiled Mac version and will not run on Linux.
- *Note: This compiled binary may not run on all platforms. You may need to build
- Clang/LLVM from source to extract the compiled FileCheck utility.*
- 1. Run tests:
+ 1. Run tests:
`make check`
- 1. Build and test:
+ * **Note**: Stanza eats a π£π£π£π£ton of memory and running many instances
+ simultaneously (as the build script does) may stall your system due to
+ excessive paging. Setting a memory limit seems to make everything behave
+ better: `ulimit -v 3096000`
+ 1. Build and test:
`make`
-##### For Mac:
- 1. Clone the repository:
+##### For Mac:
+ 1. Clone the repository:
`git clone https://github.com/ucb-bar/firrtl`
- 1. Install lit (you need to have pip installed first):
+ 1. Install lit (you need to have pip installed first):
`pip install lit`
- 1. Build firrtl:
- `make build`
- 1. Run tests:
+ 1. Build firrtl:
+ `make build`
+ 1. Run tests:
`make check`
- 1. Build and test:
+ 1. Build and test:
`make`
-#### Scala implementation
-The Scala FIRRTL implementation relies upon sbt 0.13.6. It uses sbt-assembly to create a fat JAR.
-Using a bash script and a symbolic link it can be used with the same command-line arguments as the stanza implementation.
-Example use:
- `make build-scala`
- `make set-scala` # Creates symbolic link, make set-stanza reverts to stanza implementation
- `./utils/bin/firrtl -i -o