Wiring Circuits Is Easy as {0,1,ω}, or Is It...

De Muijnck-Hughes, J. and Vanderbauwhede, W. (2023) Wiring Circuits Is Easy as {0,1,ω}, or Is It... In: 37th European Conference on Object-Oriented Programming (ECOOP 2023), Seattle, WA, USA, 17-21 July 2023, 8:1-8:28. (doi: 10.4230/LIPIcs.ECOOP.2023.8)

[img] Text
304162.pdf - Published Version
Available under License Creative Commons Attribution.

1MB

Abstract

Quantitative Type-Systems support fine-grained reasoning about term usage in our programming languages. Hardware Design Languages are another style of language in which quantitative typing would be beneficial. When wiring components together we must ensure that there are no unused ports, dangling wires, or accidental fan-ins and fan-outs. Although many wire usage checks are detectable using static analysis tools, such as Verilator, quantitative typing supports making these extrinsic checks an intrinsic aspect of the type-system. With quantitative typing of bound terms, we can provide design-time checks that all wires and ports have been used, and ensure that all wiring decisions are explicitly made, and are neither implicit nor accidental. We showcase the use of quantitative types in hardware design languages by detailing how we can retrofit quantitative types onto SystemVerilog netlists, and the impact that such a quantitative type-system has when creating designs. Netlists are gate-level descriptions of hardware that are produced as the result of synthesis, and it is from these netlists that hardware is generated (fabless or fabbed). First, we present a simple structural type-system for a featherweight version of SystemVerilog netlists that demonstrates how we can type netlists using standard structural techniques, and what it means for netlists to be type-safe but still lead to ill-wired designs. We then detail how to retrofit the language with quantitative types, make the type-system sub-structural, and detail how our new type-safety result ensures that wires and ports are used once. Our ideas have been proven both practically and formally by realising our work in Idris2, through which we can construct a verified language implementation that can type-check existing designs. From this work we can look to promote quantitative typing back up the synthesis chain to a more comprehensive hardware description language; and to help develop new and better hardware description languages with quantitative typing.

Item Type:Conference Proceedings
Additional Information:The work is funded by EPSRC grants: Border Patrol (EP/N028201/1) and AppControl (EP/V000462/1).
Keywords:Hardware design, linear types, dependent types, DSLs, Idris, SystemVerilog, Netlists
Status:Published
Refereed:Yes
Glasgow Author(s) Enlighten ID:Vanderbauwhede, Professor Wim and De Muijnck-Hughes, Dr Jan
Authors: De Muijnck-Hughes, J., and Vanderbauwhede, W.
College/School:College of Science and Engineering > School of Computing Science
Copyright Holders:Copyright © 2023 The Authors
First Published:First published in Proceedings of the 37th European Conference on Object-Oriented Programming (ECOOP 2023), Article No. 8, pp. 8:1–8:28
Publisher Policy:Reproduced under a Creative Commons License
Related URLs:

University Staff: Request a correction | Enlighten Editors: Update this record

Project CodeAward NoProject NamePrincipal InvestigatorFunder's NameFunder RefLead Dept
172893Border Patrol: Improving Hardware Security through Type-Aware Systems DesignWim VanderbauwhedeEngineering and Physical Sciences Research Council (EPSRC)EP/N028201/1Computing Science
309899AppControl/C2AB: Capability-based Control of Application BehaviourWim VanderbauwhedeEngineering and Physical Sciences Research Council (EPSRC)EP/V000462/1Computing Science