浏览代码

Merge pull request #1 from calexioe/master

Made some improvements to the org files.
master
Peter Aaser GitHub 6 年前
父节点
当前提交
22b6243f87
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 5 个文件被更改,包括 22 次插入13 次删除
  1. 二进制
      README.pdf
  2. +14
    -6
      hdl.org
  3. 二进制
      hdl.pdf
  4. +8
    -7
      introduction.org
  5. 二进制
      introduction.pdf

二进制
README.pdf 查看文件


+ 14
- 6
hdl.org 查看文件

@@ -1,3 +1,5 @@
#+LATEX_HEADER: \usepackage{minted}

* Hardware description languages * Hardware description languages
Hardware description languages, HDLs for short, are used to model circuits, typically digital. Hardware description languages, HDLs for short, are used to model circuits, typically digital.
HDLs are *declarative* languages, they describe how the circuit should be constructed. HDLs are *declarative* languages, they describe how the circuit should be constructed.
@@ -20,7 +22,8 @@
Instead of describing how text should be rendered HDLs describe how wires and components in a Instead of describing how text should be rendered HDLs describe how wires and components in a
circuit should be connected. circuit should be connected.
Although we have yet to introduce chisel, let's look at some code for a chisel circuit: Although we have yet to introduce chisel, let's look at some code for a chisel circuit:
It is not necessary to understand what is going on in this code to continue.
It is not necessary to understand what is going on in this code to continue. The following code generates
the circuit shown in figure [[fig:counter]].
#+begin_src scala #+begin_src scala
class SimpleCounter() extends Module { class SimpleCounter() extends Module {
val io = IO( val io = IO(
@@ -36,7 +39,9 @@
} }
#+end_src #+end_src
Just like the HTML describes a document the chisel code describes a simple circuit shown below: Just like the HTML describes a document the chisel code describes a simple circuit shown below:
#+CAPTION: This is the caption for the next figure link (or table)
#+NAME:fig:counter
#+ATTR_LaTeX: :height 10cm :placement [H]
#+CAPTION:Simple adder circuit generated using the chisel code on the previous page.
[[./Images/counter.png]] [[./Images/counter.png]]




@@ -47,8 +52,10 @@


While the path from HTML -> Browser is fairly short it's a lot more involved for hardware description! While the path from HTML -> Browser is fairly short it's a lot more involved for hardware description!
This shouldn't come as a suprise, displaying text is less complex than creating digital circuits. This shouldn't come as a suprise, displaying text is less complex than creating digital circuits.
A very simplified version of this is shown here:
#+CAPTION: Placeholder graphic
A very simplified version of this is shown in figure [[fig:flow]].
#+NAME:fig:flow
#+CAPTION: Flow using HDL.
#+ATTR_LaTeX: :height 5cm :placement [H]
[[./Images/toolchain1.png]] [[./Images/toolchain1.png]]


@@ -90,10 +97,11 @@
"html program", but nonetheless we will refer to a scala program building chisel as chisel programs. "html program", but nonetheless we will refer to a scala program building chisel as chisel programs.
We expand upon our first toolchain description: We expand upon our first toolchain description:
#+CAPTION: Placeholder graphic
#+NAME:fig:chisel_flow
#+CAPTION:Toolchain flow using chisel.
[[./Images/toolchain2.png]] [[./Images/toolchain2.png]]


** Scala -> Chisel Graph Builder ** Scala -> Chisel Graph Builder
The starting point, a scala program describing how to build a chisel graph. The starting point, a scala program describing how to build a chisel graph.
This program is not constrained in any way, it's able to do anything any other scala program does, This program is not constrained in any way, it's able to do anything any other scala program does,


二进制
hdl.pdf 查看文件


+ 8
- 7
introduction.org 查看文件

@@ -1,3 +1,4 @@
#+LATEX_HEADER: \usepackage{minted}
* Writing chisel * Writing chisel
** Prerequisites ** Prerequisites
+ *You should have some idea of how digital logic circuits work.* + *You should have some idea of how digital logic circuits work.*
@@ -247,7 +248,7 @@
using testOnly <TAB> using testOnly <TAB>
Running the test should look something like this. Running the test should look something like this.
#+begin_src
#+begin_src text
sbt:chisel-module-template> testOnly Examples.MyIncrementTest sbt:chisel-module-template> testOnly Examples.MyIncrementTest
Run starting. Expected test count is: 0 Run starting. Expected test count is: 0
... ...
@@ -355,7 +356,7 @@
Which can yield two different circuits depending on the opSel argument: Which can yield two different circuits depending on the opSel argument:
True: True:
[[./Images/ScalaCond1.png]] [[./Images/ScalaCond1.png]]
#+begin_src
#+begin_src text
. .
. .
. .
@@ -591,13 +592,13 @@
} }
#+end_src #+end_src
#+begin_src
#+begin_src text
sbt:chisel-module-template> compile:test sbt:chisel-module-template> compile:test
... ...
#+end_src #+end_src
As promised, this code compiles, but when you run the test which actually builds a simulator you As promised, this code compiles, but when you run the test which actually builds a simulator you
get the following: get the following:
#+begin_src
#+begin_src text
[success] Total time: 3 s, completed Apr 25, 2019 3:15:15 PM [success] Total time: 3 s, completed Apr 25, 2019 3:15:15 PM
... ...
sbt:chisel-module-template> testOnly Examples.InvalidSpec sbt:chisel-module-template> testOnly Examples.InvalidSpec
@@ -617,7 +618,7 @@
#+end_src #+end_src
While scary, the actual error is only this line: While scary, the actual error is only this line:
#+begin_src
#+begin_src text
firrtl.passes.CheckInitialization$RefNotInitializedException: @[Example.scala 25:21:@20.4] : [module Invalid] Reference myVec is not fully initialized. firrtl.passes.CheckInitialization$RefNotInitializedException: @[Example.scala 25:21:@20.4] : [module Invalid] Reference myVec is not fully initialized.
: myVec.io.idx <= VOID : myVec.io.idx <= VOID
#+end_src #+end_src
@@ -693,7 +694,7 @@
In order to make it extra clear the Driver has the optional "verbose" parameter set to true. In order to make it extra clear the Driver has the optional "verbose" parameter set to true.
This yields the following: This yields the following:
#+begin_src
#+begin_src text
DelaySpec: DelaySpec:
SimpleDelay SimpleDelay
... ...
@@ -819,7 +820,7 @@
As it turns out printf can be rather misleading when using stateful circuits. As it turns out printf can be rather misleading when using stateful circuits.
To see this in action, try running ~testOnly Examples.EvilPrintfSpec~ which yields the following To see this in action, try running ~testOnly Examples.EvilPrintfSpec~ which yields the following
#+begin_src
#+begin_src text
In cycle 0 the output of counter is: 0 In cycle 0 the output of counter is: 0
according to printf output is: 0 according to printf output is: 0
[info] [0.003] [info] [0.003]


二进制
introduction.pdf 查看文件


正在加载...
取消
保存