. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 1
-Ware: Hardware Description with Dependent Types Author: Joo Paulo - - PowerPoint PPT Presentation
. Syntax . . . . . . . Context Defjnition Motivation Why Agda? -Ware Semantics . Proofs Present / Future Current work Future 1 -Ware: Hardware Description with Dependent Types Author: Joo Paulo Pizani Flor
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 3
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 4
▶ Miniaturization still has some generations to go [3] ▶ Microarch. optimization gives diminishing returns [1] ▶ Battery energy density vs. demand for computation
▶ DSP, crypto, codecs, graphics, comm. protocols, etc.
▶ Early optimization, more error-prone ▶ Mass production, less updateable
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 5
▶ Simulation: SystemC, VHDL/Verilog ▶ Synthesis: VHDL/Verilog (subsets), C/C++ (subsets) ▶ Verifjcation: SAT solvers / Theorem provers
▶ Manual translation ▶ Loss of invariants, manual checking
▶ To “simulate” (interpret) your program, you use Haskell ▶ For compilation to x86, use C (non-standardized)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 6
▶ Solve most of the problems with multiple descriptions ▶ “Popular” example: Lava (Chalmers)
▶ Drawbacks:
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 7
▶ Well-formedness ▶ Rule out design mistakes early
iₛ
fₚ : oₛ → iₛ
▶ More precise specifjcation of circuit generators
▶ Mainly: proofs in the same language as the models
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 8
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 9
▶ Π-Ware is deep-embedded
▶ Low-level, architectural representation
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 10
▶ Combinational / sequential
▶ The ℂ type is “tagged” to keep the two cases distinct
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 11
▶ Circuits are built by combining smaller circuits
▶ A “traditional” instance of 𝖧𝖻𝗎𝖿𝗍 is 𝖢𝗉𝗉𝗆𝖴𝗌𝗃𝗉
▶ Other “interesting” instances:
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 12
▶ To defjne a gate library, we need to defjne:
▶ Dependent types help us again
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 13
▶ The whole 𝖣𝗃𝗌𝖽𝗏𝗃𝗎 module is parameterized by a record
▶ This 𝖡𝗎𝗉𝗇𝗃𝖽 class is similar to Haskell’s 𝖥𝗈𝗏𝗇
▶ Dependent types move runtime errors to type checking:
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 14
▶ Some possible instances…
▶ Simplest “useful”: 𝖢𝗉𝗉𝗆
▶ Later how this parameterization infmuences synthesis
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 15
▶ Small circuit using 𝖢𝗉𝗉𝗆 atoms and 𝖢𝗉𝗉𝗆𝖴𝗌𝗃𝗉 gates
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 16
▶ Sometimes it’s more convenient to have typed circuit I/O
▶ To be used as circuit I/O, a type needs to be 𝖳𝗓𝗈𝗎𝗂𝖿𝗍𝗃𝗔𝖻𝖼𝗆𝖿
▶ Instances
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 17
▶ Our goal is to have two semantics:
▶ Our behavioural semantics is functional
▶ Two kinds of simulation: combinational and sequential
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 17
▶ Our goal is to have two semantics:
▶ Our behavioural semantics is functional
▶ Two kinds of simulation: combinational and sequential
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 18
▶ More general, for circuit with (possibly) internal state
▶ User interface ▶
▶ 𝖳𝗎𝗌𝖿𝖻𝗇 functions can “look into the future”
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 19
▶ What can be proven: depends on which semantics is used
▶ Example behavioural property: functional correctness
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 20
▶ Circuit combinators have algebraic properties
▶ Developed a notion of equivalence between circuits (_≋_)
▶ Π-Ware can be used to defjne whole classes of circuits
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 21
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 22
▶ Case study: parallel-prefjx circuits
▶ General class + examples implemented in Π-Ware
▶ “Side-efgects” of the project
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 23
▶ Correctness of sequential circuits
▶ Little testing framework ▶ “Automated” checking for any specifjc circuit
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 24
▶ Translation to VHDL
▶ Optimizations in generated VHDL
▶ Automation possibilities
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 26
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Context
Defjnition Motivation Why Agda?
Π-Ware
Syntax Semantics Proofs
Present / Future
Current work Future 27