hardware design and functional programming: still ... · hardware design and functional...
TRANSCRIPT
![Page 1: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/1.jpg)
Hardware Design and Functional Programming:Still Interesting after All These Years
Mary SheeranChalmers
![Page 2: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/2.jpg)
Hardware Description LanguagesIEEE TRANSACTIONS ON COMPUTERS, VOL. C-17, NO. 9, SEPTEMBER 1968A Digital System Design Language (DDL)JAMES R. DULEY AND DONALD L. DIETMEYER
SPECIFYING, documenting, and controlling thedesign of digital systems are problems of increasingseverity as such systems continue to grow in sizeand complexity. Wilkes and Stringer [2] first recognizedthat a suitable design language could greatly reduce themagnitude of these problems and lead to a complete,precise, yet concise description of digital systems. Unfortunately,their contribution is mostly oriented towardthe machine that they were developing at the timeand is not generally useful.
![Page 3: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/3.jpg)
Hardware Description Languages
[2] M. V. Wilkes and J. B. Stringer, "Micro-programming and thedesign of the control circuits in an electronic digital computer,"Proc. Cambridge Phil. Socs., vol. 44, pt 2, pp. 230-238, April1953.
![Page 4: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/4.jpg)
Hardware Description Languages
Reed 1952Symbolic synthesis of digital computersProc. ACM National Meeting (Toronto)
![Page 5: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/5.jpg)
Hardware Description LanguagesIn an ideal sense a binary digital computer or what might be called more generally a Boolean machine is an automatic operational filing system…This information is stored or recorded in sets of elementary boxes or files, each containing one of the symbols 0 or 1. This information is either transformed or used to change other files or itself as a function of the past contents of all files within the system. If the contents of all files within the system are constrained to change only at discrete points of time, say the points n (n = 1,2,3, ...), then the machine may be termed a synchronous Boolean machine
![Page 6: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/6.jpg)
![Page 7: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/7.jpg)
APL
IBM Systems Journal Vol 3, No. 3 1964
![Page 8: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/8.jpg)
Quality of designs from an automatic logic generator (ALERT)Design Automation Workshop (DAC’70)
IBM 1800
2.61.3
APL
![Page 9: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/9.jpg)
Late 70s
![Page 11: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/11.jpg)
![Page 12: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/12.jpg)
Hardcover
$0.77
![Page 13: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/13.jpg)
An alternative functional style of programming isfounded on the use of combining forms for creatingprograms. … Combining forms can use high level programs to build still higher level ones in a style notpossible in conventional languages. …
Turing award 1977Paper 1978
Associated with the functional style of programming is an algebra of programs whose variables range over programs and whose operations are combining forms.
![Page 14: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/14.jpg)
![Page 15: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/15.jpg)
Users!
Plessey
![Page 16: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/16.jpg)
Users!
Plessey
![Page 17: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/17.jpg)
Plessey designers writeUsing muFP, the array processing element was described in just one line of code and the complete array required four lines of muFP description. muFP enabled the effects of adding or moving data latches within the array to be assessed quickly. Since the results were in symbolic form it was clear where and when data within the results was input into the array making it simple to examine the data-flow within the array and change it as desired. This was found to be a very useful way to learn about the data dependencies within the array.[...]From the experience gained on the design, the most important consideration when designing array processors is to ensure that the processor input/output requirements can be met easily and without sacrificing array performance. The most difficult part of the design task is not the design of the computation units but the design of the data paths and associated storage devices. It is essential to have the right design tools to aid and improve the design process. Early use of tools to explore the flow of data within and around the array and to understand the data requirements of the array is important. muFP has been shown to be useful for this purpose.
Bhandal et al, An array processor for video picture motion estimation, Systolic Array Processors, 1990, Prentice Hall
work with Plessey done by G. Jones and W. Luk
![Page 18: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/18.jpg)
PlesseyGEC
![Page 19: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/19.jpg)
Kategori:Hårdvarubeskrivande språkArtiklar i kategorin "Hårdvarubeskrivande språk"Följande 2 sidor (av totalt 2) finns i denna kategori.VVerilogVHDL
REALITY
![Page 20: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/20.jpg)
Algorithms in hardware
![Page 21: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/21.jpg)
In pictures
![Page 22: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/22.jpg)
ilv
![Page 23: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/23.jpg)
two
![Page 24: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/24.jpg)
two (ilv f) ilv (two f)
![Page 25: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/25.jpg)
bfly
bfly
bfly n f = Ilv (bfly (n-1) f) ->- evens f
![Page 26: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/26.jpg)
![Page 27: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/27.jpg)
![Page 28: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/28.jpg)
bitonic
![Page 29: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/29.jpg)
>=
![Page 30: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/30.jpg)
Batcher’s sorter (bitonic)
S
S
M
Mreverse
http://www.cs.kent.edu/~batcher/sort.pdf
![Page 31: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/31.jpg)
80
![Page 32: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/32.jpg)
oemerge :: Int -> ([a] -> [a]) -> [a] -> [a]oemerge 1 s2 = s2oemerge n s2 = ilv (oemerge (n-1) s2) ->- odds s2
![Page 33: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/33.jpg)
![Page 34: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/34.jpg)
two ilv odds
63
![Page 35: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/35.jpg)
More combinators
que
![Page 36: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/36.jpg)
vee
![Page 37: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/37.jpg)
Canfield & Williamson
ilv que odds
![Page 38: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/38.jpg)
ilv que
Canfield & Williamson
63
![Page 39: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/39.jpg)
ilv que
Canfield & Williamson
63
60 best(see Knuth)
![Page 40: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/40.jpg)
median
96<=
>=
![Page 41: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/41.jpg)
median
96
98 Charme
99 PaethGraphics Gems I
![Page 42: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/42.jpg)
SEARCH“Recently, a sequence of 2n-input prefix circuitsof depth n and complexity L(2n) (at least for n <= 25) was discovered by Sheeran [12, 13]via computer programming.”
JFP Vol 21 Issue 01 2011
![Page 43: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/43.jpg)
SEARCH
Electronic Colloquium on Computational Complexity March 2013
![Page 44: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/44.jpg)
364
notation => play => new algorithms
![Page 46: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/46.jpg)
SEARCH (examples)
Journal of Machine LearningResearch 14 (2013)
![Page 47: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/47.jpg)
SEARCH (examples)
Codish et al25 comparators is optimal when sorting 9 inputs
![Page 48: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/48.jpg)
Design FOR verification
Puts circuits to use in a new way
Example: MiniSat+
Translating Pseudo-Boolean Constraints into SAT (Een and Sörensson)
Journal on Satisfiability, Boolean Modeling and Computation 2 (2006)
![Page 49: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/49.jpg)
HW + FP in the real world?
![Page 50: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/50.jpg)
HW + FP in the real world?
4195835.0 - 3145727.0*(4195835.0/3145727.0) = 0 (Correct value)4195835.0 - 3145727.0*(4195835.0/3145727.0) = 256 (Flawed Pentium)
![Page 51: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/51.jpg)
HW + FP in the real world?
Intel Forte System 1000s users
Thanks to Carl Seger (Intel)
![Page 52: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/52.jpg)
HW + FP in the real world?
Intel Forte System 1000s users
fl
lazy functional language with built-in BDDs, decision procedures and a HW symbolic simulator (Symbolic Trajectory Evaluation engine)
Thanks to Carl Seger (Intel)
![Page 53: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/53.jpg)
HW + FP in the real world?
Intel Forte System 1000s users
fl
lazy functional language with built-in BDDs, decision procedures and a HW symbolic simulator (Symbolic Trajectory Evaluation engine)
Design languageHigh-level specification languageObject language for theorem provingScripting languageImplementation language for formal verification tools and theorem provers
Thanks to Carl Seger (Intel)
![Page 54: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/54.jpg)
Examples of fl as Design Language
RTL level
High level With physical placement information
Slide provided by Carl Seger (Intel)
![Page 55: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/55.jpg)
Example of fl as Specification Language
• Use the builtin BDDs and the ability to write if-then-else conditions over expressions to create concise and clean specifications for even very complex operations.
• Example: Floating point addition
Slide provided by Carl Seger (Intel)
![Page 56: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/56.jpg)
Example of Systems Built in fl
STEP: Formal Verification tool: 120k lines of fl + 25k lines of Tcl/Tk
IDV: Integrated Design and Verification:280k lines of fl + 40k lines of Tcl/Tk
Slide provided by Carl Seger (Intel)Forte How verification is done in practice
![Page 58: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/58.jpg)
Bluespec
FP in HW design
Thanks to R.S. Nikhil (Bluespec)
![Page 59: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/59.jpg)
Bluespec
FP in HW design
Thanks to R.S. Nikhil (Bluespec)
(FPGA layout by Satnam Singh)
![Page 60: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/60.jpg)
Bluespec
FP in HW design
Thanks to R.S. Nikhil (Bluespec)
(FPGA layout by Satnam Singh)
malware / hacking
![Page 61: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/61.jpg)
BSV is based on declarative languages
Design written in BSVlanguage
bsc compiler(“high level synthesis”: rule analysis,scheduling, optimization, …)
Verilog
Existing RTL-netlist synthesis tools
Borrow best ideas from modern programming languages, formal verification systems, and concurrency.
Abandon sequential von Neumann legacy.
Behavior spec:Guarded Atomic Transaction Rules• cf. Guarded Commands (Dijkstra), TLA+
(Lamport), UNITY (Chandy/Mishra), EventB(Abrial), …
• Fundamentally parallel/concurrent
Architecture spec:Pure functional programming language• cf. Haskell• Strong type-checking, polymorphic types,
typeclasses, higher-order functions, modularity, parameterization
(Verilog and VHDL are the main languages for HW design; > 25 years old)
Slide by R.S.Nikhil (Bluespec)
![Page 62: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/62.jpg)
62
in0
…
in1
in2
in63
in3
in4
Bfly4
Bfly4
Bfly4
x16
Bfly4
Bfly4
Bfly4
…
Bfly4
Bfly4
Bfly4
…
out0
…
out1
out2
out63
out3
out4
Permute_1
Permute_2
Permute_3
All numbers are complex and represented as two sixteen bit quantities. Fixed-point arithmetic is used to reduce area, power, ...
*
*
**
+
-
-+
+
-
-+
*jt2
t0
t3
t1
The IFFT computation (specification)
(as used in 802.11a Transmitter, for example)
Radix 4 butterfly
Slide by R.S.Nikhil (Bluespec)
![Page 63: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/63.jpg)
63
(varying in area, power, clock speed, latency, throughput)
Varying degrees of pipelining
Iterate 1 stage thrice
Direct combi-national circuit
funneling unfunnelingfewer Bfly4s
In any stage, use fewer than 16 Bfly4s
IFFT: the HW architecture space
Slide by R.S.Nikhil (Bluespec)
![Page 64: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/64.jpg)
64
Rule semantics enables compositionality of pipelines
Previous systems have also used higher-order functions to express structural composition of circuits. E.g., Lava [Bjesse, Claessen, Sheeran, Singh 1998].
But they were based on traditional synchronous clocked digital circuit semantics, so user has to manually manage pipeline balancing1, flow control, and access to shared resources.
Rule semantics are naturally “asynchronous”, enabling separation of pipeline structure from those concerns.
1Balancing: latencies may be data-dependent, and different on different paths.
Different points on a path, or on different paths, may access some shared resource (such as a RAM or a counter), at unpredictable (perhaps data dependent) times.
Slide by R.S.Nikhil (Bluespec)
![Page 65: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/65.jpg)
65
100 lines of BSV source code based on 4 parameters,express all 24 architectures in the figure, with a 10x variation in area/power
(which is “best” depends on target requirements, e.g., server vs. mobile)
• fully pipelined, flow-controlled• all control logic correct by construction
Results of using PAClib on IFFT
Slide by R.S.Nikhil (Bluespec)
![Page 66: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/66.jpg)
66
Synthesis from BSV is competitive with hand-coded RTL
VP8
H.264
BS
H.264 Deblocking Filter
H.264 Boundary Strength
VP8 Deblocking Filter
resolution
functionality
Hand-coded VHDL (reference)
1x 2x(estimate)
BSV 0.18x 0.33x 0.47x 0.81x
VP8
4Kx2K
VP8 H.264 BS
1080p
VP8 VP8 H.264 BS
Relative silicon area (smaller is better)
These results are not just competitive with RTL, but far superior. Can this really be true?
Yes, sometimes.
Example: Deblocking filter for H.264 and VP8 video decoders
Slide by R.S.Nikhil (Bluespec)
![Page 67: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/67.jpg)
BSV
Often BEATS hand-coded RTL code
![Page 68: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/68.jpg)
BSV
Often BEATS hand-coded RTL code
Algorithmically superior designs
![Page 69: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/69.jpg)
BSV
Often BEATS hand-coded RTL code
Algorithmically superior designs
Refinement, evolution, major architectural change EASY
Types, Functional Programming and Atomic Transactions in Hardware Design Nikhil LNCS 8000
![Page 70: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/70.jpg)
Bluecheck
A Generic Synthesisable Test Bench (Naylor and Moore, Memocode 2015)
QuickCheck in HW design!
Idea of a generic testbench is unheard of in mainstream HDLs
![Page 71: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/71.jpg)
stack interface
// A stack of 2ˆn elements of type t
interface Stack#(type n, type t);method Action push(t x);method Action pop;method Bool isEmpty;method t top;method Action clear;endinterface
![Page 72: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/72.jpg)
module [Specification] stackSpecAlg ();
// Create two instances of implementationStack#(8, Bit#(4)) s1 <- mkBRAMStack();Stack#(8, Bit#(4)) s2 <- mkBRAMStack();
// On s1, push x, then pop itfunction pushPop(x) =seq s1.push(x); s1.pop; endseq;
// On s2, do nothingfunction nop(x) = seq endseq;
equiv("pushPop", pushPop, nop);equiv("push" , s1.push, s2.push);equiv("pop" , s1.pop , s2.pop);equiv("top" , s1.top , s2.top);endmodule
![Page 73: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/73.jpg)
=== Depth 20, Test 15/10000 ===11: push(12)22: push(2)23: pushPop(14)27: pop28: top failed: 2 v 12Continue searching?
![Page 74: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/74.jpg)
Synthesisable!
Iterative deepening and shrinking on
![Page 75: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/75.jpg)
=== Depth 10, Test 5/10000 ===setAddrMap(<15, 11, 8, 5>)Core 0: MEM[3] == 0Core 0: MEM[7] := 8Core 1: MEM[3] := 9Core 1: MEM[7] == 0Core 0: MEM[3] == 0Not sequentially consistent
![Page 76: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/76.jpg)
Pushing verification
![Page 77: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/77.jpg)
Pushing verification
Formal Verification of Hardware Synthesis CAV’13
![Page 78: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/78.jpg)
Pushing verification
Formal Verification of Hardware Synthesis CAV’13
![Page 79: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/79.jpg)
Pushing verification
first machine verification of sequential consistency for a multicore hardware design that includes caches and speculative processors (CAV’15)
![Page 81: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/81.jpg)
Lava(s)
Feldspar + synchronous programming for hardware at Chalmers
Kansas Lava: “add Bluespec features”
Satnam Singh: I wonder!
CλaSH HardCAML etc
![Page 82: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/82.jpg)
ChiselIn this paper, we introduce Chisel (Constructing Hardware In a ScalaEmbedded Language), a new hardware design language we have developed based on the Scala programming language [8]. Chisel is intended to be a simple platform that provides modern programming language features for accurately specifying low-level hardware blocks,but which can be readily extended to capture many use-ful high-level hardware design patterns. (DAC’12)
https://chisel.eecs.berkeley.edu/
![Page 83: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/83.jpg)
Cryptol
The declarative quality of Cryptol,which makes Cryptol a good specificationlanguage, also plays a key role in theeffectiveness of automatic generationof FPGA cores. In contrast, the inherentsequentiality of mainstream programminglanguages makes them a poor matchfor the highly parallel nature of FPGAs.
Designing Tunable, Verifiable Cryptographic Hardware Using Cryptol. In Design and Verification of Microprocessor Systems for High-Assurance, David S. Hardin, Editor. Springer 2010
Undelay
![Page 85: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/85.jpg)
What next?
Slide from Chalmers Tech Talk by Andreas Olofsson (CEO Adapteva)
![Page 86: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/86.jpg)
Slide from Chalmers Tech Talk by Andreas Olofsson (CEO Adapteva)
![Page 87: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/87.jpg)
![Page 88: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/88.jpg)
Slide from Chalmers Tech Talk by Andreas Olofsson (CEO Adapteva)
![Page 89: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/89.jpg)
Slide from Chalmers Tech Talk by Andreas Olofsson (CEO Adapteva)
https://www.parallella.org/
![Page 90: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/90.jpg)
HW SW
HaskellScala
RacketC
CPU
![Page 91: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/91.jpg)
HW SW
Haskell
CPU
![Page 92: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/92.jpg)
CPUCPU
![Page 93: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/93.jpg)
CPUCPU
“The FPGAs are moving into the processors”
![Page 94: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/94.jpg)
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
CPU
![Page 95: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/95.jpg)
ProgrammingNeeds to deal with heterogeneity and massive parallelism
![Page 96: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/96.jpg)
ProgrammingNeeds to deal with heterogeneity and massive parallelism
Much relevant work in our community Blelloch’s ICFP invited talk locality work
AccelerateDelite Yesterday’s keynoteParallelism session this afternoon! and much more
![Page 97: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/97.jpg)
But STILL I lack a High Level Language to enable THINKING about playing with time and space (the way hardware designers do)
Many have come closeI am thinking about combinators (of course), inspired by BMMC and much
elseHelp!
Workshops Functional High Performance Computing Array
![Page 98: Hardware Design and Functional Programming: Still ... · Hardware Design and Functional Programming: Still Interesting after All These Years ... magnitude of these problems and lead](https://reader033.vdocuments.us/reader033/viewer/2022042801/5b02e9ba7f8b9a8c688b5967/html5/thumbnails/98.jpg)
Programming future machines will be more like hardware design than is comfortable!
Not only is FP + HW still interesting! The ideas may be important even just for SW